From patchwork Mon Jul 29 20:18:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13745679 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2069.outbound.protection.outlook.com [40.107.105.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDF94189F2B; Mon, 29 Jul 2024 20:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722284347; cv=fail; b=NkRqhSb4BLiVH1GRt/dMt8NuH9xqzxMstNkZVRa+XqPQ72vXvq51ELaYZCVBTu0y32jtkOBEp6IZck8OuSndQJDiSaZLff+JYnjbH2Y39MuPI6y6ViMiZRh2uVmV5gx2ht7ZBNhBisybDUnTZFSl/LbX6RtWsbuLhKeFHp+oQHU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722284347; c=relaxed/simple; bh=YJ3hjZthXXzphaK3hv8FaNx6snvHLN1pAh0ZRKuyMgY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=e1BTjebrxRYA8YAjGJ2s9aK1O3KppZkxNQXrZiIk+1Nl52eV6xtq8/UqI9tX2Q+s8tAQxFPr4HLEwBctXoKBveSmgKwq03M2c+ijGgSy3jnJrpqgjwwil3ackLsRzUOPy4YsnnJY7DFMzk8GKqWPctE8/8j1eIPJv0oW1cEMBBU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=GYLbNRhv; arc=fail smtp.client-ip=40.107.105.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="GYLbNRhv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lTigqMGE2kJKAZ2EDGZnIcgCC8pOdeejKS5mr/DVDnAOJsT19rCsvK5fTvzxAYRjwNUdEeP3HVWQwiTTuaroRns0P4jff7UIupZdP4iBwhUklRdSj5VqtRDgVvU89YE6ME1rrsVRUpp+Z2QjFns3Xcyu2qJwM6ShNKSei//sIjyhxgoeJAGIhRO48lHM/9oCM0TmyzW+NQCy/sXxX5pvOBJedWyK42tjFx3afaAacl4QmI5zjCIM7awyu/Ya479I82F9+feIueCCQuXZ7iz+yEvWzhlBrjiB20aZdXdxjubgc29ij4SQ+wV5zJQim2LX9uVo+7T5JZfWc4Csu6mRpA== 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=F/ED5YZ2FyvpBvvH5Xw7f4z7V/rcD3E2Y6xkiZJeXxg=; b=lY2CN+T2kknzAMnC4BBet42lL/LZcK0w1lKHyzN8d4jWhtqoX+y8PcG8bGMEdgRwzegmknyqfizZtULHjzKG6X+wlTAHxGBAWQn6KQ7dEtgOGJQJops0fVgZSpVejxcML2BJ6p5MBZMIxxZsjal6lUlQprUVdulrAQXiG8X2M9eRlYmRLCDPzMVyIwgny1McSHo8a05gHhoUvFcaOTPX3fGoK1q2ZmnjszgLSycgxbGi80KZBEow+gCzOySX+yenQcxUT6cLpzH6zw8eu07XjFbGB7dTv/yQp77vvSPLUfUnS1HDcGwiEXVYMpeZIVIWW+UNZ3JwEkFuMVOiKWVGjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F/ED5YZ2FyvpBvvH5Xw7f4z7V/rcD3E2Y6xkiZJeXxg=; b=GYLbNRhvIUfDH9vcyzzuT1Uwcw2jyqXRRL08PHsQsWVnH4XEjELDon0HndSeJaTL1rW9Zyxaro6MCB9F57HU3xBL/qfG/kcCZ4sQcGS42b/e/Uz8og4ttrN+r2PPWBCnDYU3S6G7AxOnpCkT9So2HsgoyqrhCe/5CUAoTR3lfScHoLiTZwX350JbVBCAL3bh+nblFIg3+Iy+66bNlVT9pCEei5jWK/j3e7G6btupkpU18ALy9Wytn6zb7A7009Y8BlLCLv+HzUKACnh9M3z9YX+K1xiHh13rsrEPCXD+S2yk9P2/oT5ta2qPBZzdkjsS8xB/FNaxI9X1lSuttMVTBQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by DBAPR04MB7382.eurprd04.prod.outlook.com (2603:10a6:10:1ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Mon, 29 Jul 2024 20:19:01 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.7807.026; Mon, 29 Jul 2024 20:19:00 +0000 From: Frank Li Date: Mon, 29 Jul 2024 16:18:10 -0400 Subject: [PATCH v8 03/11] PCI: imx6: Fix missing call to phy_power_off() in error handling Message-Id: <20240729-pci2_upstream-v8-3-b68ee5ef2b4d@nxp.com> References: <20240729-pci2_upstream-v8-0-b68ee5ef2b4d@nxp.com> In-Reply-To: <20240729-pci2_upstream-v8-0-b68ee5ef2b4d@nxp.com> To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1722284317; l=1233; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=YJ3hjZthXXzphaK3hv8FaNx6snvHLN1pAh0ZRKuyMgY=; b=McwapCnzcWGzLgj5Jo+5YVQ87aDIGv5Xv81/R+RT9HUykd0aR7XfeS2pm+/JR92l0g7J5y+jb CTKd58TtbD0Cr9MMJsrdTZ6PXgb8DFMzEVhb4WxJs62ox596YOHOMH/ X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0069.namprd03.prod.outlook.com (2603:10b6:a03:331::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DBAPR04MB7382:EE_ X-MS-Office365-Filtering-Correlation-Id: 3434539e-b732-4c7c-aead-08dcb00baf03 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|52116014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Vkc8pM9Z2OUx+lMl7VsAZRCQ7+vaemL?= =?utf-8?q?XbPuJJqKLayBTt0hl7eZsg57BfwITE040rKxZjPe+f2Hzd6NLeu9nDlInnGUFGKdq?= =?utf-8?q?Qkdjesi3Ce4nP72eLGYoo7pakFoF89u7G6VBQRGqBJ1w/oK7NB3qPfBfa6xW/yvtd?= =?utf-8?q?RJOGIQv1rUQGMTH0YzkIJimOrs4XpgRcNdE4b39kIQdMTikTUKm8zHinhKQdRqKLu?= =?utf-8?q?PbOZJEwXmheXL7McdOuGRSqWFL2veIV7IuGN1EVORqe5yyZuZuZaHatYmXrjWCcfP?= =?utf-8?q?j3kkupnCjDQrAz37GI9wvkd9dyoVNzwqcixPgLzqVaqgasCSbRnsZj0t3Yl/snOcp?= =?utf-8?q?JX/R1fC/bwedPMV7VbNsTn9UWn8/pfLK+cQwjfc7BYfEu6EHl73sV/kLyna1yGvty?= =?utf-8?q?TYg0HagtwMfzrzFOWaGtufV/bXnNGgslHDzieZ2mF7YECzJp1CKnJM+ZWtzuve48M?= =?utf-8?q?/ZnSr6kYjTqIYxmnPpk4+rYQm103p+SuRRQ0NPEMJ8lVvnmLYq9ZYWL8PhYRT89Ia?= =?utf-8?q?GZOqhpRME+YiK2Utox9NW5ciw3tkchcpyPn9KfPJib5Aky/BQJeZ4ZCKNQbkmGtwX?= =?utf-8?q?392JgLdSD2+EcHUdpDGJJumyCAn6Mw5UecqknUumApASHm8p4lc1/1r61h2FSj6gx?= =?utf-8?q?iLS3ooBXu5+2RofJHPCS+txoUdO7t5BC6DyfAu8hxyqtp5zQytzXMO0L6XiBt/M1f?= =?utf-8?q?ZFpDTdqFxHS2S0N3JppFAIDv1rM9Np7Vck1u5ZwLRbXOHOngaPNxPwjEO4KXkDEt1?= =?utf-8?q?gXix+x4MHIQl0gpcIkOy9Uqt/sy9VKzEJVBKdSyCbKo1kZngthcXgXumQ2UOmho5O?= =?utf-8?q?Af8RbhhQmlsZroa8/hXaYcEdyvKnqvanqVtnLFenEYL8kuDM3iRiaT3F1eXcaznae?= =?utf-8?q?lP9DsNZLE9bwOHP/jFeM2WSa0pdYNBSZqNI2+0t3STh+Zt252s8pLUbsB2Cs9mTTQ?= =?utf-8?q?RRKGDPkhUc3wW6ChRevhKG+De798R6jt2OhX3wEiJKC59VSJTlNAGZnpeLKX523WD?= =?utf-8?q?yohx4DXO8lCv6MPX3NU1jkTzMKP+wAZXOddUcX65885v7m02VMLoCfv1twZhyYr8K?= =?utf-8?q?WppYToPYDPIjW0AcgsWZYQRGGD7gxIXx5OJRDKyC/QJnSyAGTvC5qrTlZweetECcv?= =?utf-8?q?v1pK1H9NWifZIp0PbEMxLMO5dcJFX+lDcNcHWtnMxWXaNYxGorhmpJjnp7RdSND4A?= =?utf-8?q?Ds1dnfKdm8nhEIUEJl1Wr/cWdUUSLCmA1GUclsuxtCo8iuOaN0HqmRyOxuVTtBz7a?= =?utf-8?q?7q8qZnri9WAUQRoWzEuxfMAV8qPksz91WmkapZgp+r8oBzKryGXmmgjuSt4PB8Yv1?= =?utf-8?q?884MrdIeZSQVXIhu7F8BU8t5kEi5ggwzOs5QZ6512kADQk7IU7p5pjs=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(52116014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lGH7fe/i3dHjQ+3xRm25INFZgG3D?= =?utf-8?q?RTTKWnG3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6eI44eZO8cbBqr1i53c9MmOGsijdicIzQ/TSPWDvCGuUwFjxFU4N?= =?utf-8?q?Zqw2NkNZ0FAILKU82/jDrTVJhlWOhiwajpeT2Jzwn8T8411hHWF2efdaGgZB0ACi7?= =?utf-8?q?SvI9dZUGmN9hhIY+UZ5wwrhzAYeAVUOjeFc9PkYNMqauUG5LC/ciReDZlN2uKcXF0?= =?utf-8?q?JM0zTIPbIlrPOGfnZZxV0+lWw30eMd+jwbOeQ3LtvSiw7VYZkyydCGAessSG1wR5a?= =?utf-8?q?zlxsiRB1O1+8kZXqbekpBmf1yV6dsNuMC/y6cmjeu6U2e0oABdmDYt6dKvyN5KwaE?= =?utf-8?q?a1jGSXsVBJh/R07dNUbhuuSgVNkVViyQZfFfk4Aczd33mq6m40YdSe3FtYRF+Jrai?= =?utf-8?q?ELT9JC54Yi3vedMLszjxrYInCxl08G4bTKw3EgJhTcNK7oq8ppBKiPpCj6x07yuZ6?= =?utf-8?q?AcWhArsiv+gu39Ejwu0I7+5tST2Z3i0VrxK5uLhB3oQg7IfzN1WIc7R3+XdknTHqY?= =?utf-8?q?oRavBygdSkUyuOHclCbRwb+DZL0/MOcP2iCXcMGVOkuo4c8MSzZhrj258H1Tnom5L?= =?utf-8?q?TfTSfyEIrF0OOh/AkoyOa/XciPG5NuOKNLjJj/0paYlfkEbBl+Er5P2YDbf0OnCww?= =?utf-8?q?7Ia/Ga3cADrq?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3434539e-b732-4c7c-aead-08dcb00baf03 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2024 20:19:00.7840 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E7lrulLe2I3WDatlV3ppcpSpUHxcEiV0np9iMSSJZ1NtHuqlmPPtWh0gKa5dpQvPp7dWszZ2jwd7+dYsjmqbHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7382 Fix missing call to phy_power_off() in the error path of imx6_pcie_host_init(). Remove unnecessary check for imx6_pcie->phy as the PHY API already handles NULL pointers. Fixes: cbcf8722b523 ("phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on()") Signed-off-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-imx6.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 3b739aa7c5166..eaec471c46234 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -953,7 +953,7 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) ret = phy_power_on(imx6_pcie->phy); if (ret) { dev_err(dev, "waiting for PHY ready timeout!\n"); - goto err_phy_off; + goto err_phy_exit; } } @@ -968,8 +968,9 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp) return 0; err_phy_off: - if (imx6_pcie->phy) - phy_exit(imx6_pcie->phy); + phy_power_off(imx6_pcie->phy); +err_phy_exit: + phy_exit(imx6_pcie->phy); err_clk_disable: imx6_pcie_clk_disable(imx6_pcie); err_reg_disable: