Received: by 10.223.171.82 with SMTP id r18csp17848wrc; Fri, 2 Mar 2018 12:25:31 -0800 (PST) X-Google-Smtp-Source: AG47ELvmNmjJGCXwCSJlDyxH4oyjOZvW3+PVZlZf1Qh+3CSFqs6E5srrm51VM2Gi5tK3N8Ag6zcN X-Received: by 10.99.67.133 with SMTP id q127mr5546895pga.365.1520022330928; Fri, 02 Mar 2018 12:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520022330; cv=none; d=google.com; s=arc-20160816; b=a09hAimHUQWWujGKy6Cy0PzDVBCZBBI0Rs8Yoqpiz3XzQZulq0kEv0pbH+Ll95K/1x UR3a2yVXbnpR4/2RLOQrN/LUMqR4umJmoWuzLAgMG+jzqhQ5rNkjoNddRfMnISdagosx RUSKoTpU7dEH62UUZvGeVPuKXP5FekiXTlIET4GYOuWeRgEA63hMpDNfHIqXPjIQ6Eay TIeobI/cqQvieG/DomIBgpR8Us5nZv+QC2sO71RDM9L7Luesuxl9+vWIImZA/zgodKvU NbPY2JmO7PZki4sTIwP16nVN55LV+W0/wYj7485sTaFRAlb/aYJPG/KaxXT2e6JZql3x luIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=k4FeJReYnQ1HlYkxNnMV5SX8gsERao3okVleHlTZGLY=; b=MP45kF25q7Txm4tSMZY/sfab2JpltbcwkQrCqFe+v7AREYk6H77YZTyqIQ3AtWqSVc NxWQRKgfnvhaL8TIDNIu5RwszvyfraPVbis2Y4C00X+5y1rFT1EXA8khA22BmR7qWgvf PyW7J/qnwvBw1JSIrBkqeAYdIRL3IMsm7I88zMhUCiTCBpF2kXPxxfJzBivmt/AaU23R 8ykTBJnY9a/wi1VZyv20jsKk8fztuBlVmNjVYsPztnUhw56rqugHVAYrzZRzLg+8HLx2 VgQ1dq1kVS4SVldasEpTlfpYdDmAr4E92ofZw9tQ8tAQnpybtaM5LuU79KPrIpKjV4E1 sNzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=rWNzWodW; 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 l73si5406090pfj.45.2018.03.02.12.25.15; Fri, 02 Mar 2018 12:25:30 -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=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=rWNzWodW; 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 S1946791AbeCBRjr (ORCPT + 99 others); Fri, 2 Mar 2018 12:39:47 -0500 Received: from mail-ot0-f179.google.com ([74.125.82.179]:44787 "EHLO mail-ot0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165060AbeCBRjn (ORCPT ); Fri, 2 Mar 2018 12:39:43 -0500 Received: by mail-ot0-f179.google.com with SMTP id 79so9414603oth.11 for ; Fri, 02 Mar 2018 09:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=k4FeJReYnQ1HlYkxNnMV5SX8gsERao3okVleHlTZGLY=; b=rWNzWodWS5DX1feAcqV8zkGuMVmnDXZqa+Lr2+5OW0m9irwt2T+cCu2zWvc7HpOAq0 aD+7eC/gLhihBeTbhQ7PGJTQbmYsgqODN779pZ3acOK6vV7F9dBoYbJJwRjUKeFKOTLc 1xL1nGXoPemIy6nCSty2/AFhMtZCLRGcOMxKQSlfwEieU0SB6GI9QIrEFbkZS0XijFQc DX00bwmMHhDXd5Hgrfu++VGDtP6BEGqNkkmKy7KCXI8QS5W3r1oyNAz2LnnwhFxzHi9g N1uBYON+jedAxlJbv+paf+D8/op73kCuXlR53MR6CgucSFb8zSEvYN1v9bKwObaoEBfk /XEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=k4FeJReYnQ1HlYkxNnMV5SX8gsERao3okVleHlTZGLY=; b=iIIMN50LZeaNsAWT9fWGjhHoMxme77uFEVEQjBlq0A1F+J2dyyTTPVqPO1l7dFiuQJ 22WGXp49iESBGWM7Tgb5kG8n3tbj+YRoV/rcoKM84blpcRt92NYEDtuYXAGO0CS8qnjw y5LUIioX/fkwfITmjZmbifaf6k2p2styKsQ30+QLRcSxUh6HIBfFs2/J5GZ65AZbFX5b s9Lt6SBZN7610fRKmNVulIFY7asH2rlMoigoLGuw9NduwWjmAJBohDnmzBt8Q1iTjhKF N4jggDqmydGUrK5HTDxLUjYtFAs42uwdL87n8rIYk8KillAaSCBT/XXHp9Mrs/XEuAm1 YAKg== X-Gm-Message-State: APf1xPA2ozT03ERVOv/2qdCgNkM2oMkX6gQAnoAAbQLDvwH6cyACiJud WXY7JFPLaslDK9lzq5+aRhNwecXLE6q+NE80v62DCw== X-Received: by 10.157.82.20 with SMTP id e20mr4716394oth.211.1520012381465; Fri, 02 Mar 2018 09:39:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.45.2 with HTTP; Fri, 2 Mar 2018 09:39:41 -0800 (PST) In-Reply-To: <6bbe9bf3-24c1-acd9-200d-513520d34558@lechnology.com> 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> <6bbe9bf3-24c1-acd9-200d-513520d34558@lechnology.com> From: Bartosz Golaszewski Date: Fri, 2 Mar 2018 18:39:41 +0100 Message-ID: Subject: Re: [PATCH v7 10/42] clk: davinci: New driver for davinci PSC clocks To: David Lechner Cc: Bartosz Golaszewski , linux-clk@vger.kernel.org, linux-devicetree , arm-soc , Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Sekhar Nori , Kevin Hilman , Adam Ford , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-01 17:44 GMT+01:00 David Lechner : > 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 I used of_clk_get() in the genpd attach callback so the crash no longer happens, but I still can't boot it over NFS due to mdio failing. Do you have any idea why the clock rate differs between v7 and mainline? From the logs I can see that genpd domains are correctly registered, and the provider is added (you should probably skip setting up the domains in legacy mode though), the pm clocks are enabled (after being disabled by mdio after its failed probe()) but the boot process gets stuck after the kernel gets an IP address over DHCP (which is strange because apparently it had some kind of network connection). On Monday I'll prepare a small ramfs and boot over tftp only and see from there. Best regards, Bartosz