mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
lightnvm: Inherit mdts from the parent nvme device
Current lightnvm and pblk implementation does not care about NVMe max data transfer size, which can be smaller than 64*K=256K. There are existing NVMe controllers which NVMe max data transfer size is lower that 256K (for example 128K, which happens for existing NVMe controllers which are NVMe spec compliant). Such a controllers are not able to handle command which contains 64 PPAs, since the the size of DMAed buffer will be above the capabilities of such a controller. Signed-off-by: Igor Konopko <[email protected]> Reviewed-by: Hans Holmberg <[email protected]> Reviewed-by: Javier González <[email protected]> Signed-off-by: Matias Bjørling <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
d38954ed1b
commit
a14669ebc0
3 changed files with 9 additions and 2 deletions
|
|
@ -325,6 +325,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
|
|||
struct nvm_target *t;
|
||||
struct nvm_tgt_dev *tgt_dev;
|
||||
void *targetdata;
|
||||
unsigned int mdts;
|
||||
int ret;
|
||||
|
||||
switch (create->conf.type) {
|
||||
|
|
@ -412,8 +413,12 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
|
|||
tdisk->private_data = targetdata;
|
||||
tqueue->queuedata = targetdata;
|
||||
|
||||
blk_queue_max_hw_sectors(tqueue,
|
||||
(dev->geo.csecs >> 9) * NVM_MAX_VLBA);
|
||||
mdts = (dev->geo.csecs >> 9) * NVM_MAX_VLBA;
|
||||
if (dev->geo.mdts) {
|
||||
mdts = min_t(u32, dev->geo.mdts,
|
||||
(dev->geo.csecs >> 9) * NVM_MAX_VLBA);
|
||||
}
|
||||
blk_queue_max_hw_sectors(tqueue, mdts);
|
||||
|
||||
set_capacity(tdisk, tt->capacity(targetdata));
|
||||
add_disk(tdisk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue