From: Mark Brown <broonie@kernel.org> To: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>, Nicolas Saenz Julienne <nsaenzjulienne@suse.de>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, "maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..." <bcm-kernel-feedback-list@broadcom.com>, "open list:SPI SUBSYSTEM" <linux-spi@vger.kernel.org>, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" <devicetree@vger.kernel.org>, "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" <linux-rpi-kernel@lists.infradead.org>, "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" <linux-arm-kernel@lists.infradead.org>, Martin Sperl <kernel@martin.sperl.org>, lukas@wunner.de Subject: Re: [PATCH 3/3] spi: bcm2835: Enable shared interrupt support Date: Fri, 5 Jun 2020 11:28:56 +0100 [thread overview] Message-ID: <20200605102856.GB5413@sirena.org.uk> (raw) In-Reply-To: <21772111-fa1f-7a50-aa92-e44b09cff4eb@gmail.com> [-- Attachment #1: Type: text/plain, Size: 1765 bytes --] On Thu, Jun 04, 2020 at 09:05:46AM -0700, Florian Fainelli wrote: > On 6/4/2020 5:32 AM, Mark Brown wrote: > > This feels hacky - it's essentially using the compatible string to set a > > boolean flag which isn't really about the IP but rather the platform > > integration. It might cause problems if we do end up having to quirk > > this version of the IP for some other reason. > I am not sure why it would be a problem, when you describe a piece of > hardware with Device Tree, even with the IP block being strictly the > same, its very integration into a new SoC (with details like shared > interrupt lines) do warrant a different compatible string. Maybe this is > more of a philosophical question. The big concern here is trying to support things going forwards - if it turns out that any quirks are required by this version of the IP then it gets very confusing and hard to keep DTs stable if you've already quirked something that clearly isn't the IP version with the compatible string. Conversely if we start putting flags into the binding for every feature that might be changed in a given IP that gets complex as we can't ever learn new things about an existing IP version without updating all the DTs which is also bad. > Instead of counting the number of SPI devices we culd request the > interrupt first with flags = IRQF_PROBE_SHARED, if this works, good we > have a single SPI master enabled, if it returns -EBUSY, try again with > flags = IRQF_SHARED and set-up the bcm2835_spi_sh_interrupt interrupt > handler to manage the sharing. Like you said in a followup patch that doesn't work as the first device to probe will think the interrupt isn't shared. You'd need a callback to change to shared mode from genirq which feels... inelegant. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org> To: Florian Fainelli <f.fainelli@gmail.com> Cc: "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>, lukas@wunner.de, 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 3/3] spi: bcm2835: Enable shared interrupt support Date: Fri, 5 Jun 2020 11:28:56 +0100 [thread overview] Message-ID: <20200605102856.GB5413@sirena.org.uk> (raw) In-Reply-To: <21772111-fa1f-7a50-aa92-e44b09cff4eb@gmail.com> [-- Attachment #1.1: Type: text/plain, Size: 1765 bytes --] On Thu, Jun 04, 2020 at 09:05:46AM -0700, Florian Fainelli wrote: > On 6/4/2020 5:32 AM, Mark Brown wrote: > > This feels hacky - it's essentially using the compatible string to set a > > boolean flag which isn't really about the IP but rather the platform > > integration. It might cause problems if we do end up having to quirk > > this version of the IP for some other reason. > I am not sure why it would be a problem, when you describe a piece of > hardware with Device Tree, even with the IP block being strictly the > same, its very integration into a new SoC (with details like shared > interrupt lines) do warrant a different compatible string. Maybe this is > more of a philosophical question. The big concern here is trying to support things going forwards - if it turns out that any quirks are required by this version of the IP then it gets very confusing and hard to keep DTs stable if you've already quirked something that clearly isn't the IP version with the compatible string. Conversely if we start putting flags into the binding for every feature that might be changed in a given IP that gets complex as we can't ever learn new things about an existing IP version without updating all the DTs which is also bad. > Instead of counting the number of SPI devices we culd request the > interrupt first with flags = IRQF_PROBE_SHARED, if this works, good we > have a single SPI master enabled, if it returns -EBUSY, try again with > flags = IRQF_SHARED and set-up the bcm2835_spi_sh_interrupt interrupt > handler to manage the sharing. Like you said in a followup patch that doesn't work as the first device to probe will think the interrupt isn't shared. You'd need a callback to change to shared mode from genirq which feels... inelegant. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ 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-05 10:29 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-04 3:46 [PATCH 0/3] spi: bcm2835: Enable shared interrupt support Florian Fainelli 2020-06-04 3:46 ` Florian Fainelli 2020-06-04 3:46 ` [PATCH 1/3] dt-bindings: spi: Document bcm2711 and bcm7211 SPI compatible Florian Fainelli 2020-06-04 3:46 ` Florian Fainelli 2020-06-04 4:23 ` Lukas Wunner 2020-06-04 3:46 ` [PATCH 2/3] ARM: dts: bcm2711: Update SPI nodes compatible strings Florian Fainelli 2020-06-04 3:46 ` Florian Fainelli 2020-06-04 4:20 ` Lukas Wunner 2020-06-04 11:13 ` Mark Brown 2020-06-04 11:13 ` Mark Brown 2020-06-04 11:21 ` Lukas Wunner 2020-06-04 14:05 ` Mark Brown 2020-06-04 14:05 ` Mark Brown 2020-06-04 16:40 ` Florian Fainelli 2020-06-04 16:40 ` Florian Fainelli 2020-06-04 16:54 ` Stefan Wahren 2020-06-04 16:54 ` Stefan Wahren 2020-06-04 16:56 ` Florian Fainelli 2020-06-04 16:56 ` Florian Fainelli 2020-06-04 16:46 ` Stefan Wahren 2020-06-04 16:46 ` Stefan Wahren 2020-06-04 3:46 ` [PATCH 3/3] spi: bcm2835: Enable shared interrupt support Florian Fainelli 2020-06-04 3:46 ` Florian Fainelli 2020-06-04 4:17 ` Lukas Wunner 2020-06-15 17:25 ` Rob Herring 2020-06-15 17:25 ` Rob Herring 2020-06-04 12:32 ` Mark Brown 2020-06-04 12:32 ` Mark Brown 2020-06-04 16:05 ` Florian Fainelli 2020-06-04 16:05 ` Florian Fainelli 2020-06-04 20:24 ` Florian Fainelli 2020-06-04 20:24 ` Florian Fainelli 2020-06-05 11:35 ` Lukas Wunner 2020-06-05 10:28 ` Mark Brown [this message] 2020-06-05 10:28 ` 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=20200605102856.GB5413@sirena.org.uk \ --to=broonie@kernel.org \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=devicetree@vger.kernel.org \ --cc=f.fainelli@gmail.com \ --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=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: linkBe 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.