Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751294AbdFAIP3 (ORCPT ); Thu, 1 Jun 2017 04:15:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:37330 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751036AbdFAIP1 (ORCPT ); Thu, 1 Jun 2017 04:15:27 -0400 Subject: Re: [PATCH v8 2/5] usb: early: add driver for xhci debug capability To: Lu Baolu , Greg Kroah-Hartman , Ingo Molnar Cc: Mathias Nyman , tglx@linutronix.de, peterz@infradead.org, linux-usb@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Michal Kubecek References: <1490083293-3792-1-git-send-email-baolu.lu@linux.intel.com> <1490083293-3792-3-git-send-email-baolu.lu@linux.intel.com> <592E3817.4030402@linux.intel.com> <592F8BF3.4070004@linux.intel.com> From: Vlastimil Babka Message-ID: <56601eff-386e-3405-abf2-51a163201253@suse.cz> Date: Thu, 1 Jun 2017 10:15:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <592F8BF3.4070004@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1651 Lines: 37 On 06/01/2017 05:37 AM, Lu Baolu wrote: > Hi, > > On 05/31/2017 05:38 PM, Vlastimil Babka wrote: >> On 05/31/2017 05:27 AM, Lu Baolu wrote: >>> Hi, >>> >>> On 05/30/2017 09:46 PM, Vlastimil Babka wrote: >>>> On 03/21/2017 09:01 AM, Lu Baolu wrote: >>>> Did you forget to remove the #define XDBC_TRACE? >>>> >>>> Enabling this driver brings the "trace_printk() being used. Allocating >>>> extra memory. This means that this is a DEBUG kernel and it is unsafe >>>> for production use." message in 4.12-rcX dmesg. >>> This feature is only for a DEBUG kernel, should not be enabled for >>> any production kernel. This was the reason I enabled trace_printk() >>> by default. >> Hmm, but it seems we generally enable all these early printk >> features/drivers in our distro kernels. They are not active without a >> early_printk=X bootparam anyway, right? It's much more convenient to >> e.g. just tell customer to change a param when debugging something than >> to install a debug kernel. So I wouldn't agree that only a DEBUG kernel >> should have this compiled in. > > Okay, I will try to find a fix. Thanks. I didn't make it clear that the trace_printk() warning is there even if the code using it doesn't actually execute (i.e. I didn't specify any early_printk bootparam). There are some roastedy tricks to detect the potential users, so that the buffers can be allocated in advance to allow the first trace_printk() from any context, I guess. I'm not sure if there's a way to change it so that your driver reports the trace_printk usage only in response to the bootparam (which could also be a safe point to allocate ftrace buffers?). Vlastimil