Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1679549rdb; Thu, 7 Dec 2023 06:11:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFq2b8BPCz0RZi0lCIarijyU79j2HJTsBk1kkFjOMTcLhmTbsp2JqllW2gKXMnxMhJe/ipU X-Received: by 2002:a17:90a:c084:b0:286:6cc1:3eff with SMTP id o4-20020a17090ac08400b002866cc13effmr2777176pjs.54.1701958262066; Thu, 07 Dec 2023 06:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701958262; cv=none; d=google.com; s=arc-20160816; b=rrOt4Pc++HQSA4JqcDvHjXTSNZ6YMyZl0TZtutaWMFCnvmIQGWCmhPBK4JEBX5yRQ5 O+uOmnwFCE1xtaw0B6vd+XNWOE99xl/K2i/y5Iy5JorGomOqXTBOTwbJWJtjmEPXcQOs pqD9T/eIUuj7xz7lbXvQQ5xKA4zYG3wyVigkeBcAuM5WCH98A1KR3sRm1ERbSIpGUcUc 80XRpuhfkhgznlPJxwMkk52PhjN6moid4YbADVamC+TAtoda6e8qju6bD6Pr6i8OqSrR l4f0okeqDc/gRy7nk2ja2ARFmfNV8kgG9wJd2X+8lzqUafPPJo7haUImHOVWOFjZy2b5 U/eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:dkim-signature:mime-version; bh=GiNAy2Hgm4il6Eg6UIzDiq34mDKxYnVzU21DMZvQkiY=; fh=PuyFNg+5hg2AaE1XtTVYenw/2N96x1F1uyvY8GOkD/4=; b=PLDZ4PtxYeCtxeHDQyiM1924+42wMJAiTV6n1twTNplGM+LVGR1fogZO4LTC0eYjkS 6A8Pi1foXQC9Gnuk0iNh+dJ1tFhAzw+h+QJVFgUPueaiJV5q+3m8wnYZfzLTIqTzPBsQ oatIt84IHU87Lk8MN1Qd+XsQbTmlvBsOWotRzyEEVBcQfyyjgz+vQGIkK0OqpYTG2fPZ Fg2l8/E3Ac0VGNUH/jMQ1W6DMWJJ7mbguyCXY6F3vRmrNEi2arqR1bAKb79ja4sznLLm ZPpNCNpzAB/tml1GlePm8vh9xY5TXA0k3n445RNl3IA8YJfLT0mEsjhIi6ijWvyrGuMg IR9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=LhpCpjC5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o6-20020a17090aac0600b0028683c7ed04si1085485pjq.157.2023.12.07.06.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:11:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=LhpCpjC5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D98E280832C4; Thu, 7 Dec 2023 06:10:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443001AbjLGOK2 (ORCPT + 99 others); Thu, 7 Dec 2023 09:10:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442975AbjLGOK1 (ORCPT ); Thu, 7 Dec 2023 09:10:27 -0500 Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A469710E9 for ; Thu, 7 Dec 2023 06:10:32 -0800 (PST) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1701958229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GiNAy2Hgm4il6Eg6UIzDiq34mDKxYnVzU21DMZvQkiY=; b=LhpCpjC5vmNJlHpagut9DSMEp7fZMKX5K+L+Ii+geqVN4pgmaHB4UNxcmUnA1Fn22twNhZ wGOXbrUOuniiEhDXNEt8/YLeWmWHpUuqfR8e0dFRG5t/6Sp8GPaGxGloICafx/QiUopN1O ASl05ipLEvscQTis82wNW1612SPQA6sIsELqmIWCo7Qu9I2BEyykYxT8/DmlseQIgPLQN4 Sp9Rxa89tkvxbLveCrRLRf8e0+ppf4cc3xusNAbecq4wABnXcZk6w/oThvgVJfiaqjSyr8 koo3jjuqIgHB/fMDE/vnF/sxv9SXR/W/6DJIipJiju/Bf42chPY/o/FTZPaBUg== Date: Thu, 07 Dec 2023 15:10:29 +0100 From: Dragan Simic 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, Dmitry Osipenko , Chris Morgan , Benjamin Bara Subject: Re: [PATCH v2] i2c: rk3x: fix potential spinlock recursion on poll In-Reply-To: References: <20231207082200.16388-1-jensenhuang@friendlyarm.com> Message-ID: <5e11553952c02ad20591992be4284bbd@manjaro.org> X-Sender: dsimic@manjaro.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:10:44 -0800 (PST) On 2023-12-07 10:25, Jensen Huang wrote: > On Thu, Dec 7, 2023 at 4:37 PM Dragan Simic wrote: >> >> 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 > duplication > or conflicts, my patch can be discarded. Thank you for responding so quickly. Perhaps it would be best to hear from Dmitry as well, before discarding anything. It's been a while since Dmitry wrote about working on the patch, so he might have abandoned it.