Re: [PATCH 4/6] gpiolib: cdev: don't sleep in the SRCU read section in read()

From: Adrian Ambrozewicz

Date: Fri Oct 16 2026 - 03:48:57 EST


On Tue, Oct 13, 2026 at 06:48:24PM +0300, Andy Shevchenko wrote:
> It's duplicated a few times, perhaps you can make a static helper?

Yes, v2 adds one for the three read() paths.

> Caveat: not an SRCU expert, so it might be actually wrong from run-time
> behaviour perspective.

It is fine: the read section of the guard() in the helper ends when the
helper returns, and that is what the patch needs, as read() must not
stay in it while it sleeps. The callers do not use the chip after the
check.

Adrian