From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Hannes Reinecke <hare@suse.de>, Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@lst.de>,
Shaun Tancheff <shaun.tancheff@seagate.com>,
Damien Le Moal <damien.lemoal@hgst.com>,
linux-scsi@vger.kernel.org,
Sathya Prakash <sathya.prakash@broadcom.com>
Subject: Re: [PATCH 08/14] libata: evaluate SCSI sense code
Date: Mon, 4 Apr 2016 14:21:46 +0300 [thread overview]
Message-ID: <57024E4A.7070503@cogentembedded.com> (raw)
In-Reply-To: <1459763047-125551-9-git-send-email-hare@suse.de>
On 4/4/2016 12:44 PM, Hannes Reinecke wrote:
> Whenever a sense code is set it would need to be evaluated to
> update the error mask.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/ata/libata-eh.c | 28 +++++++++++++++++++---------
> drivers/scsi/scsi_error.c | 3 ++-
> include/scsi/scsi_eh.h | 1 +
> 3 files changed, 22 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index d33e7b8..99bb9f9 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -1919,20 +1919,30 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
[...]
>
> + if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
> + int ret = scsi_check_sense(qc->scsicmd);
> + /*
> + * SUCCESS here means that the sense code could
Could be?
> + * evaluated and should be passed to the upper layers
> + * for correct evaluation.
> + * FAILED means the sense code could not interpreted
Could not be?
> + * and the device would need to be reset.
> + * NEEDS_RETRY and ADD_TO_MLQUEUE means that the
> + * command would need to be retried.
> + */
> + if (ret == NEEDS_RETRY || ret == ADD_TO_MLQUEUE) {
> + qc->flags |= ATA_QCFLAG_RETRY;
> + qc->err_mask |= AC_ERR_OTHER;
> + } else if (ret != SUCCESS)
> + qc->err_mask |= AC_ERR_HSM;
This is asking to be a *switch* statement instead.
[...]
MBR, Sergei
next prev parent reply other threads:[~2016-04-04 11:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 9:43 [PATCH 00/14] libata: SATL update Hannes Reinecke
2016-04-04 9:43 ` [PATCH 01/14] libata: Implement NCQ autosense Hannes Reinecke
2016-04-04 9:43 ` [PATCH 02/14] libata: Implement support for sense data reporting Hannes Reinecke
2016-04-04 9:43 ` [PATCH 03/14] libata-scsi: sanitize ata_gen_ata_sense() Hannes Reinecke
2016-04-04 11:26 ` Sergei Shtylyov
2016-04-04 16:22 ` Tejun Heo
2016-04-04 17:33 ` Sergei Shtylyov
2016-04-04 9:43 ` [PATCH 04/14] libata: sanitize ata_tf_read_block() Hannes Reinecke
2016-04-04 9:43 ` [PATCH 05/14] libata-scsi: use scsi_set_sense_information() Hannes Reinecke
2016-04-04 9:43 ` [PATCH 06/14] libata-eh: Set 'information' field for autosense Hannes Reinecke
2016-04-04 9:44 ` [PATCH 07/14] libata-scsi: use ata_scsi_set_sense() Hannes Reinecke
2016-04-04 9:44 ` [PATCH 08/14] libata: evaluate SCSI sense code Hannes Reinecke
2016-04-04 11:21 ` Sergei Shtylyov [this message]
2016-04-04 9:44 ` [PATCH 09/14] libata-scsi: generate correct ATA pass-through sense Hannes Reinecke
2016-04-04 9:44 ` [PATCH 10/14] libata: Implement control mode page to select sense format Hannes Reinecke
2016-04-04 12:53 ` kbuild test robot
2016-04-04 9:44 ` [PATCH 11/14] scsi: add scsi_set_sense_field_pointer() Hannes Reinecke
2016-04-04 9:44 ` [PATCH 12/14] libata-scsi: Set field pointer in sense code Hannes Reinecke
2016-04-04 9:44 ` [PATCH 13/14] libata-scsi: set bit pointer for sense code information Hannes Reinecke
2016-04-04 9:44 ` [PATCH 14/14] libata-scsi: Set information sense field for invalid parameter Hannes Reinecke
2016-04-04 15:22 ` kbuild test robot
2016-04-04 15:46 ` [PATCH 00/14] libata: SATL update Tejun Heo
2016-04-04 19:54 ` Hannes Reinecke
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=57024E4A.7070503@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=damien.lemoal@hgst.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=shaun.tancheff@seagate.com \
--cc=tj@kernel.org \
/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).