From: edubezval@gmail.com (Eduardo Valentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V9] thermal: bcm2835: add thermal driver for bcm2835 soc
Date: Tue, 24 Jan 2017 01:26:48 -0800 [thread overview]
Message-ID: <20170124092645.GA3651@localhost.localdomain> (raw)
In-Reply-To: <D349C10C-C929-40A4-86BF-7F6E834DB613@martin.sperl.org>
Hello Martin,
On Fri, Jan 20, 2017 at 09:43:02AM +0100, kernel at martin.sperl.org wrote:
>
> > On 20.01.2017, at 05:23, Eduardo Valentin <edubezval@gmail.com> wrote:
> >
> > On Thu, Jan 19, 2017 at 08:14:02PM -0800, Eduardo Valentin wrote:
> >> Hello Martin,
> >>
> >> On Sat, Jan 07, 2017 at 04:55:45PM +0000, kernel at martin.sperl.org wrote:
> >>> From: Martin Sperl <kernel@martin.sperl.org>
> >>>
> >>> Add basic thermal driver for bcm2835 SOC.
> >>>
> >>> This driver currently relies on the firmware setting up the
> >>> tsense HW block and does not set it up itself.
> >>>
> >>> Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
> >>> Acked-by: Eric Anholt <eric@anholt.net>
> >>> Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
> >>>
> >>
> >> <cut>
> >
> >
> > Also, I am getting this warn from sparse:
> > drivers/thermal/bcm2835_thermal.c:110:16: warning: cast truncates bits
> > from constant value (3ffffffffff00 becomes ffffff00)
> > drivers/thermal/bcm2835_thermal.c:134:16: warning: cast truncates bits
> > from constant value (3ffffffffff becomes ffffffff)
> >
> > Have you seen this?
>
> No, I have not checked sparse.
>
> These values are defined via GENMASK on line 47 and 57 respectively
> and should actually compute to the following values:
> for line 110 (line 47 has the define):
> GENMASK(BCM2835_TS_TSENSCTL_THOLD_BITS + \
> BCM2835_TS_TSENSCTL_THOLD_SHIFT - 1, \
> BCM2835_TS_TSENSCTL_THOLD_SHIFT)
> = GENMASK(10 + 8 - 1, 8)
> = GENMASK(17, 8)
> = (((~0UL) << (8)) & (~0UL >> (32 - 1 - (10 + 8 - 1))))
> = 0x3ff00
> for line 134 (line 57 has the define):
> GENMASK(BCM2835_TS_TSENSCTL_THOLD_BITS + \
> BCM2835_TS_TSENSCTL_THOLD_SHIFT - 1, \
> BCM2835_TS_TSENSCTL_THOLD_SHIFT)
> = GENMASK(10 + 0 - 1, 0)
> = GENMASK(9, 0)
> = (((~0UL) << (0)) & (~0UL >> (32 - 1 - (10 + 0 - 1))))
> = 0x003ff
>
> Note that the preprocessor expansions have been verified by
> looking at the preprocessed driver source
> (drivers/thermal/bcm2835_thermal.i)
OK then.
>
> I wonder why sparse is computing these GENMASK values as:
> 0x3ffffffffff00 and 0x3ffffffffff
In the case you can confirm that the values are correct, I believe this
could be a false positive report on sparse, in this case.
>
> Martin
next prev parent reply other threads:[~2017-01-24 9:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-07 16:55 [PATCH V9] thermal: bcm2835: add thermal driver for bcm2835 soc kernel at martin.sperl.org
2017-01-20 4:14 ` Eduardo Valentin
2017-01-20 4:23 ` Eduardo Valentin
2017-01-20 8:43 ` kernel at martin.sperl.org
2017-01-24 9:26 ` Eduardo Valentin [this message]
2017-01-24 9:37 ` kernel at martin.sperl.org
2017-01-20 7:54 ` kernel at martin.sperl.org
2017-01-24 9:31 ` Eduardo Valentin
2017-01-24 9:52 ` kernel at martin.sperl.org
2017-02-02 4:29 ` Eduardo Valentin
2017-02-04 8:35 ` kernel at martin.sperl.org
2017-02-08 4:31 ` Eduardo Valentin
2017-02-08 8:19 ` kernel at martin.sperl.org
2017-02-04 9:36 ` Stefan Wahren
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=20170124092645.GA3651@localhost.localdomain \
--to=edubezval@gmail.com \
--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).