Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2260793rdb; Tue, 3 Oct 2023 15:54:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7Ii12iArsdMl/7St6Uz6FZqv6fkEdWmn2MC1accMz+D8AdHSdgqalCM3CL2LakSLWQLoD X-Received: by 2002:a05:6a20:8402:b0:15d:e8ce:145 with SMTP id c2-20020a056a20840200b0015de8ce0145mr999557pzd.21.1696373690523; Tue, 03 Oct 2023 15:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696373690; cv=none; d=google.com; s=arc-20160816; b=uwMB8Suz8h/v7MZ3p9mc4BwID9Tdp4TY2KErmBTiDvs08st0/W2gY8t6CsSvz67nWU iAr31Kwc44zsv0CYgTMoVhhlpMSQ4YrLRALCM77G5wjuhYbPHf5/nTJtGJIKrr92Lmpo 11n48Wi0roqjkpERoOaxVdj0smDUgZMP9L2iS5P5AsH/5SDKuPsfEhPJc2UXkSBrK4CD PRIkHbLM208zHVZzoHd8OD5VX78xkjPLgvc0uQ6cPZVs2pUyssvVmQFAhgL3MPuiQMD7 SG4JlnM042Xz0qCh8BljlGoWS4wGf9usZlW1ZcUvEyRNVXVc9lm3EYF6yhNU2+yKCLL/ WDNw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bZTV9hlCuV9rooecFhmbKCX2xT/hoyYkxbR1mo7KxBc=; fh=wYk28n3/Bmx+6DLvXni6WKwkZLaUGkz9ulYZ8wxwat0=; b=PV2VmjEizcXNEtqMLbdW+ciM/BRwHCfWe2zzoUs39tY9sJgTo/CofVXIl/dg2sOZeZ z4CA9BR5H0/nfXoQdXEVc6u1C8C0cElLEOtpf0RV2U6XUbq7cuGcX2LZ3zoddYV4c3oE jhusleIGkZIK4VO97exSD2iZ7E2/t2Gh3KixmxO94c+PGLhDNgb6RuFpPsny3EJzrhUb lnfWnOoMpz01Wrj9BNcTyDTY8qMxbzxrmaDjI/1s41+mtVuemf+h8vXY3XXAthekln6d GjP/Q6AI2GDem5GpqCUprArb91hVt3C4yOherJls4Iz2mMwAeu3ArokMf7ppoD8UgSf3 FI0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jxK5C/JA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id t12-20020a056a0021cc00b0068fbd15c036si2595702pfj.286.2023.10.03.15.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 15:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jxK5C/JA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 287428182EC7; Tue, 3 Oct 2023 15:54:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231854AbjJCWyl (ORCPT + 99 others); Tue, 3 Oct 2023 18:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbjJCWyk (ORCPT ); Tue, 3 Oct 2023 18:54:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDC7FAF; Tue, 3 Oct 2023 15:54:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D8A9C433C7; Tue, 3 Oct 2023 22:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696373677; bh=9Oft35Q1R1+kG+ADxClgAanF3/fHDbeRHG97EroNmi0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jxK5C/JATXAL5TIu1lyaXWewPzHW/nqlXuV5LlsnA6sfucQfzBrO+HsjJ7aNIK47T rlMHv4I27UWPwP8KFeArZ65rAnDybVL5oesYmfAvSWZRYZ4D+3f+oB+n0ArGOK1BpY G8I8x27mo15usD5zuQhYcfkxhln4cqshu121eEiGe3C7VB5YvM+/B44bxqlGLahB4G IL29143bJIMsHDeAifGLJZ7zkSnIcHcUiPI4DHgABcNAbTr55ZQmBtbmQaOnCBPP/t CnfBdCdEMwmiszQTDeW5lSYSvV9GL8DYi4zNZkMx9wQjchjE/04um3CQSabMop+xZW EOcExskCuiQNA== Date: Wed, 4 Oct 2023 00:54:31 +0200 From: Andi Shyti To: Jian Zhang Cc: brendan.higgins@linux.dev, benh@kernel.crashing.org, joel@jms.id.au, andrew@aj.id.au, zhangjian3032@gmail.com, yulei.sh@bytedance.com, xiexinnan@bytedance.com, Tommy Huang , Wolfram Sang , "open list:ARM/ASPEED I2C DRIVER" , "moderated list:ARM/ASPEED I2C DRIVER" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list Subject: Re: [External] Re: [PATCH v2] i2c: aspeed: Fix i2c bus hang in slave read Message-ID: <20231003225431.owtpcds7rrijj7yf@zenone.zhora.eu> References: <20230927154244.3774670-1-zhangjian.3032@bytedance.com> <20230928145128.tjflbgvena4apivs@zenone.zhora.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 15:54:48 -0700 (PDT) Hi Jian, On Thu, Sep 28, 2023 at 11:04:23AM -0400, Jian Zhang wrote: > > From: "Andi Shyti" > > Date:? Thu, Sep 28, 2023, 22:51 > > Subject:? [External] Re: [PATCH v2] i2c: aspeed: Fix i2c bus hang in slave read > > To: "Jian Zhang" > > Cc: , , , , , , , "Tommy Huang", "Wolfram Sang", "open list:ARM/ASPEED I2C DRIVER", "moderated list:ARM/ASPEED I2C DRIVER", "moderated list:ARM/ASPEED MACHINE SUPPORT", "moderated list:ARM/ASPEED MACHINE SUPPORT", "open list" > > Hi Jian, > > > > On Wed, Sep 27, 2023 at 11:42:43PM +0800, Jian Zhang wrote: > > > When the `CONFIG_I2C_SLAVE` option is enabled and the device operates > > > as a slave, a situation arises where the master sends a START signal > > > without the accompanying STOP signal. This action results in a > > > persistent I2C bus timeout. The core issue stems from the fact that > > > the i2c controller remains in a slave read state without a timeout > > > mechanism. As a consequence, the bus perpetually experiences timeouts. > > > > > > In this case, the i2c bus will be reset, but the slave_state reset is > > > missing. Acked-by: Andi Shyti I checked the flow in the driver and makes sense to me. I'd also love a last minute comment from Brendan or Benjamin or Joel. > > > Fixes: fee465150b45 ("i2c: aspeed: Reset the i2c controller when timeout occurs") > > > Signed-off-by: Jian Zhang > > > > Why I'm failing to find your v1 patch? And where is the > > changelog? > Sorry, something was missing, > v2: > * remove the i2c slave reset and only move the `bus->slave_state = > ASPEED_I2C_SLAVE_INACTIVE` to the aspeed_i2c_init > > [0]: https://lore.kernel.org/linux-arm-kernel/20230810072155.3726352-1-zhangjian.3032@bytedance.com/T/ Thanks! I should really check my filters here. Andi > Jian > > > > Andi