Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1854010pxb; Mon, 12 Apr 2021 08:10:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0qLnWokBhoQuoVfMGGiUdIFqJY5oNgoFy4O9M1b/FFte8iG6Nk0+viCV83HNOdMmi/e3V X-Received: by 2002:a17:907:9894:: with SMTP id ja20mr12507179ejc.428.1618240255106; Mon, 12 Apr 2021 08:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618240255; cv=none; d=google.com; s=arc-20160816; b=XvrkCsIMlVSV9iBNMD9qdLzK8D+60siSdmDy9DQFvjrbbsZLKEuKG8p2EviiPj65fM Wvi41JxQGjsaOyY1gm1rGE+kB7Uoa+MaLXDl2QgSHgWvzBZydIjah1KTqHL2QYeR51J9 G94cBHQWCvgnpJLz6iwaQFPROzSB2jYDZmv8ua3atNsaCLiJ8T5uYbJwAtX+lrOZu1h2 e5UiCgg3pgCoPBFUWSxVCfWl0kmZ88md8BWQSU8WEjxB2dz0E7HEqp09bzWBFHKaBfhT Avb0+kntZzrOsBIOErXIM4KcP9Ik074lZwrj5ttBg3I8V9kXqaSr8eT7U92JdIzrabXn Qe2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DmSCxYKLork0Za29EbJoxTv1PLkL2Ldjya0fiM8G2b8=; b=VDjt2y9mtI3sr4YoT9PoQDq6GVIpOeNXZa0rXhqLz6bgbt9pBuYykvqSqYMoOUpRR3 hbb6dzGGpZ40T8akeCrx7uSTa5JvR1sJFO4NJya9kvBvhnIt/2TZuAmEIWMyJPNvso2n C9uS+lmCs5f4ShPvZO0VrgP++snK45KDyzPsxou4eF543XTDFgttf9IzrGBA45hAG9Gb eVZWlktxWbYs0Qt5pVG00xHnebSiGCUm2es5FoAVdeRPpsT3bqZNOjAvEmpqpOAPyOz9 xGfz6AcCCkqrb3/mDkeehcAWtaqVdkNHQsmC35kK8bp7JrMGQDd526kTtkYP9G/hNrn1 KgLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y4RBA8XC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si3072695ejx.574.2021.04.12.08.10.29; Mon, 12 Apr 2021 08:10:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y4RBA8XC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242639AbhDLPJ7 (ORCPT + 99 others); Mon, 12 Apr 2021 11:09:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:38512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238789AbhDLPJ6 (ORCPT ); Mon, 12 Apr 2021 11:09:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 021D360C3E; Mon, 12 Apr 2021 15:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618240180; bh=OGR65Ysb1boNRc1FvyA0qHgepPCXKOh2glD5vDmHs98=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=y4RBA8XCCfKWfqqbg2RxozU2cZE1GnOIMBBtmB2tCF2M7pA4CyhUqqm8xx3emkRY0 izSz7PA5BrLrj8MJwhWYbLReESotxnzGOtb7SOsZUZr2iTrCsthON2/kLOQ8IF9+Lr KgHTe6719+uIb8iMWGzzue965rfOU04aDhtn/tEY= Date: Mon, 12 Apr 2021 17:09:37 +0200 From: Greg KH To: "Grumbach, Emmanuel" Cc: "kvalo@codeaurora.org" , "linux-wireless@vger.kernel.org" , "luca@coelho.fi" , "Beker, Ayala" , "Coelho, Luciano" Subject: Re: [PATCH RESEND 2/3] iwlwifi: mei: add the driver to allow cooperation with CSME Message-ID: References: <20210412124328.24472-1-emmanuel.grumbach@intel.com> <20210412124328.24472-2-emmanuel.grumbach@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Apr 12, 2021 at 02:46:53PM +0000, Grumbach, Emmanuel wrote: > > On Mon, Apr 12, 2021 at 02:29:45PM +0000, Grumbach, Emmanuel wrote: > > > > > > > > On Mon, Apr 12, 2021 at 01:44:58PM +0000, Grumbach, Emmanuel wrote: > > > > > > > +#define IWL_MEI_DEBUG(c, f, a...) \ > > > > > > > + do { \ > > > > > > > + CHECK_FOR_NEWLINE(f); \ > > > > > > > > > > > > Huh? > > > > > > > > > > > > > + dev_dbg(&(c)->dev, f, ## a); \ > > > > > > > > > > > > Just use dev_dbg(), don't be special for a single driver, it > > > > > > hurts when trying to read different drivers. > > > > > > > > > > I took this from iwlwifi. I can change if needed, not a big deal. > > > > > > > > Please do. > > > > > > > > > > > +module_param_named(defer_start_message, > > defer_start_message, > > > > > > bool, > > > > > > > +0644); MODULE_PARM_DESC(defer_start_message, > > > > > > > + "Defer the start message Tx to CSME (default > > false)"); > > > > > > > > > > > > Why do you need this? Who is going to set it to anything else, > > > > > > and why would they? This isn't the 1990's anymore, please do > > > > > > not add new module parameters. > > > > > > > > > > For testing. I need this to be able to force a certain order of > > > > > initialization > > > > which is possible (and hence must be tested) but not likely to happen. > > > > > Another point is tracing. This allows me to load the module but > > > > > prevent any > > > > real operation. Then, start tracing. This way, I can see the whole > > > > flow in tracing, even the very beginning. > > > > > > > > Then call this something obvious, > > > > > > "kernel_hacker_debuging_testing_only_use_if_you_know_what_you_are_ > > > > doing". > > > > > > > > Or better yet, just put it in debugfs to turn it on/off and no > > > > module parameter is needed at all. > > > > > > > > > > Debugfs is not a replacement for module parameters. Debugfs can be > > > used only after the driver already ran quite a bit of its > > > initialization code path. Here I want to be able to catch the very > > > first messages with tracing. > > > > Then use the proper trace functionality of the kernel, which is not module > > parameters :( > > I am sorry if I drive you nuts but I don't know any "proper trace > functionality" in the kernel that the user could enable / disable and > that would be available immediately at init. The in-kernel trace facilities do not work for boot code? Documentation/tracing/boottime-trace.rst seems to disagree :) > The user needs to > "activate" the trace points using trace-cmd or whatever other tool. By > the time the user does so, the driver has already run the code path I > wish to debug. I can use debug prints, but you didn't seem happy about > it. So I am happy to use tracing, but then we need to make sure it > cover all the cases. The way I make it cover all the cases is with > this module parameter. If you know a better way, I'll be happy to use > it. See the above document, there's nothing "special" about a single kernel driver that should warrant a one-off user/kernel api like this. thanks, greg k-h