From: Florian Fainelli <f.fainelli@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>, Lukas Wunner <lukas@wunner.de>
Cc: Mark Brown <broonie@kernel.org>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
Scott Branden <sbranden@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
linux-kernel@vger.kernel.org,
"open list:SPI SUBSYSTEM" <linux-spi@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>,
"maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..."
<bcm-kernel-feedback-list@broadcom.com>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@lists.infradead.org>,
Martin Sperl <kernel@martin.sperl.org>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Subject: Re: [PATCH v2] spi: bcm2835: Enable shared interrupt support
Date: Mon, 15 Jun 2020 12:42:50 -0700 [thread overview]
Message-ID: <2e4a6c4b-857f-1000-e7fd-327b0800fb97@gmail.com> (raw)
In-Reply-To: <3d4fd3f9-9bde-90a8-bef5-9fc97cc9b363@arm.com>
On 6/15/2020 12:09 PM, Robin Murphy wrote:
> On 2020-06-08 12:41, Lukas Wunner wrote:
>> On Mon, Jun 08, 2020 at 12:11:11PM +0100, Robin Murphy wrote:
>>> And all in code that has at least one obvious inefficiency left on
>>> the table either way.
>>
>> Care to submit a patch to overcome that inefficiency?
>
> I'll have a quick go, but without any way to measure performance impact
> (or even test for correctness) I don't fancy going too deep based purely
> on disassembly and ARM11 cycle timings.
>
>>> This thread truly epitomises Knuth's "premature optimisation"
>>> quote... ;)
>>
>> The thread came about because it can be determined at compile time
>> whether the interrupt is going to be shared:
>
> ...which is exactly my point - "because it can be" is anything but proof
> that avoiding a trivial check makes enough measurable difference to
> justify putting in the effort to do so.
>
>> On the BCM2835 (Raspberry Pi 1), CONFIG_ARCH_MULTI_V6 is set and this
>> SoC doesn't have multiple bcm2835-spi instances, so no shared interrupt.
>>
>> The question is how to discern BCM2836/BCM2837 (Raspberry Pi 2/3), which
>> do not have multiple instances, and BCM2711 (Raspberry Pi 4) which does.
>
> Hmm, how much relative importance does that have? On a 700MHz ARM11 it's
> obviously desirable to spend as little time in the IRQ handler as
> possible in order to have time left to do anything else, but on the
> other SoCs even if the IRQ remains permanently asserted it can still
> only consume 25% of the available CPU capacity, at which point the
> impact of 2-3 cycles either way at 1GHz+ seems pretty much immeasurable.
>
>> The Raspberry Pi Foundation compiles BCM2711 kernels with
>> CONFIG_ARM_LPAE=y,
>> but Florian considered that kludgy as a discriminator and opted for
>> runtime-detection via the compatible string instead. If you've got
>> a better idea please come forward.
>>
>> Is "optimize shared IRQ support away if IS_ENABLED(CONFIG_ARCH_MULTI_V6),
>> else leave it in" the best we can do?
>
> In all honesty I'm starting to think it seriously might be :)
Or how about this: we slightly re-structure the interrupt handler such
that all possible interrupt conditions are explicitly handled and
terminate with a return IRQ_HANDLED, and those which are not, including
in the case of a "spurious" (because the interrupt was triggered for
another SPI controller instance), then we finish the function with
IRQ_NONE. This would not impact the performance for the BCM2835/36/37
which would still have a single controller/single interrupt line to handle.
--
Florian
WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>, Lukas Wunner <lukas@wunner.de>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
Scott Branden <sbranden@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
"open list:SPI SUBSYSTEM" <linux-spi@vger.kernel.org>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
Mark Brown <broonie@kernel.org>,
"maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..."
<bcm-kernel-feedback-list@broadcom.com>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@lists.infradead.org>,
Martin Sperl <kernel@martin.sperl.org>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] spi: bcm2835: Enable shared interrupt support
Date: Mon, 15 Jun 2020 12:42:50 -0700 [thread overview]
Message-ID: <2e4a6c4b-857f-1000-e7fd-327b0800fb97@gmail.com> (raw)
In-Reply-To: <3d4fd3f9-9bde-90a8-bef5-9fc97cc9b363@arm.com>
On 6/15/2020 12:09 PM, Robin Murphy wrote:
> On 2020-06-08 12:41, Lukas Wunner wrote:
>> On Mon, Jun 08, 2020 at 12:11:11PM +0100, Robin Murphy wrote:
>>> And all in code that has at least one obvious inefficiency left on
>>> the table either way.
>>
>> Care to submit a patch to overcome that inefficiency?
>
> I'll have a quick go, but without any way to measure performance impact
> (or even test for correctness) I don't fancy going too deep based purely
> on disassembly and ARM11 cycle timings.
>
>>> This thread truly epitomises Knuth's "premature optimisation"
>>> quote... ;)
>>
>> The thread came about because it can be determined at compile time
>> whether the interrupt is going to be shared:
>
> ...which is exactly my point - "because it can be" is anything but proof
> that avoiding a trivial check makes enough measurable difference to
> justify putting in the effort to do so.
>
>> On the BCM2835 (Raspberry Pi 1), CONFIG_ARCH_MULTI_V6 is set and this
>> SoC doesn't have multiple bcm2835-spi instances, so no shared interrupt.
>>
>> The question is how to discern BCM2836/BCM2837 (Raspberry Pi 2/3), which
>> do not have multiple instances, and BCM2711 (Raspberry Pi 4) which does.
>
> Hmm, how much relative importance does that have? On a 700MHz ARM11 it's
> obviously desirable to spend as little time in the IRQ handler as
> possible in order to have time left to do anything else, but on the
> other SoCs even if the IRQ remains permanently asserted it can still
> only consume 25% of the available CPU capacity, at which point the
> impact of 2-3 cycles either way at 1GHz+ seems pretty much immeasurable.
>
>> The Raspberry Pi Foundation compiles BCM2711 kernels with
>> CONFIG_ARM_LPAE=y,
>> but Florian considered that kludgy as a discriminator and opted for
>> runtime-detection via the compatible string instead. If you've got
>> a better idea please come forward.
>>
>> Is "optimize shared IRQ support away if IS_ENABLED(CONFIG_ARCH_MULTI_V6),
>> else leave it in" the best we can do?
>
> In all honesty I'm starting to think it seriously might be :)
Or how about this: we slightly re-structure the interrupt handler such
that all possible interrupt conditions are explicitly handled and
terminate with a return IRQ_HANDLED, and those which are not, including
in the case of a "spurious" (because the interrupt was triggered for
another SPI controller instance), then we finish the function with
IRQ_NONE. This would not impact the performance for the BCM2835/36/37
which would still have a single controller/single interrupt line to handle.
--
Florian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-06-15 19:43 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 21:28 [PATCH v2] spi: bcm2835: Enable shared interrupt support Florian Fainelli
2020-06-04 21:28 ` Florian Fainelli
2020-06-05 8:46 ` Nicolas Saenz Julienne
2020-06-05 8:46 ` Nicolas Saenz Julienne
2020-06-05 10:52 ` Mark Brown
2020-06-05 10:52 ` Mark Brown
2020-06-05 10:58 ` Nicolas Saenz Julienne
2020-06-05 10:58 ` Nicolas Saenz Julienne
2020-06-05 10:51 ` Lukas Wunner
2020-06-05 11:14 ` Mark Brown
2020-06-05 11:14 ` Mark Brown
2020-06-05 12:20 ` Mark Brown
2020-06-05 12:20 ` Mark Brown
2020-06-05 11:34 ` Robin Murphy
2020-06-05 11:34 ` Robin Murphy
2020-06-05 13:20 ` Mark Brown
2020-06-05 13:20 ` Mark Brown
2020-06-05 13:46 ` Robin Murphy
2020-06-05 13:46 ` Robin Murphy
2020-06-05 14:41 ` Robin Murphy
2020-06-05 14:41 ` Robin Murphy
2020-06-05 15:27 ` Mark Brown
2020-06-05 15:27 ` Mark Brown
2020-06-05 22:04 ` Florian Fainelli
2020-06-05 22:04 ` Florian Fainelli
2020-06-08 11:11 ` Robin Murphy
2020-06-08 11:11 ` Robin Murphy
2020-06-08 11:28 ` Mark Brown
2020-06-08 11:28 ` Mark Brown
2020-06-15 16:34 ` Florian Fainelli
2020-06-15 16:34 ` Florian Fainelli
2020-06-15 17:00 ` Mark Brown
2020-06-15 17:00 ` Mark Brown
2020-06-15 17:04 ` Florian Fainelli
2020-06-15 17:04 ` Florian Fainelli
2020-06-15 17:30 ` Mark Brown
2020-06-15 17:30 ` Mark Brown
2020-06-15 17:31 ` Robin Murphy
2020-06-15 17:31 ` Robin Murphy
2020-06-15 19:26 ` Mark Brown
2020-06-15 19:26 ` Mark Brown
2020-06-08 11:41 ` Lukas Wunner
2020-06-15 19:09 ` Robin Murphy
2020-06-15 19:09 ` Robin Murphy
2020-06-15 19:42 ` Florian Fainelli [this message]
2020-06-15 19:42 ` Florian Fainelli
2020-06-15 20:48 ` Mark Brown
2020-06-15 20:48 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2022-07-19 10:53 [PATCH v2] spi: bcm2835: enable " Marc Kleine-Budde
2022-07-26 11:17 ` Mark Brown
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=2e4a6c4b-857f-1000-e7fd-327b0800fb97@gmail.com \
--to=f.fainelli@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@martin.sperl.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=nsaenzjulienne@suse.de \
--cc=rjui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=sbranden@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.