linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Loic Poulain <loic.poulain@linaro.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Hemant Kumar <hemantk@codeaurora.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 4/6] mhi: pci_generic: No-Op for device_wake operations
Date: Thu, 4 Mar 2021 09:34:38 +0100	[thread overview]
Message-ID: <CAMZdPi_+sVnahTtQP+Osv_qrxz=dS=i4n5bdZp2ffT7nvBLB0A@mail.gmail.com> (raw)
In-Reply-To: <20210304064736.GD3363@thinkpad>

On Thu, 4 Mar 2021 at 07:47, Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:
>
> On Mon, Mar 01, 2021 at 05:25:09PM +0100, Loic Poulain wrote:
> > The wake_db register presence is highly speculative and can fuze MHI
> > devices. Indeed, currently the wake_db register address is defined at
> > entry 127 of the 'Channel doorbell array', thus writing to this address
> > is equivalent to ringing the doorbell for channel 127, causing trouble
> > with some device that get an unexpected channel 127 doorbell interrupt.
> >
>
> what are those "some" devices?

I had this issue with SDX24 based modems. With SDX55, there is no
apparent issue but also no proof that it works as expected (device
never enters M1), so discarding this, for now, to avoid prevent any
trouble. At some point, we can add a kind of per-device QUIRK flag to
enable or disable this, but we need at least one 'working' device for
that.

>
> > This change fixes that issue by setting wake get/put as no-op for
> > pci_generic devices. The wake device sideband mechanism seems really
> > specific to each device, and is AFAIK no defined by the MHI spec.
> >
>
> s/no/not
>
> > It also removes zeroing initialization of wake_db register during MMIO
> > initialization, the register being set via wake_get/put accessors few
> > cycles later during M0 transition.
> >
>
> IIUC, the DEVICE_WAKE specified in the MHI spec corresponds to the wake doorbell
> register. But in some cases, this rather happens to be a #WAKE sideband GPIO as
> in PCIe.

Yes, this wake thing seems to depend on devices, and the 'wake
doorbell register' does not seem to have an 'official' offset/address.

>
> > Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> > ---
> >  drivers/bus/mhi/core/init.c   |  2 --
> >  drivers/bus/mhi/pci_generic.c | 18 ++++++++++++++++++
> >  2 files changed, 18 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> > index 2159dbc..32eb90f 100644
> > --- a/drivers/bus/mhi/core/init.c
> > +++ b/drivers/bus/mhi/core/init.c
> > @@ -510,8 +510,6 @@ int mhi_init_mmio(struct mhi_controller *mhi_cntrl)
> >
> >       /* Setup wake db */
> >       mhi_cntrl->wake_db = base + val + (8 * MHI_DEV_WAKE_DB);
> > -     mhi_write_reg(mhi_cntrl, mhi_cntrl->wake_db, 4, 0);
> > -     mhi_write_reg(mhi_cntrl, mhi_cntrl->wake_db, 0, 0);
>
> I need comment from Hemant/Bhaumik on this change since I don't exactly know if
> this is really required or not.

Sure.

Regards,
Loic

  reply	other threads:[~2021-03-04  8:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 16:25 [PATCH 1/6] mhi: pci_generic: Parametrable element count for events Loic Poulain
2021-03-01 16:25 ` [PATCH 2/6] mhi: pci_generic: Introduce quectel EM1XXGR-L support Loic Poulain
2021-03-04  6:32   ` Manivannan Sadhasivam
2021-03-01 16:25 ` [PATCH 3/6] mhi: pci_generic: Add SDX24 based modem support Loic Poulain
2021-03-04  6:32   ` Manivannan Sadhasivam
2021-03-01 16:25 ` [PATCH 4/6] mhi: pci_generic: No-Op for device_wake operations Loic Poulain
2021-03-04  6:47   ` Manivannan Sadhasivam
2021-03-04  8:34     ` Loic Poulain [this message]
2021-03-01 16:25 ` [PATCH 5/6] mhi: pci_generic: Use generic PCI power management Loic Poulain
2021-03-04  6:56   ` Manivannan Sadhasivam
2021-03-04  8:23     ` Loic Poulain
2021-03-01 16:25 ` [PATCH 6/6] mhi: pci_generic: Add support for runtime PM Loic Poulain
2021-03-04  6:31 ` [PATCH 1/6] mhi: pci_generic: Parametrable element count for events 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='CAMZdPi_+sVnahTtQP+Osv_qrxz=dS=i4n5bdZp2ffT7nvBLB0A@mail.gmail.com' \
    --to=loic.poulain@linaro.org \
    --cc=hemantk@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).