From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Adrian Hunter" <adrian.hunter@intel.com>,
linux-mmc@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
devicetree@vger.kernel.org, "Jason Cooper" <jason@lakedaemon.net>,
"Andrew Lunn" <andrew@lunn.ch>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
linux-arm-kernel@lists.infradead.org,
"Antoine Tenart" <antoine.tenart@free-electrons.com>,
"Miquèl Raynal" <miquel.raynal@free-electrons.com>,
"Nadav Haklai" <nadavh@marvell.com>,
"Shadi Ammouri" <shadi@marvell.com>,
"Yehuda Yitschak" <yehuday@marvell.com>,
"Omri Itach" <omrii@marvell.com>,
"Hanna Hawa" <hannah@marvell.com>,
"Igal Liberman" <igall@marvell.com>,
"Marcin Wojtas" <mw@semihalf.com>
Subject: Re: [PATCH v2] mmc: sdhci-xenon: Fix clock resource by adding an optional bus clock
Date: Mon, 02 Oct 2017 16:32:23 +0200 [thread overview]
Message-ID: <87fub1mxhk.fsf@free-electrons.com> (raw)
In-Reply-To: <20170930141753.7c4e34ea@xhacker.debian> (Jisheng Zhang's message of "Sat, 30 Sep 2017 14:17:53 +0800")
Hi Jisheng,
On sam., sept. 30 2017, Jisheng Zhang <Jisheng.Zhang@synaptics.com> wrote:
> Hi Thomas,
>
> On Sat, 30 Sep 2017 08:07:10 +0200 Thomas Petazzoni wrote:
>
>> Hello,
>>
>> On Sat, 30 Sep 2017 10:41:09 +0800, Jisheng Zhang wrote:
>>
>> > > + priv->axi_clk = devm_clk_get(&pdev->dev, "axi");
>> > > + if (IS_ERR(priv->axi_clk)) {
>> > > + err = PTR_ERR(priv->axi_clk);
>> > > + if (err == -EPROBE_DEFER)
>> > > + goto err_clk;
>> > > + priv->axi_clk = NULL;
>> >
>> > IMHO, this assignment could be removed. What do you think?
>>
>> No, because if the clock is not present in the Device Tree,
>> priv->axi_clk will contain an error code encoded as a pointer, so
>> priv->axi_clk will not be NULL. Hence the rest of the code that will
>
> FWICT, the clk_disable_unprepare() could also check whether the clk
> is err, am I wrong?
You're right, I've jsut checked it.
So I will remove it to have a smaller fix.
Thanks,
Gregory
>
>> operate on this clock will believe there is a valid clock pointed by
>> priv->axi_clk. So we really want to reset it to NULL when there was an
>> error getting the clock.
>>
>> Best regards,
>>
>> Thomas
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
WARNING: multiple messages have this Message-ID (diff)
From: gregory.clement@free-electrons.com (Gregory CLEMENT)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] mmc: sdhci-xenon: Fix clock resource by adding an optional bus clock
Date: Mon, 02 Oct 2017 16:32:23 +0200 [thread overview]
Message-ID: <87fub1mxhk.fsf@free-electrons.com> (raw)
In-Reply-To: <20170930141753.7c4e34ea@xhacker.debian> (Jisheng Zhang's message of "Sat, 30 Sep 2017 14:17:53 +0800")
Hi Jisheng,
On sam., sept. 30 2017, Jisheng Zhang <Jisheng.Zhang@synaptics.com> wrote:
> Hi Thomas,
>
> On Sat, 30 Sep 2017 08:07:10 +0200 Thomas Petazzoni wrote:
>
>> Hello,
>>
>> On Sat, 30 Sep 2017 10:41:09 +0800, Jisheng Zhang wrote:
>>
>> > > + priv->axi_clk = devm_clk_get(&pdev->dev, "axi");
>> > > + if (IS_ERR(priv->axi_clk)) {
>> > > + err = PTR_ERR(priv->axi_clk);
>> > > + if (err == -EPROBE_DEFER)
>> > > + goto err_clk;
>> > > + priv->axi_clk = NULL;
>> >
>> > IMHO, this assignment could be removed. What do you think?
>>
>> No, because if the clock is not present in the Device Tree,
>> priv->axi_clk will contain an error code encoded as a pointer, so
>> priv->axi_clk will not be NULL. Hence the rest of the code that will
>
> FWICT, the clk_disable_unprepare() could also check whether the clk
> is err, am I wrong?
You're right, I've jsut checked it.
So I will remove it to have a smaller fix.
Thanks,
Gregory
>
>> operate on this clock will believe there is a valid clock pointed by
>> priv->axi_clk. So we really want to reset it to NULL when there was an
>> error getting the clock.
>>
>> Best regards,
>>
>> Thomas
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
WARNING: multiple messages have this Message-ID (diff)
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Adrian Hunter" <adrian.hunter@intel.com>,
linux-mmc@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
devicetree@vger.kernel.org, "Jason Cooper" <jason@lakedaemon.net>,
"Andrew Lunn" <andrew@lunn.ch>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
linux-arm-kernel@lists.infradead.org,
"Antoine Tenart" <antoine.tenart@free-electrons.com>,
"Miquèl Raynal" <miquel.raynal@free-electrons.com>,
"Nadav Haklai" <nadavh@marvell.com>,
"Shadi Ammouri" <shadi@marvell.com>,
"Yehuda Yitschak" <yehuday@marvell.com>,
"Omri Itach" <omrii@marvell.com>,
"Hanna Hawa" <hannah@marvell.com>,
"Igal Liberman" <igall@marvell.com>,
"Marcin Wojtas" <mw@semihalf.com>,
Stable <stable@vger.kernel.org>
Subject: Re: [PATCH v2] mmc: sdhci-xenon: Fix clock resource by adding an optional bus clock
Date: Mon, 02 Oct 2017 16:32:23 +0200 [thread overview]
Message-ID: <87fub1mxhk.fsf@free-electrons.com> (raw)
In-Reply-To: <20170930141753.7c4e34ea@xhacker.debian> (Jisheng Zhang's message of "Sat, 30 Sep 2017 14:17:53 +0800")
Hi Jisheng,
On sam., sept. 30 2017, Jisheng Zhang <Jisheng.Zhang@synaptics.com> wrote:
> Hi Thomas,
>
> On Sat, 30 Sep 2017 08:07:10 +0200 Thomas Petazzoni wrote:
>
>> Hello,
>>
>> On Sat, 30 Sep 2017 10:41:09 +0800, Jisheng Zhang wrote:
>>
>> > > + priv->axi_clk = devm_clk_get(&pdev->dev, "axi");
>> > > + if (IS_ERR(priv->axi_clk)) {
>> > > + err = PTR_ERR(priv->axi_clk);
>> > > + if (err == -EPROBE_DEFER)
>> > > + goto err_clk;
>> > > + priv->axi_clk = NULL;
>> >
>> > IMHO, this assignment could be removed. What do you think?
>>
>> No, because if the clock is not present in the Device Tree,
>> priv->axi_clk will contain an error code encoded as a pointer, so
>> priv->axi_clk will not be NULL. Hence the rest of the code that will
>
> FWICT, the clk_disable_unprepare() could also check whether the clk
> is err, am I wrong?
You're right, I've jsut checked it.
So I will remove it to have a smaller fix.
Thanks,
Gregory
>
>> operate on this clock will believe there is a valid clock pointed by
>> priv->axi_clk. So we really want to reset it to NULL when there was an
>> error getting the clock.
>>
>> Best regards,
>>
>> Thomas
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2017-10-02 14:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 13:04 [PATCH v2] mmc: sdhci-xenon: Fix clock resource by adding an optional bus clock Gregory CLEMENT
2017-09-29 13:04 ` Gregory CLEMENT
2017-09-29 13:04 ` Gregory CLEMENT
[not found] ` <20170929130435.6805-1-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-09-29 18:42 ` zhoujie wu
2017-09-29 18:42 ` zhoujie wu
2017-09-29 18:42 ` zhoujie wu
2017-09-30 2:32 ` Jisheng Zhang
2017-09-30 2:32 ` Jisheng Zhang
2017-09-30 2:32 ` Jisheng Zhang
2017-09-30 2:41 ` Jisheng Zhang
2017-09-30 2:41 ` Jisheng Zhang
2017-09-30 2:41 ` Jisheng Zhang
2017-09-30 6:07 ` Thomas Petazzoni
2017-09-30 6:07 ` Thomas Petazzoni
2017-09-30 6:07 ` Thomas Petazzoni
2017-09-30 6:17 ` Jisheng Zhang
2017-09-30 6:17 ` Jisheng Zhang
2017-09-30 6:17 ` Jisheng Zhang
2017-10-02 14:32 ` Gregory CLEMENT [this message]
2017-10-02 14:32 ` Gregory CLEMENT
2017-10-02 14:32 ` Gregory CLEMENT
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=87fub1mxhk.fsf@free-electrons.com \
--to=gregory.clement@free-electrons.com \
--cc=Jisheng.Zhang@synaptics.com \
--cc=adrian.hunter@intel.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@free-electrons.com \
--cc=devicetree@vger.kernel.org \
--cc=hannah@marvell.com \
--cc=igall@marvell.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=miquel.raynal@free-electrons.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=omrii@marvell.com \
--cc=robh+dt@kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=shadi@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
--cc=yehuday@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.