summaryrefslogtreecommitdiff
path: root/drivers/usb/renesas_usbhs/mod_host.c
diff options
context:
space:
mode:
authorYuping Luo <Yuping.Luo@csr.com>2011-10-25 19:13:10 -0700
committerFelipe Balbi <balbi@ti.com>2011-12-12 11:44:59 +0200
commit144974e7f9e32b53b02f6c8632be45d8f43d6ab5 (patch)
treedd7df00f65b13f79ed028bbed2cffd83769faab5 /drivers/usb/renesas_usbhs/mod_host.c
parentb4fcea2a71cafc59a749fa3ef88e51af8c2e3b37 (diff)
downloadlinux-144974e7f9e32b53b02f6c8632be45d8f43d6ab5.tar.gz
usb: gadget: mass_storage: support multi-luns with different logic block size
With Peiyu's patch "gadget: mass_storage: adapt logic block size to bound block devices" (http://www.spinics.net/lists/linux-usb/msg50791.html), now mass storage can adjust logic block size dynamically based on real devices. Then there is one issue caused by it, if two luns have different logic block size, mass storage can't work. Let's check the current software flow: 1. get_next_command(): call received_cbw(); 2. received_cbw(): update common->lun = cbw->Lun, but common->curlen is not updated; 3. do_scsi_command(): in READ_X and WRITE_X commands, common->data_size_from_cmnd is updated by common->curlun->blkbits; 4. check_command(): update common->curlun according to common->lun As you can see, the step 3 uses wrong common->curlun, then wrong common->curlun->blkbits. If the two luns have same blkbits, there isn't issue. Otherwise, both will fail. This patch moves the common->curlun update to step 1, then make sure step 3 gets right blkbits and data_size_from_cmnd. Cc: Peiyu Li <peiyu.li@csr.com> Signed-off-by: YuPing Luo <yuping.luo@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/mod_host.c')
0 files changed, 0 insertions, 0 deletions