From patchwork Mon Oct 21 12:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjian Song X-Patchwork-Id: 13844037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8017CD15D82 for ; Mon, 21 Oct 2024 12:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=oINRKQZNvFOYIJMSMWUZEIDIzq9b6A6ifP/Z4dH2tLY=; b=dnpPN/cLLeUw3vNZbxqRu0O+Ts EaT5/4xm++2X6DECjKmK6325KPoCPHuWo3Jy7m1rt3DTOGVXB9ydjwv/1XNjQttE3P/mi2FxhValK tutDzzfi5z1E7eZWaa2epPiF4g99VlS5o4WCzRkSc74NkN+5+ghW6OHdP8m1Vc7u5eAfvMW7tubbW VNrBN0cjgn0FT4MjilEx1QSZL8cTNVvjbDmAs8XrZpAjvZFMORc52Eorqn6QKXWPyLPAwt7Gaqj9C DbkJo8CYrvSB8CqiHrDuVSNGIzXYVFbg3mRNhRqpiOn9H1l4c7jThftyPlCY6gqHVikrwvgAiqIWl IMgWKMGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2rRn-00000007E0O-2I2J; Mon, 21 Oct 2024 12:23:43 +0000 Received: from mail-eastasiaazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c400::2] helo=HK3PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2rLd-00000007C9g-0PHr; Mon, 21 Oct 2024 12:17:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G6XlhWkN1G41vlyr7OZOJjxRTffrZruOeGvqDbMsiQuyngZoBSnidtbUA5knv1r+OqMjJucYTImsTtRVNdvEEMY9fEen6VvuXi5L1G+HrOlNJMo15yxNGsktRV0Y+u1YAHbEzUQbZxjgjI+Ni74RyfJ5/72YNqXynWTFrMMofUK17vaFCo0dNC6Ae0BbyZytMldBgiXHXMyTZ3q1uwt44Tuu1IGzQs8X6wTt2U3TZYGGVu/tghdDwC5Rfy0tS63KvqohAm/v/mMwQWTqeR/vb0zgM4AAluq9BgrBtu/V9JhCkM5b41BQULntZsARaKh82RshL23DAfEtCeDESqAAdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oINRKQZNvFOYIJMSMWUZEIDIzq9b6A6ifP/Z4dH2tLY=; b=HLkulrF+WfNgSNdsVZ70IIOZ5JjUCp/6SO2VwaGUY97z3lo4pw1zE0nKU/VPq8W+azTfS4syvQkZwAc9rhFzyEZz1E6uvzD0ix2b1w23oXPo6/JDn3NCw286YGDLNmygR2pGzuhT+xTtCgTReXfr5jGyGNwqhRN0q3gRT2l1adA5BuKxTh/vD5HtESYgGPNa0myqEcVZJ6ArlJ7MBog3XeZuHSTNP195dauZqO1Q10qh+9FCcVQNUxH1ZDcOJ38/Gmp3bRZw+Ei3dvqB7GZlVI3+EntIM9ztxje1aLNV5DTPzjFQUNasW17PHr3aBxvKvA+qkQnTr9UgdkaMLYOLeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fibocom.com; dmarc=pass action=none header.from=fibocom.com; dkim=pass header.d=fibocom.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fibocomcorp.onmicrosoft.com; s=selector1-fibocomcorp-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oINRKQZNvFOYIJMSMWUZEIDIzq9b6A6ifP/Z4dH2tLY=; b=WqxcV6Ly5OkH+arEDYddBkVIbZ7Coy1ucrJpc7Nd1hO7uThmjYuheJpwrm76SqJVBRYQRHKzinfvnblgNL0E/BTbyl1kxVoOnbEXyWJmf2yMbxnM9+elADUMyRnfDBXrGiIF5rTa++FNWD47JEl1xJ4R/THRBkiPZsiJD99qTMI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fibocom.com; Received: from TY0PR02MB5766.apcprd02.prod.outlook.com (2603:1096:400:1b5::6) by SG2PR02MB5604.apcprd02.prod.outlook.com (2603:1096:4:1cb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23; Mon, 21 Oct 2024 12:16:58 +0000 Received: from TY0PR02MB5766.apcprd02.prod.outlook.com ([fe80::f53d:47b:3b04:9a8b]) by TY0PR02MB5766.apcprd02.prod.outlook.com ([fe80::f53d:47b:3b04:9a8b%4]) with mapi id 15.20.8069.027; Mon, 21 Oct 2024 12:16:58 +0000 From: Jinjian Song To: chandrashekar.devegowda@intel.com, chiranjeevi.rapolu@linux.intel.com, haijun.liu@mediatek.com, m.chetan.kumar@linux.intel.com, ricardo.martinez@linux.intel.com, loic.poulain@linaro.org, ryazanov.s.a@gmail.com, johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, angelogioacchino.delregno@collabora.com, linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com, corbet@lwn.net, linux-mediatek@lists.infradead.org, helgaas@kernel.org, danielwinkler@google.com, korneld@google.com, Jinjian Song Subject: [net-next v1] net: wwan: t7xx: reset device if suspend fails Date: Mon, 21 Oct 2024 20:16:34 +0800 Message-Id: <20241021121634.16278-1-jinjian.song@fibocom.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR04CA0153.apcprd04.prod.outlook.com (2603:1096:4::15) To TY0PR02MB5766.apcprd02.prod.outlook.com (2603:1096:400:1b5::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY0PR02MB5766:EE_|SG2PR02MB5604:EE_ X-MS-Office365-Filtering-Correlation-Id: 850c40de-1cc0-4d9c-449e-08dcf1ca4237 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|7416014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: QhAeaMMMd/U2mkvJce/7RrvXLDlgEZt1vzttoxKGaaf07lnPHeA+FWaoLHvZtNlfgzh1BUSc2Ox/vUrilJ+/NrfMW9jNVwdGR/1HDRTSvHUz10Wja7tPd3kc6H4kfcdeZ/Yx4ZPhgqgw4Km+rWO/L8oyucY7d3AU6v6XDJZ8CO+dBaIvptpiHGXmer6cYx934FFEPUPbfGrJphFYgFJCi856uYqoLb9Bl79oQY7dcTUjcVQbjS8fp9EcJHOdguvbbmXv3YAk9v5O9IIW2/u3mFP9KHB6oWGeo3Al+AeOqtmranSAvTYbxSmE+gKJnMm+H129GJrNst4UXhUCTWnIrGSqox7qTIRS8iSLEKZAGCywr6uR07KldAEMpL+koU6lefacVo/O+NjaYWLXVIpmw5dz6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d02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(376014)(7416014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mJbSNJpciQrVN/J8mMoe0C9IUhBYAWLlhQ7Azqa/TVkFkMQuJ2pF3I+5YANEJNqIvCCfXsSPTmdrtzdslyGg0xdeZnmS5bNUzy0GC445tWiwhSEGsw80XXkgDhif31rD2gx9Rrz+jY02/UHmGRVd1bEiEVwSQoUH9Hm+WpqUIO3tqUDWyA09sm1l434sRbpDCV8qLTuJ+35r2u+/zNgVnxpaHlvWN9PAORBG6yuuyoUmQBrNMoQQ9V/m5A4FuAfawO31ix7MRGgSoXZd9dZCDbB4FO+gGsHC/JXDD9pEal18t9v3Y6LoIvLZDOXlcod5YeYmMPqi3a0xSkBvZpDg9o61vhiP+1Y02Ob9LljDGwTDY2gclTGfSZBfLQYaWTwY/DnPAEKc4MKoQ5fLnDYpw3zN+lnLFbO5YdUhtxzRkyeT06FSrk7ID+F7OsKzTa9c9ob1r98uheOl4kwqb7eqeve5w6SdTgT6FrCMBYnXBDoodyOzI2qGSvOKwYhDWROA4UjWCKYOdqWwPzUVrPJ4UDzu986s3Ch4F0FF2zBeuVsaxXuCvK03HPL2vIHoja/El09AYsu6Ppd28g3gpEEl4CYcvUBfAuz30pWNsw4PUH7D2qN6zrUDmU/5kp+tGx7rXmrP7tiYr9zfW08zlmN0KUUbEzhnLZkigte5kKDRC06/JZoVPxaJ1nQHn29Xzjez+z+LRU2N6Ja/KbqHwfqzzuddsgmp8HGdYoM/PyvXzwnRxWD0kpNi8b5z1UHWjdlce4LUdkrvAAy4MnthbicfIDweomASV0aflIZnPylr/V0YNEJJLNqwlBzutyosA6M/FMbEqbYjXNnh/uiexhw4/eKJZWGq1fE7EjC8E/v4tzPh0Vp5J5ONqrwRFP8gVrZcrgm/qTKPriE986xmBeTbjEG4D5zbuwz5ImdKlMZiSxyZtApNyn1dmxqZcWEUw6DCzad1qA5ya2KjrklF0awdxjuwUpZYxHee5q98BDety6CGFzKb9F0HnbJd7lcU8b7tfwNymzSEQDFwPqIvmdbF0iASxv2vLn8NDAzdo3qda4j2SmeHpRUaKthYfoNq3lnvEYF3hCJMq7RGQ7+2mfaZNL+H0vys3z5K0ltYeL1oHw5lrZn2bwQRU//qDbdm/iywUW8APk90God2Et6+WlA3a4qxzUh2smDjPAt56atido4sX4SJD5woj9TudsW75HUND9HHBO15SOXoYWibuZZ9hC3wBeugwimTN3cbYlEed8AeDe4vA5fvRHo/v9bC+nX6Q7AB3Be16LbgUbEQBgTO9FEyskpsr67AknmH1CtiuF3c6DvgXS5lEbjj0ID/Ftsqopny7pK/8t+BxDUsud1y5aJyZ4D6fMOJO8JiXXvuDtVuEk2bmy8jIzkN5C6ZjhmmlOYaC+YEiUMOxsKaOJOFIIDnA0xm+QE3C98dFRLv1q1SzG1bKTFA0Ssfy3ZnOeoMaknriUIXSHMc14htniKIoz2+4H9co71wKhechs66GGKjGEpDcZeouV2DB/cXpE+G7W+jZcYZ0xCRUcaa73veia+W9KwoR5VBVAXipqE35JC9q52/FQBaYPINzfDbGMiKDa9LYDveLAawCaiEfY5BpQ== X-OriginatorOrg: fibocom.com X-MS-Exchange-CrossTenant-Network-Message-Id: 850c40de-1cc0-4d9c-449e-08dcf1ca4237 X-MS-Exchange-CrossTenant-AuthSource: TY0PR02MB5766.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 12:16:58.1194 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 889bfe61-8c21-436b-bc07-3908050c8236 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U87Y1GRSOsJ+7MWekGlfR4C6GHUnf/NDSecp9MHrg4Y8/77vgMDOoU4FSxPRTuqQDifYxB+rOCt+z2HOY8/yVm/+eqOYwlnXvb7PjXUtPXk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR02MB5604 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_051721_185244_6C6066C0 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If driver fails to set the device to suspend, it means that the device is abnormal. In this case, reset the device to recover. Signed-off-by: Jinjian Song --- drivers/net/wwan/t7xx/t7xx_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wwan/t7xx/t7xx_pci.c b/drivers/net/wwan/t7xx/t7xx_pci.c index e556e5bd49ab..625f5679c3b0 100644 --- a/drivers/net/wwan/t7xx/t7xx_pci.c +++ b/drivers/net/wwan/t7xx/t7xx_pci.c @@ -427,6 +427,7 @@ static int __t7xx_pci_pm_suspend(struct pci_dev *pdev) iowrite32(T7XX_L1_BIT(0), IREG_BASE(t7xx_dev) + ENABLE_ASPM_LOWPWR); atomic_set(&t7xx_dev->md_pm_state, MTK_PM_RESUMED); t7xx_pcie_mac_set_int(t7xx_dev, SAP_RGU_INT); + t7xx_reset_device(t7xx_dev, PLDR); return ret; }