Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579569 > unrolled thread

Re: [RFC PATCH 06/33] irqchip/gic-v3-its: Add probing for VLPI properties

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-02-13 11:10 +0100
Last post2017-02-16 14:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC PATCH 06/33] irqchip/gic-v3-its: Add probing for VLPI  properties Thomas Gleixner <tglx@linutronix.de> - 2017-02-13 11:10 +0100
    Re: [RFC PATCH 06/33] irqchip/gic-v3-its: Add probing for VLPI  properties Auger Eric <eric.auger@redhat.com> - 2017-02-16 14:50 +0100

#1579569 — Re: [RFC PATCH 06/33] irqchip/gic-v3-its: Add probing for VLPI properties

FromThomas Gleixner <tglx@linutronix.de>
Date2017-02-13 11:10 +0100
SubjectRe: [RFC PATCH 06/33] irqchip/gic-v3-its: Add probing for VLPI properties
Message-ID<talK1-2iF-3@gated-at.bofh.it>
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....

Thanks,

	tglx

[toc] | [next] | [standalone]


#1582589

FromAuger Eric <eric.auger@redhat.com>
Date2017-02-16 14:50 +0100
Message-ID<tbuBz-6P1-1@gated-at.bofh.it>
In reply to#1579569
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@redhat.com>

Thanks

Eric


> 
> Thanks,
> 
> 	tglx
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web