Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932759AbdC2BQZ (ORCPT ); Tue, 28 Mar 2017 21:16:25 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:56244 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932571AbdC2BQW (ORCPT ); Tue, 28 Mar 2017 21:16:22 -0400 X-IronPort-AV: E=Sophos;i="5.36,239,1486393200"; d="scan'208";a="238898426" Authentication-Results: codeaurora.org; dkim=none (message not signed) header.d=none;codeaurora.org; dmarc=none action=none header.from=renesas.com; Message-ID: <87wpb8ansx.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Stephen Boyd , Russell King CC: Linux-Kernel , Linux-ALSA , , Linux-Renesas Subject: Question about of_clk_put ? In-Reply-To: <874m2jvtmw.wl%kuninori.morimoto.gx@renesas.com> References: <874m2jvtmw.wl%kuninori.morimoto.gx@renesas.com> User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Wed, 29 Mar 2017 01:16:15 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0121.jpnprd01.prod.outlook.com (10.174.152.15) To TY1PR06MB0831.apcprd06.prod.outlook.com (10.163.245.25) X-MS-Office365-Filtering-Correlation-Id: f17b6cf3-dfab-4ed4-155d-08d476413257 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423069)(201703031133075);SRVR:TY1PR06MB0831; X-Microsoft-Exchange-Diagnostics: 1;TY1PR06MB0831;3:K7SX2dyROXWXeocy7JgZb/HcRtlxy62rbtf+9qga/NGwaNud+/OSIvPgZ+8i9RQsatD/l0E3qcZz2q7QqFM7tCxy7rc3vBM1jznPMNAkAupy3UTpCA2ElRD8iBW/g+J5I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L4lV7VDNGC8k+2gLH0zGCk3JmxPvebbQdrc+FWHDzKh3HcPZzxQPVN6/dI9Kq0DQHiE5JWmHTVm385C+wqc3Dis+xpyz2Si11Z1DCbJ+PowXj6Y04m+YW4t7Iah0Q3rEvlIArioZXsvH/VuhqvqRYUOnwra4+Is3Vo4OHylXLxBQtfK8nVgyCeM1qBgbT9XqLMr5+GztHVuWJUDoVfpAYyUDzUzclVuOp+UiPNr0bVXba+x9dN7W9EWUPshtLrfs1wxGUpkl/3kGpbiBeqGU9KXzAgjOCrpz+zJulSl2ZqVjgu/qmcibeWS1y4iS0bCPbRs+CBbs0BVEK8ouaJ6X3BtW4FeUHMKsobyI12KPChxYS3jX48KiO6T6SZEE8mib3MDDlghIFTOsoSXRSEEqxQhEh3X+XUSS+uRj82Z3+78Jwd7ij4kRWvf+L+4xC7d4iPAcYAWtYpKr5XGUTdH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040443)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123558025)(20161123562025)(201703131423068)(201702281528068)(201703061421068)(201703061406068)(6072148);SRVR:TY1PR06MB0831;BCL:0;PCL:0;RULEID:;SRVR:TY1PR06MB0831; X-Microsoft-Exchange-Diagnostics: 1;TY1PR06MB0831;4:lHdtvErGV6Z6pHf31nF+8CgJz9XZY0TJNrEq85JI/QExF7MyXOn/WKeb1suRDfP85x6/uRw0lvwQGcAMEE52dRM4xriyTUMx8Ze4vq/0jDlCULYBL6jBBMEoDk0nMjAqJ3Wm6DCgIbkwsIC+wcE525fznNEtrM9bPLqCdSIFzvvpGLF57u/iRPDKo0F+4oQ9W5Pauk4KZvlYOEyFhkk0f1lDDUo7Bxe0uwWfTfNidmqO3CwvHQUYW7T/S08qMUFiDR9Zjg1dVy4GLo8oVJ9scCzb71HYXL4WrXhO6vKg4ykWRug8qKOYh4XIUHAhiw1qYcDBWEWOI2n1JWZBr6yrmtxxtzeuM0rvHAS8Qb9X4Cj6B9M/yDS/T+LXtFLx7yaehVX7KsSju/nPHEfSF/Wp08N3wGrZZ61ldaYe8Z66P31lirQXeMvbglB2058riAuZdDN7+9XgXQTXWoQv9kB0k1a4HcXFW0F3KpkmPIqZ04UIRHm9IaEySEmHGwanghPFy/n4+JckugB8X+V9tJ8vvKR0rY2b7Lad+c8DIMtZXan/4MmRu7Lwmg55c0EYjcnpXWalqliSLcZ9M2YQ0wvsmd6u9jg7oWxPVnYc/wCMgMccPHAZTI2xah8EVZ3lGHWmbNQor6JC/0beROWOXBv8UyIbcddJ2L56P2GQAggsyA4Cck/7EqHawxbTtCgHOQ5m4TTUF/w2Eb+7/AP80SHB8YnGhzjNhM6COCJUBEoiOgiYKeFjDz7UKFyIuBiXrDt9 X-Forefront-PRVS: 0261CCEEDF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39450400003)(39410400002)(39400400002)(39840400002)(39850400002)(39860400002)(51234002)(4326008)(5660300001)(54906002)(2906002)(83506001)(38730400002)(53416004)(2950100002)(53936002)(7116003)(25786009)(50466002)(189998001)(46406003)(42186005)(6486002)(4001350100001)(6116002)(305945005)(7736002)(47776003)(3846002)(36756003)(33646002)(54356999)(86362001)(76176999)(66066001)(8676002)(23726003)(50986999)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:TY1PR06MB0831;H:morimoto-PC.renesas.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;TY1PR06MB0831;23:az1/qTrzedeuxGTKCXy9xI8ioc0XOnBRLUsLDpmM+?= =?us-ascii?Q?Xe+4l61Hg1LazoS0pP4KytmbWdme4Jw5gR+ghHilKyEvtWDOlTOpU1NX9MMi?= =?us-ascii?Q?2KF0Dlq4qgvgjDktdy2LizZM0rxaEUGxvvIE7TRgoOeYoXH4oSAww0JF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wh1ao/L3dNoZB1ldVito845dnX6aPsbTROivcy?= =?us-ascii?Q?ZKhQoE=3D?= X-Microsoft-Exchange-Diagnostics: 1;TY1PR06MB0831;6:HV3aLwGaeuDE4D5xbIJqfkml3Y1aJnYB0PfurHEQ2HVlhACX5UQEePHiRqmOl/Rgv2GPeCaCbxp0GkkQTVlvf3zpxqP5Dj55LrWhe+NHt3O1xyPvcUAvNedCyCpn+sT9YboUfRAXZnLXUz6i1i3V9Y1FIbS0EASWh707uZELS8bX650Xmm59hkTepWCY1VHTa58XWseezvFipXbiVzSlGPwxv2KGSBQQlOTHp4JeE0Q8avG/2/756YJ/VP1bzFVqs/PsvswIrmJSEMJFCUm8p9HAjR5nOooLTvXQxbWcbXXQcis0h3L1vIs/gHtXTWJoOO4TDCBruR11a6T5qQ0NpNmwlrlfqnHxsnnFOwvRzWwQrtLNlrxAumM6nNwH2PE5N1e3eXk3Z9JYOlmzo4xmXw==;5:g9xcC7P2ZhzcfDZM1YqdtiEaRixb4tKWQU8SWKtRPcPCl0jfphT8qxZfXGyXp1vv09S+vOacNVDj2vqdJlZmYCJ8zVhDGARd1564okZ21YUrztIfREvchSQguD0g1+gH6eB03R8Gbx+w2SxdqQR1GQ==;24:7adRG1UZN/HF/TVMUcpsrkDbDqjiAUIRFD2XdBRbL4TaLVljMsPn06z4lKbHGaNzi+vdXq2wm7fCD75hA/x+1rzHqtehK3h5CYyYvhEwyW0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;TY1PR06MB0831;7:SybeUM0xhrncLVLXeMyWG/HGH4dmz0PjW4zxplHCDdibqANaUfXT4uXtx+9qhvnSQJlJ2zSfn1UbSMOcjpZevGzzmc6+ulR5+2YL215jVDnagA4ejp+rSJlveM35tpa9GYzP0VOEdcrMKlTYsBaVljvUnzYuv9JdXz2wvWkOc4BcjNLehQy0rrTnyW3FugJAIqp+LBInHz9FPKz/zujBOLBYmkklWAS5ApxaRSJb5XIFFeff5Io56Qmdaegtys01KmzJfALs+DeOWhaJLcfOVHlO+XapJDuk6/W/YMcAmEnpQ6AY6XpOdWNyTnPTF8INfYwIh3nZkTgcl0vKfNu3NQ==;20:NgURnlqtrYZroURdHzq/qjuTHKMFtwf1RmoZg3Vq4rPFCooZpqGGeHxXVFOnm5PxATup7yXEKFPHUa3aeSKRU2gNIaYRS2im9izjXhw2DMS4NVi5iKfK7/UB2J7bu6afKM9W5w1erC2PIlJRY1orq2Fu7itWlU1u3smEoRw1zq8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2017 01:16:15.3140 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR06MB0831 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1823 Lines: 40 Hi Stephen Now, I'm using devm_get_clk_from_child() (= linux/drivers/clk/clk-devres.c) and I got Oops if I do bind/unbind driver several times. [ 32.008847] Unable to handle kernel paging request at virtual address d503201faa1e03e0 [ 32.017124] pgd = ffff8006f9060000 [ 32.020883] [d503201faa1e03e0] *pgd=0000000000000000 [ 32.026243] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 32.032198] CPU: 0 PID: 934 Comm: kworker/0:2 Not tainted 4.11.0-rc3+ #1259 [ 32.039573] Hardware name: Renesas Salvator-X board based on r8a7795 (DT) [ 32.046814] Workqueue: events deferred_probe_work_func [ 32.052405] task: ffff8006fad2d800 task.stack: ffff8006f90b8000 [ 32.058809] PC is at __of_clk_get_from_provider+0x174/0x1b0 [ 32.064878] LR is at __of_clk_get_from_provider+0x164/0x1b0 .... [ 32.746677] [] __of_clk_get_from_provider+0x174/0x1b0 [ 32.754131] [] __of_clk_get_by_name+0x104/0x140 [ 32.761058] [] of_clk_get_by_name+0x30/0x50 [ 32.767630] [] devm_get_clk_from_child+0x54/0xb0 ... I tried to find the criminal point, but, I couldn't specify where it is. Sometimes it is NULL pointer access crashed, sometimes it is crashed on of_clk_src_onecell_get(), sometimes there is no Oops. I want to solve this issue, but I want to know about of_clk_put as 1st step. In devm_clk_get() case, it is using clk_get() <-> clk_put() pair, this is OK. In devm_get_clk_from_child() case, it is using of_clk_get_by_name() (= __of_clk_get()) <-> clk_put() pair. If my understand was correct, __of_clk_get() uses __clk_create_clk(), so, its pair should be __clk_free_clk() ? I wonder I can find of_clk_get(), but couldn't find of_clk_put(). Is using of_clk_get() <-> clk_put() OK ? Best regards --- Kuninori Morimoto