Re: [PATCH v3 01/24] gpio: protect the list of GPIO devices with SRCU

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

 



On Sat, Feb 10, 2024 at 12:01 PM Hillf Danton <hdanton@xxxxxxxx> wrote:
>
> On Thu,  8 Feb 2024 10:58:57 +0100 Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> > @@ -382,11 +389,13 @@ static int gpiodev_add_to_list_unlocked(struct gpio_device *gdev)
> >               /* add between prev and next */
> >               if (prev->base + prev->ngpio <= gdev->base
> >                               && gdev->base + gdev->ngpio <= next->base) {
> > -                     list_add(&gdev->list, &prev->list);
> > +                     list_add_rcu(&gdev->list, &prev->list);
> >                       return 0;
> >               }
> >       }
> >
> > +     synchronize_srcu(&gpio_devices_srcu);
> > +
> If not typo, could you shed light on why this sync is needed?
>

No it's not a typo. I'm not an expert on RCU but I figured that right
after we add the new element to the SRCU-protected list, we need to
wait for all read-only critical sections to complete before
continuing? Is that not correct?

Bart

> >       return -EBUSY;
> >  }
>





[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