Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1560385
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands |
| Date | 2017-01-17 10:30 +0100 |
| Message-ID | <t0yfx-5dT-51@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <sURkS-2H5-33@gated-at.bofh.it> <sUSgV-3hC-5@gated-at.bofh.it> <sWs8G-3cr-11@gated-at.bofh.it> <t0lLk-5zl-15@gated-at.bofh.it> <t0mHn-6bh-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* 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);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-01-06 03:10 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands Sreekanth Reddy <sreekanth.reddy@broadcom.com> - 2017-01-06 16:50 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-01-10 06:00 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-01-16 21:10 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-01-16 22:10 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands Ingo Molnar <mingo@kernel.org> - 2017-01-17 10:30 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands Sreekanth Reddy <sreekanth.reddy@broadcom.com> - 2017-01-17 15:20 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands Christoph Hellwig <hch@lst.de> - 2017-01-17 15:30 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-01-17 22:00 +0100
Re: [PATCH] scsi: mpt3sas: fix hang on ata passthru commands James Bottomley <James.Bottomley@HansenPartnership.com> - 2017-01-17 15:50 +0100
csiph-web