From: Daniel Axtens <dja@ozlabs.au.ibm.com>
To: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>,
linux-scsi@vger.kernel.org,
James.Bottomley@HansenPartnership.com, nab@linux-iscsi.org,
wenxiong@linux.vnet.ibm.com, hch@infradead.org,
mikey@neuling.org, imunsie@au1.ibm.com,
"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>
Subject: Re: [PATCH v3 2/4] cxlflash: Base error recovery support
Date: Thu, 06 Aug 2015 08:38:39 +1000 [thread overview]
Message-ID: <1438814319.6796.0.camel@ozlabs.au.ibm.com> (raw)
In-Reply-To: <4194F460-16AC-46A2-9ECF-63C4F100060A@linux.vnet.ibm.com>
On Wed, 2015-08-05 at 17:30 -0500, Matthew R. Ochs wrote:
> Hi Brian,
>
> Thanks for reviewing. Comments inline below.
>
>
> -matt
>
> > On Aug 5, 2015, at 11:04 AM, Brian King <brking@linux.vnet.ibm.com> wrote:
> >
> > On 08/02/2015 11:33 PM, Matthew R. Ochs wrote:
> >
> >> diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
> >> index ba070a5..3d6217a 100644
> >> --- a/drivers/scsi/cxlflash/common.h
> >> +++ b/drivers/scsi/cxlflash/common.h
> >> @@ -76,6 +76,12 @@ enum cxlflash_init_state {
> >> INIT_STATE_SCSI
> >> };
> >>
> >> +enum eeh_state {
> >> + EEH_STATE_NONE,
> >> + EEH_STATE_ACTIVE,
> >> + EEH_STATE_FAILED
> >> +};
> >
> > Can you use pdev->error_state and pci_channel_offline instead of duplicating this
> > state information in a private driver definition?
>
> Makes sense, I’ll look into this.
>
I don't think my vPHB code propagates error_state yet. I'll check, and
if necessary, push a patch and fold it into my v3.
Regards
Daniel
> >>
> >> +#ifdef CONFIG_CXL_EEH
> >> + cxl_perst_reloads_same_image(afu, val)
> >> +#endif
> >
> > I'd suggest moving this to a .h and defining the function as a noop there if appropriate, something
> > like:
> >
> > #ifndef CONFIG_CXL_EEH
> > #define cxl_perst_reloads_same_image(cfg->cxl_afu, true) do { } while(0)
> > #endif
>
> Done.
>
> >>
> >> - rcr = afu_reset(cfg);
> >> - if (rcr == 0)
> >> - rc = SUCCESS;
> >> - else
> >> - rc = FAILED;
> >> + switch (cfg->eeh_active) {
> >> + case EEH_STATE_NONE:
> >> + cfg->eeh_active = EEH_STATE_FAILED;
> >
> > Seems a little strange to be messing with the EEH state machine here when EEH isn't even at play.
> > If you can't switch to use the existing EEH state machine in the pdev struct, suggest renaming
> > this internal state machine to something more accurate and using the pdev EEH state machine where you can.
> > Same goes for the eeh_waitq…
>
> I do agree that this is a bit strange. What we’re doing here is borrowing the framework we
> put in place to quiesce user contexts and hold off new threads coming in during an EEH
> event. I’ll look into how we can refactor this given that we’re going to move to using the
> existing EEH state machine (pdev->error_state) and will no longer be able to toggle state.
>
> >> + pr_debug("%s: pdev=%p state=%u\n", __func__, pdev, state);
> >> +
> >> + switch (state) {
> >> + case pci_channel_io_frozen:
> >> + cfg->eeh_active = EEH_STATE_ACTIVE;
> >> + udelay(100);
> >> +
> >
> > I think this udelay needs a comment…
>
> This may end up going away. I’ll add a comment if we keep it.
>
> > I'd suggest calling scsi_block_requests here to stop your queuecommand function from being called.
> > Note that this won't stop EH commands from being sent, so you will still need to check this
> > in queuecommand, although the right thing to do may be to fix scsi_send_eh_cmnd to not call
> > queuecommand if the host is blocked.
> >
> > You’d then need to call scsi_unblock_requests when EEH in the perm failure and resume cases.
>
> Good suggestion, we’ll look at adding this in.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-08-05 22:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 4:33 [PATCH v3 2/4] cxlflash: Base error recovery support Matthew R. Ochs
2015-08-05 16:04 ` Brian King
2015-08-05 22:30 ` Matthew R. Ochs
2015-08-05 22:38 ` Daniel Axtens [this message]
2015-08-07 5:12 ` Daniel Axtens
2015-08-07 20:53 ` Matthew R. Ochs
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=1438814319.6796.0.camel@ozlabs.au.ibm.com \
--to=dja@ozlabs.au.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brking@linux.vnet.ibm.com \
--cc=hch@infradead.org \
--cc=imunsie@au1.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=manoj@linux.vnet.ibm.com \
--cc=mikey@neuling.org \
--cc=mrochs@linux.vnet.ibm.com \
--cc=nab@linux-iscsi.org \
--cc=wenxiong@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).