Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp613017ybt; Wed, 24 Jun 2020 07:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZNmlNj2EqQQIIRv/cOHTcMmpJLT0P1j8umS92f9VEx49UumIG/7ZnlgaPU+0gOUiuzy8w X-Received: by 2002:a17:906:f88a:: with SMTP id lg10mr20821091ejb.317.1593007743613; Wed, 24 Jun 2020 07:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593007743; cv=none; d=google.com; s=arc-20160816; b=dPei+njj/yWB6Y9SWFqylLwkEVgw9eS8QjLJxFb15P2DoJ41HcuoGYUSycLD9WsOni QCBg+4Bh83wbooXHuBiI3ycEX9F9fornrtO939u65P2ari5bm29g6LCY48wHpP76nG3i rNdEscgBowIGEhyyfC9w4d1KrvCKerJibzGiLRLdZMQjUKsicNNBWdayP9pMxmc4kxoM nCT0/q+wG8uqylZs5CeY7b01gSwUYgMNYgHwcFi5A/H+jc4x9xhIEUQIJnyVJFeqDfMx NWL/PUs75KEf0gCN3O4/h1Y/ZaPgfrZjgEzD1R6pBxH2B0qxY9foiyITMT+7XZwwcGm+ ogfg== 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=FRVORTjqa/+9DcZnDp26I3NHb37aWoGaEMjOHVlHQMg=; b=vEwWcqNxYcXVnn6DYwGVGNuazcwe2clvieXi2tCRaUIaDYZw+eeQnzNXklK/WnV9aV CWvA3HDaewZjsUnI0/P98rTbGDp43dl2JiwogCMvC9uOKGvLqz5xklL1nHmqzfGwtBdc wRT9OBHkbejL1KODnhenBf6NEzg4SL21zIZ4Ef84nQk2kjcs7GoCj7AEnzKZbtBQ83I3 piuIb9mHW7TPx1fnTBOYLUtB26EbHYLdRwE6R7obbW5yQTdhs4PP61b0syHCb/r56TO9 jSUVfitnJ+C85Xi6e7EQqWQIocUYzFQzpGNhRp92wbJVQX0QAxhkgbim+IR+u/SMj1oF ch2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=jbyBL2rW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si6309327edq.180.2020.06.24.07.08.39; Wed, 24 Jun 2020 07:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=jbyBL2rW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404012AbgFXOFQ (ORCPT + 99 others); Wed, 24 Jun 2020 10:05:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403979AbgFXOFQ (ORCPT ); Wed, 24 Jun 2020 10:05:16 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A005C061573 for ; Wed, 24 Jun 2020 07:05:16 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id r22so1847774qke.13 for ; Wed, 24 Jun 2020 07:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FRVORTjqa/+9DcZnDp26I3NHb37aWoGaEMjOHVlHQMg=; b=jbyBL2rWyxn8MXrza0tPa/CArnHR7kI4gNj29oS2jJr50BwyZkRsKZjA3JMDZvPVrq EoDD6Ef0I4VD1SmtYGbL4oNs+SGiSJZg/sPg8SpmHI6x9gNGNSsy4Ux3kS9QJLmZZ6CQ nfvGXvaNrzcTZiyo/HR6ym7yyvQwvz5dNdqCykSehIGEm7CkLbPE/xWU5FrtnNlgvmfz SS05v1SdEH+dX8Y3s8m48NrJfl3mpy+Ul2Fvbem04v4G5IALaUTfM1qiCIs6UEuECrQU zJbN3MI2+dPwrKkhS+hepHxhJD9y0xfbuglxXK7nOAnGKxJl7M93UiodT4fW2IY2tEgD b42g== 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=FRVORTjqa/+9DcZnDp26I3NHb37aWoGaEMjOHVlHQMg=; b=MnlJxHxI7M5kVMS6nqcdvoQ1q75/eaP7bb2spsgwTGaFKWu9VguxO7fPKt3WA4+ta6 qpqIVH6HUB69Tzn+TgTCQDbkUldl2NHq1251gCvKCiaJgYtCRG3fu87ZybtteAmNTXti KhqdG23RGKZl1DiP+6Qwc2tERHljNUDqw2jyrMo6fUnU5fbRzKcs4FhdW6a+ggWxlp/b QYI7VPKexm5ppsJabeaIiAEtxM1z/2PRVORauLYQa7oDd5ShjqG/RtnGNSvjxET1OBOg gkPk6CqJtN+iLIj0hLbT0LyVZbALmeyon9xnWGjD1IvsT9h9NFuml3rdP48SFCE8L7a2 VJXw== X-Gm-Message-State: AOAM533Nr5R6hHbw1y3k4JRKWMevIa2OlbH5GcAihuVlCTWCSUAWDZuk sDxFzu7vRNBV29gCXqQRBKdMo4LczOac+nrVXSzP+REE2Z4= X-Received: by 2002:a37:9c81:: with SMTP id f123mr1967271qke.21.1593007515407; Wed, 24 Jun 2020 07:05:15 -0700 (PDT) MIME-Version: 1.0 References: <20200623040107.22270-1-warthog618@gmail.com> <20200623040107.22270-11-warthog618@gmail.com> In-Reply-To: <20200623040107.22270-11-warthog618@gmail.com> From: Bartosz Golaszewski Date: Wed, 24 Jun 2020 16:05:04 +0200 Message-ID: Subject: Re: [PATCH 10/22] gpiolib: cdev: fix minor race in GET_LINEINFO_WATCH To: Kent Gibson Cc: LKML , linux-gpio , Linus Walleij 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 wt., 23 cze 2020 o 06:02 Kent Gibson napisa=C5=82(a)= : > > Merge separate usage of test_bit/set_bit into test_and_set_bit to remove > the possibility of a race between the test and set. > > Similarly test_bit and clear_bit. > > In the existing code it is possible for two threads to race past the > test_bit and then set or clear the watch bit, and neither return EBUSY. > > Signed-off-by: Kent Gibson > Reviewed-by: Bartosz Golaszewski