Skip to content

Commit 2837461

Browse files
committed
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
2 parents f3b5020 + 3cedc87 commit 2837461

File tree

8 files changed

+32
-12
lines changed

8 files changed

+32
-12
lines changed

drivers/scsi/aacraid/commctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
845845
rcode = -EINVAL;
846846
goto cleanup;
847847
}
848-
p = kmalloc(sg_count[i], GFP_KERNEL|GFP_DMA32);
848+
p = kmalloc(sg_count[i], GFP_KERNEL);
849849
if (!p) {
850850
dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
851851
sg_count[i], i, usg->count));
@@ -886,7 +886,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
886886
rcode = -EINVAL;
887887
goto cleanup;
888888
}
889-
p = kmalloc(sg_count[i], GFP_KERNEL|GFP_DMA32);
889+
p = kmalloc(sg_count[i], GFP_KERNEL);
890890
if (!p) {
891891
dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
892892
sg_count[i], i, upsg->count));

drivers/scsi/aic7xxx/aic79xx_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6112,17 +6112,17 @@ ahd_alloc(void *platform_arg, char *name)
61126112
ahd->int_coalescing_stop_threshold =
61136113
AHD_INT_COALESCING_STOP_THRESHOLD_DEFAULT;
61146114

6115-
if (ahd_platform_alloc(ahd, platform_arg) != 0) {
6116-
ahd_free(ahd);
6117-
ahd = NULL;
6118-
}
61196115
#ifdef AHD_DEBUG
61206116
if ((ahd_debug & AHD_SHOW_MEMORY) != 0) {
61216117
printk("%s: scb size = 0x%x, hscb size = 0x%x\n",
61226118
ahd_name(ahd), (u_int)sizeof(struct scb),
61236119
(u_int)sizeof(struct hardware_scb));
61246120
}
61256121
#endif
6122+
if (ahd_platform_alloc(ahd, platform_arg) != 0) {
6123+
ahd_free(ahd);
6124+
ahd = NULL;
6125+
}
61266126
return (ahd);
61276127
}
61286128

drivers/scsi/hpsa.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8871,7 +8871,7 @@ static void hpsa_disable_rld_caching(struct ctlr_info *h)
88718871
kfree(options);
88728872
}
88738873

8874-
static void hpsa_shutdown(struct pci_dev *pdev)
8874+
static void __hpsa_shutdown(struct pci_dev *pdev)
88758875
{
88768876
struct ctlr_info *h;
88778877

@@ -8886,6 +8886,12 @@ static void hpsa_shutdown(struct pci_dev *pdev)
88868886
hpsa_disable_interrupt_mode(h); /* pci_init 2 */
88878887
}
88888888

8889+
static void hpsa_shutdown(struct pci_dev *pdev)
8890+
{
8891+
__hpsa_shutdown(pdev);
8892+
pci_disable_device(pdev);
8893+
}
8894+
88898895
static void hpsa_free_device_info(struct ctlr_info *h)
88908896
{
88918897
int i;
@@ -8929,7 +8935,7 @@ static void hpsa_remove_one(struct pci_dev *pdev)
89298935
scsi_remove_host(h->scsi_host); /* init_one 8 */
89308936
/* includes hpsa_free_irqs - init_one 4 */
89318937
/* includes hpsa_disable_interrupt_mode - pci_init 2 */
8932-
hpsa_shutdown(pdev);
8938+
__hpsa_shutdown(pdev);
89338939

89348940
hpsa_free_device_info(h); /* scan */
89358941

drivers/scsi/mpt3sas/mpt3sas_base.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,6 +3348,7 @@ _base_mpi_ep_writeq(__u64 b, volatile void __iomem *addr,
33483348
spin_lock_irqsave(writeq_lock, flags);
33493349
writel((u32)(data_out), addr);
33503350
writel((u32)(data_out >> 32), (addr + 4));
3351+
mmiowb();
33513352
spin_unlock_irqrestore(writeq_lock, flags);
33523353
}
33533354

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5009,7 +5009,8 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
50095009
return;
50105010

50115011
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)
50135014
return;
50145015

50155016
rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed,

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,8 +2494,12 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
24942494
ox_id = le16_to_cpu(sts24->ox_id);
24952495
par_sense_len = sizeof(sts24->data);
24962496
/* Valid values of the retry delay timer are 0x1-0xffef */
2497-
if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1)
2498-
retry_delay = sts24->retry_delay;
2497+
if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1) {
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+
}
24992503
} else {
25002504
if (scsi_status & SS_SENSE_LEN_VALID)
25012505
sense_len = le16_to_cpu(sts->req_sense_length);

drivers/scsi/qla2xxx/qla_mbx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
292292
if (time_after(jiffies, wait_time))
293293
break;
294294

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+
295303
/* Check for pending interrupts. */
296304
qla2x00_poll(ha->rsp_q_map[0]);
297305

drivers/scsi/sd_zbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp)
442442
} else if (this_zone_blocks != zone_blocks &&
443443
(block + this_zone_blocks < sdkp->capacity
444444
|| this_zone_blocks > zone_blocks)) {
445-
this_zone_blocks = 0;
445+
zone_blocks = 0;
446446
goto out;
447447
}
448448
block += this_zone_blocks;

0 commit comments

Comments
 (0)