linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Loic Poulain <loic.poulain@linaro.org>
To: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Hemant Kumar <hemantk@codeaurora.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 2/8] mhi: pci-generic: Perform hard reset on remove
Date: Fri, 27 Nov 2020 17:21:20 +0100	[thread overview]
Message-ID: <CAMZdPi83hzkW7bpWddFsF6PeRqna6T8ye0QZ51NHz2r5AxpgHA@mail.gmail.com> (raw)
In-Reply-To: <f964e9ff-b2f3-dde4-13d8-9fc711b899da@codeaurora.org>

Hi Jeffrey,

On Wed, 25 Nov 2020 at 18:41, Jeffrey Hugo <jhugo@codeaurora.org> wrote:
> >>> @@ -329,6 +336,10 @@ static void mhi_pci_remove(struct pci_dev *pdev)
> >>>        mhi_power_down(mhi_cntrl, true);
> >>>        mhi_unprepare_after_power_down(mhi_cntrl);
> >>>        mhi_unregister_controller(mhi_cntrl);
> >>> +
> >>> +     /* MHI-layer reset could not be enough, always hard-reset the device */
> >>> +     mhi_pci_reset(mhi_cntrl);
> >>
> >> Referring to MHI spec:
> >> Hosts writes this register to trigger a reset. This can be used when the
> >> host detects a timeout in the MHI protocol and can use the reset as a
> >> last resort to recover the device. Host should first attempt an MHI
> >> Reset procedure before resetting the entire device.
> >>
> >> What issue are you facing which requires you to do full device reset ?
> >> Based on the spec recommendation, looks like this should be a last resort.
> >
> > On module unload/reload, the device does not go through cold reset and
> > can be in error state on further reload, causing mhi power up to fail.
> > This patch simply resets the device in remove so that it is in the
> > exact same condition as before probing (not only MHI layer, but all
> > the device context), I think it makes sense and prevents any
> > unexpected state on further reloading. Note also that unloading the
> > module (or unbinding the device) is not something that usually
> > happens, except when the user does it explicitly for any reason.
>
> This seems unnecessary to me.  Qaic has the same usecase, and the MHI
> state machine reset is sufficient.  Perhaps you have a unique edge case
> though.
>
> However, you are implementing the soc_reset functionality in your
> driver, when its a common MHI functionality, and is something I would
> like to use.  If you dig back, I proposed a sysfs extension to expose
> that to userspace, but I have a desire to use it from my driver, same as
> you.
>
> Would you please make MHI core changes to expose the soc_reset
> functionality out so that multiple drivers can use a common implementation?

I overlooked this reply, going to move that into MHI core, as you suggested.

Thanks,
Loic

  reply	other threads:[~2020-11-27 16:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 14:59 [PATCH 0/8] mhi: pci_generic: Misc improvements Loic Poulain
2020-11-13 14:59 ` [PATCH 1/8] mhi: pci-generic: Increase number of hardware events Loic Poulain
2020-11-13 16:56   ` Bhaumik Bhatt
2020-11-18  3:54   ` Hemant Kumar
2020-11-18  8:26     ` Loic Poulain
2020-11-19  1:50       ` Hemant Kumar
2020-11-19  9:42         ` Loic Poulain
2020-11-13 14:59 ` [PATCH 2/8] mhi: pci-generic: Perform hard reset on remove Loic Poulain
2020-11-19  1:46   ` Hemant Kumar
2020-11-19  9:21     ` Loic Poulain
2020-11-25 17:41       ` Jeffrey Hugo
2020-11-27 16:21         ` Loic Poulain [this message]
2020-12-02  1:54           ` Bhaumik Bhatt
2020-11-13 14:59 ` [PATCH 3/8] mhi: pci_generic: Enable burst mode for hardware channels Loic Poulain
2020-11-13 17:06   ` Bhaumik Bhatt
2020-11-13 14:59 ` [PATCH 4/8] mhi: pci_generic: Add support for reset Loic Poulain
2020-11-13 17:12   ` Bhaumik Bhatt
2020-11-13 17:42     ` Loic Poulain
2020-11-13 17:44       ` Bhaumik Bhatt
2020-11-13 14:59 ` [PATCH 5/8] mhi: pci_generic: Add suspend/resume/recovery procedure Loic Poulain
2020-11-19  2:21   ` Hemant Kumar
2020-11-19  9:54     ` Loic Poulain
2020-11-13 15:00 ` [PATCH 6/8] mhi: pci_generic: Add PCI error handlers Loic Poulain
2020-11-13 15:00 ` [PATCH 7/8] mhi: pci_generic: Add health-check Loic Poulain
2020-11-13 15:00 ` [PATCH 8/8] mhi: pci_generic: Increase controller timeout value Loic Poulain
2020-11-13 17:08   ` Bhaumik Bhatt
2020-11-25 20:23   ` Hemant Kumar

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=CAMZdPi83hzkW7bpWddFsF6PeRqna6T8ye0QZ51NHz2r5AxpgHA@mail.gmail.com \
    --to=loic.poulain@linaro.org \
    --cc=hemantk@codeaurora.org \
    --cc=jhugo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=manivannan.sadhasivam@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;
as well as URLs for NNTP newsgroup(s).