From: Radu Rendec <radu@rendec.net>
To: "Farber, Eliav" <farbere@amazon.com>,
Thomas Gleixner <tglx@kernel.org>,
"Shenhar, Talel" <talel@amazon.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/8] irqchip/al-fic: support error and fatal outputs and FIC v2
Date: Wed, 07 Oct 2026 21:19:58 -0400 [thread overview]
Message-ID: <43538d360e9344e13359dab406dd7484b1a67967.camel@rendec.net> (raw)
In-Reply-To: <BY3PR18MB47223DDF986081E1A74E4A40C6962@BY3PR18MB4722.namprd18.prod.outlook.com>
On Mon, 2026-10-05 at 11:19 +0000, Farber, Eliav wrote:
> On Sun, 2026-10-05 at 01:01 +0000, Radu Rendec wrote:
> > On Sun, 2026-09-27 at 08:06 +0000, Eliav Farber wrote:
> >
> > > + /* make sure the controller works in non msi_x mode */
> > > + control |= CONTROL_MASK_MSI_X;
> >
> > The side effect of this is that all the other bits previously set in
> > the AL_FIC_CONTROL register are preserved, whereas before this patch
> > they were reset by initializing "control" to CONTROL_MASK_MSI_X. Is
> > this intentional? If it is, then perhaps it deserves a comment because
> > it looks like a behavior change.
>
> It is intentional, but it is not actually a behaviour change. Every
> writable bit in this register resets to 0; the only non-zero reset field
> is the revision, which is read-only. So at probe the read-modify-write
> produces the same value as building it from CONTROL_MASK_MSI_X alone.
I see, so you're relying on all bits being 0 out of hardware reset
(except for the revision bits). The driver can only be compiled as
built-in, so it will never be loaded multiple times during the lifetime
of the kernel, which means the hardware will always be in the
after-reset state when the driver initializes. I know nothing about
this particular hardware, so the question may be silly - is the
hardware guaranteed to also reset in the case of a "soft" reboot
(e.g. running the "reboot" command)?
> I kept the read-modify-write because it is the better practice - it costs
> nothing and does not rely on the reset value staying 0 - and because the
> version field now has to be read from this register anyway. I did not add
> a code comment since there is no surprising behaviour to flag, but I added
> a paragraph to the commit message explaining the equivalence. Let me know
> if you would still rather see a comment at the write site.
No, I think the commit message explains it very clearly, so a comment
at the call site isn't necessary.
I agree that read-modify-write is generally good practice. However, as
part of their initialization, drivers should make sure that the
hardware is in a known state - either by resetting it or by setting
registers to fixed values. In this case, you're assuming it's already
in a specific state - which is fine if that's guaranteed to always be
the hardware reset state. In other words, I just want to make sure
you're not missing a case when the hardware can be in a different state
than after-reset when the driver initializes.
--
Best regards,
Radu
next prev parent reply other threads:[~2026-10-08 1:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 8:06 [PATCH v2 0/8] irqchip/al-fic: shared parent IRQ, error/fatal outputs and affinity Eliav Farber
2026-09-27 8:06 ` [PATCH v2 1/8] irqchip/al-fic: fix argument alignment and a repeated word Eliav Farber
2026-10-04 16:15 ` Radu Rendec
2026-09-27 8:06 ` [PATCH v2 2/8] irqchip/al-fic: use %pOF and raise init log level Eliav Farber
2026-10-04 16:25 ` Radu Rendec
2026-09-27 8:06 ` [PATCH v2 3/8] irqchip/al-fic: keep the device_node instead of a cached name string Eliav Farber
2026-10-04 17:40 ` Radu Rendec
2026-10-05 11:17 ` Farber, Eliav
2026-10-08 1:14 ` Radu Rendec
2026-09-27 8:06 ` [PATCH v2 4/8] irqchip/al-fic: switch to shared parent interrupt Eliav Farber
2026-10-04 19:30 ` Radu Rendec
2026-10-05 11:18 ` Farber, Eliav
2026-09-27 8:06 ` [PATCH v2 5/8] dt-bindings: interrupt-controller: amazon,al-fic: add mask selection Eliav Farber
2026-09-28 16:50 ` Conor Dooley
2026-10-04 21:06 ` Radu Rendec
2026-09-27 8:06 ` [PATCH v2 6/8] irqchip/al-fic: support error and fatal outputs and FIC v2 Eliav Farber
2026-10-05 1:01 ` Radu Rendec
2026-10-05 11:19 ` Farber, Eliav
2026-10-08 1:19 ` Radu Rendec [this message]
2026-10-08 8:20 ` Farber, Eliav
2026-09-27 8:06 ` [PATCH v2 7/8] irqchip/al-fic: add support for FIC v3 Eliav Farber
2026-10-05 1:04 ` Radu Rendec
2026-09-27 8:06 ` [PATCH v2 8/8] irqchip/al-fic: add irq_set_affinity callback Eliav Farber
2026-10-05 1:25 ` Radu Rendec
2026-10-05 11:20 ` Farber, Eliav
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=43538d360e9344e13359dab406dd7484b1a67967.camel@rendec.net \
--to=radu@rendec.net \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=farbere@amazon.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=talel@amazon.com \
--cc=tglx@kernel.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
all inboxes | Powered by JetHome®