Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933275AbdC3Bqv (ORCPT ); Wed, 29 Mar 2017 21:46:51 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:49540 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752742AbdC3Bqs (ORCPT ); Wed, 29 Mar 2017 21:46:48 -0400 X-IronPort-AV: E=Sophos;i="5.36,244,1486393200"; d="scan'208";a="238174770" Authentication-Results: renesas.com; dkim=none (message not signed) header.d=none;renesas.com; dmarc=none action=none header.from=renesas.com; Message-ID: <87r31fee05.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Kuninori Morimoto CC: Stephen Boyd , Russell King , Linux-Renesas , Linux-ALSA , Linux-Kernel , Subject: Re: [alsa-devel] Question about of_clk_put ? In-Reply-To: <87wpb8ansx.wl%kuninori.morimoto.gx@renesas.com> References: <874m2jvtmw.wl%kuninori.morimoto.gx@renesas.com> <87wpb8ansx.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: Thu, 30 Mar 2017 01:46:42 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0110.jpnprd01.prod.outlook.com (10.174.152.156) To SG2PR06MB0821.apcprd06.prod.outlook.com (10.162.198.147) X-MS-Office365-Filtering-Correlation-Id: b666aa46-04ad-4a4d-c089-08d4770e9e5d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(201703131423075)(201703031133081);SRVR:SG2PR06MB0821; X-Microsoft-Exchange-Diagnostics: 1;SG2PR06MB0821;3:wU9PC/T0C54AzipTJ1okf2zoGeWWjuTbmVpMbsQvHwH0vyolwwcJ4PGwvZ2EM/4SZn+YWU4b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WnRTPQVnhY/KbhizcoN7LV5XWm/2PfVCh49gQ57fgQ8aPlqpg7GRSVLg+m8tHlj3Py5yZIiJdQ3nnHX5GnLOCuTOjaUk2TM1rKt0mDnLWCeLS4rHEUijMxenovW7wkZuCiEdvy60vkr4A3Eoz3NKuKDG5MMwh8FdTijeFN1aswETxM+T+i4SYZCV5N+DHjjN8cktQONdF4UWZt3hkcMpR8vXJENrQs4NeUr9eaqkrFerHD+Bx42ujyR9ML/DTvGnNFUmjHm3g1romzvw8Xf50jLkW8vP2n3Y+hyOYAJcCejZ/fvi0XNiXHwNOfkUvpkxsb8KU/uKXva2aLjrWnHFeXoCwbrO997HmRoZfnVQXaF318cUYxu+gEslXjNmI9s8ci2fvyPsB9hAbYoAZpnW35/Qez/6GtaXaWPbfHVuXNYfUTOc3W+2YUa6hnA3hK2AYWLHSimAgdCGtI/e8KWWC1p8wsk51D3BwON3HvD7aJpwDPxag/xMjaU1MJWqM1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(201703131423075)(201702281528075)(201703061421075)(201703061406075)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:SG2PR06MB0821;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0821; X-Microsoft-Exchange-Diagnostics: 1;SG2PR06MB0821;4:8pTJsDs/jI777w9duRKFH4+YPYWIIhhJnDP8unYUUkSERNxMPJKJNMrXYloQ0d1gMAcTSEGC2WgE6FOfspWDqKXnWrPxJ0XR8KP3ZdN0aZg9kxcI0QysMGb/az/zNuW4xrysKXmOB03W1E27OGMeSq2AxIiBScHDZKK1UCfqLGRnRRR/QRBCzcx60uUmKqcusgZ6+H94l/c1pp6ekTEJ16qR+8RtHaxCZOyELcR0BFUIokbPVEuztQNV1rgD/noMvwRIE23GqyajN8ctueBeWSeZqcHE+Ffoinhx5U8W1b6/LGbIX6gz05PACb2VrfwngjHEsdID1KRx+8Lgb9acrvO+alYHCgTvcbvzorEoeJQhjh18nU4yPQ6P7gQ8Ixf5EM26fQFRPc2wHFffGv39QFVsLP+gf1vPe/0UNoXA16jc0LtrT2WILNzC1/vGllp4ApReWUZCvhrn/oDyX/c7wa/5GM+CKTgcAx59gQ0RpkDKom3oxC8nB5+Ew9y5ekVNpKYjFrdjbm9swOp/MfGFs/oaNcQx0qGwAYV/iHZldd9yJlvQTaE89nDjDGBJKzGQFKWcP8aQPWxEtK8xfzHGcTr4QNEiEBpkp/jrtLrmsX9aL4AJaz2j/QcPLJLcYFg/Stzl8wLf6Q/l86phFFmNalJVkCzlm1GVMNuKKx8TrjNWUbWU/+TzAWr5CJE07bU/zC0uOKyiyPX22E/nmi2nLWdemnD4a+fjlaOiVxdyYGZYGmC2zDCXeQae/Xzrhugc X-Forefront-PRVS: 02622CEF0A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39840400002)(39410400002)(39450400003)(39400400002)(39850400002)(39860400002)(51234002)(7049001)(6486002)(6862004)(4326008)(305945005)(6306002)(54906002)(83506001)(189998001)(53936002)(50466002)(5660300001)(46406003)(25786009)(2950100002)(1720100001)(229853002)(6200100001)(42186005)(53416004)(6246003)(2906002)(33646002)(50986999)(76176999)(54356999)(86362001)(38730400002)(110136004)(47776003)(66066001)(966004)(3846002)(7736002)(8676002)(23726003)(81166006)(6116002)(36756003)(16060500001);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB0821;H:morimoto-PC.renesas.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SG2PR06MB0821;23:z1ex99BDms+MoCda83POUT3eLldwf5Eo1cUgCTBGE?= =?us-ascii?Q?t0/j1vEoeM2Jl6R2cUTsu99UehmiV39SJKg28HMB1lovcfpX2CKrxX0T0UVW?= =?us-ascii?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1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SG2PR06MB0821;7:5Zqq+1nX/QLx+irSAsJefAU7uJeKT2BAAJ3mAs1KA3Vg3q2EyZqBq0ixjoiEeD/SN0sfnyFOGt6KY7fi1IW5u4nzjOSF+BgXJ4ilJiFYVA+CSJl64GzHgsV366UuWz4BRLFjLJBj3Tq5BW4HF2i0O6c3B2RLHPDDd0uDWc1PZamPzVadmBCZFD+nUPXINokqATYbhagxIhDKW3lCennPKNY0PuApRaplNcHLA24nS1Nr8RhYx4dQ3ylkuCIqEWCJ7kiGB2e7izLW9nbOxrdIctaPi0Kd7M/n55S5waFURFvRKZsxZOwl6PR3cj2NzbAOjUdwxSTR9rP4Eupp3bbXyQ==;20:psnYkuVbkvCvb+MEmrhK7HSUjwZxChYNah/lcfjKuCa5WJ4VLKV+7LfpKXs9QAntRNR2we4EKhdA+EK1nOX5xgDhXm7rDbjL0eRWsbxK17jtFuG467iShODONyfDTAiy7b1VUkHShIspWcQXwQQ6539EKNdOwQtFt5k5O4uD2sw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 01:46:42.7497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0821 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2102 Lines: 47 Hi Sorry for my noise. I could solve my issue. > 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 > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel