Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4433936rwb; Tue, 20 Sep 2022 14:00:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lJ+9WzZ3DSLTXz9vfn5PJJBVvECBzKQFbPeze9yP/qTu0a5EiCB6ogChrSFOpZ9b5PMKX X-Received: by 2002:a63:5f16:0:b0:439:41a8:ab4e with SMTP id t22-20020a635f16000000b0043941a8ab4emr22052703pgb.195.1663707607651; Tue, 20 Sep 2022 14:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663707607; cv=none; d=google.com; s=arc-20160816; b=VVBq3TCB0paUth0ECuOpvOlClBUtPaahqUtu7lmYzMyIsbQDsmDTJf2DovfuqdP1Yb wYo3E9Rg+5Oinea/36nCrcpyuhACkqH3Xnm1rdzsanGbmpzXkd17RL4ZwFUWV+s/Oh6n oFiNPV/GQUx+xt5GzpWl6EtmmVIXgX/R5yD7kZjdpjw//EmQgkMOlyOf/3GKm891n2aJ 2JCteCFSlcZjYwSD2lI2hNQTmSAWriXCvj2ZTqLw7wb0GitQUFp/kzCqFpRdqxkztafj xFLR9Rw6CC5iSe6rG7zAArKE2YyuHSDG/SZ7Q4IUAiyClWn4vMHUyuwoeLgfYPYklHbl g8nA== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=V/X2NQANvTDmkPd1F0YWtdFn++b8aCyFunzORsYrONQ=; b=oVqsvdcFHrfZjN/EDsUX8IOnTa3wxJZTyGK/ZHcfbhuiuAfR1Bk7Qc8Es6ULxrSD01 1kymJU+lTST/hvZOrUIlLEAm3GgaU4xuC8Us3qAOYGSICNGyiOnDDL2HRcxIDA6CDpkI y3JL8sCLPS/aEuOdIYn8asekdBLr1ofrFCay+Ae6/sqvlQWWMWro+NXDiucXFpdCCPAp 4aWj0UXYkyl5tFYTKFW5yZSTGUSpryS5EdCs+f7JC2Oa+qyYebmm0nZc0drLARfC5a1v zIPtsh/i7u/T8dVQiGiL3nCGdcg2EDtyyqEt2aUlCVHPJ2DF06C6CicTtkWWvgwEikGh D+MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=TCs7kqkP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3-20020a63eb03000000b0043a3851b2cbsi724555pgh.540.2022.09.20.13.59.56; Tue, 20 Sep 2022 14:00: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=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=TCs7kqkP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbiITUha (ORCPT + 99 others); Tue, 20 Sep 2022 16:37:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiITUh2 (ORCPT ); Tue, 20 Sep 2022 16:37:28 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFF216F27B for ; Tue, 20 Sep 2022 13:37:27 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d24so3593470pls.4 for ; Tue, 20 Sep 2022 13:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date; bh=V/X2NQANvTDmkPd1F0YWtdFn++b8aCyFunzORsYrONQ=; b=TCs7kqkPQVrLQkRrAFwXm+g+FHBRWFoV2esGT6hmslFrkA05qpUHyeFUnJDyZ8ulQr I4Amixm2yJcjeuv90ODZ6IhHDPAJzeuzYkzc7zYTE1QIa8e5V/hPHIDbS5i6nOokcfr9 cqTJAihIHVduLLHltI6VpNfxj96TgvybwBWvZKOaOI2jrMZv/U4vfBhHbr9MJYzXU839 AqHOKNc90ry76qNuFowv999TixYYFmsATpgrYh2jV9fnUMdfFMOFi9KIVFjtEUqSJu6V MHzBlJB1f8iy1JgS2kMS7JK8WNIjtV1p+dvq1Z9q5xm1OfbrSw73pE/m1TpFIxsclOpR oh1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date; bh=V/X2NQANvTDmkPd1F0YWtdFn++b8aCyFunzORsYrONQ=; b=7Ifl0OgBIVQzABKgnlMEmQnZdUZk/4Xn53Ug/1vfwjUH0sbpiEooAnV7zBp5YzhaJ5 ZmZPw3LxQzlevBEFpK9nPhDsIrV3Gljig9LGa59csBw0txBFFk0xjMG5vE3uycCU4+kN rIjo9hfT5tQwIfYqE3lhDDQeEt8Ai7sd8ikWXMNVMxQVQRltR4NI67gLmP9YmK7nia28 VY8XGIWVGboyRLSt94Uw4HFbDgyrQDsqfEfGYZcdarHbWvC6M3LyhDp69KXgxreFXzKy plBg/tpc8CVGTuovHbjhRqmf3LJgjKp1l3XPYU1pMGEyY3gjzcey4XdF4DxIcfBB+TzH RLeg== X-Gm-Message-State: ACrzQf12+CLgXURXmSbotebiTl5igEGQppNqxZ8jfvyLFFGN53BO3z5D mgvBzkrXbTFZ60+EODV1cbzmOQ== X-Received: by 2002:a17:90a:4f4f:b0:202:7ab1:46ec with SMTP id w15-20020a17090a4f4f00b002027ab146ecmr5857272pjl.32.1663706247087; Tue, 20 Sep 2022 13:37:27 -0700 (PDT) Received: from localhost (p57a238e9.dip0.t-ipconnect.de. [87.162.56.233]) by smtp.gmail.com with ESMTPSA id x68-20020a623147000000b0053b850b17c8sm319621pfx.152.2022.09.20.13.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 13:37:26 -0700 (PDT) Date: Tue, 20 Sep 2022 13:37:26 -0700 (PDT) X-Google-Original-Date: Tue, 20 Sep 2022 13:37:20 PDT (-0700) Subject: Re: [PATCH v2] serial: sifive: enable clocks for UART when probed In-Reply-To: <20220920160017.7315-1-olof@lixom.net> CC: Greg KH , jirislaby@kernel.org, linux-serial@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Olof Johansson , u.kleine-koenig@pengutronix.de, emil.renner.berthing@canonical.com, Paul Walmsley From: Palmer Dabbelt To: Olof Johansson Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Tue, 20 Sep 2022 09:00:18 PDT (-0700), Olof Johansson wrote: > When the PWM driver was changed to disable clocks if no PWMs are enabled, > it ended up also disabling the shared parent with the UART, since the > UART doesn't do any clock enablement on its own. > > To avoid these surprises, switch to clk_get_enabled(). > > Fixes: ace41d7564e655 ("pwm: sifive: Ensure the clk is enabled exactly once per running PWM") > Cc: Uwe Kleine-König > Cc: Emil Renner Berthing > Cc: Palmer Dabbelt > Cc: Paul Walmsley > Signed-off-by: Olof Johansson > > --- > > v2: Switch to devm_clk_enabled() per Uwe's suggestion. > > --- > drivers/tty/serial/sifive.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c > index 5c3a07546a58..4b1d4fe8458e 100644 > --- a/drivers/tty/serial/sifive.c > +++ b/drivers/tty/serial/sifive.c > @@ -945,7 +945,7 @@ static int sifive_serial_probe(struct platform_device *pdev) > return PTR_ERR(base); > } > > - clk = devm_clk_get(&pdev->dev, NULL); > + clk = devm_clk_get_enabled(&pdev->dev, NULL); > if (IS_ERR(clk)) { > dev_err(&pdev->dev, "unable to find controller clock\n"); > return PTR_ERR(clk); I have one of these lying around somewhere if you need someone to test it, but sounds like you had from the v1 email. Either way Acked-by: Palmer Dabbelt Reviewed-by: Palmer Dabbelt as this seems better than what was there. Thanks!