[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d04c4e22-49cd-13f8-f461-9ccf8057cb96@redhat.com>
Date: Thu, 16 Feb 2017 14:46:03 +0100
From: Auger Eric <eric.auger@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <marc.zyngier@....com>
Cc: Jason Cooper <jason@...edaemon.net>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
Christoffer Dall <christoffer.dall@...aro.org>
Subject: Re: [RFC PATCH 06/33] irqchip/gic-v3-its: Add probing for VLPI
properties
Hi,
On 13/02/2017 11:00, Thomas Gleixner wrote:
> On Tue, 17 Jan 2017, Marc Zyngier wrote:
>> + typer = gic_read_typer(its_base + GITS_TYPER);
>> its->base = its_base;
>> its->phys_base = res->start;
>> - its->ite_size = ((gic_read_typer(its_base + GITS_TYPER) >> 4) & 0xf) + 1;
>> + its->ite_size = ((typer >> 4) & 0xf) + 1;
>> + its->is_v4 = !!(typer & GITS_TYPER_VLPIS);
>> + if (its->is_v4 && !(typer & GITS_TYPER_VMOVP)) {
>> + int its_number;
>> +
>> + its_number = find_first_zero_bit(&its_list_map, 16);
>
> s/16/ITS_MAX_ENTITIES or whatever.
>
>> + if (its_number >= 16) {
>> + pr_err("ITS@%pa: No ITSList entry available!\n",
>> + &res->start);
>> + err = -EINVAL;
>> + goto out_free_its;
>> + }
>> +
>> + ctlr = readl_relaxed(its_base + GITS_CTLR);
>> + ctlr &= ~GITS_CTLR_ITS_NUMBER;
>> + ctlr |= its_number << GITS_CTLR_ITS_NUMBER_SHIFT;
>> + writel_relaxed(ctlr, its_base + GITS_CTLR);
>> + ctlr = readl_relaxed(its_base + GITS_CTLR);
>> + if ((ctlr & GITS_CTLR_ITS_NUMBER) != (its_number << GITS_CTLR_ITS_NUMBER_SHIFT)) {
>> + its_number = ctlr & GITS_CTLR_ITS_NUMBER;
>> + its_number >>= GITS_CTLR_ITS_NUMBER_SHIFT;
>> + }
>> +
>> + if (test_and_set_bit(its_number, &its_list_map)) {
>
> You just established above that the bit is not set. I assume that this is
> code which has no concurrency concerns....
I understand this covers the case where the ITS_number field is RO. In
such a case the its_number has changed just above compared to the first
find_first_zero_bit?
Besides
Reviewed-by: Eric Auger <eric.auger@...hat.com>
Thanks
Eric
>
> Thanks,
>
> tglx
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Powered by blists - more mailing lists