linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: libsas: Grab the host lock in sas_ata_device_link_abort()
@ 2022-12-20 12:53 Xingui Yang
  2022-12-20 14:59 ` John Garry
  0 siblings, 1 reply; 10+ messages in thread
From: Xingui Yang @ 2022-12-20 12:53 UTC (permalink / raw)
  To: jejb, martin.petersen, john.g.garry
  Cc: linux-scsi, linux-kernel, linuxarm, yangxingui, prime.zeng,
	kangfenglong

Grab the host lock in sas_ata_device_link_abort() before calling
ata_link_abort(), as the comment in ata_link_abort() mentions.

Signed-off-by: Xingui Yang <yangxingui@huawei.com>
---
 drivers/scsi/libsas/sas_ata.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index f7439bf9cdc6..4f2017b21e6d 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -889,7 +889,9 @@ void sas_ata_device_link_abort(struct domain_device *device, bool force_reset)
 {
 	struct ata_port *ap = device->sata_dev.ap;
 	struct ata_link *link = &ap->link;
+	unsigned long flags;
 
+	spin_lock_irqsave(ap->lock, flags);
 	device->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */
 	device->sata_dev.fis[3] = ATA_ABORTED; /* tf error */
 
@@ -897,6 +899,7 @@ void sas_ata_device_link_abort(struct domain_device *device, bool force_reset)
 	if (force_reset)
 		link->eh_info.action |= ATA_EH_RESET;
 	ata_link_abort(link);
+	spin_unlock_irqrestore(ap->lock, flags);
 }
 EXPORT_SYMBOL_GPL(sas_ata_device_link_abort);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-21 12:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20 12:53 [PATCH] scsi: libsas: Grab the host lock in sas_ata_device_link_abort() Xingui Yang
2022-12-20 14:59 ` John Garry
2022-12-21  0:36   ` Damien Le Moal
2022-12-21  2:42     ` Jason Yan
2022-12-21  3:59       ` Damien Le Moal
2022-12-21  6:35         ` Jason Yan
2022-12-21  8:31           ` Damien Le Moal
2022-12-21  9:44             ` Niklas Cassel
2022-12-21 12:24               ` Damien Le Moal
2022-12-21  1:47   ` yangxingui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).