Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4150154rwb; Tue, 20 Sep 2022 09:28:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TcZPK1TcJiVY/kLUEBDSdvRi6gcK2rWREOM5uTEyt1dnC1W6yZUC9GQcM5b7srQS+qH9q X-Received: by 2002:a17:907:2bcf:b0:772:4b8e:6b29 with SMTP id gv15-20020a1709072bcf00b007724b8e6b29mr17377901ejc.412.1663691332456; Tue, 20 Sep 2022 09:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663691332; cv=none; d=google.com; s=arc-20160816; b=NAnoqzdzqXBcvE3TvOLlv18iQDKSIMtNdSWuAUcSsOGW2mNYg5PgnEZ9MxNE4WdduI mI8mWQP0vxaimL3FhDSe/BCw+0uYppQpdMnXSC9sxxDq2cl1wsWx89koV7cxaXwFVC24 t5kMrOdBfkcwPljv1/GqYabynDcdei9+U5023wqoIAy/J64vD8YxkZnaxGlX8/DKEV0l ZXvdxFJqbX4gUd3dXYSb8Hq4fRvLyMhsGCjS7X5By4vJtG5BMcmUUyQKI9tHipC7Ro+r xJHZHDJUzXcyHE0NvMMcnxQCvrhj1qUXbQeRt0TRC6Xm7VdEM1LGLjlAQ7JAmrDsNxJB kP3A== 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:date:subject:cc:to:from:dkim-signature; bh=/XA5rkoouGgX9DCK7SjCAV6orQoM99AmvM4Gl/XVcZc=; b=og83QUvmZna04dH6zhpzAuX04g/OFAi2bl4s6lU0BaI+CJ/C6EVi8gwTR9trBPb5yc HC/+ffvJWHbo31tZGYu9Ht95NTgUvLnNKUvwfv8hnL0Slyb47aySJpz5JN81Bdnoiyy0 tOdw4le1jqAhLWxgAqCAqKsF3UEGLHl50GGwgYcq2pWXjZMN7hz+XoozFU6PwPkqb1r9 L8OjSKM5dRbZNRtCTJsTQT5sVUMF26vgFlPEbLREWYwIknjiCZIi2zrYz3/KF2zSXLC1 HFGgBiqYuTwoAN0IGdSnuJcW5gx3zhEb5AOOXTidMmoX1wdH3ekQ285Nk2Iilsi/Ri9w iFFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20210112.gappssmtp.com header.s=20210112 header.b=UbdCnls3; 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 b5-20020a056402084500b0043d00293d23si214765edz.391.2022.09.20.09.28.26; Tue, 20 Sep 2022 09:28:52 -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=@lixom-net.20210112.gappssmtp.com header.s=20210112 header.b=UbdCnls3; 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 S231584AbiITQBG (ORCPT + 99 others); Tue, 20 Sep 2022 12:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231431AbiITQAz (ORCPT ); Tue, 20 Sep 2022 12:00:55 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FE695A803 for ; Tue, 20 Sep 2022 09:00:51 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id e68so3186465pfe.1 for ; Tue, 20 Sep 2022 09:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=/XA5rkoouGgX9DCK7SjCAV6orQoM99AmvM4Gl/XVcZc=; b=UbdCnls33atG4xWvWkmByU/a6tf+VDySm1kndblgUXjNNzsdPPmowbUFA11ocrRWSh BDGKgRXo1Tyg27YE89N4hwD27d5JT7U64+hgjWoag4+AgFhsV8J3naLUCmgu8SJ5HTEc ZNgYAhlLVTYexBs5rA9it8sXkQvHoKzIjWUWCk+UIDWupY8B6v/xyp95mmGvWHh3IseX l8AQ7TDBzS8r0EQfO7RWzP0BLAbLPjoyKs50cCbjv8zaumDgF35xr35MisOarryf1kg3 Y0RCKoGEmn3ig3ip85mGIeU4uswZ86MQG886MXYoldVfo3qKXUAR6fXVQj71ExGqEptp BcCA== 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:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=/XA5rkoouGgX9DCK7SjCAV6orQoM99AmvM4Gl/XVcZc=; b=K2d1ApO2dx1xZLOwcYcW0TfwW5+pmprstfRmFCJSZTHSF0zChRRH5A4+i4nqF7e1xr wqnnPu2DF7Ad7SUAcKi/7LM/4m50jSedo6LMryP0GjytdjftWuHtPiOnK/EeY+TaPkhz NjJRL39nNAvW0uY3LJNZG6OV8YBW5D5TXovMhjQlRsT8QzK09DGVgx+/Pyu9u070UC/Z 8z+TSb48hiQihqgdsTTTUSl9qBiXmH61mYBaI5wX4wC49tnBdsXtLtdWP+oCbhZXjMuQ E2Ek9YtNV4yGGGOQBco/oovroVrIvJzrgJkO3PtkIxREvFG+YEcIrhbBHywnlNDkpW9e GVNA== X-Gm-Message-State: ACrzQf3wfrygxA1LEIdP4yOrjjU6h/1kknuBuxHu1+vqJfktm/BU3ikC lX8sHOfEgCf0ZA4BOzWtHvw2AQ== X-Received: by 2002:a63:b4a:0:b0:438:c97c:994d with SMTP id a10-20020a630b4a000000b00438c97c994dmr21373081pgl.597.1663689650624; Tue, 20 Sep 2022 09:00:50 -0700 (PDT) Received: from lx2k.lixom.net (99-152-116-91.lightspeed.sntcca.sbcglobal.net. [99.152.116.91]) by smtp.gmail.com with ESMTPSA id bf10-20020a170902b90a00b0017849a2b56asm89488plb.46.2022.09.20.09.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 09:00:48 -0700 (PDT) From: Olof Johansson To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Olof Johansson , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Emil Renner Berthing , Palmer Dabbelt , Paul Walmsley Subject: [PATCH v2] serial: sifive: enable clocks for UART when probed Date: Tue, 20 Sep 2022 09:00:18 -0700 Message-Id: <20220920160017.7315-1-olof@lixom.net> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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_NONE 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 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); -- 2.30.2