Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1499916ybl; Thu, 5 Dec 2019 02:25:08 -0800 (PST) X-Google-Smtp-Source: APXvYqz1D3ojtB3tqp+1Y9jsgO+XlXqkQH17zLzZZPMvEtWFXmcIcuqn4DyFgOQZdK6sVc6G72OQ X-Received: by 2002:a05:6808:b18:: with SMTP id s24mr6290381oij.31.1575541508030; Thu, 05 Dec 2019 02:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575541508; cv=none; d=google.com; s=arc-20160816; b=CpC+4uHOO3N/fpknY2QzeGOlNoqDuOqJ9LMfVyi6oneIkMnjyBmBDAhKxNEI/+vrW2 syXx11VhbTP3X295DHQUDDuZqQDpVux/zggk1BAU8nJ4wueEYHPQpqGC6Deq6Eyi6vtr FOOcp3J5I1c9Q3WMvKGPYYPdhaDWZNIp05ejJC4ggGn4uqUMf3zQtIeY3om3T1TfnBP6 mpGaUgt6iODfiaBRdCte89g2QkJ5zeLxeJvB2F7qcssJyPZOdzIetE7upGF9CUFLpuGx kvE+wX96wZSB/oRao9eh13GScY96ILhQcQZo53lkv4I6Q3TL1CHy1o441BrXfs4BDmbN yUKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ebicAYXy9k2mxJvMhxK27he4zZtnJrB2MXkWfn+pqxY=; b=drdc28jqxhZlPyrGzxqfnF9CL4CS16g2DTTaEUr1zjaIpy61i50eCbK7iwik/Frina OjYOhxASUT/JfIp942uz0qegxJNUvoOzH6SnWe6xGTe0x2C1oCYs+lFcbHyVRtdTfYws xeALb7VSBUjq6tWOw3iKmotgF6BHqyHJwldxNJT2njj45yhmTWyzyOrgpzi0wLsv/ATL bImGuZIWvuQ49rOMmiwb5MoxjE2eY7RU05IoSv7g/kv4cTKFbEgzIgEzZ5YMgaq7snzH Cskwelr9bcntHhnPFAHdllTJsZz/e9Oea6ySJDf6zpmC2wnIeSoU9KNmlG40/MCGvIII QEpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NxjLFuv2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si4804509otl.54.2019.12.05.02.24.55; Thu, 05 Dec 2019 02:25:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NxjLFuv2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729346AbfLEKXC (ORCPT + 99 others); Thu, 5 Dec 2019 05:23:02 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44602 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728735AbfLEKXB (ORCPT ); Thu, 5 Dec 2019 05:23:01 -0500 Received: by mail-pl1-f194.google.com with SMTP id d19so1064198pls.11; Thu, 05 Dec 2019 02:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ebicAYXy9k2mxJvMhxK27he4zZtnJrB2MXkWfn+pqxY=; b=NxjLFuv216NNLaoZNHD5p14KmVz2OeM2dP4/YR+SwNI++oEF/j6KAUDujz2shC1jff 0Y0TvlPFmRS32w+D0wg3NAfmOOTWrjP4vsh/gM+YiJAZSvwYip57ClpqYhihRrAJu3aR UTLLAep3mEXVPEcgg74rcKtd2k795nBMULapu43qhujZXiwtlkr2LBl81kUtFViPUjn2 zE93kzLmtuqYMKxK1J2v8lWqobDHmMD/3mcusQ99ehN2oS2xmsTkvhbmS8vZq6GJPAuk TS0KAm8FZF5LrdxMEkIKogLdT3kKZGdD7fiL44YDLb/B18X3XHaGJyDjDNVKDIixNTsv c/fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ebicAYXy9k2mxJvMhxK27he4zZtnJrB2MXkWfn+pqxY=; b=Ez9QOcCuXotxMP0H1l3E5U577sfXcmegSgNvku8kBBYMF88tSWmf+zoMt6ONRCwD4s m0+bnAhOdtg0PkpY1hDouGBwfdqmHM6ahJLCHk1xDhAOZbCJQq6bz21dS6LYu6bbUxt/ rlzJud3TU6JotwxulQtO0qWNMGtulE7lIpf7DeYXS+xzNz1SWHyA4HVBbkt+ME0QoUDa 6vlv1acbdD5jLsBY6Ae8Nqn0+dSwVXKTH+q69Xj/98AVRAV5BPE9uvC5OdRfpExGWctF 2rgl2tv1zFpjliJKpV/PIafZ0mC1KyhAfy1GmMdIcWYEcncRD6u/M+93jNdZogJaLATN V5dg== X-Gm-Message-State: APjAAAURV3vCxK7uZUxG77FZoB7TcBOLymsAoSzRG8oJiDqVKhwQV5Q7 MB6pOOjKz9+Jswh6B98zAI+DaS6noFnh9tq7Y3M= X-Received: by 2002:a17:90b:3109:: with SMTP id gc9mr8506024pjb.30.1575541380977; Thu, 05 Dec 2019 02:23:00 -0800 (PST) MIME-Version: 1.0 References: <20191204155912.17590-1-brgl@bgdev.pl> <20191204155912.17590-8-brgl@bgdev.pl> In-Reply-To: From: Andy Shevchenko Date: Thu, 5 Dec 2019 12:22:51 +0200 Message-ID: Subject: Re: [PATCH v2 07/11] gpiolib: rework the locking mechanism for lineevent kfifo To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Kent Gibson , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 5, 2019 at 11:31 AM Bartosz Golaszewski wrote: > =C5=9Br., 4 gru 2019 o 23:25 Andy Shevchenko = napisa=C5=82(a): > > On Wed, Dec 4, 2019 at 6:01 PM Bartosz Golaszewski wrot= e: > > > + spin_lock(&le->wait.lock); > > > if (!kfifo_is_empty(&le->events)) > > > events =3D 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 =3D 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. --=20 With Best Regards, Andy Shevchenko