Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3167588rwd; Mon, 22 May 2023 09:31:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5iRUhnMUx2suY480p1I2o8tCnDnLXsfXtZOcMkmwyIICruufAM/mkp6uz11RHjEeD1l9vP X-Received: by 2002:a17:902:680d:b0:1a9:6183:f965 with SMTP id h13-20020a170902680d00b001a96183f965mr9661819plk.60.1684773086707; Mon, 22 May 2023 09:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684773086; cv=none; d=google.com; s=arc-20160816; b=mR3xfP9Kh9A4eaY7ackyj0spLWvS2jmjq/ZUoOKrwXFcuk1iW7Vfe2jzC7bBChlVZo QzOsX8gsM2yqdf0D4evowFr7wAr3LYX4gvR9SS90xLSIgxuCcL82pW8ZqLfqQggXSycX zZsrkKYCDVlDQR526uPh4wMfRP/NDM8BJCR1ONvdRX276E6P73uBu2EePzCOAJCxxceG HoanKINrvnhosFxK0XxWOu4w2L7Kk4yiI4eYEvVb8RwBOVO3sH8+LhD8wrgMYBXsHYFT SYkDgGgQly4RRRjJgDt4YmuoMFSVTrfdkqBB+G1cSrwg1Z/p6amKu+xH16KXLRlJkjR1 QQ6Q== 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=M5UfIpTqBdOphhajnAZw8wR46nysPGmM8dw5zaZKWu4=; b=LPDpzMIjQZ/3bOIJBpUJeOepV+ShMdPMIKUcsQ36FhulUk/Y1HVMCt/uXWQIR5DO5I RNPPI9TsBATxMQ+LoOafi14NWQdUH7SNxbA1QXXUARsgTkjxy4hE8McDLNLILoVIDGZn XwPmnMMd35u0KtpmVyj47bPnsWdZDHJcB41YyvKmjEl/kuHkGIBCFISWr6LD5nFEVvHy bQ5+iVZ6t7UCE//HL+OJkor6oGR9M+Slkq2T+EXBu09L4YF1cxABnL2g7cP4zg8wXTKy B4OlQfdsIjqA1AoYfGxMGPSX0KVIB1x9ybGu9xl5ADm4hwVOzjiXW1r3TCulcbHt4mC2 DbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uxrHeBum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a170902714300b001ae469d868dsi4591639plm.651.2023.05.22.09.31.12; Mon, 22 May 2023 09:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uxrHeBum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232417AbjEVQ0z (ORCPT + 99 others); Mon, 22 May 2023 12:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbjEVQ0w (ORCPT ); Mon, 22 May 2023 12:26:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3B1FFD; Mon, 22 May 2023 09:26:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3FC3F619D3; Mon, 22 May 2023 16:26:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31C88C433EF; Mon, 22 May 2023 16:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684772807; bh=+QBgGjkSmT8IRp213R2vBwO0H73ayKuAs2FpmTLOpZo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uxrHeBumrrNbQQx/qlTcvAWuJT/nue/NAARfPjVnh2vHGeozCHZeTDBc9D2fl3lba fUqUbwyPSSUvAb0RgTdGN7itd6UpYdYhn2WgelZaDgksdoSjwfhBZpOk55DzSK36mQ nS70+0/UHNHwsaEKttRM3eajXI7AtC9J8FXKBvJI= Date: Mon, 22 May 2023 17:26:43 +0100 From: Greg KH To: Rajat Khandelwal Cc: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] usb: typec: intel_pmc_mux: Expose IOM port status to debugfs Message-ID: <2023052215-skilled-polygraph-33dd@gregkh> References: <20230522070343.3675581-1-rajat.khandelwal@linux.intel.com> <2023052216-railway-zipfile-680f@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 22, 2023 at 03:24:13PM +0530, Rajat Khandelwal wrote: > Hi, > > On 5/22/2023 1:07 PM, Greg KH wrote: > > On Mon, May 22, 2023 at 12:33:43PM +0530, Rajat Khandelwal wrote: > > > IOM status has a crucial role during debugging to check the > > > current state of the type-C port. > > > There are ways to fetch the status, but all those require the > > > IOM port status offset, which could change with platform. > > > > > > Make a debugfs directory for intel_pmc_mux and expose the status > > > under it per port basis. > > > > > > Signed-off-by: Rajat Khandelwal > > > Reviewed-by: Heikki Krogerus > > > --- > > > > > > v4: > > > 1. Maintain a root directory for PMC module and incorporate devices > > > under it > > > 2. Add the debugfs module under '/sys/kernel/debug/usb' > > > 3. Use the platform device 'pmc->dev' to assign the device's name > > > > > > v3: Allocate the debugfs directory name for the platform device with > > > its ACPI dev name included > > > > > > v2: > > > 1. Remove static declaration of the debugfs root for 'intel_pmc_mux' > > > 2. Remove explicitly defined one-liner functions > > > > > > drivers/usb/typec/mux/intel_pmc_mux.c | 54 ++++++++++++++++++++++++++- > > > 1 file changed, 53 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c > > > index 34e4188a40ff..f400094c76f2 100644 > > > --- a/drivers/usb/typec/mux/intel_pmc_mux.c > > > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c > > > @@ -15,6 +15,8 @@ > > > #include > > > #include > > > #include > > > +#include > > > +#include > > > #include > > > @@ -143,8 +145,14 @@ struct pmc_usb { > > > struct acpi_device *iom_adev; > > > void __iomem *iom_base; > > > u32 iom_port_status_offset; > > > + > > > +#ifdef CONFIG_DEBUG_FS > > > + struct dentry *dentry; > > > +#endif > > No need for the #ifdef anymore, right? In fact, I think it will break > > the build if you have it this way and CONFIG_DEBUG_FS is not enabled, > > right? > > I guess you're right. Maybe it'd have been fine if the rest of the > debugfs stuff was also enclosed within the conditional macros. Which is not needed and not good kernel coding style, so it's right that they are not there. > Anyways, removing it seems appropriate now. > > Also, is it OK to send you v5 on the public list directly? Where else would you send it? confused, greg k-h