diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-14 03:35:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-14 03:35:32 -0400 |
commit | 2837461dbe6f4a9acc0d86f88825888109211c99 (patch) | |
tree | ef88b43e1ff159aa6b9ebb4cd8100e29aaee85a2 | |
parent | f3b5020e168a383496e3096b754a1ad17f09df36 (diff) | |
parent | 3cedc8797b9c0f2222fd45a01f849c57c088828b (diff) |
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"This is a set of minor (and safe changes) that didn't make the initial
pull request plus some bug fixes"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: qla2xxx: Mask off Scope bits in retry delay
scsi: qla2xxx: Fix crash on qla2x00_mailbox_command
scsi: aic7xxx: aic79xx: fix potential null pointer dereference on ahd
scsi: mpt3sas: Add an I/O barrier
scsi: qla2xxx: Fix setting lower transfer speed if GPSC fails
scsi: hpsa: disable device during shutdown
scsi: sd_zbc: Fix sd_zbc_check_zone_size() error path
scsi: aacraid: remove bogus GFP_DMA32 specifies
-rw-r--r-- | drivers/scsi/aacraid/commctrl.c | 4 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_core.c | 8 | ||||
-rw-r--r-- | drivers/scsi/hpsa.c | 10 | ||||
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_base.c | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 8 | ||||
-rw-r--r-- | drivers/scsi/sd_zbc.c | 2 |
8 files changed, 32 insertions, 12 deletions
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index a2b3430072c7..25f6600d6c09 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c | |||
@@ -845,7 +845,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) | |||
845 | rcode = -EINVAL; | 845 | rcode = -EINVAL; |
846 | goto cleanup; | 846 | goto cleanup; |
847 | } | 847 | } |
848 | p = kmalloc(sg_count[i], GFP_KERNEL|GFP_DMA32); | 848 | p = kmalloc(sg_count[i], GFP_KERNEL); |
849 | if (!p) { | 849 | if (!p) { |
850 | dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", | 850 | dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", |
851 | sg_count[i], i, usg->count)); | 851 | sg_count[i], i, usg->count)); |
@@ -886,7 +886,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) | |||
886 | rcode = -EINVAL; | 886 | rcode = -EINVAL; |
887 | goto cleanup; | 887 | goto cleanup; |
888 | } | 888 | } |
889 | p = kmalloc(sg_count[i], GFP_KERNEL|GFP_DMA32); | 889 | p = kmalloc(sg_count[i], GFP_KERNEL); |
890 | if (!p) { | 890 | if (!p) { |
891 | dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", | 891 | dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", |
892 | sg_count[i], i, upsg->count)); | 892 | sg_count[i], i, upsg->count)); |
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 67d292dcc607..2d82ec85753e 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c | |||
@@ -6112,10 +6112,6 @@ ahd_alloc(void *platform_arg, char *name) | |||
6112 | ahd->int_coalescing_stop_threshold = | 6112 | ahd->int_coalescing_stop_threshold = |
6113 | AHD_INT_COALESCING_STOP_THRESHOLD_DEFAULT; | 6113 | AHD_INT_COALESCING_STOP_THRESHOLD_DEFAULT; |
6114 | 6114 | ||
6115 | if (ahd_platform_alloc(ahd, platform_arg) != 0) { | ||
6116 | ahd_free(ahd); | ||
6117 | ahd = NULL; | ||
6118 | } | ||
6119 | #ifdef AHD_DEBUG | 6115 | #ifdef AHD_DEBUG |
6120 | if ((ahd_debug & AHD_SHOW_MEMORY) != 0) { | 6116 | if ((ahd_debug & AHD_SHOW_MEMORY) != 0) { |
6121 | printk("%s: scb size = 0x%x, hscb size = 0x%x\n", | 6117 | printk("%s: scb size = 0x%x, hscb size = 0x%x\n", |
@@ -6123,6 +6119,10 @@ ahd_alloc(void *platform_arg, char *name) | |||
6123 | (u_int)sizeof(struct hardware_scb)); | 6119 | (u_int)sizeof(struct hardware_scb)); |
6124 | } | 6120 | } |
6125 | #endif | 6121 | #endif |
6122 | if (ahd_platform_alloc(ahd, platform_arg) != 0) { | ||
6123 | ahd_free(ahd); | ||
6124 | ahd = NULL; | ||
6125 | } | ||
6126 | return (ahd); | 6126 | return (ahd); |
6127 | } | 6127 | } |
6128 | 6128 | ||
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index af0e628ff396..15c7f3b6f35e 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -8871,7 +8871,7 @@ out: | |||
8871 | kfree(options); | 8871 | kfree(options); |
8872 | } | 8872 | } |
8873 | 8873 | ||
8874 | static void hpsa_shutdown(struct pci_dev *pdev) | 8874 | static void __hpsa_shutdown(struct pci_dev *pdev) |
8875 | { | 8875 | { |
8876 | struct ctlr_info *h; | 8876 | struct ctlr_info *h; |
8877 | 8877 | ||
@@ -8886,6 +8886,12 @@ static void hpsa_shutdown(struct pci_dev *pdev) | |||
8886 | hpsa_disable_interrupt_mode(h); /* pci_init 2 */ | 8886 | hpsa_disable_interrupt_mode(h); /* pci_init 2 */ |
8887 | } | 8887 | } |
8888 | 8888 | ||
8889 | static void hpsa_shutdown(struct pci_dev *pdev) | ||
8890 | { | ||
8891 | __hpsa_shutdown(pdev); | ||
8892 | pci_disable_device(pdev); | ||
8893 | } | ||
8894 | |||
8889 | static void hpsa_free_device_info(struct ctlr_info *h) | 8895 | static void hpsa_free_device_info(struct ctlr_info *h) |
8890 | { | 8896 | { |
8891 | int i; | 8897 | int i; |
@@ -8929,7 +8935,7 @@ static void hpsa_remove_one(struct pci_dev *pdev) | |||
8929 | scsi_remove_host(h->scsi_host); /* init_one 8 */ | 8935 | scsi_remove_host(h->scsi_host); /* init_one 8 */ |
8930 | /* includes hpsa_free_irqs - init_one 4 */ | 8936 | /* includes hpsa_free_irqs - init_one 4 */ |
8931 | /* includes hpsa_disable_interrupt_mode - pci_init 2 */ | 8937 | /* includes hpsa_disable_interrupt_mode - pci_init 2 */ |
8932 | hpsa_shutdown(pdev); | 8938 | __hpsa_shutdown(pdev); |
8933 | 8939 | ||
8934 | hpsa_free_device_info(h); /* scan */ | 8940 | hpsa_free_device_info(h); /* scan */ |
8935 | 8941 | ||
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index bf04fa90f433..569392d0d4c9 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c | |||
@@ -3348,6 +3348,7 @@ _base_mpi_ep_writeq(__u64 b, volatile void __iomem *addr, | |||
3348 | spin_lock_irqsave(writeq_lock, flags); | 3348 | spin_lock_irqsave(writeq_lock, flags); |
3349 | writel((u32)(data_out), addr); | 3349 | writel((u32)(data_out), addr); |
3350 | writel((u32)(data_out >> 32), (addr + 4)); | 3350 | writel((u32)(data_out >> 32), (addr + 4)); |
3351 | mmiowb(); | ||
3351 | spin_unlock_irqrestore(writeq_lock, flags); | 3352 | spin_unlock_irqrestore(writeq_lock, flags); |
3352 | } | 3353 | } |
3353 | 3354 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index fbbb328c64d5..7b675243bd16 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -5009,7 +5009,8 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
5009 | return; | 5009 | return; |
5010 | 5010 | ||
5011 | if (fcport->fp_speed == PORT_SPEED_UNKNOWN || | 5011 | if (fcport->fp_speed == PORT_SPEED_UNKNOWN || |
5012 | fcport->fp_speed > ha->link_data_rate) | 5012 | fcport->fp_speed > ha->link_data_rate || |
5013 | !ha->flags.gpsc_supported) | ||
5013 | return; | 5014 | return; |
5014 | 5015 | ||
5015 | rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, | 5016 | rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed, |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index d14d3911516d..9fa5a2557f2c 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -2494,8 +2494,12 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
2494 | ox_id = le16_to_cpu(sts24->ox_id); | 2494 | ox_id = le16_to_cpu(sts24->ox_id); |
2495 | par_sense_len = sizeof(sts24->data); | 2495 | par_sense_len = sizeof(sts24->data); |
2496 | /* Valid values of the retry delay timer are 0x1-0xffef */ | 2496 | /* Valid values of the retry delay timer are 0x1-0xffef */ |
2497 | if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1) | 2497 | if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1) { |
2498 | retry_delay = sts24->retry_delay; | 2498 | retry_delay = sts24->retry_delay & 0x3fff; |
2499 | ql_dbg(ql_dbg_io, sp->vha, 0x3033, | ||
2500 | "%s: scope=%#x retry_delay=%#x\n", __func__, | ||
2501 | sts24->retry_delay >> 14, retry_delay); | ||
2502 | } | ||
2499 | } else { | 2503 | } else { |
2500 | if (scsi_status & SS_SENSE_LEN_VALID) | 2504 | if (scsi_status & SS_SENSE_LEN_VALID) |
2501 | sense_len = le16_to_cpu(sts->req_sense_length); | 2505 | sense_len = le16_to_cpu(sts->req_sense_length); |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index d8a36c13aeda..7e875f575229 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -292,6 +292,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) | |||
292 | if (time_after(jiffies, wait_time)) | 292 | if (time_after(jiffies, wait_time)) |
293 | break; | 293 | break; |
294 | 294 | ||
295 | /* | ||
296 | * Check if it's UNLOADING, cause we cannot poll in | ||
297 | * this case, or else a NULL pointer dereference | ||
298 | * is triggered. | ||
299 | */ | ||
300 | if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags))) | ||
301 | return QLA_FUNCTION_TIMEOUT; | ||
302 | |||
295 | /* Check for pending interrupts. */ | 303 | /* Check for pending interrupts. */ |
296 | qla2x00_poll(ha->rsp_q_map[0]); | 304 | qla2x00_poll(ha->rsp_q_map[0]); |
297 | 305 | ||
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 76da8c3a6f09..a14fef11776e 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c | |||
@@ -442,7 +442,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) | |||
442 | } else if (this_zone_blocks != zone_blocks && | 442 | } else if (this_zone_blocks != zone_blocks && |
443 | (block + this_zone_blocks < sdkp->capacity | 443 | (block + this_zone_blocks < sdkp->capacity |
444 | || this_zone_blocks > zone_blocks)) { | 444 | || this_zone_blocks > zone_blocks)) { |
445 | this_zone_blocks = 0; | 445 | zone_blocks = 0; |
446 | goto out; | 446 | goto out; |
447 | } | 447 | } |
448 | block += this_zone_blocks; | 448 | block += this_zone_blocks; |