From patchwork Tue Nov 13 11:54:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10680369 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 9A1EB13BF for ; Tue, 13 Nov 2018 11:55:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 864AC29FE8 for ; Tue, 13 Nov 2018 11:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 793872A68C; Tue, 13 Nov 2018 11:55:19 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 163A229FE8 for ; Tue, 13 Nov 2018 11:55:18 +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=9QN3MSeVNKz4c8CqACKrLrYdO7QMH4IweK4NgbGU7AU=; b=QDW25eNTucComQ fJPRbJfLPggW9hO0M0GJjxdyQUztOgXz2nWIGInkgG8LtcH00WD3stIrbDvpAMsWWIUAylJ5m2Onr P+ApAG3HNNxZfwo5qYprmaQNONzr4V/pOWrYSSN/M4XZ7yWDnXcQow8JisazHMeAUeULr3yztOJdk 24Nt/LGg21ccS2kRf/vhsnSIw4ffyf/TNMvzawNxYJtho37UVINSsz+JDO6X90/L29Y7w9AIdoAFf S1OHzbIg30XZAafOL27e71UeN8AXthbszb94Ib3HrQY6Ok4/vqstYMDin8joSKMHMEsffhhMgfyit AlpMyRSVV4dt3IlcLaQw==; 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 1gMXHo-0001pP-78; Tue, 13 Nov 2018 11:55:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMXHm-0001pH-92 for linux-arm-kernel@bombadil.infradead.org; Tue, 13 Nov 2018 11:55:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bOFHv/3c0GNoHkJbBBBaRUpNSxnB5JpuxdTZIm5ceDA=; b=qab/ixaLFawjx6npFdZCi3u8Qr 4+L/oGe/yxFzKH0ZFlYannoFud3mqUzAB20v7biCKFuyMj6kMxeRPkn59jZRmle8NTnam+Pfbzaav 7KEiRRvqEAb1WF7xx7qtp4XB+S65zjgwm9uxv4gzgmPrJGQRlhMxFXDJSK8akQ4MrortLJAtzY342 +sS6rN8effN6WxqSc+RzzvHIDliM3AsFsfkNgmuc9mOvBaMiD+PeLMKc+AKDHGdGYtv2N8ZX7t4ss 2gi6AXAgI83jqYdeOgxPvWrI6P6aelDkf1m0NN8kPJ6nHiCzmag01Ep1lDmst+dZQdawhd42jarcX QnYDTCBg==; Received: from mail-lf1-f68.google.com ([209.85.167.68]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMXHi-0001WX-4Q for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2018 11:55:12 +0000 Received: by mail-lf1-f68.google.com with SMTP id l10so4982733lfh.9 for ; Tue, 13 Nov 2018 03:54:59 -0800 (PST) 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=bOFHv/3c0GNoHkJbBBBaRUpNSxnB5JpuxdTZIm5ceDA=; b=eSC2Sxn97nORqoUbhVlKBJcXWaKf9s3DqqUCRiJNZGG/cf+5Gzf5sC5qvQWcyEszzP VfsgLH0JKsRjP8BTLeg3ESfQ9JJp4oMKOxwIIKr0oxp3qah1smzMfQ7U4grWYi09rihH 9IpE6i8RttL8Ilu0VkXAnr3h7FKKIt6Yi8ludg9edDaJPo16xQy6NZh32wtpBbwo0WMh +lIXtqtiMsavwAEWEd5+92EsPBYvf60uqGZ+Ewn1hSrJq/R88VM0II09HdRLR+YOyWQ5 0sVvWkvPj/G5QzLSxhBRNFfZe78b6dkxtwI5i6eUBOYF5lzo/6h7pWBRdEheasowC8xs 1yeg== X-Gm-Message-State: AGRZ1gJvKsI5cOyz6wz4vNuOJZywBsLA8N2T1+OJabQdvqlbEPw9fUp/ hfLtCvoxBDQ9DH4nS0pdDe4= X-Google-Smtp-Source: AJdET5dYHSCeSosjptwTLJYJUE1VV1G3T4MwBaisndIsMJoRSWnO0igwRIYZzp0QFkMO+bEI5zJHOg== X-Received: by 2002:a19:2b54:: with SMTP id r81mr2928543lfr.34.1542110098569; Tue, 13 Nov 2018 03:54:58 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id q8-v6sm1943292lji.69.2018.11.13.03.54.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Nov 2018 03:54:57 -0800 (PST) Date: Tue, 13 Nov 2018 13:54:48 +0200 From: Matti Vaittinen To: mazziesaccount@gmail.com Subject: [PATCH v4 0/8] 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-20181113_115510_181509_9739D3E2 X-CRM114-Status: GOOD ( 22.67 ) 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-doc@vger.kernel.org, Michael Turquette , Daniel Kurtz , Sebastian Reichel , David Brown , Lee Jones , linux-clk@vger.kernel.org, Rob Herring , Jonathan Corbet , Andrey Smirnov , "Rafael J. Wysocki" , Russell King , Krzysztof Kozlowski , Chanwoo Choi , Andy Gross , Huang Shijie , Guenter Roeck , Bartlomiej Zolnierkiewicz , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stephen Boyd , Matti Vaittinen , linux-kernel@vger.kernel.org, Akshu Agrawal 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 Series add bd71837/bd71837 PMIC clock support + managed interfaces 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 =) Patch 8 adds support for clock gate in ROHM bd71837 and bd71847 PMICs. This change is included in the series because it depends on new managed interfaces introduced in this series. bd718x7 driver and devm interfaces are tested on BeagleBoneBlack and bd71837 break-out board. Clk area register interface of bd71847 is identical to bd71837. Changed drivers are: clk-max77686, clk-st, clk-hi655x, rk808, clk-twl6040 and apcs-msm8916. New driver is clk-bd718x7 This series has been discussed for a while now. For those who want to see whole discussion: The bd71837 driver was originally proposed here https://lore.kernel.org/lkml/d99c8762b0fbbcb18ec4f4d104191364c0ea798c.1528117485.git.matti.vaittinen@fi.rohmeurope.com/ clk portion was separated from that series and devm variants were proposed here https://lore.kernel.org/linux-clk/cover.1535630942.git.matti.vaittinen@fi.rohmeurope.com/ Cleanup to other drivers was initiated in this series while waiting for MFD portions of bd718x7 to be applied. And now when MFD dependencies are in-tree his version (4) combines bd718x7 driver back to this series. Changelog (for this series) v4 - Add support for ROHM bd718x7 PMIC clock gate. Included in this patch series because it depends on managed interfaces added in patch 1. Changelog (for this series) 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 (for this series) 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 (8): 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 clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock Documentation/driver-model/devres.txt | 3 + drivers/clk/Kconfig | 7 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-bd718x7.c | 131 ++++++++++++++++++++++++++++++++++ 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 ++ 14 files changed, 292 insertions(+), 76 deletions(-) create mode 100644 drivers/clk/clk-bd718x7.c