mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hector Martin <marcan@marcan.st>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Sasha Finkelstein <fnkl.kernel@gmail.com>
Cc: thierry.reding@gmail.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, sven@svenpeter.dev,
	alyssa@rosenzweig.io, asahi@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] pwm: Add Apple PWM controller
Date: Sat, 29 Oct 2022 15:25:30 +0900	[thread overview]
Message-ID: <fdc98171-e764-5be2-69ed-4395b13c06fe@marcan.st> (raw)
In-Reply-To: <3b8441da-31af-2414-1362-0efb05cbf8c0@linaro.org>

On 29/10/2022 04.49, Krzysztof Kozlowski wrote:
> On 28/10/2022 14:51, Sasha Finkelstein wrote:
>> On Fri, 28 Oct 2022 at 20:54, Krzysztof Kozlowski
>> <krzysztof.kozlowski@linaro.org> wrote:
>>>
>>> On 28/10/2022 12:52, Sasha Finkelstein wrote:
>>>> +config PWM_APPLE
>>>> +     tristate "Apple SoC PWM support"
>>>> +     depends on ARCH_APPLE || (COMPILE_TEST && 64BIT)
>>>
>>> Why this code cannot be build on 32-bit?
>> It uses 64-bit divisions, which causes it to fail to build on 32-bit
>> mips. It should not be a
>> problem, since this hardware is only present on 64-bit SoCs.
> 
> Does not matter, code should be portable and buildable on 32-bit. If it
> does not build then your code is not correct.

This statement does not apply in general. There are plenty of drivers
which cannot reasonably build for 32-bit, and make no sense because no
32-bit hardware exists that could use them. Examples include anything
that accesses 64-bit registers on 64-bit SoCs the normal way, and
further anything that touches CPU stuff like system registers.

In *this* case, if the only issue is some 64-bit math, then yes, it
should be made to build on 32-bit (especially since this is likely to
also work for older 32-bit Apple SoCs). But the (COMPILE_TEST && 64BIT)
pattern is definitely valid in other cases, and I've been adding it
lately to shut up the kernel test bot since it makes no sense to compile
test a whole pile of our drivers on 32-bit architectures - they
fundamentally can't compile without adding pointless hypothetical broken
fluff to the driver like split MMIO accesses (which often can't work on
real hardware), and it serves no purpose.


- Hector

  reply	other threads:[~2022-10-29  6:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 16:52 [PATCH 0/4] PWM and keyboard backlight driver for ARM Macs Sasha Finkelstein
2022-10-28 16:52 ` [PATCH 1/4] dt-bindings: pwm: Add Apple PWM controller Sasha Finkelstein
2022-10-28 17:53   ` Krzysztof Kozlowski
2022-10-28 18:44     ` Sasha Finkelstein
2022-10-28 19:04   ` Rob Herring
2022-10-28 19:47   ` Krzysztof Kozlowski
2022-10-28 16:52 ` [PATCH 2/4] " Sasha Finkelstein
2022-10-28 17:54   ` Krzysztof Kozlowski
2022-10-28 18:51     ` Sasha Finkelstein
2022-10-28 19:49       ` Krzysztof Kozlowski
2022-10-29  6:25         ` Hector Martin [this message]
2022-10-28 16:52 ` [PATCH 3/4] arm64: dts: apple: t8103: Add " Sasha Finkelstein
2022-10-28 17:56   ` Krzysztof Kozlowski
2022-10-28 16:52 ` [PATCH 4/4] MAINTAINERS: Add entries for Apple PWM driver Sasha Finkelstein

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=fdc98171-e764-5be2-69ed-4395b13c06fe@marcan.st \
    --to=marcan@marcan.st \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=devicetree@vger.kernel.org \
    --cc=fnkl.kernel@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=thierry.reding@gmail.com \
    /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

all inboxes | Powered by JetHome®