Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1675136pxj; Wed, 19 May 2021 11:11:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/sj+f0qT9MxjJd03BsBPuhYNqdCguHr60WHzO+kbJiYmL9JhyI+6dFktnsRqCYdbbERqN X-Received: by 2002:a6b:3119:: with SMTP id j25mr741737ioa.64.1621447891963; Wed, 19 May 2021 11:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447891; cv=none; d=google.com; s=arc-20160816; b=FSUvuuSu333f2GJZy2i/ErB703hptF0pkzjt7Sso1edpEIEaZWSLUdTvo7McWCjev5 KtX9L3qoolRJPq+S0nBMKTmypNxsuglSMJXsHAMFTyKW6T65ar15E79rNFsWquGyadeD lHS1UZ7b0X7wlXr+Im6WkhDjEMRg0FreJY7AOzuA1WZKTB0ms6izpcGV22mptPLFqQPM BGJcWb8pIWUUEYCfygVH/MdU9qOMdmxdgE6H0nPpCReA9/ZcjyQFVgCE961Q+5/guSYC YCpvCPT+4uAhhWcLVCcN2h5CvNKQbKO2DRCjcHf5F4Js0Gn0PAQ5o5jNZWIqtgeYaBwC /bcw== 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=V6DVO6cQ8VwoC/W1G/yz2FU0Rn7VBLfNOk0NX/bUWWw=; b=ulT7XUADHoXTeP2pEtKknklT4qbZOZX7ETRmjWozxZboG2t9CR3Ee8H+I969zGTaij DPLREkNHJ9goi7F8VupixWDQtte5t6aJDtWth7x4zAjjb/FB5TY8Xk6HuD15jKzAtFna gXTVlO0Xfu5kbFRE3nP9gPG+KnZ6VsFli6zWYZ9wcUdNKlPjZfycN1i9dWoShXa8HfOl 1Sr+TkQ3NOTUe/X/jWt8O8dchk5YahVO1tyA7vhyud589TsjjyuG39SlHq2nKMW0Bwpm LJDBxyPJ3Ln7ma8KrHGspxpzf0l6yFN97ORl6mgCYydyoKC1onayu1raHP7gqlEGv0AV eAyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AMaBiMyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 h19si2527874iow.36.2021.05.19.11.11.19; Wed, 19 May 2021 11:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=AMaBiMyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1349630AbhERNcY (ORCPT + 99 others); Tue, 18 May 2021 09:32:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:41320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244870AbhERNcW (ORCPT ); Tue, 18 May 2021 09:32:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DB60611CC; Tue, 18 May 2021 13:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621344664; bh=X53wMEAAhoR3qDgv6I72kl2g+HLNTa0WDNa3S6R6O5c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AMaBiMyrN7AbIR6l1QmB9cO8+qQ8w15UNy5GuSflZ2m2ZOLcF05ptFN9XRkrYCY8b AihL0TPjtCDRRR5ujG+5SmJpZlHUUpVSYaHkD+IoI8anHI5a1tscqaO2hfshTPvrUQ wrm24CUkxubvt/iYKGTrXFDJjdYnqFgxjvEALRig= Date: Tue, 18 May 2021 15:31:02 +0200 From: Greg Kroah-Hartman To: Heikki Krogerus , Badhri Jagan Sridharan Cc: Guenter Roeck , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kyle Tso Subject: Re: [PATCH v1 1/2] usb: typec: tcpm: Expose tcpm logs through a misc device Message-ID: References: <20210517233609.610248-1-badhri@google.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-kernel@vger.kernel.org On Tue, May 18, 2021 at 04:00:48PM +0300, Heikki Krogerus wrote: > On Mon, May 17, 2021 at 04:36:08PM -0700, Badhri Jagan Sridharan wrote: > > Although TCPM logs were primarily focussed to aid developers > > during bringup, TCPM logs have proved to be critical even > > post-bringup as it provides a good starting point to triage > > interoperability issues with accessories. TCPM logs > > are exposed through debugfs filesystem. For systems that > > don't mount debugfs by default, this change introduces a > > module parameter log_misc_dev which when set exports the > > tcpm logs through a misc device. This change also leaves > > the option of exporting tcpm logs through debugfs for > > backwards compatibility. > > This does not look correct to me. At the very least you need to now > document your misc device interface. Why are you removing the choice > whether to enable this or not? The module parameter does also not > sound like a good idea at all. > > I'm really not sure about this. This is just a poor man's debugfs that > removes any choice of enabling it. Since clearly debugging related > information is what you are after here, debugfs really should be > enough for you. I agree, this is an abuse of a misc device, not ok at all. Just use debugfs if you really want this type of thing, that is what it is there for. > > > Signed-off-by: Badhri Jagan Sridharan > > --- > > drivers/usb/typec/tcpm/tcpm.c | 98 +++++++++++++++++++++++++---------- > > 1 file changed, 72 insertions(+), 26 deletions(-) > > > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > > index c4fdc00a3bc8..b79194919b27 100644 > > --- a/drivers/usb/typec/tcpm/tcpm.c > > +++ b/drivers/usb/typec/tcpm/tcpm.c > > @@ -12,6 +12,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -33,6 +34,10 @@ > > > > #include > > > > +static bool modparam_log_misc_dev; > > +module_param_named(log_misc_dev, modparam_log_misc_dev, bool, 0444); > > +MODULE_PARM_DESC(log_misc_dev, "Expose tcpm logs through misc device"); This is not the 1990's, no new module parameters please. thanks, greg k-h