LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: Gilad Broner <gbroner@codeaurora.org>
Cc: Jej B <james.bottomley@hansenpartnership.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	linux-arm-msm@vger.kernel.org, Santosh Y <santoshsy@gmail.com>,
	linux-scsi-owner@vger.kernel.org,
	Subhash Jadavani <subhashj@codeaurora.org>,
	Yaniv Gardi <ygardi@codeaurora.org>,
	Dolev Raviv <draviv@codeaurora.org>,
	Sujit Reddy Thumma <sthumma@codeaurora.org>,
	Vinayak Holikatti <vinholikatti@gmail.com>,
	"James E.J. Bottomley" <jbottomley@parallels.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Ingo Molnar <mingo@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Davidlohr Bueso <davidlohr@hp.com>,
	Andi Kleen <ak@linux.intel.com>,
	Alexei Starovoitov <ast@plumgrid.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Dan Streetman <ddstreet@ieee.org>
Subject: Re: [PATCH v4 4/4] scsi: ufs: inject errors to verify error handling
Date: Tue, 10 Mar 2015 22:09:21 +0900	[thread overview]
Message-ID: <CAC5umyj1jJLpE90W1mpoxh6UpgzYF_p3B_=eTXOfmTboYNUULQ@mail.gmail.com> (raw)
In-Reply-To: <83c5d23982cd8eb481a6ff2848925331.squirrel@www.codeaurora.org>

2015-03-10 19:20 GMT+09:00 Gilad Broner <gbroner@codeaurora.org>:
>>> +static bool inject_cmd_hang_tr(struct ufs_hba *hba)
>>> +{
>>> +       int tag;
>>> +
>>> +       tag = find_first_bit(&hba->outstanding_reqs, hba->nutrs);
>>> +       if (tag == hba->nutrs)
>>> +               return 0;
>>> +
>>> +       __clear_bit(tag, &hba->outstanding_reqs);
>>> +       hba->lrb[tag].cmd = NULL;
>>> +       __clear_bit(tag, &hba->lrb_in_use);
>>
>> hba->lrb_in_use is a bitmap set by test_and_set_bit_lock().  So
>> this should be cleared by clear_bit_unlock().
>
> You are correct. Thanks.
>
>>
>> And as soon as the bit corresponds to this slot in hba->lrb_in_use is
>> cleared, this slot could be reused.  But if the request corresponds
>> to the slot is not completed yet, it could sacrifice the new request,
>> too.  So should we only inject into the commands which have been
>> completed like this?
>
> Please note that we only clear the bit in hba->lrb_in_use. scsi_done is
> not called for this request. Therefore, the tag is not yet free in the
> block layer and next calls for queuecommand will not pass down this tag to
> be used in the UFS driver. So there is no danger of a new request being
> sacrificed.

OK, I see there is no danger as far as the commands are comming
through queuecommand().  But what about the query requests?
PATCH 1/4 in this series has added ioctl interface for query
request which also acquires a tag in hba->lrb_in_use through
ufshcd_get_dev_cmd_tag().  Although it is very difficult to
happen, is it possible for new query requests to be clashed by
inject_cmd_hang_tr() in the same way I described earlier?

      reply	other threads:[~2015-03-10 13:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 14:56 [PATCH v4 0/4] Add ioctl and debug utilities to UFS driver Gilad Broner
2015-03-02 14:56 ` [PATCH v4 1/4] scsi: ufs: add ioctl interface for query request Gilad Broner
2015-03-02 14:56 ` [PATCH v4 2/4] scsi: ufs: add debugfs for ufs Gilad Broner
2015-03-02 14:56 ` [PATCH v4 3/4] scsi: ufs: add trace events and dump prints for debug Gilad Broner
2015-03-02 14:56 ` [PATCH v4 4/4] scsi: ufs: inject errors to verify error handling Gilad Broner
2015-03-04 13:50   ` Akinobu Mita
2015-03-10 10:20     ` Gilad Broner
2015-03-10 13:09       ` Akinobu Mita [this message]

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='CAC5umyj1jJLpE90W1mpoxh6UpgzYF_p3B_=eTXOfmTboYNUULQ@mail.gmail.com' \
    --to=akinobu.mita@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=davidlohr@hp.com \
    --cc=ddstreet@ieee.org \
    --cc=draviv@codeaurora.org \
    --cc=gbroner@codeaurora.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi-owner@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=santoshsy@gmail.com \
    --cc=sthumma@codeaurora.org \
    --cc=subhashj@codeaurora.org \
    --cc=vinholikatti@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=ygardi@codeaurora.org \
    --subject='Re: [PATCH v4 4/4] scsi: ufs: inject errors to verify error handling' \
    /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

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).