Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1548448rdb; Thu, 7 Dec 2023 02:13:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHExL8a/Z5JfAAMwrcWMt3vMoCbDSAaaub0qH99pkE0gYpV49OVr027mmeAL2NpkwQRBTg7 X-Received: by 2002:a17:90b:112:b0:286:6cc1:294 with SMTP id p18-20020a17090b011200b002866cc10294mr2093470pjz.95.1701943983660; Thu, 07 Dec 2023 02:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701943983; cv=none; d=google.com; s=arc-20160816; b=Zfdh5gNNGd+R/SePfRXKPTK4787ZQnGlq6MTwxK5dqjYDWbt2A4uKu9+LDkuFow42l nFsK4vHn8P6chlrO9o9lkmpwHS2nfee1/v0WBWNzfa5cwLOiIJiVJqI5YyIthlKQxvGJ x1ekLoPHH/kLmxbnI2s5D418vUC1lgMYPvQwigLnByYQPBv037/hfT2Lo2Lto4oqepFO joL29ZXIrGu000hTv6jUuP5K3HdLt/0gBZ3C0Dvc4NgRulEDAMdOAoQg1wt4EqCCRNB/ dFsgIabQ2Lh0CFK8I6ShXJ2ogCm1reEw+hvMPdYCQVtromMN7otCLw+c2XwLJMeWfrbn wTYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=56T1M3RkgkEvFsKEJLHWcohTkirOLnD7I3rdsoTC1yI=; fh=tOnQbDzstOaFaGELDMIl/1YK8pdXNxSaP22mkvinO5Q=; b=Im5LGp1y0w2SzQVFtpOrqvAqL7b6n6m+f2UFUuU1tsdDbtq5THIvBjiSlssTorqLUz 35mqkCs8GND1PtwKWCov3Ax7PfJ0yv37M8jDPoxdnt1y2ovZ0rdstDePWBexzjoojlaS ari/EMuCvg6upaF1879dPXkra982iRzUT4+9PVBs4fnqDWazbrHK10l6fnMuACH8gFc3 25SnVuOobzyPPXVYLGAiaDjyjH1mX20AR1DTsegML+tmfICLyrCCQMVh2AKjKsx9XFsG Uk+CiXYuTL/slLwp3gLyOFEh9bQuuNUDZl5m01Z5qAPFowGw8L7/SJjm4SaT104QpCra XhvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@friendlyarm-com.20230601.gappssmtp.com header.s=20230601 header.b=jxZvrCWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h14-20020a17090a470e00b00288654f292esi834919pjg.20.2023.12.07.02.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:13:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@friendlyarm-com.20230601.gappssmtp.com header.s=20230601 header.b=jxZvrCWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 930A580A0E23; Thu, 7 Dec 2023 02:12:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378978AbjLGJ0J (ORCPT + 99 others); Thu, 7 Dec 2023 04:26:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbjLGJZv (ORCPT ); Thu, 7 Dec 2023 04:25:51 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE7ED4A for ; Thu, 7 Dec 2023 01:25:57 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-54cb4fa667bso888782a12.3 for ; Thu, 07 Dec 2023 01:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=friendlyarm-com.20230601.gappssmtp.com; s=20230601; t=1701941156; x=1702545956; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=56T1M3RkgkEvFsKEJLHWcohTkirOLnD7I3rdsoTC1yI=; b=jxZvrCWikWieZRTpVZsMw0cQ03wEvaQTxcNTvw4DfWpvkIt9LPDYqZX2Wb3g92JuuW SmEA+Q2Z7utaNpoVC/HUjbKqMtAIvz/tJ5bTQyLXI74t2r31cg+JKAUJsSmTcJ1bTMfB 3+JffSCf4FmOOuDxrSddrGTe4hyF5PP6T/+9pvxzo6VOYj8NrlSpj0Uz+mkdT5DlwXSH 0B9wdmRFjwx3DVSKVr37rYdKIaQzQv3EndZlS/7kR6fQ7sB0lALLALBf/F0hckoY4a7s UhYycfhYxt/LQ1FlWrzdLUiphRZKk5T82+ymkKOf6lmnZOw4452GNPzjY97yGINvTnfV 3Qyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701941156; x=1702545956; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=56T1M3RkgkEvFsKEJLHWcohTkirOLnD7I3rdsoTC1yI=; b=EWJ86sgoD5T2txK5l91/NSBX+DvZCzCMk8caAIPDzv/qU3Rojw2McQv5bSS6jF0Y5V KF4getPdZc0k01+4XHpuQQWP040xypZRoqMCo+1SAaGtcLWcykUpF+VOJlTX9Xf+Wk2m m9vb9MdtFRETcRT3mTbeN0DSe6uXnKUvtd1Bq+FaPCaB5ID8LQtJe58gVirCBW0KueUe 5kdtyXc0XrC/BhSx2ambQ6lFlZLjtrMDiEStu7HPgSdut2vUhBno8V99L9a/H9j6ids/ 1MYlQAP24Nf3rcjXyCoOLzPaalviV78Hiqt9uot7OpnwzVBF8tlsH41KErlAh8+I6VCc +eEA== X-Gm-Message-State: AOJu0YztQX9d3vI+DZCW1o9r4G7IuzB3ofoxQ60r+4PbvWDl+phfFQUW nXkUUf01QpNtbM3ael24corlEoPvSm9OWsmXytDv9A== X-Received: by 2002:a50:8a97:0:b0:54c:d8f6:3f with SMTP id j23-20020a508a97000000b0054cd8f6003fmr1476412edj.56.1701941155885; Thu, 07 Dec 2023 01:25:55 -0800 (PST) MIME-Version: 1.0 References: <20231207082200.16388-1-jensenhuang@friendlyarm.com> In-Reply-To: From: Jensen Huang Date: Thu, 7 Dec 2023 17:25:44 +0800 Message-ID: Subject: Re: [PATCH v2] i2c: rk3x: fix potential spinlock recursion on poll To: Dragan Simic 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, Dmitry Osipenko , Chris Morgan , Benjamin Bara Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 02:12:58 -0800 (PST) On Thu, Dec 7, 2023 at 4:37=E2=80=AFPM Dragan Simic wr= ote: > > On 2023-12-07 09:21, 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) > > > > Store the IRQ number and disable/enable it around the polling transfer. > > This patch has been tested on NanoPC-T4. > > In case you haven't already seen the related discussion linked below, > please have a look. I also added more people to the list of recipients, > in an attempt to make everyone aware of the different approaches to > solving this issue. > > https://lore.kernel.org/all/655177f4.050a0220.d85c9.3ba0@mx.google.com/T/= #m6fc9c214452fec6681843e7f455978c35c6f6c8b Thank you for providing the information. I hadn't seen this link before. After carefully looking into the related discussion, it appears that Dmitry Osipenko is already working on a suitable patch. To avoid duplicatio= n or conflicts, my patch can be discarded. -- Best regards, Jensen