aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-09-25 13:03:56 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-09-25 13:03:56 -0400
commit593d1006cdf710ab3469c0c37c184fea0bc3da97 (patch)
treee4db58440018a52089e8d6b39160f753ab10df99 /drivers/scsi
parent5217192b85480353aeeb395574e60d0db04f3676 (diff)
parent9b20aa63b8fc9a6a3b6831f4eae3621755e51211 (diff)
Merge remote-tracking branch 'tip/core/rcu' into next.2012.09.25b
Resolved conflict in kernel/sched/core.c using Peter Zijlstra's approach from https://lkml.org/lkml/2012/9/5/585.
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/bnx2i/bnx2i_hwi.c3
-rw-r--r--drivers/scsi/hpsa.c3
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c3
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c20
-rw-r--r--drivers/scsi/scsi_error.c10
-rw-r--r--drivers/scsi/scsi_lib.c5
-rw-r--r--drivers/scsi/scsi_scan.c10
-rw-r--r--drivers/scsi/virtio_scsi.c2
8 files changed, 47 insertions, 9 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 33d6630529de..91eec60252ee 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -1264,6 +1264,9 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
1264 int rc = 0; 1264 int rc = 0;
1265 u64 mask64; 1265 u64 mask64;
1266 1266
1267 memset(&iscsi_init, 0x00, sizeof(struct iscsi_kwqe_init1));
1268 memset(&iscsi_init2, 0x00, sizeof(struct iscsi_kwqe_init2));
1269
1267 bnx2i_adjust_qp_size(hba); 1270 bnx2i_adjust_qp_size(hba);
1268 1271
1269 iscsi_init.flags = 1272 iscsi_init.flags =
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 796482badf13..2b4261cb7742 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1315,8 +1315,9 @@ static void complete_scsi_command(struct CommandList *cp)
1315 } 1315 }
1316 break; 1316 break;
1317 case CMD_PROTOCOL_ERR: 1317 case CMD_PROTOCOL_ERR:
1318 cmd->result = DID_ERROR << 16;
1318 dev_warn(&h->pdev->dev, "cp %p has " 1319 dev_warn(&h->pdev->dev, "cp %p has "
1319 "protocol error \n", cp); 1320 "protocol error\n", cp);
1320 break; 1321 break;
1321 case CMD_HARDWARE_ERR: 1322 case CMD_HARDWARE_ERR:
1322 cmd->result = DID_ERROR << 16; 1323 cmd->result = DID_ERROR << 16;
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index dc27598785e5..ed38454228c6 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4066,7 +4066,6 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4066 spin_lock_init(&instance->cmd_pool_lock); 4066 spin_lock_init(&instance->cmd_pool_lock);
4067 spin_lock_init(&instance->hba_lock); 4067 spin_lock_init(&instance->hba_lock);
4068 spin_lock_init(&instance->completion_lock); 4068 spin_lock_init(&instance->completion_lock);
4069 spin_lock_init(&poll_aen_lock);
4070 4069
4071 mutex_init(&instance->aen_mutex); 4070 mutex_init(&instance->aen_mutex);
4072 mutex_init(&instance->reset_mutex); 4071 mutex_init(&instance->reset_mutex);
@@ -5392,6 +5391,8 @@ static int __init megasas_init(void)
5392 printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION, 5391 printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
5393 MEGASAS_EXT_VERSION); 5392 MEGASAS_EXT_VERSION);
5394 5393
5394 spin_lock_init(&poll_aen_lock);
5395
5395 support_poll_for_event = 2; 5396 support_poll_for_event = 2;
5396 support_device_change = 1; 5397 support_device_change = 1;
5397 5398
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 9d46fcbe7755..9d5a56c4b332 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1209,6 +1209,13 @@ _base_check_enable_msix(struct MPT2SAS_ADAPTER *ioc)
1209 u16 message_control; 1209 u16 message_control;
1210 1210
1211 1211
1212 /* Check whether controller SAS2008 B0 controller,
1213 if it is SAS2008 B0 controller use IO-APIC instead of MSIX */
1214 if (ioc->pdev->device == MPI2_MFGPAGE_DEVID_SAS2008 &&
1215 ioc->pdev->revision == 0x01) {
1216 return -EINVAL;
1217 }
1218
1212 base = pci_find_capability(ioc->pdev, PCI_CAP_ID_MSIX); 1219 base = pci_find_capability(ioc->pdev, PCI_CAP_ID_MSIX);
1213 if (!base) { 1220 if (!base) {
1214 dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "msix not " 1221 dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "msix not "
@@ -2424,10 +2431,13 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
2424 } 2431 }
2425 2432
2426 /* command line tunables for max controller queue depth */ 2433 /* command line tunables for max controller queue depth */
2427 if (max_queue_depth != -1) 2434 if (max_queue_depth != -1 && max_queue_depth != 0) {
2428 max_request_credit = (max_queue_depth < facts->RequestCredit) 2435 max_request_credit = min_t(u16, max_queue_depth +
2429 ? max_queue_depth : facts->RequestCredit; 2436 ioc->hi_priority_depth + ioc->internal_depth,
2430 else 2437 facts->RequestCredit);
2438 if (max_request_credit > MAX_HBA_QUEUE_DEPTH)
2439 max_request_credit = MAX_HBA_QUEUE_DEPTH;
2440 } else
2431 max_request_credit = min_t(u16, facts->RequestCredit, 2441 max_request_credit = min_t(u16, facts->RequestCredit,
2432 MAX_HBA_QUEUE_DEPTH); 2442 MAX_HBA_QUEUE_DEPTH);
2433 2443
@@ -2502,7 +2512,7 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
2502 /* set the scsi host can_queue depth 2512 /* set the scsi host can_queue depth
2503 * with some internal commands that could be outstanding 2513 * with some internal commands that could be outstanding
2504 */ 2514 */
2505 ioc->shost->can_queue = ioc->scsiio_depth - (2); 2515 ioc->shost->can_queue = ioc->scsiio_depth;
2506 dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scsi host: " 2516 dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scsi host: "
2507 "can_queue depth (%d)\n", ioc->name, ioc->shost->can_queue)); 2517 "can_queue depth (%d)\n", ioc->name, ioc->shost->can_queue));
2508 2518
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 4a6381c87253..de2337f255a7 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -42,6 +42,8 @@
42 42
43#include <trace/events/scsi.h> 43#include <trace/events/scsi.h>
44 44
45static void scsi_eh_done(struct scsi_cmnd *scmd);
46
45#define SENSE_TIMEOUT (10*HZ) 47#define SENSE_TIMEOUT (10*HZ)
46 48
47/* 49/*
@@ -241,6 +243,14 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
241 if (! scsi_command_normalize_sense(scmd, &sshdr)) 243 if (! scsi_command_normalize_sense(scmd, &sshdr))
242 return FAILED; /* no valid sense data */ 244 return FAILED; /* no valid sense data */
243 245
246 if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
247 /*
248 * nasty: for mid-layer issued TURs, we need to return the
249 * actual sense data without any recovery attempt. For eh
250 * issued ones, we need to try to recover and interpret
251 */
252 return SUCCESS;
253
244 if (scsi_sense_is_deferred(&sshdr)) 254 if (scsi_sense_is_deferred(&sshdr))
245 return NEEDS_RETRY; 255 return NEEDS_RETRY;
246 256
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ffd77739ae3e..faa790fba134 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -776,7 +776,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
776 } 776 }
777 777
778 if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */ 778 if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */
779 req->errors = result;
780 if (result) { 779 if (result) {
781 if (sense_valid && req->sense) { 780 if (sense_valid && req->sense) {
782 /* 781 /*
@@ -792,6 +791,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
792 if (!sense_deferred) 791 if (!sense_deferred)
793 error = __scsi_error_from_host_byte(cmd, result); 792 error = __scsi_error_from_host_byte(cmd, result);
794 } 793 }
794 /*
795 * __scsi_error_from_host_byte may have reset the host_byte
796 */
797 req->errors = cmd->result;
795 798
796 req->resid_len = scsi_get_resid(cmd); 799 req->resid_len = scsi_get_resid(cmd);
797 800
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 56a93794c470..d947ffc20ceb 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -764,6 +764,16 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
764 sdev->model = (char *) (sdev->inquiry + 16); 764 sdev->model = (char *) (sdev->inquiry + 16);
765 sdev->rev = (char *) (sdev->inquiry + 32); 765 sdev->rev = (char *) (sdev->inquiry + 32);
766 766
767 if (strncmp(sdev->vendor, "ATA ", 8) == 0) {
768 /*
769 * sata emulation layer device. This is a hack to work around
770 * the SATL power management specifications which state that
771 * when the SATL detects the device has gone into standby
772 * mode, it shall respond with NOT READY.
773 */
774 sdev->allow_restart = 1;
775 }
776
767 if (*bflags & BLIST_ISROM) { 777 if (*bflags & BLIST_ISROM) {
768 sdev->type = TYPE_ROM; 778 sdev->type = TYPE_ROM;
769 sdev->removable = 1; 779 sdev->removable = 1;
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index c7030fbee79c..3e79a2f00042 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -331,7 +331,7 @@ static void virtscsi_map_sgl(struct scatterlist *sg, unsigned int *p_idx,
331 int i; 331 int i;
332 332
333 for_each_sg(table->sgl, sg_elem, table->nents, i) 333 for_each_sg(table->sgl, sg_elem, table->nents, i)
334 sg_set_buf(&sg[idx++], sg_virt(sg_elem), sg_elem->length); 334 sg[idx++] = *sg_elem;
335 335
336 *p_idx = idx; 336 *p_idx = idx;
337} 337}