From: Bjorn Helgaas <helgaas@kernel.org>
To: Amey Narkhede <ameynarkhede03@gmail.com>
Cc: Ryder Lee <ryder.lee@mediatek.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Rob Herring <robh@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
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: Thu, 29 Apr 2021 17:38:38 -0500 [thread overview]
Message-ID: <20210429223838.GA588275@bjorn-Precision-5520> (raw)
In-Reply-To: <20210429134749.75157-1-ameynarkhede03@gmail.com>
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?
> 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.
> list_for_each_entry_safe(port, tmp, &pcie->ports, list)
> mtk_pcie_enable_port(port);
> --
> 2.31.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-04-29 22:40 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 [this message]
2021-04-30 6:43 ` Amey Narkhede
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=20210429223838.GA588275@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=ameynarkhede03@gmail.com \
--cc=bhelgaas@google.com \
--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