Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3017467rwb; Mon, 15 Aug 2022 16:14:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR6+G5RqkQXGTQCi556/iGd5S0KOVpwgRm+OTsLkAgWoW8+EE9b4DO078TRfQi0/aJQzS0lS X-Received: by 2002:a05:6402:304c:b0:440:d482:2fa6 with SMTP id bs12-20020a056402304c00b00440d4822fa6mr16760642edb.344.1660605247321; Mon, 15 Aug 2022 16:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605247; cv=none; d=google.com; s=arc-20160816; b=OBeuBnXcQD83mIZ35o2TrBUeLOAAwBwdYMmyz6E3OiyxXPt3ok4b5US9SWobnKSwqh GVgu8U7ha0oN7tFGuWBV8D4mOclLUftXzXhcCwrC22qNgG2d0Pgxv2S3xo+hgOztEZPI yDcCJAoT5Sgep2UfX7UeUn1+gwo2mZn9yiACBIFpUvoTSQcGlvPkGgE5N1ORX+mwpo/0 a99OTHvmOSs+e0Jm7IV4lqgR1UJgxx+1spHcQoWRUcKEd5h0dPcV2bPXiREAFaJhrFxG grPv4e5N1CD0xBGmOsgFbAlrExJvf5qFOw2jKFTIw3HLKNPVWPffTXkn3mdMMLOJtPKh MKRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L2HxWa8n3iSFI3hcVgopTE+3kRA+HWjzc8ZuRUAusxA=; b=WgRayHLVarR1TDBqbHz80Zf+Q9nOQDXhtbbNnpyJlAYtqDcftlrO2YBBwi4IDH12Fz lPmadGBmdBLENJzwYCxBq/XLuIfjCYewf971NVLQaGr+zIYzkLjlafWqj2sFpRevWM2O dJo84AAcNg/BGAkuhT3MAMaxGzlRjQUs0xtRo+LTXP5xqC4n9xhx2z+exqxiepAjPG5X rYCClA5inWDOVsoqlvKjE7Xbw4TD6Y+Z9XxrKFieuzAByAREf2QStMMSkTFSd2pOsse3 q+yrObnB9Bs8pAA/2I+TYlZXcoZh46cAfp8PC4St1i+r0mHajSWl7shKDVC03d12yXK6 XkRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BThENeyX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a056402440900b0043d0b0de3f3si9870298eda.532.2022.08.15.16.13.41; Mon, 15 Aug 2022 16:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BThENeyX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343685AbiHOWM1 (ORCPT + 99 others); Mon, 15 Aug 2022 18:12:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244075AbiHOWKL (ORCPT ); Mon, 15 Aug 2022 18:10:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 005EB118DDC; Mon, 15 Aug 2022 12:38:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A185260BC2; Mon, 15 Aug 2022 19:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94CFCC433C1; Mon, 15 Aug 2022 19:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592285; bh=BWdZqPLDXsnad35DrHwcE33hAm8J1xbYtk0RGyawOr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BThENeyXsNigqO2x4HQ7fWfRyukkcDN3hrM9lCZlASxQ62IV1Ylqohws9WV87M9Q2 PxGZX3kN2TBG0DHPs8hEPl3YHdNZNPE1xavE2gxd8gbhEI3nfiNIZcrYipMDU+7eAv KVfJhfM11rloJnlSGcqg1gdAR+kRe9wrEu12RnFw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabrice Gasnier , Vinod Koul , Sasha Levin Subject: [PATCH 5.18 0760/1095] phy: stm32: fix error return in stm32_usbphyc_phy_init Date: Mon, 15 Aug 2022 20:02:39 +0200 Message-Id: <20220815180500.716285659@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabrice Gasnier [ Upstream commit 32b378a9179ae4db61cfc5d502717214e6cd1e1c ] Error code is overridden, in case the PLL doesn't lock. So, the USB initialization can continue. This leads to a platform freeze. This can be avoided by returning proper error code to avoid USB probe freezing the platform. It also displays proper errors in log. Fixes: 5b1af71280ab ("phy: stm32: rework PLL Lock detection") Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220713133953.595134-1-fabrice.gasnier@foss.st.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/st/phy-stm32-usbphyc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c index 007a23c78d56..a98c911cc37a 100644 --- a/drivers/phy/st/phy-stm32-usbphyc.c +++ b/drivers/phy/st/phy-stm32-usbphyc.c @@ -358,7 +358,9 @@ static int stm32_usbphyc_phy_init(struct phy *phy) return 0; pll_disable: - return stm32_usbphyc_pll_disable(usbphyc); + stm32_usbphyc_pll_disable(usbphyc); + + return ret; } static int stm32_usbphyc_phy_exit(struct phy *phy) -- 2.35.1