From patchwork Fri Nov 2 12:34:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FA8717D5 for ; Fri, 2 Nov 2018 12:35:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85C7C2B39F for ; Fri, 2 Nov 2018 12:35:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B142B3A0; Fri, 2 Nov 2018 12:35:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 824942B3AA for ; Fri, 2 Nov 2018 12:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=V5OE1OEUCUjrhIbGa3wGLcg1jro4HJzvtN6fHtOLsVo=; b=B+n+vKXE6VjzR5 0wIH2KXTjoPdxnzjaFuWVCRVD3no/G/RoybBJlFJZTilr6vO+rBjvUekvRyw9SLkE0MfYoPkB02Jz coGY3Ddrh2COjV86g45KfKPs5WawudUVJStD2v85SdKwsg+hjIcwUzcnx8otDv0P8wJRF7vqeYP1+ q3ntMbbdy2ZoBrNEUJUrDeQVAFmzbG6dzqVs31C2JRTSPZycYEsVLqmDUsGQAAIkEPWUOS1f2VBBp vOaDlJTcVneK8RKAfaXfQ+Y+3dJgusns/gv0ketZr1OSzF+DoBBSUn8RGdZFTGcA4JQz3L989757h gmtyIYRC0qO8RTNAMlIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYfC-0006S5-8v; Fri, 02 Nov 2018 12:34:58 +0000 Received: from mail-lf1-f66.google.com ([209.85.167.66]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYf8-0006Qy-L1 for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:34:56 +0000 Received: by mail-lf1-f66.google.com with SMTP id n3-v6so1210403lfe.7 for ; Fri, 02 Nov 2018 05:34:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ynh9STkpWY6Mq3ED/crgVidCuu+blQH1TC7rguiYoAw=; b=FlE8VxB4R6jS5NYwhFziVgSXqnCGP8O22QH86R5HTQrig85e63+0ALGGG0olrL+JJM ER6sG2/edMwa1rllzd8/+GBfB+m5eOTDqRsSgq7jGSMdhZ/qcpzpImtpe+XvBxCA633k 97Bt8S1sWO6LZo0vNqM+OQl4I4ZlWI9QDjwSPzfTU3fPrdkh80X6EVWn8hmLp/1tPXaT j3EgyUO5u9P2WW0PKpz34f8vBHXP1azdzlANi31BJUJhR0STybTTusH6N8EfenWYCo2E rYi6Wd5EKcyF4FWDVtP9Ji8NZ8Dlqz4/H3MM3V85/YUB+5RdH1tnbPmiVJ6gfRBakM7A ABdA== X-Gm-Message-State: AGRZ1gL5OzNBxOjRWaemcAJgf1wIBzsj3eSWKY8ou3ryEI0BskEni6EB GNRYra3sF1iogyFGyEelWzI= X-Google-Smtp-Source: AJdET5f9eDJeDHvBGgPTNqx5dPEm1OHTqF6IqxDGufbMtYIkmC2Cx5TIIn4eWgy61qnow99/n33R1g== X-Received: by 2002:a19:ae03:: with SMTP id f3mr958335lfc.86.1541162080611; Fri, 02 Nov 2018 05:34:40 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id q5-v6sm5306022ljh.60.2018.11.02.05.34.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:34:39 -0700 (PDT) Date: Fri, 2 Nov 2018 14:34:26 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 0/7] clk: clkdev: managed clk lookup and provider registrations Message-ID: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053454_688576_9E447422 X-CRM114-Status: GOOD ( 16.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Patch series adding managed clkdev and of_provider registrations Few clk drivers appear to be leaking clkdev lookup registrations at driver remove. The patch series adds devm versions of lookup registrations and cleans up few drivers. Driver clean-up patches have not been tested as I lack the HW. All testing and comments if driver/device removal is even possible for changed drivers is highly appreciated. If removal is not possible I will gladly drop the patches from series - although leaking lookups may serve as bad example for new developers =) Changed drivers are: clk-max77686, clk-st, clk-hi655x, rk808, clk-twl6040 and apcs-msm8916. New devm registration variants have been tested on BeagleBoneBlack using ROHM BD71837 PMIC driver. Same devm variants were earlier proposed together with BD71837/BD71847 PMIC clk driver in this series: https://lore.kernel.org/linux-clk/cover.1535630942.git.matti.vaittinen@fi.rohmeurope.com/ The BD71837/BD71847 work is currently pending for related MFD commits to get merged in clk-tree and the devm functions are now submitted in this series. Changelog v3 Address issues spotted by Krzysztof Kozlowski - Drop patch 3 for clk-s3c2410-dclk as this device can never be removed - Fix indentiation for clk-max77686 - Rest of the patches are unchanged. Changelog v2 Issue spotted by 0-Day test suite - Add a stub function 'devm_of_clk_add_parent_hw_provider' for no OF config. - patches 2-8 are unchanged. This patch series is based on clk-next --- Matti Vaittinen (7): clk: clkdev/of_clk - add managed lookup and provider registrations clk: clk-max77686: Clean clkdev lookup leak and use devm clk: clk-st: avoid clkdev lookup leak at remove clk: clk-hi655x: Free of_provider at remove clk: rk808: use managed version of of_provider registration clk: clk-twl6040: Free of_provider at remove clk: apcs-msm8916: simplify probe cleanup by using devm Documentation/driver-model/devres.txt | 3 + drivers/clk/clk-hi655x.c | 4 +- drivers/clk/clk-max77686.c | 29 ++------ drivers/clk/clk-rk808.c | 15 +---- drivers/clk/clk-twl6040.c | 5 +- drivers/clk/clk.c | 28 ++++++-- drivers/clk/clkdev.c | 122 ++++++++++++++++++++++++++-------- drivers/clk/qcom/apcs-msm8916.c | 5 +- drivers/clk/x86/clk-st.c | 3 +- include/linux/clk-provider.h | 11 +++ include/linux/clkdev.h | 4 ++ 11 files changed, 153 insertions(+), 76 deletions(-)