From: William Qiu <william.qiu@starfivetech.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <linux-pwm@vger.kernel.org>,
"Emil Renner Berthing" <kernel@esmil.dk>,
Rob Herring <robh+dt@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Hal Feng <hal.feng@starfivetech.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>
Subject: Re: [PATCH v6 2/4] pwm: opencores: Add PWM driver support
Date: Fri, 27 Oct 2023 18:23:58 +0800 [thread overview]
Message-ID: <e3faaa46-896a-405d-ac5f-97587e81fba4@starfivetech.com> (raw)
In-Reply-To: <20231024114545.73ljfceuon2blkxz@pengutronix.de>
On 2023/10/24 19:45, Uwe Kleine-König wrote:
> Hello William,
>
> On Tue, Oct 24, 2023 at 05:16:49PM +0800, William Qiu wrote:
>> On 2023/10/20 19:25, Uwe Kleine-König wrote:
>> > Hello,
>> >
>> > On Fri, Oct 20, 2023 at 06:37:39PM +0800, William Qiu wrote:
>> >> Add Pulse Width Modulation driver support for OpenCores.
>> >>
>> >> Co-developed-by: Hal Feng <hal.feng@starfivetech.com>
>> >> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
>> >> Signed-off-by: William Qiu <william.qiu@starfivetech.com>
>> >> ---
>> >> MAINTAINERS | 7 ++
>> >> drivers/pwm/Kconfig | 11 ++
>> >> drivers/pwm/Makefile | 1 +
>> >> drivers/pwm/pwm-ocores.c | 211 +++++++++++++++++++++++++++++++++++++++
>> >> 4 files changed, 230 insertions(+)
>> >> create mode 100644 drivers/pwm/pwm-ocores.c
>> >>
>> >> diff --git a/MAINTAINERS b/MAINTAINERS
>> >> index 6c4cce45a09d..321af8fa7aad 100644
>> >> --- a/MAINTAINERS
>> >> +++ b/MAINTAINERS
>> >> @@ -16003,6 +16003,13 @@ F: Documentation/i2c/busses/i2c-ocores.rst
>> >> F: drivers/i2c/busses/i2c-ocores.c
>> >> F: include/linux/platform_data/i2c-ocores.h
>> >>
>> >> +OPENCORES PWM DRIVER
>> >> +M: William Qiu <william.qiu@starfivetech.com>
>> >> +M: Hal Feng <hal.feng@starfivetech.com>
>> >> +S: Supported
>> >> +F: Documentation/devicetree/bindings/pwm/opencores,pwm-ocores.yaml
>> >> +F: drivers/pwm/pwm-ocores.c
>> >> +
>> >> OPENRISC ARCHITECTURE
>> >> M: Jonas Bonn <jonas@southpole.se>
>> >> M: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
>> >> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
>> >> index 8ebcddf91f7b..cbfbf227d957 100644
>> >> --- a/drivers/pwm/Kconfig
>> >> +++ b/drivers/pwm/Kconfig
>> >> @@ -434,6 +434,17 @@ config PWM_NTXEC
>> >> controller found in certain e-book readers designed by the original
>> >> design manufacturer Netronix.
>> >>
>> >> +config PWM_OCORES
>> >> + tristate "Opencores PWM support"
>> >> + depends on HAS_IOMEM && OF
>> >> + depends on COMMON_CLK && RESET_CONTROLLER
>> >
>> > Would it make sense to add something like:
>> >
>> > depends on ARCH_SOMETHING || COMPILE_TEST
>> >
>> > here?
>> >
>> But there is no mention of architectural limitations in the OpenCores's
>> specification.
>
> I already guessed that. Still it probably makes no sense to enable that
> option on most machines. The PWM device found in i.MX SoCs can
> theoretically also be implemented on AT91 or S390x. In practice it
> isn't, so there is a dependency on ARCH_MXC || COMPILE_TEST.
>
> Consider the role of someone who does a kernel bump for a certain
> machine (on one end of the spectrum) or a distribution kernel (on the
> other end).
>
> If you take a 6.5 x86_64 allmodconfig + COMPILE_TEST=n and upgrade to
> v6.6-rc7 and do an oldconfig, you get 90 questions[1].
>
> Just looking quickly through this list, among them are:
>
> DRM support for Loongson Graphics (DRM_LOONGSON) [N/m/?] (NEW)
> Xilinx AXI DMAS Engine (XILINX_DMA) [N/m/y/?] (NEW)
> Clock driver for Renesas VersaClock 3 devices (COMMON_CLK_VC3) [N/m/y/?] (NEW)
> Realtek RT1017 SDCA Codec - SDW (SND_SOC_RT1017_SDCA_SDW) [N/m/?] (NEW)
>
> I didn't check in detail and maybe one or the other is valid on x86_64,
> but I'd be surprised if you find two that are sensible to enable on
> x86_64 to support a real machine.
>
> While I think Kconfig cannot be held responsible to only allow
> generating "real world sensible" configurations, we should work a bit
> harder to rule out the obvious violators and make it easy for people
> configuring the kernel where sensible.
>
> In my book it's better to have a too strong dependency at first for a
> new driver (but allow it with COMPILE_TEST). Someone who as a device
> needing that driver will find it out and speak up. However if you allow
> to enable the driver everywhere, many people will disable the driver
> (maybe using yes '' | make oldconfig), some will spend time to research
> about this option to find which machines actually have such a device and
> if the machine(s) they care about are in this set. This is a waste of
> time and opportunities. (And note, this isn't only about people spending
> time to decide if they enable or disable PWM_OCORES, this is also about
> people who use yes '' because there are too many questions and so they
> might miss the handful of useful ones.)
>
> Best regards
> Uwe
>
> [1] measured using
>
> yes '' | make oldconfig
>
> and counting the occurrences of "(NEW)".
>
I see, I'll think about it.
Maybe depend on STARFIVE'S SoCs first?
Best regards,
William
next prev parent reply other threads:[~2023-10-27 10:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 10:37 [PATCH v6 0/4] StarFive's Pulse Width Modulation driver support William Qiu
2023-10-20 10:37 ` [PATCH v6 1/4] dt-bindings: pwm: Add OpenCores PWM module William Qiu
2023-10-20 14:21 ` Conor Dooley
2023-10-20 14:22 ` Conor Dooley
2023-10-20 18:04 ` Krzysztof Kozlowski
2023-10-23 8:00 ` William Qiu
2023-10-20 18:01 ` Krzysztof Kozlowski
2023-10-23 8:02 ` William Qiu
2023-10-20 10:37 ` [PATCH v6 2/4] pwm: opencores: Add PWM driver support William Qiu
2023-10-20 11:25 ` Uwe Kleine-König
2023-10-24 9:16 ` William Qiu
2023-10-24 11:45 ` Uwe Kleine-König
2023-10-27 10:23 ` William Qiu [this message]
2023-10-27 13:23 ` Uwe Kleine-König
2023-11-01 2:22 ` William Qiu
2023-11-02 11:30 ` Uwe Kleine-König
2023-11-06 7:26 ` William Qiu
2023-10-20 10:37 ` [PATCH v6 3/4] riscv: dts: starfive: jh7110: Add PWM node and pins configuration William Qiu
2023-10-25 13:45 ` Emil Renner Berthing
2023-10-20 10:37 ` [PATCH v6 4/4] riscv: dts: starfive: jh7100: " William Qiu
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=e3faaa46-896a-405d-ac5f-97587e81fba4@starfivetech.com \
--to=william.qiu@starfivetech.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hal.feng@starfivetech.com \
--cc=kernel@esmil.dk \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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).