Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3371630pxj; Tue, 1 Jun 2021 03:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZm2ncbDYka73VnKfFIb3N9ojbC3tvHIu4DkOFKPQxqh+Miwn1PEfC0uqhg4JqephwAgZ5 X-Received: by 2002:aa7:c787:: with SMTP id n7mr31480389eds.309.1622544845868; Tue, 01 Jun 2021 03:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622544845; cv=none; d=google.com; s=arc-20160816; b=VTaFZU0vGICcJypMC+qxXE3OTWuu8SI9FhdaRkuphjqvs7fFXVjTkCOtFNZzwGSPzr zBPw6RltOTpM5re4dhmFaYHTFWxoGulmbNicudvhzCvj+gdlp1eoAHfUs3IOkdP41RaM vjI8LponjTM6EFxjvSy4umwMJjMDEXyjaosAnbKkJ8nRx1aJBgIcp7ky5Ds8Ql7pNVYG bP0HJ/E4AQYKv/xN93L0cl3aDu+5J4SRWMPrG91MDSjuZh3H7+9MgdukLVFERtbsmW71 AKvsco1usCfPFmgnSMQTk7ZwZNEwq5BbtF7kjeTSk6LQ2/Vl/sIDupog2ZlWLjMC1Bmu ykYA== 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=Kkk96RFhOUVeXcdtYw7VNYf9WSYu11sjtdPL/xxbKe8=; b=WE73TsVK9gn/PXTQrqqRrH8eO+IElAFmBRvvaSejVOSvbs01SCOz7N4BsTPoLhWFs9 ONMWRdpzzl7XEsAzDcvhUVlj+28j8ikC4Zt3j2/Pl3JXrFxlMPWAmoqqgqB08boFhkgM PibAvdj9Zi9ZIUQoxYhP+EcgFGfrOh0rkaTyvFMDO15Xaa2h5vFjcnneY4qti3G2mOWo oQT3GNliG4QOSmbSnrEkH8v9IG52aqyrjDQUk75HC1Z8nKqGnkSEogSFCMNExDLEMMzO MG0yUm5K+Q5CqybnmwdizyjL6VLhMtXcw+OXWymc1EIL1yuMVVRYp23HBAoWXEtrP3tC kTXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o1ehZKIu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb8si2217522ejc.558.2021.06.01.03.53.42; Tue, 01 Jun 2021 03:54:05 -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=@linaro.org header.s=google header.b=o1ehZKIu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233299AbhFAKxl (ORCPT + 99 others); Tue, 1 Jun 2021 06:53:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232968AbhFAKxi (ORCPT ); Tue, 1 Jun 2021 06:53:38 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21ABDC06174A for ; Tue, 1 Jun 2021 03:51:57 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id w33so21059567lfu.7 for ; Tue, 01 Jun 2021 03:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kkk96RFhOUVeXcdtYw7VNYf9WSYu11sjtdPL/xxbKe8=; b=o1ehZKIudj8IUbNQJja9Bw9E9H+E7miiapinkr/taDqFF3USQSngLdAs8ijRzdZ5V4 R8DlQVmJxyWLsrLsjSnekMwy/de6jXpATv4L6WrPeY0hpYbHi8PSRH6GATZbgs9j3QlQ 5TK1ycoaH/cgAu6KgAma2Q3jm3i0rbxMBH1ca232N7C8suTpy2V/Obr1ogILk8FMvgdz 9DPGRRwyNUcb8mXrXKub2kPGQ2RxKx1zZL6wQDX4+c8gLKNy4DfiNZP7IgsUtPFQxGjy ppyiI9c1hoOI9oSO/zm31ropq2E1gVVhXMwoeppqq2s3IlwYf0fEv7QhfUNyXfLJ++9H tfFw== 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; bh=Kkk96RFhOUVeXcdtYw7VNYf9WSYu11sjtdPL/xxbKe8=; b=Yz4orueJtRDEJR+IzGSs2mdr33ZhZTqkvtIWwOIkwJA1twKGa+obSFTkegRCXfA06g F/0+wqeS+NmWd5JA/W2jHbVVzsO0usBEOZ0OvFoEgw5oKlygb7+gcDv7KpyzzOJEnHw6 fApOE083qnNG/4Xmb0GCihenmz05OR5Qc3jSdbQTxfdn43kC4pnCdr+aAeyGpNam1OdK 5RBBsNxx5fMj+5sCbvBWV3BWFL2Sox+WaWfWHizoWmfqOSdn1I0qSCiC37VGDkcH0j7C xaat0F1REwjBl9UnZuWFTq4Bvy2vt2+lCobIW0p5UWvy85cJrsDF7rH8NLaEmGtESAjB K7cw== X-Gm-Message-State: AOAM531kQJrE65N0jkRVgDftFt7R/42R/RlepqbHQNgptkm4efNCCBux aDb051zfwcUUIVv8AIbfE3Rkbhl34ix4g/NDA53m8A== X-Received: by 2002:a05:6512:3e03:: with SMTP id i3mr14354819lfv.529.1622544715508; Tue, 01 Jun 2021 03:51:55 -0700 (PDT) MIME-Version: 1.0 References: <02bbf73ea8a14119247f07a677993aad2f45b088.camel@svanheule.net> <84352c93f27d7c8b7afea54f3932020e9cd97d02.camel@svanheule.net> In-Reply-To: From: Linus Walleij Date: Tue, 1 Jun 2021 12:51:43 +0200 Message-ID: Subject: Re: [PATCH v3 0/6] RTL8231 GPIO expander support To: Michael Walle 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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.) Yours, Linus Walleij