public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Amey Narkhede <ameynarkhede03@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Ryder Lee <ryder.lee@mediatek.com>,
	lorenzo.pieralisi@arm.com, Rob Herring <robh@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] PCI: mediatek: Verify whether the free_ck clock is ungated or not
Date: Fri, 30 Apr 2021 12:13:20 +0530	[thread overview]
Message-ID: <20210430064320.ktnr2wjhza4p44dk@archlinux> (raw)
In-Reply-To: <20210429223838.GA588275@bjorn-Precision-5520>

On 21/04/29 05:38PM, Bjorn Helgaas wrote:
> Can you make the subject say something at a higher level instead of
> just paraphrasing the C code?  I'm guessing this means resume will now
> fail if the clock isn't turned on?
>
> On Thu, Apr 29, 2021 at 07:17:49PM +0530, Amey Narkhede wrote:
> > Verify that the free_ck clock is ungated on device resume
> > by checking return value of clk_prepare_enable().
>
> Also the commit log -- this doesn't say anything more than the code
> itself.  Did you find this by tripping over it?  Or just by code
> inspection?  I guess without the check, we continue on and try to
> resume, but accesses to PCI devices fail and maybe return ~0 data or
> cause machine checks or something?
>
I found this with code inspection. Sorry for the unclear commit
messsage. I'll try to clarify it in v2.
> > Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
> > ---
> >  drivers/pci/controller/pcie-mediatek.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> > index 23548b517..9b13214bf 100644
> > --- a/drivers/pci/controller/pcie-mediatek.c
> > +++ b/drivers/pci/controller/pcie-mediatek.c
> > @@ -1154,11 +1154,14 @@ static int __maybe_unused mtk_pcie_resume_noirq(struct device *dev)
> >  {
> >  	struct mtk_pcie *pcie = dev_get_drvdata(dev);
> >  	struct mtk_pcie_port *port, *tmp;
> > +	int ret;
> >
> >  	if (list_empty(&pcie->ports))
> >  		return 0;
> >
> > -	clk_prepare_enable(pcie->free_ck);
> > +	ret = clk_prepare_enable(pcie->free_ck);
> > +	if (ret)
> > +		return ret;
>
> Most callers print an error message when clk_prepare_enable() fails.
>
[...]
I'll update this in v2.

Thanks,
Amey

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2021-04-30  6:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 13:47 [PATCH] PCI: mediatek: Verify whether the free_ck clock is ungated or not Amey Narkhede
2021-04-29 22:38 ` Bjorn Helgaas
2021-04-30  6:43   ` Amey Narkhede [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=20210430064320.ktnr2wjhza4p44dk@archlinux \
    --to=ameynarkhede03@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=ryder.lee@mediatek.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