Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933766AbbHKCsI (ORCPT ); Mon, 10 Aug 2015 22:48:08 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:8999 "EHLO mx0a-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932991AbbHKCsF (ORCPT ); Mon, 10 Aug 2015 22:48:05 -0400 Date: Tue, 11 Aug 2015 10:44:06 +0800 From: Jisheng Zhang To: Sebastian Hesselbarth CC: Antoine Tenart , , , , Subject: Re: [PATCH 2/3] ARM: berlin: register cpufreq-dt for the BG2Q Message-ID: <20150811104406.77e0a264@xhacker> In-Reply-To: <55C90814.3050505@gmail.com> References: <1438259752-16320-1-git-send-email-antoine.tenart@free-electrons.com> <1438259752-16320-3-git-send-email-antoine.tenart@free-electrons.com> <20150731141602.28b28f21@xhacker> <55C90814.3050505@gmail.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-08-11_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=inbound_notspam policy=inbound score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1506180000 definitions=main-1508110043 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2754 Lines: 79 Dear Sebastian, On Mon, 10 Aug 2015 22:22:44 +0200 Sebastian Hesselbarth wrote: > On 31.07.2015 08:16, Jisheng Zhang wrote: > > On Thu, 30 Jul 2015 14:35:51 +0200 > > Antoine Tenart wrote: > > > >> The BG2Q SoC uses cpufreq-dt for cpufreq. Register a platform device for > >> this. > >> > >> Signed-off-by: Antoine Tenart > >> --- > [...] > >> diff --git a/arch/arm/mach-berlin/berlin.c b/arch/arm/mach-berlin/berlin.c > >> index ac181c6797ee..0de906374994 100644 > >> --- a/arch/arm/mach-berlin/berlin.c > >> +++ b/arch/arm/mach-berlin/berlin.c > >> @@ -15,9 +15,21 @@ > [...] > >> +static void __init berlin_init_late(void) > >> +{ > >> + if (of_find_matching_node(NULL, berlin2q_match)) > >> + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); > > > > I'm not sure is it acceptable to always register cpufreq-dt platform device. > > In cpufreq-dt driver, the probe will exit if there's no cpuclk node. > > Jisheng, > > registering the _device_ without checking for any requirements of > the _driver_ is usual practice. It it the driver's job to check > all of them and report an error or warning. So, I am fine with > adding the device unconditionally. > > Using the .init_late() callback seems reasonable - but can you > evaluate if we can have cpufreq-dt also for BG2/BG2CD? I'd also > accept a single, default operating-point. hmm, if so, we can enable cpufreq-dt for BG2/BG2CD. In fact, there's no any problem if we don't touch the voltage, only changing the cpufreq should not introduce stable issues. > > BTW, there is one true point about Jisheng's comment: try to order > your patches logically correct to avoid unnecessary warnings, i.e. > > 1/3 add cpuclk > 2/3 add cpufreq-dt properties > 3/3 register cpufreq-dt device > > If you consider a git-bisect run, you can land in between any of the > three patches but they are always in the above order - so ordering is > important. > > Sebastian > > >> +} > >> + > >> static const char * const berlin_dt_compat[] = { > >> "marvell,berlin", > >> NULL, > >> @@ -25,6 +37,7 @@ static const char * const berlin_dt_compat[] = { > >> > >> DT_MACHINE_START(BERLIN_DT, "Marvell Berlin") > >> .dt_compat = berlin_dt_compat, > >> + .init_late = berlin_init_late, > >> /* > >> * with DT probing for L2CCs, berlin_init_machine can be removed. > >> * Note: 88DE3005 (Armada 1500-mini) uses pl310 l2cc > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/