Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1072943rda; Mon, 23 Oct 2023 01:14:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHCZlk0IrMixLhhiFmq+VxTP8uankJTxr7HDqIrAiv+TDo76sG6OYrpmcGnSF5GSE7a106 X-Received: by 2002:a05:6808:8c9:b0:3ae:156f:d31e with SMTP id k9-20020a05680808c900b003ae156fd31emr8541960oij.1.1698048857244; Mon, 23 Oct 2023 01:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698048857; cv=none; d=google.com; s=arc-20160816; b=lMKiTx/NUD+lCJJBXFt0ebbzNaSLYboaYsTgujZMqJEWeVRqXpZB4FrittGGnCWdQ8 ftcWxW2EmAkXCn1j/O9rQtsRWtrwo0mMm2rV5uY9VxzgxGsFSjwmczkCJZvl5WbwP5hl 3Lndg/NGT5eMdnZEiqI3AKV/lNsixkF/NvfWjfdJAkPiZ2um3RCdujNxooHJvlGscReu CFFr6etbcR8bu0x+0De54WzsJJ5tMykCc0n4UDtJqNbQzqu1m8ueQ4PZwRi8O8sxlKnT rhMw3oZh35zJ3IhmHS3sh6vrXrALuT9eEp/+Z7P0cQYj1dcj84axlyzIj0/AHBcRysnw e8Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=CVn2wGDgbRWhf+g4emjmAkl6EpHDSLLl6DuDPTQRuow=; fh=ZqJ3xrq0DGyvWtPBQo5VWOM7gaftcxyjM72UWd4YoC8=; b=HZ7xdeVfYXPZ3EocN7SqpKco4tgJ24aPylFNKxL8wSxiA3tptGwygU1ihQtTZYi3X0 Lvo6DnMC1jyg/4fXE0Eqa4YPy/JTt61IAk0RAXYNYB3SYlB2xv7aukjoQznwZ+xZYbHd vPMqPK5IdR/VBICP+601lNFW490nnbRy9/RM8AYBOQSTArq79TQSC2SACgbYREpufVbZ Jid79G9WbWZQGWxau/8XhUs6NSmuUZkyHyRSSyF7kMAqpyBfw4l3ergY+a6cUU0Np6sZ VxBzsLYjvPI6VS2tBYlUcdOxORJE+Lxfz6G0/icYJR4H6RITiwFKRbAInQ42n1iRcAsR Ipvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id j63-20020a638042000000b005aa4888b9bfsi6290190pgd.629.2023.10.23.01.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 01:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 52BCD80A1673; Mon, 23 Oct 2023 01:14:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232599AbjJWINW (ORCPT + 99 others); Mon, 23 Oct 2023 04:13:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232178AbjJWINK (ORCPT ); Mon, 23 Oct 2023 04:13:10 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB9510C2; Mon, 23 Oct 2023 01:13:07 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 39N8CXFC060218; Mon, 23 Oct 2023 16:12:33 +0800 (+08) (envelope-from Huangzheng.Lai@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx04.spreadtrum.com [10.0.1.214]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4SDSVg0CXSz2KkWG6; Mon, 23 Oct 2023 16:08:11 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx04.spreadtrum.com (10.0.1.214) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 23 Oct 2023 16:12:31 +0800 From: Huangzheng Lai To: Andi Shyti CC: Orson Zhai , Baolin Wang , Chunyan Zhang , , , huangzheng lai , Huangzheng Lai , Xiongpeng Wu Subject: [PATCH V2 6/7] i2c: sprd: Increase the waiting time for I2C transmission to avoid system crash issues Date: Mon, 23 Oct 2023 16:11:57 +0800 Message-ID: <20231023081158.10654-7-Huangzheng.Lai@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231023081158.10654-1-Huangzheng.Lai@unisoc.com> References: <20231023081158.10654-1-Huangzheng.Lai@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To shmbx04.spreadtrum.com (10.0.1.214) X-MAIL: SHSQR01.spreadtrum.com 39N8CXFC060218 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 23 Oct 2023 01:14:12 -0700 (PDT) Due to the relatively low priority of the isr_thread, when the CPU load is high, the execution of sprd_i2c_isr_thread will be delayed. After the waiting time is exceeded, the I2C driver will perform operations such as disabling the I2C controller. Later, when sprd_i2c_isr_thread is called by the CPU, there will be kernel panic caused by illegal access to the IIC register. After pressure testing, we found that increasing the IIC waiting time to 10 seconds can avoid this problem. Fixes: 0b884fe71f9e ("i2c: sprd: use a specific timeout to avoid system hang up issue") Cc: # v5.11+ Signed-off-by: Huangzheng Lai --- drivers/i2c/busses/i2c-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c index b65729ba7d5a..dbdac89ad482 100644 --- a/drivers/i2c/busses/i2c-sprd.c +++ b/drivers/i2c/busses/i2c-sprd.c @@ -74,7 +74,7 @@ /* timeout (ms) for pm runtime autosuspend */ #define SPRD_I2C_PM_TIMEOUT 1000 /* timeout (ms) for transfer message */ -#define I2C_XFER_TIMEOUT 1000 +#define I2C_XFER_TIMEOUT 10000 /* dynamic modify clk_freq flag */ #define I2C_3M4_FLAG 0x0100 #define I2C_1M_FLAG 0x0080 -- 2.17.1