devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: sudeep.holla@arm.com, tglx@linutronix.de, jason@lakedaemon.net,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	rnayak@codeaurora.org, sboyd@kernel.org,
	bjorn.andersson@linaro.org, nicolas.dechesne@linaro.org,
	ctatlor97@gmail.com, vkoul@kernel.org, robh+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/4] irqchip/gic: common: add support to device tree based quirks
Date: Mon, 10 Dec 2018 13:19:52 +0000	[thread overview]
Message-ID: <50b81a24-ecf1-b36f-86e5-1ec4a476cbfd@linaro.org> (raw)
In-Reply-To: <da39d3af-b8e4-1b5e-cdf4-54dd9e955a0b@arm.com>



On 10/12/18 10:55, Marc Zyngier wrote:
>>   
>> +void gic_enable_of_quirks(const struct device_node *np,
>> +			  const struct gic_quirk *quirks, void *data)
>> +{
>> +	for (; quirks->desc; quirks++) {
> So you expect quirks->desc to be NULL at some point, just like for any
> other quirk table we have.
> 
>> +		if (!of_device_is_compatible(np, quirks->compatible))
>> +			continue;
>> +		if (quirks->init(data))
>> +			pr_info("GIC: enabling workaround for %s\n",
>> +				quirks->desc);
>> +	}
>> +}
>> +
>>   void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
>>   		void *data)
>>   {
>> diff --git a/drivers/irqchip/irq-gic-common.h b/drivers/irqchip/irq-gic-common.h
>> index 3919cd7c5285..97e58fb6c232 100644
>> --- a/drivers/irqchip/irq-gic-common.h
>> +++ b/drivers/irqchip/irq-gic-common.h
>> @@ -23,6 +23,7 @@
>>   
>>   struct gic_quirk {
>>   	const char *desc;
>> +	const char *compatible;
>>   	bool (*init)(void *data);
>>   	u32 iidr;
>>   	u32 mask;
>> @@ -35,6 +36,8 @@ void gic_dist_config(void __iomem *base, int gic_irqs,
>>   void gic_cpu_config(void __iomem *base, void (*sync_access)(void));
>>   void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
>>   		void *data);
>> +void gic_enable_of_quirks(const struct device_node *np,
>> +			  const struct gic_quirk *quirks, void *data);
>>   
>>   void gic_set_kvm_info(const struct gic_kvm_info *info);
>>   
>> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
>> index 29e9d47be97d..c95796fa4de6 100644
>> --- a/drivers/irqchip/irq-gic-v3.c
>> +++ b/drivers/irqchip/irq-gic-v3.c
>> @@ -1271,6 +1271,9 @@ static void __init gic_of_setup_kvm_info(struct device_node *node)
>>   	gic_set_kvm_info(&gic_v3_kvm_info);
>>   }
>>   
>> +static const struct gic_quirk gic_quirks[] = {
>> +};
> ... and yet here you provide an empty table. That's not going to work
> very well. You definitely need to have an empty entry at the end of the
> array, always.
> 
> I guess you want to test your code on a non affected platform, and I'm
> pretty sure you'll see it exploding.

Yes, Should have carefully looked at this!!
We need an empty entry at the end!
I will fix it and send a new version!

Thanks,
srini
> 

  reply	other threads:[~2018-12-10 13:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 10:23 [PATCH v4 0/4] irqchip/gic-v3: Add support to DT based quirk for msm8996 Srinivas Kandagatla
2018-12-10 10:23 ` [PATCH v4 1/4] dt-bindings/gic-v3: Add msm8996 compatible string Srinivas Kandagatla
2018-12-10 10:23 ` [PATCH v4 2/4] irqchip/gic: common: add support to device tree based quirks Srinivas Kandagatla
2018-12-10 10:55   ` Marc Zyngier
2018-12-10 13:19     ` Srinivas Kandagatla [this message]
2018-12-10 10:23 ` [PATCH v4 3/4] irqchip: gic-v3: Add quirk for msm8996 secured registers Srinivas Kandagatla
2018-12-10 10:23 ` [PATCH v4 4/4] arm64: dts: add msm8996 compatible to gicv3 Srinivas Kandagatla

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=50b81a24-ecf1-b36f-86e5-1ec4a476cbfd@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=ctatlor97@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=nicolas.dechesne@linaro.org \
    --cc=rnayak@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=tglx@linutronix.de \
    --cc=vkoul@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;
as well as URLs for NNTP newsgroup(s).