[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeONTHmK=jvbt5LtRTxtp5gn=8x=JUFOfnwsGcAfvJCgA@mail.gmail.com>
Date: Thu, 5 Dec 2019 12:22:51 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
Kent Gibson <warthog618@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 07/11] gpiolib: rework the locking mechanism for
lineevent kfifo
On Thu, Dec 5, 2019 at 11:31 AM Bartosz Golaszewski
<bgolaszewski@...libre.com> wrote:
> śr., 4 gru 2019 o 23:25 Andy Shevchenko <andy.shevchenko@...il.com> napisał(a):
> > On Wed, Dec 4, 2019 at 6:01 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
> > > + spin_lock(&le->wait.lock);
> > > if (!kfifo_is_empty(&le->events))
> > > events = EPOLLIN | EPOLLRDNORM;
> > > + spin_unlock(&le->wait.lock);
> >
> > Sound like a candidate to have kfifo_is_empty_spinlocked().
>
> Yeah, I noticed but I thought I'd just add it later separately - it's
> always easier to merge self-contained series.
...and easier to forget about.
But it's up to you :-)
> > > struct lineevent_state *le = filep->private_data;
> > > - unsigned int copied;
> > > + struct gpioevent_data event;
> > > int ret;
> >
> > > + if (count < sizeof(event))
> > > return -EINVAL;
> >
> > This still has an issue with compatible syscalls. See patch I have
> > sent recently.
> > I dunno how you see is the better way: a) apply mine and rebase your
> > series, or b) otherwise.
> > I can do b) if you think it shouldn't be backported.
> >
>
> Looking at your patch it seems to me it's best to rebase yours on top
> of this one - where I simply do copy_to_user() we can add a special
> case for 32-bit user-space. I can try to do this myself for v3 if you
> agree.
Yea, I'm fine with it.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists