diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-04 20:19:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-04 20:19:18 -0400 |
commit | f1b134fdf6d36c975b4a66cf952565cd73aebdba (patch) | |
tree | f7524266c501c9196106cd14222ab5e8c4f3004f | |
parent | 7274264f60cc0b71389efed286001ff0860c3141 (diff) | |
parent | e8bac9e0647dd04c83fd0bfe7cdfe2f6dfb100d0 (diff) |
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
-rw-r--r-- | block/scsi_ioctl.c | 2 | ||||
-rw-r--r-- | drivers/scsi/hptiop.c | 7 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_spi.c | 8 | ||||
-rw-r--r-- | drivers/scsi/ses.c | 18 |
4 files changed, 27 insertions, 8 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index c5b9bcfc0a6d..12a5182173f6 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -518,7 +518,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q, | |||
518 | hdr.sbp = cgc.sense; | 518 | hdr.sbp = cgc.sense; |
519 | if (hdr.sbp) | 519 | if (hdr.sbp) |
520 | hdr.mx_sb_len = sizeof(struct request_sense); | 520 | hdr.mx_sb_len = sizeof(struct request_sense); |
521 | hdr.timeout = cgc.timeout; | 521 | hdr.timeout = jiffies_to_msecs(cgc.timeout); |
522 | hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd; | 522 | hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd; |
523 | hdr.cmd_len = sizeof(cgc.cmd); | 523 | hdr.cmd_len = sizeof(cgc.cmd); |
524 | 524 | ||
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index da876d3924be..74d12b58a263 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c | |||
@@ -1249,6 +1249,13 @@ static struct pci_device_id hptiop_id_table[] = { | |||
1249 | { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops }, | 1249 | { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops }, |
1250 | { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, | 1250 | { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, |
1251 | { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops }, | 1251 | { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops }, |
1252 | { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1253 | { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1254 | { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1255 | { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1256 | { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1257 | { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1258 | { PCI_VDEVICE(TTI, 0x4311), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1252 | { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops }, | 1259 | { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops }, |
1253 | { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops }, | 1260 | { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops }, |
1254 | { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops }, | 1261 | { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops }, |
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 75a64a6cae8c..b29360ed0bdc 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c | |||
@@ -366,12 +366,14 @@ spi_transport_rd_attr(rti, "%d\n"); | |||
366 | spi_transport_rd_attr(pcomp_en, "%d\n"); | 366 | spi_transport_rd_attr(pcomp_en, "%d\n"); |
367 | spi_transport_rd_attr(hold_mcs, "%d\n"); | 367 | spi_transport_rd_attr(hold_mcs, "%d\n"); |
368 | 368 | ||
369 | /* we only care about the first child device so we return 1 */ | 369 | /* we only care about the first child device that's a real SCSI device |
370 | * so we return 1 to terminate the iteration when we find it */ | ||
370 | static int child_iter(struct device *dev, void *data) | 371 | static int child_iter(struct device *dev, void *data) |
371 | { | 372 | { |
372 | struct scsi_device *sdev = to_scsi_device(dev); | 373 | if (!scsi_is_sdev_device(dev)) |
374 | return 0; | ||
373 | 375 | ||
374 | spi_dv_device(sdev); | 376 | spi_dv_device(to_scsi_device(dev)); |
375 | return 1; | 377 | return 1; |
376 | } | 378 | } |
377 | 379 | ||
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 0fe031f003e7..1bcf3c33d7ff 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c | |||
@@ -345,14 +345,14 @@ static int ses_enclosure_find_by_addr(struct enclosure_device *edev, | |||
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | 347 | ||
348 | #define VPD_INQUIRY_SIZE 512 | 348 | #define VPD_INQUIRY_SIZE 36 |
349 | 349 | ||
350 | static void ses_match_to_enclosure(struct enclosure_device *edev, | 350 | static void ses_match_to_enclosure(struct enclosure_device *edev, |
351 | struct scsi_device *sdev) | 351 | struct scsi_device *sdev) |
352 | { | 352 | { |
353 | unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL); | 353 | unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL); |
354 | unsigned char *desc; | 354 | unsigned char *desc; |
355 | int len; | 355 | u16 vpd_len; |
356 | struct efd efd = { | 356 | struct efd efd = { |
357 | .addr = 0, | 357 | .addr = 0, |
358 | }; | 358 | }; |
@@ -372,9 +372,19 @@ static void ses_match_to_enclosure(struct enclosure_device *edev, | |||
372 | VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES)) | 372 | VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES)) |
373 | goto free; | 373 | goto free; |
374 | 374 | ||
375 | len = (buf[2] << 8) + buf[3]; | 375 | vpd_len = (buf[2] << 8) + buf[3]; |
376 | kfree(buf); | ||
377 | buf = kmalloc(vpd_len, GFP_KERNEL); | ||
378 | if (!buf) | ||
379 | return; | ||
380 | cmd[3] = vpd_len >> 8; | ||
381 | cmd[4] = vpd_len & 0xff; | ||
382 | if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, | ||
383 | vpd_len, NULL, SES_TIMEOUT, SES_RETRIES)) | ||
384 | goto free; | ||
385 | |||
376 | desc = buf + 4; | 386 | desc = buf + 4; |
377 | while (desc < buf + len) { | 387 | while (desc < buf + vpd_len) { |
378 | enum scsi_protocol proto = desc[0] >> 4; | 388 | enum scsi_protocol proto = desc[0] >> 4; |
379 | u8 code_set = desc[0] & 0x0f; | 389 | u8 code_set = desc[0] & 0x0f; |
380 | u8 piv = desc[1] & 0x80; | 390 | u8 piv = desc[1] & 0x80; |