Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp123640rwb; Sat, 17 Sep 2022 02:05:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69Qr4YUEk11kTJuW5EryigUyvYJHQWLCNk1mg5bNYalgCloJ26Kx33ETWNYLq8hQEpkGcj X-Received: by 2002:a05:6a00:27a0:b0:54b:e645:d5d8 with SMTP id bd32-20020a056a0027a000b0054be645d5d8mr3893877pfb.86.1663405539960; Sat, 17 Sep 2022 02:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663405539; cv=none; d=google.com; s=arc-20160816; b=Jp53dpJAHgdtnvsIIfFPzT+4MLPjNLTV09BFqiFjv655tXZS3uS0UhjG1ynDQKyLKP kWOa1EuSHxp0i7LW1l2AjiEXDdD5iGxUDWXtfXhBrfr5LFXCeltgGMpofPJ36tFNeF7U PTTRa8/sSyi1nh92GPO6KLQ3q7zmc+aioE5909fRyX8DKMnCINbs9+XxaEWO1BIeinbF gBOZOnGPS+6iPi/mqjVODMbEqcbFKRe7E3S2e4ntCbadqaly3oT+Js/s4Ej2AV5sHmzJ 8tte+5nNz114qGA/iqangkFqEn0a4pySQMaUPVAcNQiHIXQtPFnxDmCivSijEs+KWZ5y igKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=FSQNcgyAYEesnmVPk7q+33qA1xKt7CqpXLx0DBFpr+E=; b=PELkY9uK3rKW77ESpSk5bWMQAABBFP8Xz/c9Qg8nIpZAwY8EFrBbezEteAOVdRT8cv 4R8bODqOFelanBVAQpSXt9KI0WcZFDBOp2ooXPJlLGrb0K9hbpcZb3DkIPe4Z3avGuMm KDnnlANxgabat6im8W4ebW1t6i46vNFBLYLb2pG6mBVhn/I5UBZ7xkw7CttQ7xrzeC13 jbvFYIrL68VYr+ihTBCNV5mqmhwA8etUzABBo0d5vXcVKaOO0mMHeee7drl0IRJJnOJa NSYK8IZxL2HSNVRNt52rJ/rmmbxUrhLSGptpzE1+5ECWgkh11t2I1N7uk5/EZeqX+wrR 3/qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l2-20020a170903244200b00172bb36712fsi27570849pls.514.2022.09.17.02.05.28; Sat, 17 Sep 2022 02:05:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbiIQI7n (ORCPT + 99 others); Sat, 17 Sep 2022 04:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiIQI7j (ORCPT ); Sat, 17 Sep 2022 04:59:39 -0400 X-Greylist: delayed 276 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 17 Sep 2022 01:59:35 PDT Received: from tulikuusama2.dnainternet.net (tulikuusama2.dnainternet.net [83.102.40.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D13AABC1; Sat, 17 Sep 2022 01:59:31 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by tulikuusama2.dnainternet.net (Postfix) with ESMTP id 7C5D2286EB; Sat, 17 Sep 2022 11:59:30 +0300 (EEST) X-Virus-Scanned: DNA Internet at dnainternet.net X-Spam-Score: 2.975 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 Received: from tulikuusama2.dnainternet.net ([83.102.40.151]) by localhost (tulikuusama2.dnainternet.net [127.0.0.1]) (DNA Internet, port 10041) with ESMTP id Auole-u3B_-5; Sat, 17 Sep 2022 11:59:30 +0300 (EEST) Received: from omenapuu2.dnainternet.net (omenapuu2.dnainternet.net [83.102.40.54]) by tulikuusama2.dnainternet.net (Postfix) with ESMTP id 5390E25E71; Sat, 17 Sep 2022 11:59:30 +0300 (EEST) Received: from localhost (87-95-96-237.bb.dnainternet.fi [87.95.96.237]) by omenapuu2.dnainternet.net (Postfix) with ESMTP id 923AF1BF; Sat, 17 Sep 2022 11:59:23 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Sat, 17 Sep 2022 11:59:22 +0300 To: William Breathitt Gray Cc: Andy Shevchenko , brgl@bgdev.pl, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH 1/3] gpio: idio-16: Introduce the ACCES IDIO-16 GPIO library module Message-ID: References: <6b28fb497c35def57c1920362c82402bed4bd23f.1662927941.git.william.gray@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thu, Sep 15, 2022 at 11:46:13AM -0400, William Breathitt Gray kirjoitti: > On Tue, Sep 13, 2022 at 07:16:23PM +0300, Andy Shevchenko wrote: > > On Sun, Sep 11, 2022 at 04:34:38PM -0400, William Breathitt Gray wrote: ... > > > + if (value) > > > + set_bit(offset, state->out_state); > > > + else > > > + clear_bit(offset, state->out_state); > > > > assign_bit() > > > > But I'm wondering why do you need the atomic bitops under the lock? > > I don't think atomic bitops are necessary in this case because of the > lock as you pointedly out, but I felt using these made the intention of > the code clearer. Is there a non-atomic version of assign_bit(), or do > you recommend I use bitwise operations directly here instead? __assign_bit() Hint: All __ prefixed bitops (for a single bit operation!) are considered non-atomic. There are exceptions when no __-variant of op is present, but it not the case here AFAICS. -- With Best Regards, Andy Shevchenko