All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sujit Reddy Thumma <sthumma@codeaurora.org>
To: Subhash Jadavani <subhashj@codeaurora.org>
Cc: Seungwon Jeon <tgih.jun@samsung.com>,
	linux-scsi@vger.kernel.org,
	'Vinayak Holikatti' <vinholikatti@gmail.com>,
	'Santosh Y' <santoshsy@gmail.com>,
	"'James E.J. Bottomley'" <JBottomley@parallels.com>
Subject: Re: [PATCH 1/7] scsi: ufs: amend the ocs handling with fatal error
Date: Mon, 29 Jul 2013 16:21:40 +0530	[thread overview]
Message-ID: <51F6493C.3020105@codeaurora.org> (raw)
In-Reply-To: <51F608F4.9020107@codeaurora.org>

On 7/29/2013 11:47 AM, Subhash Jadavani wrote:
> On 7/26/2013 7:15 PM, Seungwon Jeon wrote:
>> Fatal error in OCS(overall command status) field indicates
>> error conditions which is not covered by UFSHCI.
>> It means that host cannot define the result of command status
>> and therefore host may need to check transfer response UPIU's
>> response and status field.
>> It was actually found that 'CHECK CONDITION' is stored in status
>> field of UPIU where OCS is 'FATAL ERROR'.

It looks like you are assuming that there will be some kind of response
from the device. But the spec. mentions - "OCS_FATAL ERROR: within host
controller that is not covered by the error conditions described above
in this table."

So spec. left everything to implementers on how to trigger this error.
Also, it says "within host controller" so ufshcd_is_valid_req_rsp()
might fail as well.

I couldn't understand why there is a need for a host controller to
interpret the SCSI command status and raise an OCS_FATAL_ERROR?

If it is clarified by the spec. then we can have generic implementation
otherwise I would prefer to make this specific to those host controllers
that raise OCS_FATAL_ERROR for CHECK_CONDITION.

