Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp708748rdb; Tue, 19 Sep 2023 08:02:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8PEzkFHpBMxeojaJtOQfyXVqmZc464pWKXiEFH60c+p36wJoOgokH/ckgyKRnzAaNrVLE X-Received: by 2002:a17:90a:9f82:b0:267:c0cb:e462 with SMTP id o2-20020a17090a9f8200b00267c0cbe462mr8725021pjp.48.1695135738680; Tue, 19 Sep 2023 08:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695135738; cv=none; d=google.com; s=arc-20160816; b=awiAVpJMU7VxpMDKE1WKq7/4PnlGTA+SLiYBUve8p0kS56A9I6kzwEuW3f/iOUtRDZ PTk8BgndJpG0/FkiTRHf5frWjLohe2zPaVUNnu6MwGMPwgIQEObbXES9IUiTiauF2uxz jKNZ0kfH3dRurS2yaJAU7QD4l8l+5xxBCRJl0PIkhaHnL0JNqc1ZZGSz3LBHu9RcINnT 13miKc5SWiIxq8NmngcKSzhFhcWSL94tjN8fu6EZWsn0hEArDY+WSTr+jmHvv6Zy3zr9 6pD/fIh3hhHVB40EewpNT1sFY/71/02LXSQelOzwPryNN/sm200rZDGCyGqPTomooUbt MIxA== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Z+KCWNb28zVEsZA3bgcGqvVW05rZBIKdnf6DwZ8F5+0=; fh=uiFS7Px3rBayxq12eXEAoPsLD4d5cz23Jij85XZpuos=; b=zYQHuwUF6pDIhuqiwlZVfGp1+a9NQBhsxn71c1Cn2Z8NA2ORyvBNso867zxR59CMen DK6fQLUR3CJbRYmt37jOXu73NpIliJ7hv3oj1Enz3a/dLHqx877JH1b+bk49e7E7Wlxf 4YwK/LbBZ3nJqi/kv8lkEhfBKHkaFPlJFyVjW496gUG+QAJ9aLS1f5PwOSy12Fy67ykz SCvIZfnnH7Act8iIG8WawfFyQzVdba6q3memp/yCY0phZ9T3HsGFcLO8nXRDKkxVAhkK EkskEzHxZQlB5LDPB6zT9ixnuaGvhUvdhdlkk8un5o4pUNQW5SdffMsNkeIgqhO0O51v fkew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fexae1IR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z10-20020a17090ad78a00b00276b87c8b8esi406066pju.59.2023.09.19.08.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 08:02:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fexae1IR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2E1DE80417C5; Tue, 19 Sep 2023 07:55:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232944AbjISOzk (ORCPT + 99 others); Tue, 19 Sep 2023 10:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232935AbjISOzj (ORCPT ); Tue, 19 Sep 2023 10:55:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6847FBE; Tue, 19 Sep 2023 07:55:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 434B0C433C7; Tue, 19 Sep 2023 14:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695135333; bh=Z+KCWNb28zVEsZA3bgcGqvVW05rZBIKdnf6DwZ8F5+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fexae1IRIHDPJnBLkZpujCXwAyJheENZPR93E3wN5P7y/Iw4c2BG9uZqcFLk5UjrG 5EWDJvua+WIZGI6QUaDAQgcHelmdYA0fKjllx0nax6AeByY0fJnUFuu3Z/om33yNzq Cb91zdCqDuHyakoV0IOmB4cA9wfXtgw7uSqR3n91kIK1/7+lT2m3z4trFvWVWjWhsx 5g/1PmFrvTswUiH6dWWhmR9v6dv6QUFewGjkCP8f3311uuL+lqYxfdwI877Bga3HFv se+yBUofdNn4Xhss9XNFF2gWxoob8KT8TcQGTOBjWynlbDsT54hs12hybMbpQyaPNi GMfSeRnRN6YOw== Date: Tue, 19 Sep 2023 16:55:29 +0200 From: Wolfram Sang To: Catalin Marinas Cc: Yann Sionneau , Jan Bottorff , Serge Semin , Yann Sionneau , Will Deacon , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Philipp Zabel , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] i2c: designware: Fix corrupted memory seen in the ISR Message-ID: Mail-Followup-To: Wolfram Sang , Catalin Marinas , Yann Sionneau , Jan Bottorff , Serge Semin , Yann Sionneau , Will Deacon , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Philipp Zabel , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org References: <37e10c3d-b5ab-75ec-3c96-76e15eb9bef8@sionneau.net> <9de89e14-35bd-415d-97f1-4b6db1258997@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mv+JQVsHnSl3dLVx" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 07:55:49 -0700 (PDT) --mv+JQVsHnSl3dLVx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > OK, since it ends up with the *_relaxed() accessors, there are no > barriers here. I wonder whether the regmap API should have both standard > and relaxed variants. If a regmap driver does not populate the > .reg_write_relaxed etc. members, a regmap_write_relaxed() would just > fall back to regmap_write(). >=20 > We went through similar discussions many years ago around the I/O > accessors and decided to add the barriers to readl/writel() even if they > become more expensive, correctness should be first. The relaxed variants > were added as optimisations if specific memory ordering was not > required. I think the regmap API should follow the same semantics, go > for correctness first as you can't tell what the side-effect of a > regmap_write() is (e.g. kicking off DMA or causing an interrupt on > another CPU). Again, I am all with Catalin here. Safety first, optimizations a la *_relaxed should be opt-in. --mv+JQVsHnSl3dLVx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmUJtl0ACgkQFA3kzBSg KbbFXRAAgy4qEqLgh7Xm0EoQCPqnMbizqcMFhaFIKjxcfbI2v5e6Gk92SdUqtAna cL+5uqpCZ9ZsF7lLzTLJwqBOzMqCB5b16JRKy6WAwXB12Cy3CtF2SeC8s90JpIk+ vi8FqnYLS+0PxjaC46iuAU52OTi9uCwew8puCS5vxi7zycgsjdCCjRbmHTAvbC0E yxQDpUWNGkOrpdl/3lPnEwdRrIpuD/pFZt6v55ytbzMbakZigH532jWkXKUPNHoG 2NgC59AvvYWx9XPAO2Pd1YwtOoVwCjbEaSyc+jFZqtwPocrueQCXnOiXHVXJ0z0F 12alQRQnb78kAz9YUnhG0hf9fCPj/2wSObaAWUap3FhLJ0eV53sfYidO2rCVEpns Onl6sqrbpakVhjCNWA6e1XBe/rKNKWi4QkX5o3+c8mwydkL0OWSxb3Xe+BOt770/ 41dcVM1nG2O0waMCJJr1UYym3gL9GYOhIbF4rrRa2jpmZZIHzG0jVkGB7Cj2LoY+ KA5iYIzS7jm+PNjC8zFgCUjc06D964jGAYJNfG4X8aYb0/nfaFniuGKGCOi2LHLi G9bqyKr7Mg/5Do7AKgmXwhkrRoJqTfQ7tTjDgEG0M/shTU7QrA60XpNXN3j4K5zT uzEbo+nxyc4L7PfzZU97e9Rmtp+mlPSfT/itDzT0sUn3EB56VUk= =7WHl -----END PGP SIGNATURE----- --mv+JQVsHnSl3dLVx--