From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCA68ECAAD3 for ; Mon, 19 Sep 2022 08:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229578AbiISIlc (ORCPT ); Mon, 19 Sep 2022 04:41:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiISIl1 (ORCPT ); Mon, 19 Sep 2022 04:41:27 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC2821E34; Mon, 19 Sep 2022 01:41:26 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9DB313200413; Mon, 19 Sep 2022 04:41:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 19 Sep 2022 04:41:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1663576883; x=1663663283; bh=uMIdq0TND+ kc29m5EHoDFRT0UopIzhGO4GH+pei3Ly0=; b=rGxG22Us/5Rkmr5lJiL6v7GWvk n3JmyY+YsMq2zuhlCtsVJF6hHd4dCPfWMK7nFupXTHr3xKar3ptzFEGP9cq0ntmV Tn/OicgfgulRY98szMeVAnDkqnLwevSjGSilVcjilJcpy31Kml+SU1Ia7t+5sUwv DMdHYO64DJ+XVegXQTCyIWC66rqq4ukYYiA0+fTIIFNK0JhM+AgFdksbxo2p886I +uAX1wkSOfWoDZ9+Imvrp/IDbstPqgWJfxfFeI74bnBUxnARNfm4QPeWYws2UiIc G8CDRYt1kSr7Jw3ruuU1rwDW4hFKEOTv6fpap2aFWr2f/5+mbevkQtajEeaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663576883; x=1663663283; bh=uMIdq0TND+kc29m5EHoDFRT0UopI zhGO4GH+pei3Ly0=; b=pknDFZPFFp6q2/ECHNDPrW8xFM1dCZSPmDIaE5mClqI4 p5oAw4RCl2rlb+YpOYIKo4Z+ieUuc2xm1Ock8qEhvLCg4SZgBtd8NnjIBsU85rya VLxQNpHsm4l4C8EWj4vWcg2v6/bua1J6mKyln6bleb5DifNEOeXafix1uqMTHJ7w q0t0Ddmib1dCkBfH85KT2/UoodmsiaFI9+U2YcYeXg49NcSClZYykOIuZMD5M5Br FFFVZGAeof9UQXZ0PJGvebwrfHyX0twYoXDtNwbL3m70lXd7q0/ClVqM+TTvuEuN 79dF3hLw+5gW+Hkgch68aFMPOtReQzYWzacj6N1pDQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvjedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehttd ortddttddvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhm qeenucggtffrrghtthgvrhhnpeejhfelffejkeejheetgfeigeekueeuuddvveekjeekue eggfdvhfefteelgefgvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Sep 2022 04:41:22 -0400 (EDT) Date: Mon, 19 Sep 2022 10:41:50 +0200 From: Greg KH To: Li Zhong Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, jirislaby@kernel.org, bcm-kernel-feedback-list@broadcom.com, alcooperx@gmail.com Subject: Re: [PATCH v1] drivers/tty/serial/8250: check the return value of clk_set_rate() Message-ID: References: <20220919081523.1579904-1-floridsleeves@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220919081523.1579904-1-floridsleeves@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Mon, Sep 19, 2022 at 01:15:23AM -0700, Li Zhong wrote: > Check the return of clk_set_rate() which could fail if there is error > setting the rate. > > Signed-off-by: Li Zhong > --- > drivers/tty/serial/8250/8250_bcm7271.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c > index 8efdc271eb75..9014853d6e35 100644 > --- a/drivers/tty/serial/8250/8250_bcm7271.c > +++ b/drivers/tty/serial/8250/8250_bcm7271.c > @@ -671,7 +671,9 @@ static void init_real_clk_rates(struct device *dev, struct brcmuart_priv *priv) > priv->real_rates[x] = clk_get_rate(priv->baud_mux_clk); > } > } > - clk_set_rate(priv->baud_mux_clk, priv->default_mux_rate); > + rc = clk_set_rate(priv->baud_mux_clk, priv->default_mux_rate); > + if (rc) > + dev_err(dev, "Error restoring default BAUD MUX clock\n"); What does this actually help with? Shouldn't you recover properly from an error instead of telling the user something bad went wrong and nothing can be done? This is not a correct fix at all, sorry. thanks, greg k-h