Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1580504ybb; Thu, 26 Mar 2020 03:34:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtBTWBf72yo9cihaOpnIlsoILfZoBSor5ing1FAUF7SvLkHKJzoVu5stj5km/aEvrLFv8k8 X-Received: by 2002:aca:4a08:: with SMTP id x8mr1312541oia.158.1585218894534; Thu, 26 Mar 2020 03:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585218894; cv=none; d=google.com; s=arc-20160816; b=FzVgL/wivz79XYwayMAYqfwkCUCtp3nfMEP5+nE3CaLp7WT5roZ76Kaylaz1Oi+koI MImmdrldV4/NvLJ6An6VLVLy9tbeuzoMsAngYp/W+5LUfQWkjmZ2atSeRiSRsIaYbA2U tVdkuM9OHpjABdcvvtrgXZGxcZs0qrcviweWTUZtfplO7m46oYTev9pv6IiQPH2aMYYw fXjMaePEnxGcVnkjQZeHXFGSZfZ3df+F0YjfXaFVNL06wSLmIzMTdjq+LOIQuR29nPtJ jS4WyJiO1YeDJO4gZe9rz0eAuOdbgyA3sTNjVVUktFJgp1OIyHJy/PkPcPIUEmIxZf0U SFNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=Y3Nif6bo7nM+Wzqicq/XWpYN8tItuhiVtkMllo8nWxE=; b=db91wqH9rOgSKjaNBlilPHrtMoYlj4VeOU5wlV3BcH0/2bVuTMuA+gclz27oJ5Gy0d lOZkVVaTxxeZGKOb+PQSe2/6L/r68n5i5aRkaytsSIfHem78TwnYpmKITJRwzSNTpbRs ryjjjnM1EkHikBbybbXgqscUcT9QobrQGCvSO/De6AFMAYMlwKARmH7lPFmwC0RUaeI5 897Tc4VVtj6tW4Nq2oOKcKv6LuD+Zes6cKX43oWx3DQfU6HzY8kOv7ytsW5efe/4LYdu 8u7vVsIVBibeYU/oBSLgtxqkW+EGKHOk4ElU6V8+PGe7UXhF+FOOp7CTmSF7pv8ho7Kj jcng== ARC-Authentication-Results: i=1; mx.google.com; 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 e19si963146oti.126.2020.03.26.03.34.41; Thu, 26 Mar 2020 03:34:54 -0700 (PDT) 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; 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 S1727960AbgCZKeD (ORCPT + 99 others); Thu, 26 Mar 2020 06:34:03 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50298 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727560AbgCZKeC (ORCPT ); Thu, 26 Mar 2020 06:34:02 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jHPpk-0004nJ-V5; Thu, 26 Mar 2020 11:33:57 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 1959110069D; Thu, 26 Mar 2020 11:33:56 +0100 (CET) From: Thomas Gleixner To: Saravana Kannan Cc: Ionela Voinescu , LKML , Daniel Lezcano , linux-tip-commits@vger.kernel.org, x86 , liviu.dudau@arm.com, sudeep.holla@arm.com, Lorenzo Pieralisi , Jon Hunter , Pawel Moll , Rob Herring , Mark Rutland Subject: Re: [tip: timers/core] clocksource/drivers/timer-probe: Avoid creating dead devices In-Reply-To: References: <20200111052125.238212-1-saravanak@google.com> <158460766637.28353.11325960928759668587.tip-bot2@tip-bot2> <20200324175955.GA16972@arm.com> <87lfnoxg2a.fsf@nanos.tec.linutronix.de> Date: Thu, 26 Mar 2020 11:33:56 +0100 Message-ID: <87imirxv57.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Saravana Kannan writes: > On Wed, Mar 25, 2020 at 2:47 PM Thomas Gleixner wrote: > >> Saravana Kannan writes: >> > On Tue, Mar 24, 2020 at 11:34 AM Saravana Kannan wrote: >> > I took a closer look. So two different drivers [1] [2] are saying they >> > know how to handle "arm,vexpress-sysreg" and are expecting to run at >> > the same time. That seems a bit unusual to me. I wonder if this is a >> > violation of the device-driver model because this expectation would >> > never be allowed if these device drivers were actual drivers >> > registered with driver-core. But that's a discussion for another time. >> > >> > To fix this issue you are facing, this patch should work: >> > https://lore.kernel.org/lkml/20200324195302.203115-1-saravanak@google.com/T/#u >> >> Sorry, that's not a fix. That's a crude hack. > > If device nodes are being handled by drivers without binding a driver > to struct devices, then not setting OF_POPULATED is wrong. So the > original patch sets it. There are also very valid reasons for allowing > OF_POPULATED to be cleared by a driver as discussed here [1]. > > The approach of the original patch (setting the flag and letting the > driver sometimes clear it) is also followed by many other frameworks > like irq, clk, i2c, etc. Even ingenic-timer.c already does it for the > exact same reason. > > So, why is the vexpress fix a crude hack? If it's the right thing to do and accepted by the DT folks, then the changelog should provide a proper explanation for it. The one you provided just baffles me. Plus the clearing of the flag really needs a big fat comment. It still does not make any sense to me. arm,vexpress-sysreg is a MFD device, so can the ARM people please explain, why the sched clock part is not just another MFD sub-device or simply has it's own DT match? >> As this is also causing trouble on tegra30-cardhu-a04 the only sane >> solution is to revert it and start over with a proper solution for the >> vexpress problem and a root cause analysis for the tegra. > > If someone can tell me which of the timer drivers are relevant for > tegra30-cardhu-a04, I can help fix it. git grep perhaps? And that's pretty much the same problem: drivers/clocksource/timer-tegra.c:TIMER_OF_DECLARE(tegra20_rtc, "nvidia,tegra20-rtc", tegra20_init_rtc); drivers/rtc/rtc-tegra.c: { .compatible = "nvidia,tegra20-rtc", }, Without looking deeper I suspect that these two are not the only ones. Can the DT folks pretty please comment on this and provide some guidance how to fix that w/o sprinkling of_node_clear_flag(node, OF_POPULATED); all over the place? Thanks, tglx