From: Thierry Reding <thierry.reding@gmail.com>
To: Guru Das Srinagesh <gurus@codeaurora.org>
Cc: linux-pwm@vger.kernel.org, kernel-team@android.com,
Mark Salyzyn <salyzyn@google.com>,
Sandeep Patil <sspatil@google.com>,
Subbaraman Narayanamurthy <subbaram@codeaurora.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] pwm: Convert period and duty cycle to u64
Date: Wed, 16 Oct 2019 12:15:39 +0200 [thread overview]
Message-ID: <20191016101539.GC1303817@ulmo> (raw)
In-Reply-To: <1571191899-6150-2-git-send-email-gurus@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]
On Tue, Oct 15, 2019 at 07:11:39PM -0700, Guru Das Srinagesh wrote:
> Because period and duty cycle are defined as ints with units of
> nanoseconds, the maximum time duration that can be set is limited to
> ~2.147 seconds. Change their definitions to u64 so that higher durations
> may be set.
>
> Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
> ---
> drivers/pwm/core.c | 4 ++--
> drivers/pwm/sysfs.c | 10 +++++-----
> include/linux/pwm.h | 16 ++++++++--------
> 3 files changed, 15 insertions(+), 15 deletions(-)
Actually, we can't do that without further preparatory work. The reason
is that consumers use the period and duty_cycle members in computations
of their own, which lead to errors such as this:
armv7l-unknown-linux-gnueabihf-ld: drivers/video/backlight/pwm_bl.o: in function `pwm_backlight_probe':
pwm_bl.c:(.text+0x3b0): undefined reference to `__aeabi_uldivmod'
So I think we need to audit all consumers carefully and make sure that
they use do_div() where necessary to avoid such errors.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-10-16 10:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 2:11 [PATCH 0/1] Convert period and duty cycle to u64 Guru Das Srinagesh
2019-10-16 2:11 ` [PATCH 1/1] pwm: " Guru Das Srinagesh
2019-10-16 6:26 ` Uwe Kleine-König
2019-10-16 7:41 ` Thierry Reding
2019-10-16 10:15 ` Thierry Reding [this message]
2019-10-17 6:02 ` Guru Das Srinagesh
2019-10-17 10:43 ` Thierry Reding
2019-11-15 9:27 ` Guru Das Srinagesh
2019-11-15 10:32 ` Thierry Reding
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=20191016101539.GC1303817@ulmo \
--to=thierry.reding@gmail.com \
--cc=gurus@codeaurora.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=salyzyn@google.com \
--cc=sspatil@google.com \
--cc=subbaram@codeaurora.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