Message ID | 20201230045743.14694-8-Viswas.G@microchip.com.com |
---|---|
State | New |
Headers | show |
Series | pm80xx updates. | expand |
On Wed, Dec 30, 2020 at 5:48 AM Viswas G <Viswas.G@microchip.com.com> wrote: > > From: Vishakha Channapattan <vishakhavc@google.com> > > Added a log message in sata completion path to log the status of failed > command. If the status does not match any expected status, another > message will be logged. > > On IO failure with known status, log message will be > > [ 1712.951735] pm80xx0:: mpi_sata_completion 2269: IO failed device_id > 16385 status 0x1 tag XX > > If the firmware returns unexpected status, log message of the following > format will be logged - > > [ 1712.951735] pm80xx0:: mpi_sata_completion XXXX: Unknown status > device_id XXXXX status 0xX tag XX > > Signed-off-by: Vishakha Channapattan <vishakhavc@google.com> > Signed-off-by: Viswas G <Viswas.G@microchip.com> > Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com> > Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com> > Signed-off-by: Radha Ramachandran <radha@google.com> Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> Thx > --- > drivers/scsi/pm8001/pm80xx_hwi.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c > index df679e36954a..e7fef42b4f6c 100644 > --- a/drivers/scsi/pm8001/pm80xx_hwi.c > +++ b/drivers/scsi/pm8001/pm80xx_hwi.c > @@ -2437,10 +2437,11 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb) > return; > } > > - if (unlikely(status)) > - pm8001_dbg(pm8001_ha, IOERR, > - "status:0x%x, tag:0x%x, task::0x%p\n", > - status, tag, t); > + if (status != IO_SUCCESS) { > + pm8001_dbg(pm8001_ha, FAIL, > + "IO failed device_id %u status 0x%x tag %d\n", > + pm8001_dev->device_id, status, tag); > + } > > /* Print sas address of IO failed device */ > if ((status != IO_SUCCESS) && (status != IO_OVERFLOW) && > @@ -2762,7 +2763,9 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb) > atomic_dec(&pm8001_dev->running_req); > break; > default: > - pm8001_dbg(pm8001_ha, DEVIO, "Unknown status 0x%x\n", status); > + pm8001_dbg(pm8001_ha, DEVIO, > + "Unknown status device_id %u status 0x%x tag %d\n", > + pm8001_dev->device_id, status, tag); > /* not allowed case. Therefore, return failed status */ > ts->resp = SAS_TASK_COMPLETE; > ts->stat = SAS_DEV_NO_RESPONSE; > -- > 2.16.3 >
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index df679e36954a..e7fef42b4f6c 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -2437,10 +2437,11 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb) return; } - if (unlikely(status)) - pm8001_dbg(pm8001_ha, IOERR, - "status:0x%x, tag:0x%x, task::0x%p\n", - status, tag, t); + if (status != IO_SUCCESS) { + pm8001_dbg(pm8001_ha, FAIL, + "IO failed device_id %u status 0x%x tag %d\n", + pm8001_dev->device_id, status, tag); + } /* Print sas address of IO failed device */ if ((status != IO_SUCCESS) && (status != IO_OVERFLOW) && @@ -2762,7 +2763,9 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb) atomic_dec(&pm8001_dev->running_req); break; default: - pm8001_dbg(pm8001_ha, DEVIO, "Unknown status 0x%x\n", status); + pm8001_dbg(pm8001_ha, DEVIO, + "Unknown status device_id %u status 0x%x tag %d\n", + pm8001_dev->device_id, status, tag); /* not allowed case. Therefore, return failed status */ ts->resp = SAS_TASK_COMPLETE; ts->stat = SAS_DEV_NO_RESPONSE;