Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [RESEND PATCH] NVMe: Add pci error handlers
Date: Thu, 19 Nov 2015 22:55:25 +0000	[thread overview]
Message-ID: <20151119225524.GC22690@localhost.localdomain> (raw)
In-Reply-To: <20151119223439.GA17172@infradead.org>

On Thu, Nov 19, 2015@02:34:39PM -0800, Christoph Hellwig wrote:
> > +static pci_ers_result_t nvme_error_detected(struct pci_dev *pdev,
> > +						pci_channel_state_t state)
> > +{
> > +	struct nvme_dev *dev = pci_get_drvdata(pdev);
> > +
> > +	dev_warn(&pdev->dev, "%s: state:%d\n", __func__, state);
> > +	switch (state) {
> > +	case pci_channel_io_normal:
> > +		return PCI_ERS_RESULT_CAN_RECOVER;
> > +	case pci_channel_io_frozen:
> > +		nvme_dev_shutdown(dev);
> > +		return PCI_ERS_RESULT_NEED_RESET;
> > +	case pci_channel_io_perm_failure:
> > +		return PCI_ERS_RESULT_DISCONNECT;
> > +	}
> > +	return PCI_ERS_RESULT_NEED_RESET;
> > +}
> 
> 
> This seems to be somewhat of a default methods used by various drivers,
> and looks rather boiler plate-y.  Any reason this conversion isn't done
> by core code?

Yeah, it's pretty common. I referenced a few other pci drivers, but
mostly mpt3sas.

Sounds like a nice longer term goal to eliminate driver specific handlers
and have a common handler in the pci-core. Many error_detected/slot_reset
handlers look similar to a suspend/resume, so maybe we can leverage
power management.

      reply	other threads:[~2015-11-19 22:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 20:58 [RESEND PATCH] NVMe: Add pci error handlers Keith Busch
2015-11-19 22:34 ` Christoph Hellwig
2015-11-19 22:55   ` Keith Busch [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=20151119225524.GC22690@localhost.localdomain \
    --to=keith.busch@intel.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