linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hector Martin <marcan@marcan.st>
To: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Rob Herring <robh+dt@kernel.org>, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 4/6] irqchip/apple-aic: Dynamically compute register offsets
Date: Sat, 18 Dec 2021 14:37:40 +0900	[thread overview]
Message-ID: <392e04a4-f786-f1f9-83a1-b587f0e1d505@marcan.st> (raw)
In-Reply-To: <87pmq1u1al.wl-maz@kernel.org>

On 13/12/2021 03.26, Marc Zyngier wrote:
> On Thu, 09 Dec 2021 04:32:47 +0000,
> Hector Martin <marcan@marcan.st> wrote:
>>
>> This allows us to support AIC variants with different numbers of IRQs
>> based on capability registers.
>>
>> Signed-off-by: Hector Martin <marcan@marcan.st>
>> ---
>>  drivers/irqchip/irq-apple-aic.c | 73 +++++++++++++++++++++++++--------
>>  1 file changed, 56 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
>> index 572d1af175fc..d03caed51d56 100644
>> --- a/drivers/irqchip/irq-apple-aic.c
>> +++ b/drivers/irqchip/irq-apple-aic.c
>> @@ -312,12 +326,15 @@ static int aic_irq_set_affinity(struct irq_data *d,
>>  	struct aic_irq_chip *ic = irq_data_get_irq_chip_data(d);
>>  	int cpu;
>>  
>> +	if (!ic->info.target_cpu)
>> +		return -EINVAL;
> 
> Can this even happen? And if it did, this should scream loudly,
> shouldn't it?

Yeah, it can't happen, so this really should be a BUG_ON. This is mostly
there in case somehow we end up with confusion between AIC versions and
register offsets later, since AIC2 does not use this field but also
shouldn't be setting up an irqchip that calls this function.

-- 
Hector Martin (marcan@marcan.st)
Public Key: https://mrcn.st/pub

  reply	other threads:[~2021-12-18  5:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09  4:32 [PATCH 0/6] irqchip/apple-aic: Add support for AICv2 Hector Martin
2021-12-09  4:32 ` [PATCH 1/6] dt-bindings: interrupt-controller: apple,aic: Add apple,aic2 support Hector Martin
2021-12-09 17:28   ` Rob Herring
2021-12-11 12:28     ` Hector Martin
2021-12-11 12:44       ` Marc Zyngier
2021-12-11 12:52         ` Hector Martin
2021-12-11 12:49       ` Mark Kettenis
2021-12-09  4:32 ` [PATCH 2/6] irqchip/apple-aic: Add Fast IPI support Hector Martin
2021-12-12 12:21   ` Marc Zyngier
2021-12-18  5:31     ` Hector Martin
2021-12-20 12:43       ` Marc Zyngier
2021-12-09  4:32 ` [PATCH 3/6] irqchip/apple-aic: Switch to irq_domain_create_tree and sparse hwirqs Hector Martin
2021-12-12 14:37   ` Marc Zyngier
2021-12-18  5:36     ` Hector Martin
2021-12-09  4:32 ` [PATCH 4/6] irqchip/apple-aic: Dynamically compute register offsets Hector Martin
2021-12-12 18:26   ` Marc Zyngier
2021-12-18  5:37     ` Hector Martin [this message]
2021-12-09  4:32 ` [PATCH 5/6] irqchip/apple-aic: Support multiple dies Hector Martin
2021-12-13 16:10   ` Marc Zyngier
2021-12-18  5:39     ` Hector Martin
2021-12-20 13:38       ` Marc Zyngier
2021-12-09  4:32 ` [PATCH 6/6] irqchip/apple-aic: Add support for AICv2 Hector Martin
2021-12-12 18:47   ` Marc Zyngier
2021-12-18  6:02     ` Hector Martin
2021-12-20 13:52       ` Marc Zyngier

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=392e04a4-f786-f1f9-83a1-b587f0e1d505@marcan.st \
    --to=marcan@marcan.st \
    --cc=alyssa@rosenzweig.io \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=tglx@linutronix.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).