Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2339409rdb; Mon, 20 Nov 2023 08:22:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPH4GJuwZqR31EMKau6d6G3giUEmyHga53H3EIK7zz3vpotMvaP+DCvBaQdnJebtBRVlyy X-Received: by 2002:a17:903:1ca:b0:1c3:3b5c:1fbf with SMTP id e10-20020a17090301ca00b001c33b5c1fbfmr10261023plh.10.1700497368810; Mon, 20 Nov 2023 08:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700497368; cv=none; d=google.com; s=arc-20160816; b=Zht/3XWY9p3IRWuGC9ojsJigG6rZveTotR8gxE3oX6IhsZza2XKEoHvD5SZ/fVvG0k XNIyCs/puOafT1elufq9qYxbpHJAWReoDS1UelDhVlKcPKK9M5LJLoB1x1N/d0wwwmzT 7YFj+6fGvdwSMLQZtcjJzIH5OnJcWKSwYnWA1bVOQCTm1pAl0t0l2lg9UGdv6tEPYpSC EG8dy6iQs/Bkx7hsHJQHUZ6AREz9+fLKuIdFlE8XAphqewIwF1ptLEFsbYq96JGzEGn1 +7+hjM41K0sAW59wDbO4hn9wDn0WupKpqAyOeeFZkFqd7Qn29GRgg4vScwpB9EYwW3os afHQ== 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=TcwRqP5CdKwv+YoLcXes/KhcYRHOs23GnCHSX7NvmrQ=; fh=G5nRJsM2FtZBa9gl+GAw2eF4FFqoGIhuSYQVK/FebGQ=; b=jKjF29uclzuSDsEnKlU8cv5PwBpSqhy+0Q0wmBHcaZX0B3Q0VfrK3Z8Ullf7i04I6o FhF96IHDNo9ymXtzfunAs5W6GvsbB5Z4Ir0r/L1ub8EvKaeZ1LfdmNSkf4pcEHUADQNp WJLnKK3mmbMeHjivfhBF1lh0GvM35qsat/LBecR2xzsDHnbgePpj7l4p0XhV908cUQDM WXMzYxKMWW9/i3IDO+OQl2VKUAWz5UDibyK6voxB91ySppRXAXX6oKKLInKPIHPfhFuZ A65QNVAjWVHpuFkqiFD9IiBCPhhg337hwYx4RC1BtvEmRKiN1fedLj4YhL0XYUXKhZMU 80RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nsEMhJ2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v8-20020a1709029a0800b001b8921fbd87si7964656plp.490.2023.11.20.08.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 08:22:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nsEMhJ2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 7CF05801B435; Mon, 20 Nov 2023 08:22:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbjKTQWk (ORCPT + 99 others); Mon, 20 Nov 2023 11:22:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbjKTQWi (ORCPT ); Mon, 20 Nov 2023 11:22:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30A3EF4 for ; Mon, 20 Nov 2023 08:22:33 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 682BDC433C7; Mon, 20 Nov 2023 16:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700497352; bh=wo6NE3x3fZnUgjOiXaaB7L0iQnLkmm2WM2aRkkTL/vg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nsEMhJ2LQ/U0o+CSgd3CLLiBEKlB9iXGA7RinYkv0I6rF+nJKEIo7jlPrj0rEe3ST hV1IMWH8nClWwhV/k0fD3IBCg9XdPz9gAnpSynlrZDXnfSFeTvWfn6XpBbxhfnDWUE 5sFpsIzxcML4jobVeF4OJ++AR5wqRgufhk/KWW5/5LsZvniJIrRbOslcqgnuC4aBkL iCS96XTx2KvbBbPorGkTgb8GwcC2UAQjsOi7DrE6OjPA3+x/QgBdCT43hcSfonfGGb hx2WFAcSz8reUlAkCqBP95DWWrJh+PsASYVbS+BmSdYy+QIJclprKvMsks0aESqy5i gTp0dSLjZSzbQ== Date: Mon, 20 Nov 2023 17:22:29 +0100 From: Wolfram Sang To: Will Deacon Cc: Linus Torvalds , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Rosin , Bartosz Golaszewski , Andi Shyti , Catalin Marinas Subject: Re: [PULL REQUEST] i2c-for-6.7-rc2 Message-ID: Mail-Followup-To: Wolfram Sang , Will Deacon , Linus Torvalds , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Rosin , Bartosz Golaszewski , Andi Shyti , Catalin Marinas References: <20231120150515.GA32570@willie-the-truck> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nhEp5Di/H6AUF6Ik" Content-Disposition: inline In-Reply-To: <20231120150515.GA32570@willie-the-truck> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 08:22:39 -0800 (PST) --nhEp5Di/H6AUF6Ik Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Will, thanks a lot for this summary! > and I think the high-level problem was something like: >=20 > 1. CPU x writes some stuff to memory (I think one example was i2c_dw_xfer= () > setting 'dev->msg_read_idx' to 0) > 2. CPU x writes to an I/O register on this I2C controller which generates > an IRQ (end of i2c_dw_xfer_init()) > 3. CPU y takes the IRQ > 4. CPU y reads 'dev->msg_read_idx' and doesn't see the write from (1) >=20 > (i2c folks: please chime in if I got this wrong) I admit that I didn't dive into this specific discussion. But we had this kind of re-ordering problem in the past in i2c, so avoiding the relaxed_* where possible came to be a good thing in my book. So, I recommended removing it for all writes, not only the one causing problems here. relaxed_* should only be used when really needed. So, this is why I applied the patch, plus I trust the people giving their tags after the in-depth discussion. But yeah, if somebody more experienced with this driver could double-check against the potential locking problem, this would be good. --nhEp5Di/H6AUF6Ik Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmVbh8UACgkQFA3kzBSg Kbak/A//S2jhodePmuM7u+4PQREH/Nmwbd3Casu+Q+QLWwr3jevovyNhWupdRsYE wDROMNs30eq+iYYzUQVKE9Mk3y8Z3m8ntjNAbkhJmrajYVd522PQnO90HLwBEaWO XaTAPyJ97uGf0yUEE9zg9U2oW8oqZh2soca2TLu26mTV0PMXFwkqEyqgBV4nf61n p92RdjVcDgpqTOjmcuhFvmV8sJ1hlY2+q5f+wY09+ZaOVdmhrA9kYezCoDz+ZX4Q MB+dUKzCC22lT9NzEDGyz5/TsVKwOa+MYSH3oHpjxb7ULk9UcC70QUnmJ76UwQZ8 9CS1uifcXhgkyu7VLahv55jjkP4cHAS3MnhTBewXsl1Rl1bOvvPhIUuPg/r00hBl pyUVlxpQWZ12gmWurqqK9cQUGlg+UcKvUZ0+aS5EsuCUwLHhorv1Pehx7M46eRrh Crkbqk1gZA15R2w1dp8DXQ+qYjK2WDRMMnU/sPa8Ad6SWiU18LhS+dqyLp4hsUuk x8NSeMyugEqaZCJk+i8SmiGCzhPOx9kAp5Gfgjjb4bKjRWlTjuIKOD/32HFqS/rW cYUlNmyicQRKsZGacYO+UV+64euw1p/QA+jiwrSkoD3+6apFLRfc9Q4uy9/Cn2r3 4jFeGVWw5PEukhIs8mYspuM91zzXnlesN/dgEGCtFdAbFfaz71Q= =JTwO -----END PGP SIGNATURE----- --nhEp5Di/H6AUF6Ik--