From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Menon, Nishanth" Subject: Re: [PATCH] omap:pm: Fix boot-time errors with debugfs disabled Date: Thu, 19 May 2011 08:58:15 -0500 Message-ID: References: <1305221790-4944-1-git-send-email-premi@ti.com> <87fwocrmr9.fsf@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from na3sys009aog114.obsmtp.com ([74.125.149.211]:36119 "EHLO na3sys009aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933238Ab1ESN6l convert rfc822-to-8bit (ORCPT ); Thu, 19 May 2011 09:58:41 -0400 Received: by mail-wy0-f175.google.com with SMTP id 20so2384983wye.20 for ; Thu, 19 May 2011 06:58:35 -0700 (PDT) In-Reply-To: Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: "Premi, Sanjeev" Cc: "Hilman, Kevin" , "linux-omap@vger.kernel.org" On Thu, May 19, 2011 at 05:30, Premi, Sanjeev wrote: >> -----Original Message----- >> From: Hilman, Kevin >> Sent: Wednesday, May 18, 2011 10:04 PM >> To: Premi, Sanjeev >> Cc: linux-omap@vger.kernel.org >> Subject: Re: [PATCH] omap:pm: Fix boot-time errors with >> debugfs disabled >> >> Hi Sanjeev, >> >> Sanjeev Premi writes: >> >> > There is an implicit assumption in current implementation that >> > debugfs is always enabled. >> > >> > When debugfs is disabled, these errors are noticed during boot: >> > =A0 omap_voltage_late_init: Unable to create voltage debugfs main = dir >> > =A0 vdd_debugfs_init: Unable to create debugfs directory for vdd_m= pu >> > =A0 vdd_debugfs_init: Unable to create debugfs directory for vdd_c= ore >> > >> > This patch fixes these errors by enclosing code related to debugfs >> > in #ifdef CONFIG_DEBUG_FS..#endif. >> > >> > Boot tested on OMAP3EVM. >> > >> > Signed-off-by: Sanjeev Premi >> >> Sorry for the delay here, I've been on the road and finally >> catching up >> on the list. >> >> Basically, I'm in the process of a pretty major cleanup of >> the VC/VP and >> SR layers. =A0For example, in my pm-wip/voltdm_* branches, the debug= fs >> interface to the voltage layer has been completely removed. =A0I'm a= lso >> thinking of removing the SR debugfs interface also, as I don't reall= y >> think we need a userspace interface for this. =A0A board-level inter= face >> is probably enough (/me waits for flame from Nishanth :) >> >> That being said, your approach below isn't quite right in its usage = of >> #ifdefs. =A0Use of #ifdefs like this is frowned upon for many reason= s. >> For starters, take a look the '#ifdefs are ugly' section of >> Documentation/SubmittingPatches. > > [sp] I don't like #ifdefs either but each time we cannot create > =A0 =A0 a new file changes like this. > > =A0 =A0 The current code is a mess with debugfs used too frequently. > =A0 =A0 And - all of it is not for debug. The location of ifdefs in > =A0 =A0 in the patch illustrates it quite well. > > =A0 =A0 BTW, this isn't the only use of ifdefs in a C file in Linux. in reality the only reason you've had to do this patch was because we had a wicked handling of debugfs entries in voltage layer - with voltdm_c these are all gone. further any entries remaining (e.g. SR) are: dentry for debugfs file -> just a minor overhead not deserving a #ifdef all other functions of debugfs (as per include/linux/debugfs.h) when debugfs is disabled in .config will be static inlined and we will not need any #ifdefs at all The real pending question is about functional SR debugfs entries that need to loose it's critical functionality. Regards, Nishanth Menon -- To unsubscribe from this list: send the line "unsubscribe linux-omap" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html