From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from va3outboundpool.messaging.microsoft.com (va3ehsobe004.messaging.microsoft.com [216.32.180.14]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 244312C01BC for ; Wed, 4 Jul 2012 13:13:22 +1000 (EST) Received: from mail94-va3 (localhost [127.0.0.1]) by mail94-va3-R.bigfish.com (Postfix) with ESMTP id 77FDE2403CC for ; Wed, 4 Jul 2012 03:11:16 +0000 (UTC) Received: from VA3EHSMHS042.bigfish.com (unknown [10.7.14.253]) by mail94-va3.bigfish.com (Postfix) with ESMTP id 6B9D32014F for ; Wed, 4 Jul 2012 03:11:14 +0000 (UTC) Received: from localhost.localdomain ([10.213.130.145]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q643DAg7008670 for ; Tue, 3 Jul 2012 20:13:13 -0700 Date: Wed, 4 Jul 2012 11:14:26 +0800 From: Zhao Chenhui To: Tabi Timur-B04825 Subject: Re: [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync Message-ID: <20120704031426.GA6133@localhost.localdomain> References: <1341310879-5468-1-git-send-email-chenhui.zhao@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: Sender: Cc: Wood Scott-B07421 , Zhao Chenhui-B35336 , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Jul 03, 2012 at 07:46:24AM -0500, Tabi Timur-B04825 wrote: > On Tue, Jul 3, 2012 at 5:21 AM, Zhao Chenhui wrote: > > > + np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids); > > + if (np) { > > + guts = of_iomap(np, 0); > > + of_node_put(np); > > + if (!guts) { > > + pr_err("%s: Could not map guts node address\n", > > + __func__); > > + return; > > + } > > + smp_85xx_ops.give_timebase = mpc85xx_give_timebase; > > + smp_85xx_ops.take_timebase = mpc85xx_take_timebase; > > + } > > I had this in mind: > > guts = of_iomap(np, 0); > of_node_put(np); > if (guts) { > smp_85xx_ops.give_timebase = mpc85xx_give_timebase; > smp_85xx_ops.take_timebase = mpc85xx_take_timebase; > } else { > pr_err("%s: Could not map guts node address\n", > __func__); > } > > That way, a missing GUTS node does not break everything. > If the guts variable is NULL, it indicates there is error in dts or kernel. We should fix the error, rather than ignore it. Moreover, if smp_85xx_ops.give/take_timebase is NULL, kernel can not do the timebase sync. -Chenhui From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030196Ab2GDD21 (ORCPT ); Tue, 3 Jul 2012 23:28:27 -0400 Received: from co1ehsobe002.messaging.microsoft.com ([216.32.180.185]:15166 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734Ab2GDD2Y (ORCPT ); Tue, 3 Jul 2012 23:28:24 -0400 X-Greylist: delayed 905 seconds by postgrey-1.27 at vger.kernel.org; Tue, 03 Jul 2012 23:28:24 EDT X-Forefront-Antispam-Report: CIP:70.37.183.190;KIP:(null);UIP:(null);IPV:NLI;H:mail.freescale.net;RD:none;EFVD:NLI X-SpamScore: -3 X-BigFish: VS-3(zz98dI9371I1432Izz1202hzz8275bhz2dh2a8h668h839h944hd25hf0ah) Date: Wed, 4 Jul 2012 11:14:26 +0800 From: Zhao Chenhui To: Tabi Timur-B04825 CC: Zhao Chenhui-B35336 , "linuxppc-dev@lists.ozlabs.org" , Wood Scott-B07421 , "galak@kernel.crashing.org" , "linux-kernel@vger.kernel.org" , Subject: Re: [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync Message-ID: <20120704031426.GA6133@localhost.localdomain> References: <1341310879-5468-1-git-send-email-chenhui.zhao@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 03, 2012 at 07:46:24AM -0500, Tabi Timur-B04825 wrote: > On Tue, Jul 3, 2012 at 5:21 AM, Zhao Chenhui wrote: > > > + np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids); > > + if (np) { > > + guts = of_iomap(np, 0); > > + of_node_put(np); > > + if (!guts) { > > + pr_err("%s: Could not map guts node address\n", > > + __func__); > > + return; > > + } > > + smp_85xx_ops.give_timebase = mpc85xx_give_timebase; > > + smp_85xx_ops.take_timebase = mpc85xx_take_timebase; > > + } > > I had this in mind: > > guts = of_iomap(np, 0); > of_node_put(np); > if (guts) { > smp_85xx_ops.give_timebase = mpc85xx_give_timebase; > smp_85xx_ops.take_timebase = mpc85xx_take_timebase; > } else { > pr_err("%s: Could not map guts node address\n", > __func__); > } > > That way, a missing GUTS node does not break everything. > If the guts variable is NULL, it indicates there is error in dts or kernel. We should fix the error, rather than ignore it. Moreover, if smp_85xx_ops.give/take_timebase is NULL, kernel can not do the timebase sync. -Chenhui