Skip to content

Commit b153f1d

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "I'd like to say these were a set of regressions for the recent merge window code. Unfortunately, they all predate the merge window code (stable cc'd). There are two fixes for data integrity (mostly only showing up on module removal), an mvsas crash with expander attached SATA devices which goes back to the dawn of the driver but is only just being picked up as sas expanders become a standard item in low end server hardware, an am53c974 one because the interrupt data isn't fully initialised before the line is and a megaraid_sas one because it uses smp_processor_id() to select MSI-X queues and that now triggers a WARN_ON()" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: mvsas: fix panic on expander attached SATA devices am53c974: Fix crash during modprobe megaraid_sas: use raw_smp_processor_id() sd: Fix missing ATO tag check sd: Unregister integrity profile
2 parents bf2ae5d + 56cbd0c commit b153f1d

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

drivers/scsi/am53c974.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ static int pci_esp_probe_one(struct pci_dev *pdev,
476476
goto fail_unmap_regs;
477477
}
478478

479+
pci_set_drvdata(pdev, pep);
480+
479481
err = request_irq(pdev->irq, scsi_esp_intr, IRQF_SHARED,
480482
DRV_MODULE_NAME, esp);
481483
if (err < 0) {
@@ -496,8 +498,6 @@ static int pci_esp_probe_one(struct pci_dev *pdev,
496498
/* Assume 40MHz clock */
497499
esp->cfreq = 40000000;
498500

499-
pci_set_drvdata(pdev, pep);
500-
501501
err = scsi_esp_register(esp, &pdev->dev);
502502
if (err)
503503
goto fail_free_irq;
@@ -507,6 +507,7 @@ static int pci_esp_probe_one(struct pci_dev *pdev,
507507
fail_free_irq:
508508
free_irq(pdev->irq, esp);
509509
fail_unmap_command_block:
510+
pci_set_drvdata(pdev, NULL);
510511
pci_free_consistent(pdev, 16, esp->command_block,
511512
esp->command_block_dma);
512513
fail_unmap_regs:
@@ -530,6 +531,7 @@ static void pci_esp_remove_one(struct pci_dev *pdev)
530531

531532
scsi_esp_unregister(esp);
532533
free_irq(pdev->irq, esp);
534+
pci_set_drvdata(pdev, NULL);
533535
pci_free_consistent(pdev, 16, esp->command_block,
534536
esp->command_block_dma);
535537
pci_iounmap(pdev, esp->regs);

drivers/scsi/megaraid/megaraid_sas_fusion.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,11 +1584,11 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
15841584
fp_possible = io_info.fpOkForIo;
15851585
}
15861586

1587-
/* Use smp_processor_id() for now until cmd->request->cpu is CPU
1587+
/* Use raw_smp_processor_id() for now until cmd->request->cpu is CPU
15881588
id by default, not CPU group id, otherwise all MSI-X queues won't
15891589
be utilized */
15901590
cmd->request_desc->SCSIIO.MSIxIndex = instance->msix_vectors ?
1591-
smp_processor_id() % instance->msix_vectors : 0;
1591+
raw_smp_processor_id() % instance->msix_vectors : 0;
15921592

15931593
if (fp_possible) {
15941594
megasas_set_pd_lba(io_request, scp->cmd_len, &io_info, scp,
@@ -1693,7 +1693,10 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
16931693
<< MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT;
16941694
cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle;
16951695
cmd->request_desc->SCSIIO.MSIxIndex =
1696-
instance->msix_vectors ? smp_processor_id() % instance->msix_vectors : 0;
1696+
instance->msix_vectors ?
1697+
raw_smp_processor_id() %
1698+
instance->msix_vectors :
1699+
0;
16971700
os_timeout_value = scmd->request->timeout / HZ;
16981701

16991702
if (instance->secure_jbod_support &&

drivers/scsi/mvsas/mv_sas.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,11 @@ static u32 mvs_get_ncq_tag(struct sas_task *task, u32 *tag)
441441
static int mvs_task_prep_ata(struct mvs_info *mvi,
442442
struct mvs_task_exec_info *tei)
443443
{
444-
struct sas_ha_struct *sha = mvi->sas;
445444
struct sas_task *task = tei->task;
446445
struct domain_device *dev = task->dev;
447446
struct mvs_device *mvi_dev = dev->lldd_dev;
448447
struct mvs_cmd_hdr *hdr = tei->hdr;
449448
struct asd_sas_port *sas_port = dev->port;
450-
struct sas_phy *sphy = dev->phy;
451-
struct asd_sas_phy *sas_phy = sha->sas_phy[sphy->number];
452449
struct mvs_slot_info *slot;
453450
void *buf_prd;
454451
u32 tag = tei->tag, hdr_tag;
@@ -468,7 +465,7 @@ static int mvs_task_prep_ata(struct mvs_info *mvi,
468465
slot->tx = mvi->tx_prod;
469466
del_q = TXQ_MODE_I | tag |
470467
(TXQ_CMD_STP << TXQ_CMD_SHIFT) |
471-
(MVS_PHY_ID << TXQ_PHY_SHIFT) |
468+
((sas_port->phy_mask & TXQ_PHY_MASK) << TXQ_PHY_SHIFT) |
472469
(mvi_dev->taskfileset << TXQ_SRS_SHIFT);
473470
mvi->tx[mvi->tx_prod] = cpu_to_le32(del_q);
474471

drivers/scsi/sd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,6 +3076,7 @@ static void scsi_disk_release(struct device *dev)
30763076
ida_remove(&sd_index_ida, sdkp->index);
30773077
spin_unlock(&sd_index_lock);
30783078

3079+
blk_integrity_unregister(disk);
30793080
disk->private_data = NULL;
30803081
put_disk(disk);
30813082
put_device(&sdkp->device->sdev_gendev);

drivers/scsi/sd_dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void sd_dif_config_host(struct scsi_disk *sdkp)
7777

7878
disk->integrity->flags |= BLK_INTEGRITY_DEVICE_CAPABLE;
7979

80-
if (!sdkp)
80+
if (!sdkp->ATO)
8181
return;
8282

8383
if (type == SD_DIF_TYPE3_PROTECTION)

0 commit comments

Comments
 (0)