Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2241873rdb; Thu, 21 Sep 2023 12:34:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1Q2BoFg1P7z0RJglSNuycbPqkpZ+eAFru08Dxc5rsMVXPNKOmTIyZ+pN+gpKLVFOZxjNY X-Received: by 2002:a05:6870:a54d:b0:1d6:c780:8b59 with SMTP id p13-20020a056870a54d00b001d6c7808b59mr7461351oal.53.1695324851741; Thu, 21 Sep 2023 12:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695324851; cv=none; d=google.com; s=arc-20160816; b=RMUjo7VmjuejHV8uB8pb8yCK+0eKLGkytq5a90X8Wv0G+EZsNRSgBKP9d0n4ml4VkR 4m2s0l3B0ZAeLnoig26BZ07zUPanEjgO1d8XsuFLL2SF1HgKHd4HNs8aJerOoPGxW30v BdhGQah+vgVw9YYldR5re0XkeQM4ZknND6HU/SezdPMn35unqN1yyAm5CSsL/7K1Indz iKmMDWX4K2I6V4de4PPsR3D6yVwEmKhZUJiTFlwCqO5OMwwGRJX/KruhgguXxeN/dX+0 BZJZzgcAud1xR2CacdfmjM8ch16nN5/8Zi/JlX9YBxnwedrBSD56XijLbYVY/VBUr/U+ hw8Q== 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=Eg0gMp/0FvzbsVVXeBicuxvLKWclTV33sRPzJKUOCx5n2f2/yXC02FeMEmMb+SZ42j sg93yI2TSIut09pWRSk0DWEM/hdKCb6nXI6C250IohHQfEbprjlrz7TuplCMDi7oXEL2 3hDlEH2Nz9+/ISv0esW+lThuWu9lwIAl3Gc3bF/1yNiAGUbuIB0erkoULh3hevpwrLNN wuMXsbyw/WlKh94onFyGk9mf0kqxFkIOBVMS2Bsdk0lw1XGFzA2PhPVSHcLFFOIPUAL0 HrDn2of398xQhvZyviH40zHNJ40sCkx6pIL7scj2yGD2mydRw1C6PWNHNSo8xXBwN3bl INhg== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id k63-20020a638442000000b00578e7a37c46si2094467pgd.50.2023.09.21.12.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 12:34:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 965BF8028262; Thu, 21 Sep 2023 12:31:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbjIUTbQ (ORCPT + 99 others); Thu, 21 Sep 2023 15:31:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbjIUTaR (ORCPT ); Thu, 21 Sep 2023 15:30:17 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DACE257B02; Thu, 21 Sep 2023 10:18:47 -0700 (PDT) Received: from SHSQR01.spreadtrum.com (localhost [127.0.0.2] (may be forged)) by SHSQR01.spreadtrum.com with ESMTP id 38L8vR5h048606; Thu, 21 Sep 2023 16:57:27 +0800 (+08) (envelope-from Huangzheng.Lai@unisoc.com) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 38L8tXmD040792; Thu, 21 Sep 2023 16:55: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 4Rrq0F2frGz2SZykd; Thu, 21 Sep 2023 16:52:13 +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; Thu, 21 Sep 2023 16:55:32 +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: Thu, 21 Sep 2023 16:54:56 +0800 Message-ID: <20230921085457.32446-7-Huangzheng.Lai@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230921085457.32446-1-Huangzheng.Lai@unisoc.com> References: <20230921085457.32446-1-Huangzheng.Lai@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx04.spreadtrum.com (10.0.1.214) X-MAIL: SHSQR01.spreadtrum.com 38L8tXmD040792 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 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, 21 Sep 2023 12:31:40 -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