Re: [PATCH v2 06/23] gpio: add SRCU infrastructure to struct gpio_desc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 05, 2024 at 10:34:01AM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> 
> Extend the GPIO descriptor with an SRCU structure in order to serialize
> the access to the label. Initialize and clean it up where applicable.

...

> +	for (i = 0; i < gdev->ngpio; i++)
> +		cleanup_srcu_struct(&gdev->descs[i].srcu);

for_each_gpio_desc()?

(It might be that the latter should be reworked a bit first, dunno)

...

> +			for (j = 0; j < i; j++)
> +				cleanup_srcu_struct(&desc->srcu);

What does this loop mean?

> +			goto err_remove_of_chip;
> +		}

...

> +err_cleanup_desc_srcu:
> +	for (i = 0; i < gdev->ngpio; i++)
> +		cleanup_srcu_struct(&gdev->descs[i].srcu);

As per above (use existing for_each macro),

...

> +	struct srcu_struct	srcu;
>  };

I am wondering if moving it to the top of the struct will give a more
performant code.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux