diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-12 17:34:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-12 17:34:11 -0400 |
commit | de72aa4c2b82a6cffe15d86a8d391ded4fb57602 (patch) | |
tree | aac3f09c8e1e2154e532886d0196a46386af301a /drivers | |
parent | 536abdb0802f3fac1b217530741853843d63c281 (diff) | |
parent | 8df5fc042c8e7c08dc438c8198b62407ee1e91a0 (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] bsg: fix oops on remove
[SCSI] fusion: default MSI to disabled for SPI and FC controllers
[SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices
[SCSI] mptspi: fix oops in mptspi_dv_renegotiate_work()
[SCSI] erase invalid data returned by device
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 11 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 9 | ||||
-rw-r--r-- | drivers/scsi/ipr.c | 6 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 9 |
4 files changed, 29 insertions, 6 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index db3c892f87f..d40d6d15ae2 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1686,9 +1686,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1686 | ioc->bus_type = SAS; | 1686 | ioc->bus_type = SAS; |
1687 | } | 1687 | } |
1688 | 1688 | ||
1689 | if (ioc->bus_type == SAS && mpt_msi_enable == -1) | 1689 | if (mpt_msi_enable == -1) { |
1690 | ioc->msi_enable = 1; | 1690 | /* Enable on SAS, disable on FC and SPI */ |
1691 | else | 1691 | if (ioc->bus_type == SAS) |
1692 | ioc->msi_enable = 1; | ||
1693 | else | ||
1694 | ioc->msi_enable = 0; | ||
1695 | } else | ||
1696 | /* follow flag: 0 - disable; 1 - enable */ | ||
1692 | ioc->msi_enable = mpt_msi_enable; | 1697 | ioc->msi_enable = mpt_msi_enable; |
1693 | 1698 | ||
1694 | if (ioc->errata_flag_1064) | 1699 | if (ioc->errata_flag_1064) |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 25bcfcf36f2..1effca4e40e 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -1266,13 +1266,18 @@ mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd) | |||
1266 | static int | 1266 | static int |
1267 | mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | 1267 | mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) |
1268 | { | 1268 | { |
1269 | struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh); | ||
1270 | int rc; | 1269 | int rc; |
1271 | 1270 | ||
1272 | rc = mptscsih_ioc_reset(ioc, reset_phase); | 1271 | rc = mptscsih_ioc_reset(ioc, reset_phase); |
1273 | 1272 | ||
1274 | if (reset_phase == MPT_IOC_POST_RESET) | 1273 | /* only try to do a renegotiation if we're properly set up |
1274 | * if we get an ioc fault on bringup, ioc->sh will be NULL */ | ||
1275 | if (reset_phase == MPT_IOC_POST_RESET && | ||
1276 | ioc->sh) { | ||
1277 | struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh); | ||
1278 | |||
1275 | mptspi_dv_renegotiate(hd); | 1279 | mptspi_dv_renegotiate(hd); |
1280 | } | ||
1276 | 1281 | ||
1277 | return rc; | 1282 | return rc; |
1278 | } | 1283 | } |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 999e91ea745..e7a3a655442 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include <linux/module.h> | 71 | #include <linux/module.h> |
72 | #include <linux/moduleparam.h> | 72 | #include <linux/moduleparam.h> |
73 | #include <linux/libata.h> | 73 | #include <linux/libata.h> |
74 | #include <linux/hdreg.h> | ||
74 | #include <asm/io.h> | 75 | #include <asm/io.h> |
75 | #include <asm/irq.h> | 76 | #include <asm/irq.h> |
76 | #include <asm/processor.h> | 77 | #include <asm/processor.h> |
@@ -4913,8 +4914,11 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
4913 | struct ipr_resource_entry *res; | 4914 | struct ipr_resource_entry *res; |
4914 | 4915 | ||
4915 | res = (struct ipr_resource_entry *)sdev->hostdata; | 4916 | res = (struct ipr_resource_entry *)sdev->hostdata; |
4916 | if (res && ipr_is_gata(res)) | 4917 | if (res && ipr_is_gata(res)) { |
4918 | if (cmd == HDIO_GET_IDENTITY) | ||
4919 | return -ENOTTY; | ||
4917 | return ata_scsi_ioctl(sdev, cmd, arg); | 4920 | return ata_scsi_ioctl(sdev, cmd, arg); |
4921 | } | ||
4918 | 4922 | ||
4919 | return -EINVAL; | 4923 | return -EINVAL; |
4920 | } | 4924 | } |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a82d2fe80fb..cbf55d59a54 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -207,6 +207,15 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, | |||
207 | */ | 207 | */ |
208 | blk_execute_rq(req->q, NULL, req, 1); | 208 | blk_execute_rq(req->q, NULL, req, 1); |
209 | 209 | ||
210 | /* | ||
211 | * Some devices (USB mass-storage in particular) may transfer | ||
212 | * garbage data together with a residue indicating that the data | ||
213 | * is invalid. Prevent the garbage from being misinterpreted | ||
214 | * and prevent security leaks by zeroing out the excess data. | ||
215 | */ | ||
216 | if (unlikely(req->data_len > 0 && req->data_len <= bufflen)) | ||
217 | memset(buffer + (bufflen - req->data_len), 0, req->data_len); | ||
218 | |||
210 | ret = req->errors; | 219 | ret = req->errors; |
211 | out: | 220 | out: |
212 | blk_put_request(req); | 221 | blk_put_request(req); |