Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2591489rwd; Mon, 22 May 2023 00:54:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WEZ6WQqRmVfwXghfOfQzzqqXh4OILnRvvhEzWTqE2YYWVGUwgZEP5G9vGo9Y3V5B9DQFB X-Received: by 2002:a05:6a00:1594:b0:646:6e40:b421 with SMTP id u20-20020a056a00159400b006466e40b421mr11031703pfk.1.1684742075230; Mon, 22 May 2023 00:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684742075; cv=none; d=google.com; s=arc-20160816; b=irjxvbLwS0czl5Y5Uhfkj9au5Mv97l1Ohj8hUtVo1XxixNd2L+5zxrnTYJYX0DTO6l 2TkQ9C//TqDfwgxICUIY5klV+aIP9v1i2wfANQiavb9idY5kgew8CDcXDfSmW/8B7CwD g6KZVKoYd0MBFskvzi4VoL5TDIV5fRcnmGbFQZPbAccGIFLGfYsexLWZ9L3bHeQ3dTtn 3jrqBm8V6E8ZcijdvTC+BjGsMDxuEjZWRVnjkws4rfvdkVs/uwa6KWWgie30Av/9hRIV sTC19KqT4WtjMgPhzQCrPEgJ8AozwpSPugCBvvzGYSJXAyUVfCTbVk+bc6H94On9Cv48 Hh/w== 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=s5AXXvs9X/zM/uKD39fMl1pLMUjcPvI3kJmisj4sH+c=; b=Frv86Mp/lVIPofQzzAZB4gVBOMOCLb978dekt1wwNpAqan43UWFLxDw4pnqHb0f5kI En90WF+jezlGGdg89g03nyqltiMXnzv8WrYWMy9NmHJA8f44jN5x254ZflTGpzlenVgD 97Jw3I4LpxbF0iqLbE4Pl7xKF1UhoLUhN4ovYxptSu5dkCcl7XfxXeGPLN/7p9VyphTF 3eEJY+fJzAgfF7YF2Avv5e3gOkupOBgHu5Vz1bl9eFSUY6uF6+fOFmuQuI1e+r3zdSza 6u5NMlpFShz485KxFF5QlzcT4nu5LKNMV3QcVQpNX7mzEg8c7OuZHb/e+r1u8fuToLKX ywqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eqS01qaJ; 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 k62-20020a638441000000b005286be44da7si4412634pgd.706.2023.05.22.00.54.20; Mon, 22 May 2023 00:54:35 -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=eqS01qaJ; 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 S232631AbjEVHiX (ORCPT + 99 others); Mon, 22 May 2023 03:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbjEVHiF (ORCPT ); Mon, 22 May 2023 03:38:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26DAFB5; Mon, 22 May 2023 00:38:04 -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 B7EA2611D8; Mon, 22 May 2023 07:38:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4B45C433EF; Mon, 22 May 2023 07:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684741083; bh=h05sI+Xfwe+94IZ9ANQcF4AryecTT3FjGz/NXi+iPNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eqS01qaJLr3SMg5caSwUWHBoEnBgSOBqKOdVj6rqn3xK/wGywIc/frtxylmK7cynT X12AqzyitwqAuOqjv7oi9U/5HzCRaa8EZ4n7F1P2iFEQ+j1XnmwvcAUwKzAeItyzao NHwtpY5k/url6ExGaBFE1UKOzFUBYDq22vdP+4MA= Date: Mon, 22 May 2023 08:37:59 +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: <2023052216-railway-zipfile-680f@gregkh> References: <20230522070343.3675581-1-rajat.khandelwal@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230522070343.3675581-1-rajat.khandelwal@linux.intel.com> 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 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? thanks, greg k-h