Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Junyan Ye <yejunyan@hust.edu.cn>
Cc: christophe.jaillet@wanadoo.fr,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Wei Yongjun" <weiyongjun1@huawei.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Andrew Murray" <amurray@thegoodpenguin.co.uk>,
	hust-os-kernel-patches@googlegroups.com,
	"Dongliang Mu" <dzm91@hust.edu.cn>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pci: controller: pci-ftpci100: Release the clock resources
Date: Thu, 27 Apr 2023 13:38:33 -0500	[thread overview]
Message-ID: <20230427183833.GA263506@bhelgaas> (raw)
In-Reply-To: <20230423053208.2348-1-yejunyan@hust.edu.cn>

On Sun, Apr 23, 2023 at 01:32:07PM +0800, Junyan Ye wrote:
> Smatch reported:
> 1. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe()
> warn: 'clk' from clk_prepare_enable() not released on lines:
> 442,451,462,478,512,517.
> 2. drivers/pci/controller/pci-ftpci100.c:526 faraday_pci_probe()
> warn: 'p->bus_clk' from clk_prepare_enable() not released on lines:
> 451,462,478,512,517.

If/when you repost this, please:

  - Rebase to v6.4-rc1 (when it's available).

  - Look at subject line history for this file and match it.

  - Include the smatch warnings exactly above (not wrapped to fit in
    75 columns).  This is to make it easier to search for the text.

  - Add "()" after function names below to make it obvious they are
    functions.  You can also omit "function", e.g., "... is obtained
    by devm_clk_get()."

> The clock resource is obtained by the devm_clk_get function. The
> clk_prepare_enable function then makes the clock resource ready for use,
> notifying the system that the clock resource should be run. After that,
> the clock resource should be released when it is no longer needed. The
> corresponding function is clk_disable_unprepare. However, while doing
> some error handling in the faraday_pci_probe function, the
> clk_disable_unprepare function is not called to release the clk and
> p->bus_clk resources.

I don't know the clk terminology.  Does "... clock resource should be
run" mean the clock should be "running" or "enabled"?
include/linux/clk.h only uses "running" twice but has many instances
of "enable", so maybe that would be better.  Or maybe it's enough to
say:

  clk_prepare_enable() then makes the clock resource ready for use.

and omit the rest of that sentence?

Looks like a nice fix, thank you!

Bjorn

      parent reply	other threads:[~2023-04-27 18:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23  5:32 [PATCH v2] pci: controller: pci-ftpci100: Release the clock resources Junyan Ye
2023-04-26 20:44 ` Linus Walleij
2023-04-27 18:38 ` Bjorn Helgaas [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=20230427183833.GA263506@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=bhelgaas@google.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dzm91@hust.edu.cn \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --cc=kw@linux.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=robh@kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=yejunyan@hust.edu.cn \
    /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