From: John Garry <john.garry@huawei.com>
To: Jason Yan <yanaijie@huawei.com>, <martin.petersen@oracle.com>,
<jejb@linux.vnet.ibm.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<zhaohongjiang@huawei.com>, <hare@suse.com>,
<dan.j.williams@intel.com>, <jthumshirn@suse.de>, <hch@lst.de>,
<huangdaode@hisilicon.com>, <chenxiang66@hisilicon.com>,
<xiexiuqi@huawei.com>, <tj@kernel.org>, <miaoxie@huawei.com>,
Ewan Milne <emilne@redhat.com>, Tomas Henzl <thenzl@redhat.com>
Subject: Re: [PATCH v2 2/7] scsi: libsas: only clear phy->in_shutdown after shutdown event done
Date: Wed, 30 Jan 2019 16:26:28 +0000 [thread overview]
Message-ID: <5643a038-a62f-e19c-1073-d845a8344b9f@huawei.com> (raw)
In-Reply-To: <20190130082412.9357-3-yanaijie@huawei.com>
On 30/01/2019 08:24, Jason Yan wrote:
> When the event queue is full of phy up and down events and reached the
> threshold, we will queue a shutdown-event, and set phy->in_shutdown so
> that we will not queue a shutdown-event again. But before the
> shutdown-event can be executed, every phy-down event will clear
> phy->in_shutdown and a new shutdown-event will be queued. The queue will
> be full of these shutdown-events.
>
> Fix this by only clear phy->in_shutdown in sas_phye_shutdown(), that is
> after the first shutdown-event has been executed.
>
Seems ok as a fix:
Reviewed-by: John Garry <john.garry@huawei.com>
After this fix, could we change to use a static per-PHY shutdown event
so that we cannot re-queue it? I know that this is going against idea of
dynamic events, but it's easier than messing with flags like this.
> Fixes: f12486e06ae8 ("scsi: libsas: shut down the PHY if events reached the threshold")
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> CC: John Garry <john.garry@huawei.com>
> CC: Johannes Thumshirn <jthumshirn@suse.de>
> CC: Ewan Milne <emilne@redhat.com>
> CC: Christoph Hellwig <hch@lst.de>
> CC: Tomas Henzl <thenzl@redhat.com>
> CC: Dan Williams <dan.j.williams@intel.com>
> CC: Hannes Reinecke <hare@suse.com>
> ---
> drivers/scsi/libsas/sas_phy.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/libsas/sas_phy.c b/drivers/scsi/libsas/sas_phy.c
> index 0374243c85d0..762bb13cca74 100644
> --- a/drivers/scsi/libsas/sas_phy.c
> +++ b/drivers/scsi/libsas/sas_phy.c
> @@ -35,7 +35,6 @@ static void sas_phye_loss_of_signal(struct work_struct *work)
> struct asd_sas_event *ev = to_asd_sas_event(work);
> struct asd_sas_phy *phy = ev->phy;
>
> - phy->in_shutdown = 0;
> phy->error = 0;
> sas_deform_port(phy, 1);
> }
> @@ -45,7 +44,6 @@ static void sas_phye_oob_done(struct work_struct *work)
> struct asd_sas_event *ev = to_asd_sas_event(work);
> struct asd_sas_phy *phy = ev->phy;
>
> - phy->in_shutdown = 0;
> phy->error = 0;
> }
>
> @@ -127,6 +125,7 @@ static void sas_phye_shutdown(struct work_struct *work)
> } else
> pr_notice("phy%02d is not enabled, cannot shutdown\n",
> phy->id);
> + phy->in_shutdown = 0;
> }
>
> /* ---------- Phy class registration ---------- */
>
next prev parent reply other threads:[~2019-01-30 16:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 8:24 [PATCH v2 0/7] libsas: fix issue of swapping or replacing disks Jason Yan
2019-01-30 8:24 ` [PATCH v2 1/7] scsi: libsas: reset the negotiated_linkrate when phy is down Jason Yan
2019-01-30 13:08 ` John Garry
2019-01-31 1:11 ` Jason Yan
2019-01-31 9:00 ` John Garry
2019-01-30 8:24 ` [PATCH v2 2/7] scsi: libsas: only clear phy->in_shutdown after shutdown event done Jason Yan
2019-01-30 16:26 ` John Garry [this message]
2019-01-31 1:13 ` Jason Yan
2019-01-30 8:24 ` [PATCH v2 3/7] scsi: libsas: optimize the debug print of the revalidate process Jason Yan
2019-01-30 16:41 ` John Garry
2019-01-31 1:31 ` Jason Yan
2019-01-31 10:25 ` John Garry
2019-01-30 8:24 ` [PATCH v2 4/7] scsi: libsas: split the replacement of sas disks in two steps Jason Yan
2019-01-30 17:22 ` John Garry
2019-01-31 2:04 ` Jason Yan
2019-01-31 10:29 ` John Garry
2019-01-31 16:38 ` John Garry
2019-02-01 1:58 ` Jason Yan
2019-02-01 9:34 ` John Garry
2019-01-30 8:24 ` [PATCH v2 5/7] scsi: libsas: check if the same device when flutter Jason Yan
2019-01-30 8:24 ` [PATCH v2 6/7] scsi: libsas: reset the phy address if discover failed Jason Yan
2019-01-30 17:36 ` John Garry
2019-01-31 2:13 ` Jason Yan
2019-01-31 9:10 ` John Garry
2019-01-30 8:24 ` [PATCH v2 7/7] scsi: libsas: fix issue of swapping two sas disks Jason Yan
2019-01-30 17:53 ` John Garry
2019-01-31 2:55 ` Jason Yan
2019-01-31 16:34 ` John Garry
2019-02-01 2:04 ` Jason Yan
2019-02-01 9:27 ` John Garry
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=5643a038-a62f-e19c-1073-d845a8344b9f@huawei.com \
--to=john.garry@huawei.com \
--cc=chenxiang66@hisilicon.com \
--cc=dan.j.williams@intel.com \
--cc=emilne@redhat.com \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=huangdaode@hisilicon.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=jthumshirn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=miaoxie@huawei.com \
--cc=thenzl@redhat.com \
--cc=tj@kernel.org \
--cc=xiexiuqi@huawei.com \
--cc=yanaijie@huawei.com \
--cc=zhaohongjiang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®