From: Thierry Reding <thierry.reding@gmail.com>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
Rob Herring <robh+dt@kernel.org>,
linux-tegra@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/5] ARM: tegra: WARN if flowctrl is not supported
Date: Mon, 20 Mar 2017 15:10:23 +0100 [thread overview]
Message-ID: <20170320141023.GB28203@ulmo.ba.sec> (raw)
In-Reply-To: <1489584715-23138-2-git-send-email-jonathanh@nvidia.com>
[-- Attachment #1.1: Type: text/plain, Size: 1348 bytes --]
On Wed, Mar 15, 2017 at 01:31:51PM +0000, Jon Hunter wrote:
> If we fail to map the IO space for the Tegra flowctrl module in
> tegra_flowctrl_init(), then if any of the public APIs for the Tegra
> flowctrl driver are called we still still attempt to access the
> hardware. Fix this by only accessing the hardware if the
> 'tegra_flowctrl_base' address has not been setup correctly and warn
> if we attempt to access the hardware when it has not.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> arch/arm/mach-tegra/flowctrl.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c
> index 475e783992fd..40b15e39f849 100644
> --- a/arch/arm/mach-tegra/flowctrl.c
> +++ b/arch/arm/mach-tegra/flowctrl.c
> @@ -47,6 +47,9 @@ static void __iomem *tegra_flowctrl_base;
>
> static void flowctrl_update(u8 offset, u32 value)
> {
> + if (WARN_ONCE(!tegra_flowctrl_base, "Tegra flowctrl not supported!"))
Technically I think this string needs a terminating "\n" because it is
eventually passed to printk(), even though the WARN_ONCE() will probably
format the output correctly even without it.
Also, "not supported" isn't a very accurate description. This has to do
with the flow controller not having been initialized yet.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
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:[~2017-03-20 14:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 13:31 [PATCH 0/5] soc/tegra: Enable flowctrl support for Tegra132/210 Jon Hunter
[not found] ` <1489584715-23138-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-03-15 13:31 ` [PATCH 1/5] ARM: tegra: WARN if flowctrl is not supported Jon Hunter
2017-03-20 14:10 ` Thierry Reding [this message]
[not found] ` <20170320141023.GB28203-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
2017-03-20 16:32 ` Jon Hunter
2017-03-15 13:31 ` [PATCH 2/5] ARM: tegra: Remove unnecessary inclusion of flowctrl header Jon Hunter
2017-03-15 13:31 ` [PATCH 3/5] soc/tegra: Move Tegra flowctrl driver Jon Hunter
[not found] ` <1489584715-23138-4-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-03-20 14:14 ` Thierry Reding
2017-03-20 16:37 ` Jon Hunter
[not found] ` <c0b18931-1377-813d-c8a3-60aea4379aa6-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-03-20 17:00 ` Thierry Reding
2017-03-15 13:31 ` [PATCH 4/5] dt-bindings: tegra: Update compatible strings for Tegra flowctrl Jon Hunter
2017-03-20 14:32 ` Thierry Reding
2017-03-15 13:31 ` [PATCH 5/5] soc/tegra: Add initial flowctrl support for Tegra210 Jon Hunter
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=20170320141023.GB28203@ulmo.ba.sec \
--to=thierry.reding@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.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).