From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21DEDCD5BCE for ; Tue, 19 Sep 2023 14:55:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232910AbjISOzk (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org --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--