Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] scsi_transport_spi: fix oops in revalidate
  [SCSI] ses: fix VPD inquiry overrun
  [SCSI] block: Fix miscalculation of sg_io timeout in CDROM_SEND_PACKET handler.
  [SCSI] hptiop: add more PCI device IDs
This commit is contained in:
Linus Torvalds 2008-08-04 17:19:18 -07:00
commit f1b134fdf6
4 changed files with 27 additions and 8 deletions

View File

@ -518,7 +518,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
hdr.sbp = cgc.sense; hdr.sbp = cgc.sense;
if (hdr.sbp) if (hdr.sbp)
hdr.mx_sb_len = sizeof(struct request_sense); hdr.mx_sb_len = sizeof(struct request_sense);
hdr.timeout = cgc.timeout; hdr.timeout = jiffies_to_msecs(cgc.timeout);
hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd; hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd;
hdr.cmd_len = sizeof(cgc.cmd); hdr.cmd_len = sizeof(cgc.cmd);

View File

@ -1249,6 +1249,13 @@ static struct pci_device_id hptiop_id_table[] = {
{ PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x4311), (kernel_ulong_t)&hptiop_itl_ops },
{ PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops }, { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops },
{ PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops }, { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops },
{ PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops }, { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops },

View File

@ -366,12 +366,14 @@ spi_transport_rd_attr(rti, "%d\n");
spi_transport_rd_attr(pcomp_en, "%d\n"); spi_transport_rd_attr(pcomp_en, "%d\n");
spi_transport_rd_attr(hold_mcs, "%d\n"); spi_transport_rd_attr(hold_mcs, "%d\n");
/* we only care about the first child device so we return 1 */ /* we only care about the first child device that's a real SCSI device
* so we return 1 to terminate the iteration when we find it */
static int child_iter(struct device *dev, void *data) static int child_iter(struct device *dev, void *data)
{ {
struct scsi_device *sdev = to_scsi_device(dev); if (!scsi_is_sdev_device(dev))
return 0;
spi_dv_device(sdev); spi_dv_device(to_scsi_device(dev));
return 1; return 1;
} }

View File

@ -345,14 +345,14 @@ static int ses_enclosure_find_by_addr(struct enclosure_device *edev,
return 0; return 0;
} }
#define VPD_INQUIRY_SIZE 512 #define VPD_INQUIRY_SIZE 36
static void ses_match_to_enclosure(struct enclosure_device *edev, static void ses_match_to_enclosure(struct enclosure_device *edev,
struct scsi_device *sdev) struct scsi_device *sdev)
{ {
unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL); unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL);
unsigned char *desc; unsigned char *desc;
int len; u16 vpd_len;
struct efd efd = { struct efd efd = {
.addr = 0, .addr = 0,
}; };
@ -372,9 +372,19 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES)) VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES))
goto free; goto free;
len = (buf[2] << 8) + buf[3]; vpd_len = (buf[2] << 8) + buf[3];
kfree(buf);
buf = kmalloc(vpd_len, GFP_KERNEL);
if (!buf)
return;
cmd[3] = vpd_len >> 8;
cmd[4] = vpd_len & 0xff;
if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf,
vpd_len, NULL, SES_TIMEOUT, SES_RETRIES))
goto free;
desc = buf + 4; desc = buf + 4;
while (desc < buf + len) { while (desc < buf + vpd_len) {
enum scsi_protocol proto = desc[0] >> 4; enum scsi_protocol proto = desc[0] >> 4;
u8 code_set = desc[0] & 0x0f; u8 code_set = desc[0] & 0x0f;
u8 piv = desc[1] & 0x80; u8 piv = desc[1] & 0x80;