From: Ingo Molnar <mingo@kernel.org>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
David Miller <davem@davemloft.net>,
Bart Van Assche <Bart.VanAssche@sandisk.com>,
Christoph Hellwig <hch@infradead.org>,
jbaron@akamai.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
sagi@grimberg.me, Sathya Prakash <sathya.prakash@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
Hannes Reinecke <hare@suse.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>,
Chaitra Basappa <chaitra.basappa@broadcom.com>,
dledford@redhat.com,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Subject: Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands
Date: Tue, 17 Jan 2017 10:20:25 +0100 [thread overview]
Message-ID: <20170117092025.GA9337@gmail.com> (raw)
In-Reply-To: <yq14m0ylnx1.fsf@oracle.com>
* Martin K. Petersen <martin.petersen@oracle.com> wrote:
> >>>>> "James" == James Bottomley <James.Bottomley@HansenPartnership.com> writes:
>
> James> Subject: [PATCH] scsi: mpt3sas: fix hang on ata passthrough
> James> commands
>
> James> mpt3sas has a firmware failure where it can only handle one pass
> James> through ATA command at a time. If another comes in, contrary to
> James> the SAT standard, it will hang until the first one completes
> James> (causing long commands like secure erase to timeout). The
> James> original fix was to block the device when an ATA command came in,
> James> but this caused a regression with
>
> Broadcom folks: Please test and ack as soon as possible so we can get
> this fix queued up.
>
> Ingo: Since you appear to have hardware, it would be great if you could
> test James' v3 (https://patchwork.kernel.org/patch/9519383/). Sorry for
> the inconvenience.
As per the interdiff below v2->v3 did not change the code in any way, only the
name of the function and a comment, so you can add this to v3 as well:
Reported-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 6f9b4c051e4d..830e2c10ba02 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -3899,7 +3899,7 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
}
}
-static int set_satl_pending(struct scsi_cmnd *scmd, bool pending)
+static int _scsih_set_satl_pending(struct scsi_cmnd *scmd, bool pending)
{
struct MPT3SAS_DEVICE *priv = scmd->device->hostdata;
@@ -3934,7 +3934,7 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
if (!scmd)
continue;
count++;
- set_satl_pending(scmd, false);
+ _scsih_set_satl_pending(scmd, false);
mpt3sas_base_free_smid(ioc, smid);
scsi_dma_unmap(scmd);
if (ioc->pci_error_recovery)
@@ -4084,7 +4084,9 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
}
/*
- * Bug work around for firmware SATL handling
+ * Bug work around for firmware SATL handling. The loop
+ * is based on atomic operations and ensures consistency
+ * since we're lockless at this point
*/
do {
if (sas_device_priv_data->ata_command_pending) {
@@ -4092,7 +4094,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
scmd->scsi_done(scmd);
return 0;
}
- } while (set_satl_pending(scmd, true));
+ } while (_scsih_set_satl_pending(scmd, true));
sas_target_priv_data = sas_device_priv_data->sas_target;
@@ -4661,7 +4663,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
if (scmd == NULL)
return 1;
- set_satl_pending(scmd, false);
+ _scsih_set_satl_pending(scmd, false);
mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
next prev parent reply other threads:[~2017-01-17 9:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-29 4:30 [PATCH] scsi: mpt3sas: fix hang on ata passthru commands Jason Baron
2016-12-29 8:02 ` Christoph Hellwig
2016-12-29 16:02 ` Jason Baron
2016-12-31 23:19 ` James Bottomley
2017-01-01 14:22 ` Bart Van Assche
2017-01-01 15:30 ` Jason Baron
2017-01-01 16:33 ` David Miller
2017-01-01 17:39 ` James Bottomley
2017-01-03 20:46 ` Jason Baron
2017-01-15 17:01 ` James Bottomley
2017-01-16 16:20 ` Bart Van Assche
2017-01-06 1:59 ` Martin K. Petersen
2017-01-06 15:46 ` Sreekanth Reddy
2017-01-10 4:50 ` Martin K. Petersen
2017-01-16 20:01 ` James Bottomley
2017-01-16 21:01 ` Martin K. Petersen
2017-01-17 9:20 ` Ingo Molnar [this message]
2017-01-17 14:13 ` Sreekanth Reddy
2017-01-17 14:15 ` Christoph Hellwig
2017-01-17 19:44 ` Martin K. Petersen
2017-01-17 14:44 ` James Bottomley
2016-12-29 16:16 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170117092025.GA9337@gmail.com \
--to=mingo@kernel.org \
--cc=Bart.VanAssche@sandisk.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=chaitra.basappa@broadcom.com \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=jbaron@akamai.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sagi@grimberg.me \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).