Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3645958iog; Tue, 21 Jun 2022 03:04:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t4eS1dusBtQTDGw+WIs/frCcTRo2x6kwSNksvl0YFUIckXFvC2svOpKuo5hRHd6MnFjMTB X-Received: by 2002:a05:6402:24a4:b0:434:e43e:2462 with SMTP id q36-20020a05640224a400b00434e43e2462mr34692902eda.312.1655805881199; Tue, 21 Jun 2022 03:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655805881; cv=none; d=google.com; s=arc-20160816; b=vGixtyjXmh8szJ7DNhZ8AdIsjdfcIY/prYJM+sRrwr+bkS2mRRpxPWst7cTc6B71M5 8JOr7+7Xof0bejkh2UIrtu7lejCxoBGu36nAKnQ/YCLOo9sZfelHYZDnKxMNhGFtsE8c A5QPGQ1LUUlobt+zE2dwqC3Wec8jq3Imb94Tw3KrJyZg+kJI3ZBf8LcqIasVfEG/7y6m yTSSat+5WTHnMkaAv2/q2ktSn99ktT7vUVMFZOyeKMW9d+6JItpVvlvdKKOnpNPUTf85 DEzVYJy1NLzAzx91unCxEw4LMZv+ZKIxogLl0Ihdctk2U2GSV5v6DG8TDmdcL/pCVsDw SJnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=eVfQd3XPechRFli107C/XOXRbeHsShcnB7OFUBR1wN4=; b=B7gTeLCn2p2nXAFQ7Nuw3lr5pcrkz0UcyIuBe9vw5rCFPsqPmS1CzQ5n5PKs9hC/5T 1+D0jitiN1ssrAltqDOftqGAl2zNJHZVT4/7qedLLglyWLnVHBCBOTxzO+AM6OpObYgu BaBJsRJWRepaeAG7suBWiW4qBwq92ZOuDFSNdANEZMviROzmRoMoKqAi+07K5cdL3lZ5 Qo0En3NIUo5Woe2iZKavhSO6YuYQCm0TYyrKpurf2nM6p7tssU9F1lKt6Ziqy0OuZbmD wshNOC49rD/0dcxH5TGdwgvwRm77j52LWc+8WKb/qagS2g4VqkvrRMPH2rW6H7gClFE2 Sqlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SkWmIxEV; 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=pass (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 s17-20020a056402521100b004355a473970si14159581edd.96.2022.06.21.03.04.14; Tue, 21 Jun 2022 03:04:41 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SkWmIxEV; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348855AbiFUJaL (ORCPT + 99 others); Tue, 21 Jun 2022 05:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348739AbiFUJaC (ORCPT ); Tue, 21 Jun 2022 05:30:02 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCCDC26103; Tue, 21 Jun 2022 02:30:01 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id c13so14050383eds.10; Tue, 21 Jun 2022 02:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eVfQd3XPechRFli107C/XOXRbeHsShcnB7OFUBR1wN4=; b=SkWmIxEV+ESyHsCbsR1Xt7I9SQuAWrV1KNmPiHSefbw6tjpPMuthp3LqtVQ2N+GIyh BF0EUqeIjZ/fTFqxBB6wXJ7xGaqQxl7IRe8eZi1sO2oZD7dNwzX7VC5QBndK7WTzX8pW ar9X/Z0jZRtZLQ6fUs2aQmiDZ2d91v914nUh+KGkyPNtXOmVVYNnVMMqb+EzlDt8o66V a0FVH1Zp8dBl16N3CmVzQ4p+Wj0SgKmTk9HwQkqHXo0LNrXTGtskvMPd3alLj3K0vLA/ //ny6WHJ/gvkwxF84HzdQy++kjBUu8yXxysyZC5+Z+VkMghwv8Mv/zySzZVeO0ePODU+ GlXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eVfQd3XPechRFli107C/XOXRbeHsShcnB7OFUBR1wN4=; b=2s3Zqa675upJTh6G69MjRIf79fYt619yMAGRheYVAhOZxjvDQh/V5uRTW8KkHbokA9 ouiE/OmoB1XtzoRptaBOv3XKHuuPiD3Ns1Sr1EuADusJC11+tn4AT+SubnHGt2nLFF3w Ok1r8qNq3D4rPcrUp9jsp2RNFD/CsMHaaOUefgvn5v/3vOPT7ypff/YLKGRakBLrxc61 fG1G29jntFiqR1FkfILkZF4NHwCA3RMc6IFpkQt2UqL3kczeBE4SV1ywrCqFnNMd+3xq m8Ww+dr8eipGBkP8yHtJ3bKLHKyUF6SkHIzyEktfgJ+lORTsUhGskbsoc0ugoVeqFgzv jJrQ== X-Gm-Message-State: AJIora+lp2mb37z0mB42PIvjXoc2uJaTNpKki3+MO19gWE/TkME7EI89 i7MERN6dXbTg17CxZHU5EB+6jwIQ0Ci/+uavlCk= X-Received: by 2002:a05:6402:4390:b0:42e:b7e:e9ac with SMTP id o16-20020a056402439000b0042e0b7ee9acmr34685476edc.97.1655803800295; Tue, 21 Jun 2022 02:30:00 -0700 (PDT) MIME-Version: 1.0 References: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> <20220620200644.1961936-16-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20220620200644.1961936-16-aidanmacdonald.0x0@gmail.com> From: Andy Shevchenko Date: Tue, 21 Jun 2022 11:29:23 +0200 Message-ID: Subject: Re: [PATCH 15/49] regmap-irq: Change the behavior of mask_writeonly To: Aidan MacDonald Cc: Mark Brown , Andy Gross , Bjorn Andersson , Srinivas Kandagatla , Banajit Goswami , Greg Kroah-Hartman , "Rafael J. Wysocki" , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , MyungJoo Ham , Michael Walle , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Lee Jones , Manivannan Sadhasivam , Cristian Ciocaltea , Chen-Yu Tsai , tharvey@gateworks.com, rjones@gateworks.com, Matti Vaittinen , orsonzhai@gmail.com, baolin.wang7@gmail.com, zhang.lyra@gmail.com, Jernej Skrabec , Samuel Holland , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , linux-actions@lists.infradead.org, linux-arm-msm , linux-arm Mailing List , linux-sunxi@lists.linux.dev, ALSA Development Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 On Mon, Jun 20, 2022 at 10:08 PM Aidan MacDonald wrote: > > No drivers currently use mask_writeonly, and in its current form > it seems a bit misleading. When set, mask registers will be > updated with regmap_write_bits() instead of regmap_update_bits(), > but regmap_write_bits() still does a read-modify-write under the > hood. It's not a write-only operation. > > Performing a simple regmap_write() is probably more useful, since > it can be used for chips that have separate set & clear registers > for controlling mask bits. Such registers are normally volatile > and read as 0, so avoiding a register read minimizes bus traffic. Reading your explanations and the code, I would rather think about fixing the regmap_write_bits() to be writeonly op. Otherwise it's unclear what's the difference between regmap_write_bits() vs. regmap_update_bits(). ... > if (d->chip->mask_writeonly) > - return regmap_write_bits(d->map, reg, mask, val); > + return regmap_write(d->map, reg, val & mask); > else > return regmap_update_bits(d->map, reg, mask, val); -- With Best Regards, Andy Shevchenko