Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Bhaumik Bhatt <bbhatt@codeaurora.org>,
	Hemant Kumar <hemantk@codeaurora.org>
Subject: Re: [PATCH v6 07/10] mhi: pci_generic: Add PCI error handlers
Date: Thu, 31 Dec 2020 16:44:34 +0530	[thread overview]
Message-ID: <20201231111434.GJ7345@thinkpad> (raw)
In-Reply-To: <CAMZdPi8+qFPbkiQz8rnC=2X6Z6fTfY=4e1HsBbXk9DJfi-AU3g@mail.gmail.com>

On Thu, Dec 31, 2020 at 10:27:01AM +0100, Loic Poulain wrote:
> Hi Mani,
> 
> On Thu, 31 Dec 2020 at 08:18, Manivannan Sadhasivam
> <manivannan.sadhasivam@linaro.org> wrote:
> >
> > On Tue, Dec 29, 2020 at 09:43:48AM +0100, Loic Poulain wrote:
> > > In AER capable root complex, errors are reported to the host which
> > > can then act accordingly and perform PCI recovering procedure.
> > >
> > > This patch enables error reporting and implements error_detected,
> > > slot_reset and resume callbacks.
> > >
> > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> > > Reviewed-by Hemant Kumar <hemantk@codeaurora.org>
> > > ---
> > >  drivers/bus/mhi/pci_generic.c | 50 +++++++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 50 insertions(+)
> 
> > > +static pci_ers_result_t mhi_pci_slot_reset(struct pci_dev *pdev)
> > > +{
> > > +     if (pci_enable_device(pdev)) {
> > > +             dev_err(&pdev->dev, "Cannot re-enable PCI device after reset.\n");
> > > +             return PCI_ERS_RESULT_DISCONNECT;
> > > +     }
> > > +
> >
> > This callback will be called after PCI slot reset, so we should also be resetting
> > the device after enabling it.
> 
> Yes, but that is done in mhi_pci_io_resume.
> 
> From the PCI error recovery documentation, "drivers should not restart
> normal I/O processing operations at this point (in slot_reset) If all
> device drivers report success on this callback, the platform will call
> resume() to complete the sequence, and let the driver restart normal
> I/O processing."
> The actual MHI PCI/recovery is then done in resume (mhi_pci_io_resume).
> 

If you read one paragraph above,

"This call gives drivers the chance to re-initialize the hardware
(re-download firmware, etc.).  At this point, the driver may assume
that the card is in a fresh state and is fully functional. The slot
is unfrozen and the driver has full access to PCI config space,
memory mapped I/O space and DMA."

So at the end of this call, the device is assumed to be functional (then only
PCI_ERS_RESULT_RECOVERED makes sense).

IMO, you should call mhi_pci_reset_prepare() in this callback and
mhi_pci_reset_done() in resume(). No need to schedule the recovery work.

Thanks,
Mani

> Regards,
> Loic

  reply	other threads:[~2020-12-31 11:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29  8:43 [PATCH v6 00/10] mhi: pci_generic: Misc improvements Loic Poulain
2020-12-29  8:43 ` [PATCH v6 01/10] mhi: Add mhi_controller_initialize helper Loic Poulain
2020-12-31  6:48   ` Manivannan Sadhasivam
2020-12-29  8:43 ` [PATCH v6 02/10] bus: mhi: core: Add device hardware reset support Loic Poulain
2020-12-31  7:01   ` Manivannan Sadhasivam
2020-12-29  8:43 ` [PATCH v6 03/10] mhi: pci-generic: Increase number of hardware events Loic Poulain
2020-12-29  8:43 ` [PATCH v6 04/10] mhi: pci_generic: Enable burst mode for hardware channels Loic Poulain
2020-12-29  8:43 ` [PATCH v6 05/10] mhi: pci_generic: Add support for reset Loic Poulain
2020-12-29  8:43 ` [PATCH v6 06/10] mhi: pci_generic: Add suspend/resume/recovery procedure Loic Poulain
2020-12-31  7:05   ` Manivannan Sadhasivam
2020-12-29  8:43 ` [PATCH v6 07/10] mhi: pci_generic: Add PCI error handlers Loic Poulain
2020-12-31  7:18   ` Manivannan Sadhasivam
2020-12-31  9:27     ` Loic Poulain
2020-12-31 11:14       ` Manivannan Sadhasivam [this message]
2020-12-29  8:43 ` [PATCH v6 08/10] mhi: pci_generic: Add health-check Loic Poulain
2020-12-29  8:43 ` [PATCH v6 09/10] mhi: pci_generic: Increase controller timeout value Loic Poulain
2020-12-31  7:18   ` Manivannan Sadhasivam
2020-12-29  8:43 ` [PATCH v6 10/10] mhi: pci_generic: Add diag channels Loic Poulain
2020-12-31  7:20   ` Manivannan Sadhasivam

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=20201231111434.GJ7345@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=bbhatt@codeaurora.org \
    --cc=hemantk@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    /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