Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3969051ybz; Mon, 20 Apr 2020 12:55:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJrmzJcxquoyaIkzlIOyJktvSvDPR/B0PcGJkMiz+uTDncb8jiH2NcOmnKGweYAcT4m3wmp X-Received: by 2002:aa7:d783:: with SMTP id s3mr12439084edq.64.1587412531646; Mon, 20 Apr 2020 12:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587412531; cv=none; d=google.com; s=arc-20160816; b=ibQMQey4Kw7e3mLCuxyzwaA3ykazZFU6lX/UPPt+ZWlrkCqAKha+Ma6/twtWp5bWcc lqjCCI1Urzr8Iw9f5ZRy5Zx8lWq5zkn1y8BYPWhZfEWHCRh7KC7pZSvWq0uqB1PZkQr8 KOPzau7iCRuD2bSCIQER8Xpih4mL7vU846TQ1tG8lkLwDq2TOBLFSZRyb5glH1h0EBU5 kV3WrSD4mDRpW7u4hgQp6x3UYHWnLlRQJSnECh8bKas3z/zNTeMUKUunkMllJQCNOA3p dJqKt4bSFaR3YLPE8RZ+lMAVZrVDOON7vDoMBBa/uCmQOdI1JnvGhoXpTfRfMNXoNABE J0lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MaHgc2Ud4bcX42r63WlzgALU6hIPj1jDmiN3kFRyBlE=; b=0dr/t5X448rFi8w2k+CdH8PN/HJYoUYBh8rbBeqXQD58WAm0/L8mOCYq0WJ7+fXeZV W2A8oZskyM50kgzvXvojntxopudiITCR6N4/JGB/9ls5SmQ+vRabunjjjTXwEO20pltt 8gZxvzK6YYiY+Ezu0IEujUTPgp8PiR085VbFTyrnBG/xPq/QId4+07hnmrN9QbfxG0hd SbSVz/srDYUfzFeNv4eEi+ehgYoTmNxWX30hXmJfed6XbzD33wcANJpmGfO2sAb5Eq1d pugGntTM2v0kV8EnJE7tSmKtecE6q9fk+riNL6n6jhdh0uz3px11dR4sa1VNUmo9x83S GV9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SgiPSULi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si119049ejr.449.2020.04.20.12.55.08; Mon, 20 Apr 2020 12:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SgiPSULi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728132AbgDTTx0 (ORCPT + 99 others); Mon, 20 Apr 2020 15:53:26 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:16256 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728103AbgDTTxY (ORCPT ); Mon, 20 Apr 2020 15:53:24 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 20 Apr 2020 12:53:11 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 20 Apr 2020 12:53:24 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 20 Apr 2020 12:53:24 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 20 Apr 2020 19:53:23 +0000 Received: from [10.26.73.5] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 20 Apr 2020 19:53:21 +0000 Subject: Re: [PATCH v2 1/2] i2c: tegra: Better handle case where CPU0 is busy for a long time To: Dmitry Osipenko , Thierry Reding , Laxman Dewangan , "Wolfram Sang" CC: , , References: <20200324191217.1829-1-digetx@gmail.com> <20200324191217.1829-2-digetx@gmail.com> From: Jon Hunter Message-ID: <1e259e22-c300-663a-e537-18d854e0f478@nvidia.com> Date: Mon, 20 Apr 2020 20:53:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200324191217.1829-2-digetx@gmail.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1587412391; bh=MaHgc2Ud4bcX42r63WlzgALU6hIPj1jDmiN3kFRyBlE=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=SgiPSULiuZKZq5822JYASXn/xwkWCMj73Hyryd3GmcD5Dw9DAyaVmNchTNlSj5nMw lmxf/cjDYWHnI5JbDYq3uwMVkiV92UrD9Hyx9vaPIhCApPfkhfeQs34cXyniR1xS6y ChIveZNLCyju0EhBf5XMCn2c0E279EcSy+itG+x/Moqz3vvlMNxuhs5xmuZ0OSLseI rk4f5h4irdTlIEgLJJipT69v1s8qV0HaGrp/D7NMK9rIrcsmfjlyhsJSejjtSe+a9T lfUnfyNsuQ+oqwXJDkGhXRYQ/+Np4QdwHTuc5/kl6A/0LZ7QIylkY2VxU/QI7bUpgU MjW32gvYehw8Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On 24/03/2020 19:12, Dmitry Osipenko wrote: > Boot CPU0 always handle I2C interrupt and under some rare circumstances > (like running KASAN + NFS root) it may stuck in uninterruptible state for > a significant time. In this case we will get timeout if I2C transfer is > running on a sibling CPU, despite of IRQ being raised. In order to handle > this rare condition, the IRQ status needs to be checked after completion > timeout. > > Signed-off-by: Dmitry Osipenko > --- > drivers/i2c/busses/i2c-tegra.c | 27 +++++++++++++++------------ > 1 file changed, 15 insertions(+), 12 deletions(-) I have noticed a regression on tegra30-cardhu-a04 when testing system suspend. Git bisect is pointing to this commit and reverting it fixes the problem. In the below console log I2C fails to resume ... [ 40.888512] usb1_vbus: supplied by 5v0 [ 40.892408] vddio_sdmmc,avdd_vdac: supplied by 5v0 [ 40.897401] cam_1v8: disabling [ 40.900548] modem_3v3: disabling [ 40.903875] vdd_cam1_ldo: disabling [ 40.907501] vdd_cam2_ldo: disabling [ 40.911092] vdd_cam3_ldo: disabling [ 40.914714] vdd_fuse_3v3: disabling [ 40.918305] vddio_vid: disabling [ 40.921623] usb1_vbus: disabling [ 59.445032] PM: suspend entry (deep) [ 59.448852] Filesystems sync: 0.000 seconds [ 59.456161] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 59.457645] OOM killer disabled. [ 59.457649] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 59.764926] Disabling non-boot CPUs ... [ 59.769540] IRQ 18: no longer affine to CPU1 [ 59.789070] IRQ 19: no longer affine to CPU2 [ 59.808049] IRQ 20: no longer affine to CPU3 [ 59.827113] Entering suspend state LP1 [ 59.827163] Enabling non-boot CPUs ... [ 59.834797] CPU1 is up [ 59.840943] CPU2 is up [ 59.847378] CPU3 is up [ 59.850577] tegra-i2c 7000d000.i2c: runtime resume failed -13 [ 59.856432] tegra-i2c 7000d000.i2c: runtime resume failed -13 [ 59.862231] tegra-i2c 7000d000.i2c: runtime resume failed -13 [ 59.868070] vdd_pexa,vdd_pexb: is_enabled() failed: -13 [ 59.873334] tegra-i2c 7000d000.i2c: runtime resume failed -13 [ 59.879143] vdd_pexa,vdd_pexb: is_enabled() failed: -13 [ 59.884420] Failed to enable avdd-pex-pll: -13 [ 59.888877] Failed to enable avdd-plle: -13 [ 59.893061] Failed to enable avdd-pexb: -13 [ 59.897279] Failed to enable vdd-pexb: -13 [ 59.901383] tegra-pcie 3000.pcie: failed to enable regulators: -13 [ 60.434185] clk_plle_training: timeout waiting for PLLE [ 60.439565] tegra-pcie 3000.pcie: failed to enable CML clock: -16 [ 60.445700] ------------[ cut here ]------------ [ 60.450346] WARNING: CPU: 0 PID: 653 at /home/jonathanh/workdir/tegra/mlt-linux_next/kernel/drivers/regulator/core.c:2603 _regulator_disable+0xb8/0x1b4 [ 60.463959] unbalanced disables for vdd_pexa,vdd_pexb [ 60.469038] Modules linked in: [ 60.472107] CPU: 0 PID: 653 Comm: rtcwake Tainted: G W 5.7.0-rc2-next-20200420 #2 [ 60.480892] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) [ 60.487190] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 60.494951] [] (show_stack) from [] (dump_stack+0xc0/0xd4) [ 60.502189] [] (dump_stack) from [] (__warn+0xe0/0xf8) [ 60.509073] [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8) [ 60.516568] [] (warn_slowpath_fmt) from [] (_regulator_disable+0xb8/0x1b4) [ 60.525191] [] (_regulator_disable) from [] (regulator_disable+0x34/0xd0) [ 60.533729] [] (regulator_disable) from [] (regulator_bulk_disable+0x28/0xb4) [ 60.542619] [] (regulator_bulk_disable) from [] (tegra_pcie_pm_resume+0xbb0/0x107c) [ 60.552032] [] (tegra_pcie_pm_resume) from [] (dpm_run_callback+0x38/0x1d4) [ 60.560741] [] (dpm_run_callback) from [] (device_resume_noirq+0x110/0x248) [ 60.569451] [] (device_resume_noirq) from [] (dpm_resume_noirq+0x10c/0x36c) [ 60.578162] [] (dpm_resume_noirq) from [] (suspend_devices_and_enter+0x27c/0x9dc) [ 60.587393] [] (suspend_devices_and_enter) from [] (pm_suspend+0x308/0x370) [ 60.596110] [] (pm_suspend) from [] (state_store+0x6c/0xc8) [ 60.603440] [] (state_store) from [] (kernfs_fop_write+0xf8/0x210) [ 60.611379] [] (kernfs_fop_write) from [] (__vfs_write+0x2c/0x1c4) [ 60.619310] [] (__vfs_write) from [] (vfs_write+0xa4/0x188) [ 60.626632] [] (vfs_write) from [] (ksys_write+0xa4/0xd4) [ 60.633778] [] (ksys_write) from [] (ret_fast_syscall+0x0/0x54) [ 60.641437] Exception stack(0xeda91fa8 to 0xeda91ff0) [ 60.646497] 1fa0: 0000006c 00498438 00000004 00498438 00000004 00000000 [ 60.654683] 1fc0: 0000006c 00498438 00497228 00000004 00000004 00000004 0048478c 00497228 [ 60.662866] 1fe0: 00000004 be9029b8 b6ec8c0b b6e53206 [ 60.668007] ---[ end trace 5453317048e46ae9 ]--- [ 60.672632] Failed to disable vdd-pexb: -5 [ 60.676761] tegra-pcie 3000.pcie: tegra pcie power on fail: -16 [ 60.682694] PM: dpm_run_callback(): tegra_pcie_pm_resume+0x0/0x107c returns -16 [ 60.690035] PM: Device 3000.pcie failed to resume noirq: error -16 [ 60.696859] tegra-mc 7000f000.memory-controller: fdcdwr2: write @0x877e8400: EMEM address decode error (SMMU translation error [--S]) [ 60.708876] tegra-mc 7000f000.memory-controller: fdcdwr2: write @0x877e8400: Page fault (SMMU translation error [--S]) [ 61.278965] OOM killer enabled. [ 61.288563] Restarting tasks ... done. [ 61.300508] PM: suspend exit [ 63.124813] asix 1-1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1 [ 63.740705] PM: suspend entry (deep) [ 63.744593] Filesystems sync: 0.000 seconds [ 63.749600] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 63.751053] OOM killer disabled. [ 63.751057] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. Have you seen this? Cheers Jon -- nvpublic