Received: by 10.223.185.116 with SMTP id b49csp6686303wrg; Wed, 28 Feb 2018 13:42:52 -0800 (PST) X-Google-Smtp-Source: AG47ELs3xe8yJCccjmXdrclWbhxHZMreGtc6GMj0HPR2CmGNC890QEmeuDKuyBZyifxwP+J6PPDP X-Received: by 2002:a17:902:20eb:: with SMTP id v40-v6mr3817170plg.360.1519854172863; Wed, 28 Feb 2018 13:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519854172; cv=none; d=google.com; s=arc-20160816; b=kHdd7H5hew21Xx0bKbDjEwfbZBezt3ttUWEGkUEc0R4pLITjbxH+gFwmy37+z+5f0B oLPqhvMVDMvg31q3XbQmke5QiJH2Ei4yZM77r1cORAp8PXETrK/djvFzfNrJkjRq8Qks JZh5MaAhv3j0T8K0b1tJKe238r1jUrHPq6N/brBbxZb8jAtDgA48tDXcAgn6zIuB2b++ WSKoIAsieaUyJrt1WTS1Zxqk9R7hDzjvR/Ftf6wGS4Q3CMb6BBAw1fswTOsEiliOg3Mh elaN7kfnDM42KMUWFT5LFAUYm8aRQsUQE3mzazGGpgNZu/v7CnHk9NGPp3dk/sCV2Vv0 ZRDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=SNggVZp5z0D65D7IuBGGqti9VRPWIItxMD5LU97Yq0U=; b=hDHQ+LY+ld3E2FZdca7we13/4HLN5tq3b9Nc8tTn9yKpAONlt5YJvtmzMjTT5nctnf artsK3YtAj0rphLwnIHamHnhMa9s6BEhKzqOzRRPz6I+w7X6Ru8Mxc0h1NwGVrEHiaX9 5X0fSHEf39Q40IYBKlg5gD8kOoCpusfrdN5O3fd4F+/hPa8fA8MVQQ4SMfS+gHnQ9Hyc Gjt/miYcsv83E3MgLPC9wYVly3sy1e7WB0JjIt1cy0by12vcc7J1YEb1gi/c5HyxWjhn 1zMQ3KoD7TSoqa9dhmY3JIo3FteXP6dNBZmtbzi88Jbkut+rYD9Z9r+Ghlu6FszZcK6h UvLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=MnXCIrOE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si1840813pfu.71.2018.02.28.13.42.38; Wed, 28 Feb 2018 13:42:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=MnXCIrOE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935172AbeB1VkZ (ORCPT + 99 others); Wed, 28 Feb 2018 16:40:25 -0500 Received: from vern.gendns.com ([206.190.152.46]:50059 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932597AbeB1VkW (ORCPT ); Wed, 28 Feb 2018 16:40:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SNggVZp5z0D65D7IuBGGqti9VRPWIItxMD5LU97Yq0U=; b=MnXCIrOEkn3xnKvLj4LJnxXMsb 0looDSp0gnsjdvH8u194ysomQfxw8lHTmsOnMQHWJee475pjrp6zu9BvfutpLEH1HBBfnQlfCwyuL mp/WSI7GJ0BvPyxFnlWlP5ttBT0H4SolkN52nNxB/dlHf3d9jkxrkt7qHdAZMIgYyXl8yDFRUgjsh nHK7Tcj8IgmmjEGNakbYWF3/OW7SQrIvyr3nreJoBIXZxAFYH+WzqN/t57tpMc90BC0VZmz7prEev N6r1GukOO5BZ2VyfMpvkPSj4h4L/0ARIwfb/4OKi34wj0vVvNiN9gtL5d2xi/Opc2BMUHvwadYuX3 LH+g8RTA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:45342 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1er9R0-001KjR-E0; Wed, 28 Feb 2018 16:38:46 -0500 Subject: Re: [PATCH v7 10/42] clk: davinci: New driver for davinci PSC clocks To: Bartosz Golaszewski Cc: linux-clk@vger.kernel.org, linux-devicetree , arm-soc , Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Sekhar Nori , Kevin Hilman , Adam Ford , LKML References: <1519071723-31790-1-git-send-email-david@lechnology.com> <1519071723-31790-11-git-send-email-david@lechnology.com> From: David Lechner Message-ID: <93696fc8-bb93-aa20-3506-3d7216c17cd2@lechnology.com> Date: Wed, 28 Feb 2018 15:40:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/28/2018 06:38 AM, Bartosz Golaszewski wrote: > > I think I found the reason for the strange crashes we were > experiencing (emac core->name being NULL) thanks to Sekhar who pointed > me in the right direction. > > The mdio driver fails to probe with v7 due to the supplied clock rate > being wrong. Before failing we register the emac clock with > pm_clk_add_clk(). When clock_ops puts the clock, it decreases the > reference count of the clock, but we never actually increased it in > the first place in the line above. The core clock code then destroys > the associated clk_core structure. When the next user comes around (in > our case the clk debug functions) the system crashes. > > I believe there to be two issues: one is with v7 - we need to increase > the clock reference count in davinci_psc_genpd_attach_dev(). > > Second is the error path in the clock framework - we should remove the > destroyed clk_core from the debug list, which is not being done now. > > Why we even need to track the refcount of clk_core is a mistery for me > though. Stephen, Mike? > > Best regards, > Bartosz Golaszewski Great find. I figured it had to be something like this, but I wasn't able to reproduce the problem yet. I suppose it is time to spin up a v8 with some fixes.