aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 23:30:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 23:30:48 -0400
commit5cc103506289de7ee0a0b526ae0381541990cad4 (patch)
treeae8a4958e70c6d1295030b40e333dcc007b3c074 /drivers/scsi
parent73ecf3a6e3f0206bf56a0fefe3b3eda042fb7034 (diff)
parent92ca0dc5ee022e4c0e488177e1d8865a0778c6c2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (141 commits) USB: mct_u232: fix broken close USB: gadget: amd5536udc.c: fix error path USB: imx21-hcd - fix off by one resource size calculation usb: gadget: fix Kconfig warning usb: r8a66597-udc: Add processing when USB was removed. mxc_udc: add workaround for ENGcm09152 for i.MX35 USB: ftdi_sio: add device ids for ScienceScope USB: musb: AM35x: Workaround for fifo read issue USB: musb: add musb support for AM35x USB: AM35x: Add musb support usb: Fix linker errors with CONFIG_PM=n USB: ohci-sh - use resource_size instead of defining its own resource_len macro USB: isp1362-hcd - use resource_size instead of defining its own resource_len macro USB: isp116x-hcd - use resource_size instead of defining its own resource_len macro USB: xhci: Fix compile error when CONFIG_PM=n USB: accept some invalid ep0-maxpacket values USB: xHCI: PCI power management implementation USB: xHCI: bus power management implementation USB: xHCI: port remote wakeup implementation USB: xHCI: port power management implementation ... Manually fix up (non-data) conflict: the SCSI merge gad renamed the 'hw_sector_size' member to 'physical_block_size', and the USB tree brought a new use of it.
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/sd.c12
-rw-r--r--drivers/scsi/sr.c8
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 20295774bf7..57d1e3e1bd4 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1498,6 +1498,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,
1498 unsigned long long lba; 1498 unsigned long long lba;
1499 unsigned sector_size; 1499 unsigned sector_size;
1500 1500
1501 if (sdp->no_read_capacity_16)
1502 return -EINVAL;
1503
1501 do { 1504 do {
1502 memset(cmd, 0, 16); 1505 memset(cmd, 0, 16);
1503 cmd[0] = SERVICE_ACTION_IN; 1506 cmd[0] = SERVICE_ACTION_IN;
@@ -1626,6 +1629,15 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,
1626 sector_size = get_unaligned_be32(&buffer[4]); 1629 sector_size = get_unaligned_be32(&buffer[4]);
1627 lba = get_unaligned_be32(&buffer[0]); 1630 lba = get_unaligned_be32(&buffer[0]);
1628 1631
1632 if (sdp->no_read_capacity_16 && (lba == 0xffffffff)) {
1633 /* Some buggy (usb cardreader) devices return an lba of
1634 0xffffffff when the want to report a size of 0 (with
1635 which they really mean no media is present) */
1636 sdkp->capacity = 0;
1637 sdkp->physical_block_size = sector_size;
1638 return sector_size;
1639 }
1640
1629 if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) { 1641 if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) {
1630 sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a " 1642 sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a "
1631 "kernel compiled with support for large block " 1643 "kernel compiled with support for large block "
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index e148341079b..d7b383c96d5 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -862,10 +862,16 @@ static void get_capabilities(struct scsi_cd *cd)
862static int sr_packet(struct cdrom_device_info *cdi, 862static int sr_packet(struct cdrom_device_info *cdi,
863 struct packet_command *cgc) 863 struct packet_command *cgc)
864{ 864{
865 struct scsi_cd *cd = cdi->handle;
866 struct scsi_device *sdev = cd->device;
867
868 if (cgc->cmd[0] == GPCMD_READ_DISC_INFO && sdev->no_read_disc_info)
869 return -EDRIVE_CANT_DO_THIS;
870
865 if (cgc->timeout <= 0) 871 if (cgc->timeout <= 0)
866 cgc->timeout = IOCTL_TIMEOUT; 872 cgc->timeout = IOCTL_TIMEOUT;
867 873
868 sr_do_ioctl(cdi->handle, cgc); 874 sr_do_ioctl(cd, cgc);
869 875
870 return cgc->stat; 876 return cgc->stat;
871} 877}