Skip to content

Commit 1401b7c

Browse files
committed
Merge branch 'for-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata fix from Tejun Heo: "One patch to fix a regression from the recent switch to blk-mq tag allocation which can cause oops on SAS-attached SATA drives" * 'for-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: ata: Add a new flag to destinguish sas controller
2 parents 5cf955e + 5067c04 commit 1401b7c

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

drivers/ata/libata-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4737,7 +4737,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag)
47374737
return NULL;
47384738

47394739
/* libsas case */
4740-
if (!ap->scsi_host) {
4740+
if (ap->flags & ATA_FLAG_SAS_HOST) {
47414741
tag = ata_sas_allocate_tag(ap);
47424742
if (tag < 0)
47434743
return NULL;
@@ -4776,7 +4776,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
47764776
tag = qc->tag;
47774777
if (likely(ata_tag_valid(tag))) {
47784778
qc->tag = ATA_TAG_POISON;
4779-
if (!ap->scsi_host)
4779+
if (ap->flags & ATA_FLAG_SAS_HOST)
47804780
ata_sas_free_tag(tag, ap);
47814781
}
47824782
}

drivers/scsi/ipr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6815,7 +6815,8 @@ static struct ata_port_operations ipr_sata_ops = {
68156815
};
68166816

68176817
static struct ata_port_info sata_port_info = {
6818-
.flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA,
6818+
.flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA |
6819+
ATA_FLAG_SAS_HOST,
68196820
.pio_mask = ATA_PIO4_ONLY,
68206821
.mwdma_mask = ATA_MWDMA2,
68216822
.udma_mask = ATA_UDMA6,

drivers/scsi/libsas/sas_ata.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ static struct ata_port_operations sas_sata_ops = {
547547
};
548548

549549
static struct ata_port_info sata_port_info = {
550-
.flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | ATA_FLAG_NCQ,
550+
.flags = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | ATA_FLAG_NCQ |
551+
ATA_FLAG_SAS_HOST,
551552
.pio_mask = ATA_PIO4,
552553
.mwdma_mask = ATA_MWDMA2,
553554
.udma_mask = ATA_UDMA6,

include/linux/libata.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ enum {
232232
* led */
233233
ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */
234234
ATA_FLAG_LOWTAG = (1 << 24), /* host wants lowest available tag */
235+
ATA_FLAG_SAS_HOST = (1 << 25), /* SAS host */
235236

236237
/* bits 24:31 of ap->flags are reserved for LLD specific flags */
237238

0 commit comments

Comments
 (0)