From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PM / OPP: fix debugfs files for 64-bit
Date: Wed, 7 Oct 2015 16:29:11 +0530 [thread overview]
Message-ID: <20151007105911.GC9892@linux> (raw)
In-Reply-To: <5706174.BUsqiXljxZ@wuerfel>
Hi Arnd,
On 07-10-15, 09:35, Arnd Bergmann wrote:
> The recently added debugfs support for OPP creates files using the
> debugfs_create_bool() and debugfs_create_u32() interfaces, but
> casts the data argument to u32*, which is broken on some architectures.
>
> In case of debugfs_create_bool(), the API has changed as of 621a5f7ad9cd
> ("debugfs: Pass bool pointer to debugfs_create_bool()"), so we now get
> a warning about the new interface in linux-next, which contains both
> patches. Removing the cast makes it work in linux-next, and makes it
> warn in cases where it does not work.
>
> For debugfs_create_u32(), the current usage is broken on 64-bit
> architectures when the values exceed the range of 32-bit variables
> (which should not happen), or when the kernel is built for as
> big-endian. This patch removes the casts and changes the types
> to u32 to make them match and print the correct value on all
> architectures.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 5cb5fdbf38770 ("PM / OPP: Add debugfs support")
> ---
> Found while building ARM allmodconfig
Thanks. I just got back from vacations and this was the first thing I
was going to look at. :)
So, there are two problems here and I feel they should be fixed
separately.
The bool thing is simple to fix, just remove the cast as you did.
Though it will keep warning if we use pm/linux-next branch directly,
but will work well with linux-next.
The second problem isn't that trivial. Just making unsigned longs as
u32 doesn't look like the right solution to me (at least). They are
unsigned long, to match the expected types with other frameworks like
clock and regulator.
What about adding something like debugfs_create_unsigned_long() for
such cases?
@Greg ??
--
viresh
next prev parent reply other threads:[~2015-10-07 10:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 7:35 [PATCH] PM / OPP: fix debugfs files for 64-bit Arnd Bergmann
2015-10-07 10:59 ` Viresh Kumar [this message]
2015-10-07 11:03 ` Viresh Kumar
2015-10-07 11:07 ` Greg Kroah-Hartman
2015-10-07 11:21 ` Viresh Kumar
2015-10-07 12:57 ` Greg Kroah-Hartman
2015-10-07 13:03 ` Viresh Kumar
2015-10-07 17:19 ` Greg Kroah-Hartman
2015-10-07 17:27 ` Viresh Kumar
2015-10-07 17:39 ` Greg Kroah-Hartman
2015-10-07 18:00 ` Viresh Kumar
2015-10-07 19:12 ` Arnd Bergmann
2015-10-08 7:48 ` Viresh Kumar
2015-10-08 14:25 ` Alan Stern
2015-10-19 15:40 ` Michael Turquette
2015-10-19 15:53 ` Russell King - ARM Linux
2015-10-20 10:22 ` Michael Turquette
2015-10-07 16:33 ` Russell King - ARM Linux
2015-10-07 16:36 ` Viresh Kumar
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=20151007105911.GC9892@linux \
--to=viresh.kumar@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).