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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F8FDC433E0 for ; Mon, 21 Dec 2020 09:17:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E02E22CA1 for ; Mon, 21 Dec 2020 09:17:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E02E22CA1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1OXbZFQIhOjELIiBwijutyluIIvFoLI3nqWauve8diw=; b=fZf70SbD6ezMgX8saU4Dncqwy FrtuI3AnBgzK17V9FRjSe+wcso7cdp9NsYEmjchH8ns3Sw5Poers5XeUF5NpFmtZXsDAmyDL2VGnD XOp6YVFPkiKo8tBkQmqPcdBAKtjtsCIC9TiBGiFxFQB0XfY8KlqXF44zL/Jb+COPQoVjk5954Ctcb UpXVU6/3e1odvMOgwvLuHZ0SwaCqXKr/uxnoyibFSxyx5uvc0NasaT3+hYTgFD8semi3/lKGcRrdF g+hjGixkwiMu6Zjl/OHNM7eH+BdXTt0gf8WFxup8MRLKYUlGDS/otO1wVPQVQrL21JoMO8JOJi6jP NGAeuizQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHIq-0004Al-DQ; Mon, 21 Dec 2020 09:16:28 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krHIn-0004A8-S4 for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 09:16:26 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1krHIi-0007qT-1O; Mon, 21 Dec 2020 10:16:20 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1krHIh-0007fN-31; Mon, 21 Dec 2020 10:16:19 +0100 Date: Mon, 21 Dec 2020 10:16:18 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Simon South Subject: Re: [PATCH v2 0/3] pwm: rockchip: Eliminate potential race condition when probing Message-ID: <20201221091618.oxjpmlnmo5iaobt7@pengutronix.de> References: MIME-Version: 1.0 In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_041626_078945_F82E9DCA X-CRM114-Status: GOOD ( 19.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, heiko@sntech.de, bbrezillon@kernel.org, linux-rockchip@lists.infradead.org, thierry.reding@gmail.com, tpiepho@gmail.com, lee.jones@linaro.org, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============2512897879548182435==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2512897879548182435== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eeksxyzczcgmi3o7" Content-Disposition: inline --eeksxyzczcgmi3o7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Simon, On Sat, Dec 19, 2020 at 03:44:07PM -0500, Simon South wrote: > This patch series aims to eliminate the race condition Trent Piepho > identified[0] in the Rockchip PWM driver's rockchip_pwm_probe() > function, by moving code that disables a PWM device's signal clock > ahead of the code that registers the device via pwmchip_add(). >=20 > It additionally >=20 > - Fixes a potential kernel hang introduced by my earlier commit > 457f74abbed0 ("pwm: rockchip: Keep enabled PWMs running while > probing") by ensuring a device's APB clock is enabled before its > registers are accessed, and >=20 > - Tries to improve the driver by (re-)enabling the signal clock of > only PWM devices that appear to have been started already by the > bootloader, rather than enabling every device's signal clock and > selectively disabling it later. >=20 > I've tested these changes on my (RK3399-based) Pinebook Pro with its > screen backlight enabled by U-Boot and they appear to work fine. >=20 > I'd be grateful for help with testing on other devices, particularly > those with SoCs like the RK3328 that use separate bus and signal > clocks for their PWM devices. (My ROCK64 uses its PWM-output pins for > other purposes and wasn't of help here.) While looking through your I found another little problem that you might want to address: rockchip_pwm_get_state() calls clk_get_rate(pc->clk). According to the documentation (in include/linux/clk.h) this is only valid for enabled clocks but there are no precautions that pc->clk is enabled. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --eeksxyzczcgmi3o7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl/gZ+AACgkQwfwUeK3K 7AlBSwgAi/BqGwU/XSxPIDslGkhzhyao4Lwb9+ApXPmCwjizBPznMsBo8AuBODp3 qPZWN4S8C1RgBOGthjLjEaELaEqYh/IajguDC1OKV82zb59ySexhWQmdRiLzv5cz FYDsmYOOM7bzZJ227cjjsbJJzW3uKukIOl9E3NRlEgpcTUKCX+gc2GuuiewVOU4V Cflcdh1Vwt3puLDz8Lb2XBSIrhoV6f1r+ZP4qFuNU0DgICGueFKIST2ijpMHxQHU Px/Q34UUSW3qB/n02kphI8nZjvND9gVM2b8JQ0qVcXnQiBV0fv9EyIwFAOz3ulzb DU7qQrJDGXndMbVRuQPF0NtWWr1wIQ== =j9Pi -----END PGP SIGNATURE----- --eeksxyzczcgmi3o7-- --===============2512897879548182435== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2512897879548182435==--