Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp65023rdb; Tue, 19 Dec 2023 09:25:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVlBy9vdbDKslc87O8oZ/kC8xFdifoq1rQ6WeMXY7FdY090cEIz7zIHQ5pImyVNzCKAy95 X-Received: by 2002:a05:620a:21d9:b0:781:c23:8d with SMTP id h25-20020a05620a21d900b007810c23008dmr456052qka.129.1703006720278; Tue, 19 Dec 2023 09:25:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703006720; cv=none; d=google.com; s=arc-20160816; b=pZkNg8NTECX+Rb0atLkIcSfcrPn6HD0PT6M+ZkGLDdrcR7ie21QhSSO2gNe/6GfxjC aWY8/ivJEm/bAM5k0Xyla4PgudwcB2j9G/hY37mkwmqdfNwliQwOBy+mHGKd4ZxEsX8e qXZsPIG9XCk+O8ojyzGroNgGFSsqpArO1xHwJtJvqnccPr1quOaaBTcMYLmhOWA3SN45 a7K7ATL0u4a/JzQcDP7+igpNOzCEWAeGW0bLKrKN5xDW/4fiDSJyzqJfTgetTo5UIAL1 vf+I++0US4flbosXAd8lAUp4L2N+Yyyd7qp5sRo9KBrMI2I+cBEKJtAw5NrYXdp/0TKd 6GFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=g/TMtkhMz5F5Aom9LS8CpEu96y9qxOCAKMzbK3SdFvk=; fh=INCR05RW+QA2VEpjC69piu1qCeB64/QE+WOgbYn7Z28=; b=rn8tKUYnO2m145MIejLxqqwFk/OYU56fSN4XAap9dBJH4xeA9RTvL/CzX90li6WaBi d3YMrWm20EakAV76s/bcpcxsxwxnuBCUdFntaLPt0QAYtvLqnr8ydPLAGMj2CSOmnUso rdCHx3/TeXwxTMjwKhrc8Cbpnl0I/IMlCugV22KKKTer4HCcY0UkCJ1r32vXVk2gUe/u f0a2vV4O4XkcikeesUW5/XUfRAFRQ7g3pzL+LfaOMaK8VhaHnvr1QaSYqHdXdEWTvUNW L5lx/IYQGJuhbPa6rFznE63Y7SbBbJcxADtBPabyBbEvLX2kzPCD/mzKFtJFdpz0wEqI juYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TggN0veb; spf=pass (google.com: domain of linux-kernel+bounces-5687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a28-20020a05620a439c00b0077f03a5868esi27200986qkp.77.2023.12.19.09.25.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:25:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TggN0veb; spf=pass (google.com: domain of linux-kernel+bounces-5687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0C1741C20F20 for ; Tue, 19 Dec 2023 17:25:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B25A358AF; Tue, 19 Dec 2023 17:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TggN0veb" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8816434CF7; Tue, 19 Dec 2023 17:23:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADBEC433C7; Tue, 19 Dec 2023 17:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703006616; bh=20UlB/3GfBU7VYZQewkO6lNFHuoMJTapMIPvG5CgEsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TggN0vebKJ6zeSIXebegrggCNwejrthasvy1lIIA7g8T3m8pdMjO+QzvSkWd6kacP a3V8Cu4UM2V7YHffN0m/T2R07vKhPE5MxMXOJBkiOCdjBFyVQGZNjWM2jV3msavsSv p5MVd8ONuLdnHnCLdlYi/W6DlzUk7laGzv1vMTU6D9U6uatOpuaok2mFiQYtH9P3+T 2HYHCcaQwSC8qHB6CcUV6OG3tEWv6Uod+MBQqbRw+CsIfJiHCjIxgsP2xih5nazRSw ozaG412tuzBggoNg+tacIncA+mG2GQnBrcJsRq51UiV5d1jfc2cxiTfAG1gcx+vRYx hFf07aavyy11g== Date: Tue, 19 Dec 2023 18:23:32 +0100 From: Wolfram Sang To: Jensen Huang Cc: Heiko Stuebner , Andi Shyti , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] i2c: rk3x: fix potential spinlock recursion on poll Message-ID: Mail-Followup-To: Wolfram Sang , Jensen Huang , Heiko Stuebner , Andi Shyti , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231207082200.16388-1-jensenhuang@friendlyarm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lI4kUQ0cF6rdsM1g" Content-Disposition: inline In-Reply-To: <20231207082200.16388-1-jensenhuang@friendlyarm.com> --lI4kUQ0cF6rdsM1g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 07, 2023 at 04:21:59PM +0800, Jensen Huang wrote: > Possible deadlock scenario (on reboot): > rk3x_i2c_xfer_common(polling) > -> rk3x_i2c_wait_xfer_poll() > -> rk3x_i2c_irq(0, i2c); > --> spin_lock(&i2c->lock); > ... > > -> rk3x_i2c_irq(0, i2c); > --> spin_lock(&i2c->lock); (deadlock here) >=20 > Store the IRQ number and disable/enable it around the polling transfer. > This patch has been tested on NanoPC-T4. >=20 > Signed-off-by: Jensen Huang > Reviewed-by: Heiko Stuebner > Reviewed-by: Andi Shyti Applied to for-current, thanks! But I'd like to see the follow-up patches somewhen which have been discussed in this thread. --lI4kUQ0cF6rdsM1g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmWB0ZQACgkQFA3kzBSg KbbOVw/+NVen+AGSOw4eMjuOsuw6K8gqDN/xh3Ljd6DswQnEF9MIELUKGPoq8/Iw AgJfpJdu+JLIxqZ7n8wxXAzQNeq4cA7/66j+5N4NSPE5C5DV7iAcQIvlQQHi2P93 uxCjDe6OnDoeS2JA3KCwL+Kce2JQvZ7EWLp5A/UaX1sANt2L3aZ4Xs0vj6yFpRg2 keWp0ouKrsMhRt9Vmi5zFWxtd1M0vdiOLywFLcWRq9vbVB6ZKjcMidjLQHPQ96sM uKm+3QbhLrV4qPZE+BLI+WAFfAr6x9/geqZ7qyFQeJOfWEcFFHFYMWEba+zybCKa P9zdG4vAkn8ZzRzoRJ/+xhvoXwUh7RbumsdnNiR51pGnSBF68BsQla5A/cg/mhHL fMrdIg9d/2BBm0rUrOpIE2EuSRLDJWCWaPuVyx+QNKRDzOlVIYM9PyZbREiWNEyP 1n+IZf09ueeTVy5OJRpQVq4tGy6tp0+R4F/kFLfZKUe4UYr6CQdiUH4ctQw6YBt0 01RAzx4GWxyRpXBjp8uH+Ili3ZIqJpLFDfABErhxfUIMluAOsBetPSuNdEIcWny8 7JICmbtPoYvWoLahdHT8DE3YNQcjf25IQZY3j2mCNKicTeibisXBkgsWieRbcAXS D8p6y+ALiam4Yx9t871AZAMqZlUq/cXQT7TrkxVaXp/OfsviIpo= =dZSq -----END PGP SIGNATURE----- --lI4kUQ0cF6rdsM1g--