> > Form a certain time, UFS drivers set the value of 'max_sectors' like below, > meaning 1MB. > And the size of PRDT part of UCD per one slot is decided with SG_ALL(128) > multiplied by PRDT entry size, 16 bytes if 4DW of PRDT is used. > > If there is another knob to make it smaller to split a request, it seems UFS > driver can receive 1MB of chunk. > And when 4KB page is used, 256 PRDT entries are necessary to describe data > area. > Thus, it seems that the driver has been allocating less than it needs. > > If my understanding is wrong, please correct me. > > -- > static const struct scsi_host_template ufshcd_driver_template = { .. > .max_sectors = SZ_1M / SECTOR_SIZE, > > static int ufshcd_memory_alloc(struct ufs_hba *hba) .. > ucdl_size = ufshcd_get_ucd_size(hba) * hba->nutrs; > > static inline size_t ufshcd_get_ucd_size(const struct ufs_hba *hba) { > return sizeof(struct utp_transfer_cmd_desc) + SG_ALL * > ufshcd_sg_entry_size(hba); > > Thanks. > Kiwoong Kim > The current UFS Spec each PRDR entry can support the maximum data size 256KB, but if the host side system somehow cannon make 256KB per PRDR entry, and split 4KB per scatter gather list, 128 is not enough. This is my understanding.