Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3407469pxj; Tue, 1 Jun 2021 04:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCSHah2eShKP+K62zBRe+REZy9N4tOulg5ik4+7hw58CLsdWvPzHpRjhJKHwgESkbTXqIj X-Received: by 2002:a05:6402:50d2:: with SMTP id h18mr32260279edb.10.1622547941496; Tue, 01 Jun 2021 04:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622547941; cv=none; d=google.com; s=arc-20160816; b=ot2cciCUByGduH5eaGZ7QTE8Mn+XDMBhWkh9kqHZk4EWbT+iM/dtNd2Coba074fks/ 9iIlQoZcZ+ShnZq15ybqYqad3IXUyuNoxlMLwV2coT7BAXBVfa6nSVLbmVOTZ6H0YxoP PLP/NzvjBZ5kwPcHwXkuoq59JbkXWsIutxKQqel1ybDaLBcqR7+RJ1afyOdyExCOE8d0 F2QB5yilBCahmv9LAQrUzrETgbYL8pUwwlWZC93S/0abICA6oo/qyTzb2RCOPhG30wXk 1EFf1sSw1IK1/pd5alypyWWeWK5QC8LqRI2jCVrRnVQm6SDEXISXFePIbyR6edcgfZRZ CJ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=xC7P/bcFCV2ZCGkF8kjoqn5cfA8HZsmaWEnBxWUHEDM=; b=pN22U0hPSBJOWxG3u5MFbYSLC924uOAjKuPRZpXnmDrM4Z2s8CPChkuvv9XfbflU+8 8yU5ZHyska9RoS2vyF/zol3E3zeEg9fmaNJVZRo65HDbcwS9Zujqa7U/N/FsIAxLmBo1 cg7nk7s0EL4KUtW6Z0Bi3ogR9G6aECgS+y4SMKJuFVFeH0kOqViJ+4ngRrScqghk0Mny T2nWmzi96Qh2quvX2Tft19esPL0l//dK61lm/J3F/RrUwwI3psu4Svpx1XHw8z9g3GDc 1qL8gnJXTNtaQarkSoKPbI3fkwIe+NrbW0lZsqy0azoTY+cAjkqXeEbglHdvEMz32l1w t1/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=eNiCyfvW; 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 g25si11588059eds.466.2021.06.01.04.45.18; Tue, 01 Jun 2021 04:45:41 -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=@walle.cc header.s=mail2016061301 header.b=eNiCyfvW; 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 S233715AbhFALnl (ORCPT + 99 others); Tue, 1 Jun 2021 07:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbhFALnl (ORCPT ); Tue, 1 Jun 2021 07:43:41 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA9F0C061574; Tue, 1 Jun 2021 04:41:59 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 701912224A; Tue, 1 Jun 2021 13:41:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1622547718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xC7P/bcFCV2ZCGkF8kjoqn5cfA8HZsmaWEnBxWUHEDM=; b=eNiCyfvWaN/+vfSha991PXVg+RUbyHmmgR0PDUfcscbxStGXX847KmZdGfsRA49Z+JNIUK a+xj7o/h3+JkiKyPGmGscPC5NINmziOPzrYVBqxKhgyB1fbvhYNsWTM+lOBq8RLWllzVKI CrALRlMjL7Wd82QxbvzkulHMl7axo0g= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 01 Jun 2021 13:41:57 +0200 From: Michael Walle To: Linus Walleij Cc: Andy Shevchenko , Hans de Goede , Sander Vanheule , Andrew Lunn , Pavel Machek , Rob Herring , Lee Jones , Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Bartosz Golaszewski , Linux LED Subsystem , devicetree , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH v3 0/6] RTL8231 GPIO expander support In-Reply-To: References: <02bbf73ea8a14119247f07a677993aad2f45b088.camel@svanheule.net> <84352c93f27d7c8b7afea54f3932020e9cd97d02.camel@svanheule.net> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <401805ef27bb273d7aca4f3377b53b07@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-06-01 12:51, schrieb Linus Walleij: > On Tue, Jun 1, 2021 at 12:18 PM Michael Walle wrote: >> Am 2021-06-01 11:59, schrieb Linus Walleij: > >> > Just regarding all registers/memory cells in a register page >> > as default volatile (which is what we do a lot of the time) >> > has its upsides: bugs like this doesn't happen. >> >> I don't think this is the bug here. If it is really a write-only >> register >> the problem is the read in RMW. Because reading the register will >> return >> the input value instead of the (previously written) output value. > > True that. Write and read semantics differ on the register. > > Volatile is used for this and some other things, > like for example interrupts being cleared when a register > is read so it is strictly read-once. Isn't that what precious is for? > So the regmap config is really important to get right. > > IIUC one of the ambitions around Rust is to encode this > in how memory is specified in the language. (I am still > thinking about whether that is really a good idea or not.) -- -michael