>>
>> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
>> ---
>>   drivers/scsi/ufs/ufshcd.c |    3 +--
>>   1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>> index b743bd6..4cf3a2d 100644
>> --- a/drivers/scsi/ufs/ufshcd.c
>> +++ b/drivers/scsi/ufs/ufshcd.c
>> @@ -1199,7 +1199,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba,
>> struct ufshcd_lrb *lrbp)
>>       switch (ocs) {
>>       case OCS_SUCCESS:
>> -
>> +    case OCS_FATAL_ERROR:
>>           /* check if the returned transfer response is valid */
>>           result = ufshcd_is_valid_req_rsp(lrbp->ucd_rsp_ptr);
>
> I don't see the response UPIU data of the last command response is
> cleared anywhere in the driver. This means its quite possible that if
> the current command failed (and if it is using the same tag as the last
> succeeded command) with the OCS_FATAL_ERROR then response UPIU (pointed
> by lrbp->ucd_rsp_ptr) content may be still the same as the last one. If
> we ensure to clear the response UPIU data after every command completion
> then only we can rely on the response  UPIU content in case of fatal
> errors.
>
> Regards,
> Subhash
>>           if (result) {
>> @@ -1229,7 +1229,6 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba,
>> struct ufshcd_lrb *lrbp)
>>       case OCS_MISMATCH_DATA_BUF_SIZE:
>>       case OCS_MISMATCH_RESP_UPIU_SIZE:
>>       case OCS_PEER_COMM_FAILURE:
>> -    case OCS_FATAL_ERROR:
>>       default:
>>           result |= DID_ERROR << 16;
>>           dev_err(hba->dev,
>


-- 
Regards,
Sujit

  parent reply	other threads:[~2013-07-29 10:51 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20  0:41 [PATCH v2 0/3] ufs: fix bugs in probing and removing driver paths Akinobu Mita
2013-07-20  0:41 ` [PATCH v2 1/3] ufshcd-pci: release ioremapped region during removing driver Akinobu Mita
2013-07-26 13:45   ` [PATCH 1/7] scsi: ufs: amend the ocs handling with fatal error Seungwon Jeon
2013-07-29  6:17     ` Subhash Jadavani
2013-07-29 10:05       ` Seungwon Jeon
2013-07-29 10:27         ` Subhash Jadavani
2013-07-29 10:51       ` Sujit Reddy Thumma [this message]
2013-07-30 13:02         ` Seungwon Jeon
2013-08-12  7:17           ` Subhash Jadavani
2013-08-13 11:50             ` Seungwon Jeon
2013-08-13 13:39               ` Subhash Jadavani
2013-07-29 18:03     ` Santosh Y
2013-07-20  0:41 ` [PATCH v2 2/3] ufs: don't disable_irq() if the IRQ can be shared among devices Akinobu Mita
2013-07-26 13:44   ` [PATCH 0/7] scsi: ufs: some fixes and updates Seungwon Jeon
2013-08-23 13:00     ` [PATCH v2 0/6] " Seungwon Jeon
2013-08-25 11:23       ` Dolev Raviv
2013-08-26 14:40     ` [PATCH v3 " Seungwon Jeon
2013-08-28 10:46       ` Subhash Jadavani
2013-07-20  0:41 ` [PATCH v2 3/3] ufs: don't stop controller before scsi_remove_host() Akinobu Mita
2013-07-26 13:46 ` [PATCH 2/7] scsi: ufs: find out sense data over scsi status values Seungwon Jeon
2013-07-29  6:35   ` Subhash Jadavani
2013-07-30 13:00     ` Seungwon Jeon
2013-07-29 10:51   ` Sujit Reddy Thumma
2013-07-30 13:03     ` Seungwon Jeon
2013-07-30  3:53   ` Santosh Y
2013-07-30 13:03     ` Seungwon Jeon
2013-07-31  0:15       ` Elliott, Robert (Server Storage)
2013-08-06 12:08         ` Seungwon Jeon
2013-08-23 13:00   ` [PATCH v2 1/6] " Seungwon Jeon
2013-08-23 13:00   ` [PATCH v2 2/6] scsi: ufs: fix the setting interrupt aggregation counter Seungwon Jeon
2013-08-23 13:00   ` [PATCH v2 3/6] scsi: ufs: add dme configuration primitives Seungwon Jeon
2013-08-23 13:00   ` [PATCH v2 4/6] scsi: ufs: add unipro attribute IDs Seungwon Jeon
2013-08-23 13:00   ` [PATCH v2 5/6] scsi: ufs: add operation for the uic power mode change Seungwon Jeon
2013-08-23 13:00   ` [PATCH v2 6/6] scsi: ufs: configure the attribute for power mode Seungwon Jeon
2013-08-26 14:40   ` [PATCH v3 1/6] scsi: ufs: find out sense data over scsi status values Seungwon Jeon
2013-08-27  8:53     ` Subhash Jadavani
2013-08-28 12:43       ` Yaniv Gardi
2013-08-26 14:40   ` [PATCH v3 2/6] scsi: ufs: fix the setting interrupt aggregation counter Seungwon Jeon
2013-08-27  9:01     ` Subhash Jadavani
2013-08-28 12:43       ` Yaniv Gardi
2013-08-26 14:40   ` [PATCH v3 3/6] scsi: ufs: add dme configuration primitives Seungwon Jeon
2013-08-27  9:15     ` Subhash Jadavani
2013-08-28 12:44       ` Yaniv Gardi
2013-08-26 14:40   ` [PATCH v3 4/6] scsi: ufs: add unipro attribute IDs Seungwon Jeon
2013-08-27  9:14     ` Subhash Jadavani
2013-08-28 12:46       ` Yaniv Gardi
2013-08-26 14:40   ` [PATCH v3 5/6] scsi: ufs: add operation for the uic power mode change Seungwon Jeon
2013-08-27  9:53     ` Subhash Jadavani
2013-08-27 11:28       ` Seungwon Jeon
2013-08-27 11:47         ` Subhash Jadavani
2013-08-27 11:58           ` Seungwon Jeon
2013-08-28 12:45             ` Yaniv Gardi
2013-08-26 14:41   ` [PATCH v3 6/6] scsi: ufs: configure the attribute for power mode Seungwon Jeon
2013-08-27 10:21     ` Subhash Jadavani
2013-08-27 10:27       ` Subhash Jadavani
2013-09-09 11:51   ` [PATCH] scsi: ufs: export the helper functions for vender probe/remove Seungwon Jeon
2013-07-26 13:46 ` [PATCH 3/7] scsi: ufs: fix the setting interrupt aggregation counter Seungwon Jeon
2013-07-29  7:03   ` Subhash Jadavani
2013-07-30 13:01     ` Seungwon Jeon
2013-07-26 13:47 ` [PATCH 4/7] scsi: ufs: add dme configuration primitives Seungwon Jeon
2013-07-29  9:24   ` Subhash Jadavani
2013-07-30 13:02     ` Seungwon Jeon
2013-08-13  6:56       ` Subhash Jadavani
2013-07-26 13:48 ` [PATCH 5/7] scsi: ufs: add unipro attribute IDs Seungwon Jeon
2013-07-29  9:26   ` Subhash Jadavani
2013-07-26 13:48 ` [PATCH 6/7] scsi: ufs: add operation for the uic power mode change Seungwon Jeon
2013-07-29  9:53   ` Subhash Jadavani
2013-07-30 13:02     ` Seungwon Jeon
2013-07-26 13:49 ` [PATCH 7/7] scsi: ufs: configure the attribute for power mode Seungwon Jeon
2013-07-31 13:28   ` Subhash Jadavani
2013-08-06 12:08     ` Seungwon Jeon
2013-08-13  7:00       ` Subhash Jadavani

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=51F6493C.3020105@codeaurora.org \
    --to=sthumma@codeaurora.org \
    --cc=JBottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=santoshsy@gmail.com \
    --cc=subhashj@codeaurora.org \
    --cc=tgih.jun@samsung.com \
    --cc=vinholikatti@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.