Received: by 10.223.185.116 with SMTP id b49csp7646859wrg; Thu, 1 Mar 2018 08:45:29 -0800 (PST) X-Google-Smtp-Source: AG47ELuEjiyAl75Q0Uv2hMB4RwUR3KswD4oISCnqd9gNzhPzlr+mkGmHnDvI+AOTzeW5gLRc4j2J X-Received: by 2002:a17:902:968b:: with SMTP id n11-v6mr2488528plp.168.1519922729130; Thu, 01 Mar 2018 08:45:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519922729; cv=none; d=google.com; s=arc-20160816; b=GvJE6IezXWgDOdHIAHhgUfmIiz8D0SRpkkyHg60/mHvVSb/H3zq0XSkLXkZNuvLWxo q4Jp6uDLKXUk2+KUuVsnpYQv5IoI0c1gnQfO+Fb6qhlzkV8YlsIfhCNzZrxWqIyaGf8l PMgUx3RsTJXzYxwqwD2cUNfT8sHtIGgTjHYBkumebkEVkptDIIGedHDcxbdtWTb4z6aB hJgr+eRxvGfVwYegFF4pbMMrLzCb4GCc7f5LclSHTGPJ/aqDowWejqb9I1SMYC2ahnPE r8QbIhnSgeV1mus8BSPY9JDwHxrOOtSoBtcPD8TzFfHfGYHvI4LS6BZGhspJ45jdejd7 nV2A== 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=HjXK8Ly6qk694dplZqcb/sihQVi9bdO85N69XntPA90=; b=pXYHLiu3AvQMVIpNiT6l1nulQHvSRUkD3oDwIOu39I94wLz+jJzVXoQVnMa5UoD7R5 Umv61xSNCPaU/oXmFPqaUyUETeSSJOUhMy3JPFavOkgqBjyP5IdQ+/Ys0V4axOnaxlAv 6dcHNaKSXugV3XvtNUx3j+BC8M9CdWGybYfyv+obz7rL/cNScoXn4evcyyTX8r2GOq6M SRn8QW962tmXZQGudgWi/BAb6i+xJd2R442Ylm6IWRCli6zBJbI4om0h7B1XC/1mJtUq KQKOU4SegPcZgsY9VrHVfC4NWGX2+VYU1OMqDXTfOopZ7TspabgOgbedkggtRBjqIpog NiEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=JOoiufCo; 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 i12si2658875pgp.7.2018.03.01.08.45.14; Thu, 01 Mar 2018 08:45:29 -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=JOoiufCo; 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 S1033220AbeCAQoR (ORCPT + 99 others); Thu, 1 Mar 2018 11:44:17 -0500 Received: from vern.gendns.com ([206.190.152.46]:49997 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033029AbeCAQoL (ORCPT ); Thu, 1 Mar 2018 11:44:11 -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=HjXK8Ly6qk694dplZqcb/sihQVi9bdO85N69XntPA90=; b=JOoiufCo838+5YGeN+Ap6N1XeO csS1s0dDTwl/At7gxLQ/FQgaBw2UXtnCfgNrJs82dLVxOEDVCuc5M9VYPgDDiumWjjac9bFD8jOBb 3Mti2L6bPUW7kDHqExIGaBuzWnb3Q0QKPSPZIGBK3KCzEPry3x/I3gbeIoqstjx9vCv5u3vkBF1A8 FwEBs9SAu5Y+OJiAlv38Ne/PTe4UcurmPaJAMIHODj79LTKSWdBwASpjQZVUlW0WgmkFqFdQXhhSW ZXBP9MvYR7Q7oAsWwJ4wQs/yfQ4xIGh9abyLH7rDokW8PbKSJ3UIUBgBi93e05kLRKS44GDrSYSyO ipvjCeOA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:59710 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 1erRHt-000I3V-Hk; Thu, 01 Mar 2018 11:42:33 -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> <93696fc8-bb93-aa20-3506-3d7216c17cd2@lechnology.com> From: David Lechner Message-ID: <6bbe9bf3-24c1-acd9-200d-513520d34558@lechnology.com> Date: Thu, 1 Mar 2018 10:44:29 -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 03/01/2018 02:36 AM, Bartosz Golaszewski wrote: > 2018-02-28 22:40 GMT+01:00 David Lechner : >> 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. > > I still don't know why the mdio clock rate is much lower than in > mainline though. Any ideas? > > Thanks, > Bart > Now that you have fixed the crash, can you answer the questions I have asked earlier? > Can you post the output of this command so that I can see how your clocks are setup: cat /sys/kernel/debug/clk/clk_summary > Using your workaround, can you run: cat /sys/kernel/debug/pm_genpd/pm_genpd_summary If you see: 1e27000.clock-controller: emac off-0 then genpd is not working like it is supposed to. You should see something like this for device that are working: 1e27000.clock-controller: uart2 on /devices/platform/soc@1c00000/1d0d000.serial active