From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13098C77B73 for ; Mon, 22 May 2023 09:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232784AbjEVJye (ORCPT ); Mon, 22 May 2023 05:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232659AbjEVJyX (ORCPT ); Mon, 22 May 2023 05:54:23 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2778CC2; Mon, 22 May 2023 02:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684749262; x=1716285262; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Tpv33id8FXgSyWY15secqhEjCEaHD/wMEKZRfaT7ChE=; b=l8L7ePGqHJgHfE+GKVySJ0ZjsJ3r5rXPC9JPUr2ycjst71zrJnV6Z2R4 3zQYa8m8NIi1jnL6UA1h7X+sU6l7UxWTs8X5RF9Di1IfrAwaaar36dhdl mO/V40e0Ox9flskIMwUOi4eeoHwPULYIJx//sAs+WyL0j5NtkOe9PEL7F ZyKh55ST6x469aakH88C5Ai6GcotboebaJe0fpBmNbssjN2Qq2J797YyP lcqzSub2AXnX8ycBKFI6qfJ6IIF/ufsqCTPzYc2mIg5F0mcdnaPqAh9EW HOS2HQA6/8FywqZgzbsGqwp4lNlC4OHuVwcumuXXiyjfXsxjq3DZQcqsL A==; X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="352900229" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="352900229" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 02:54:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="653884244" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="653884244" Received: from rajatkha-mobl.gar.corp.intel.com (HELO [10.67.146.41]) ([10.67.146.41]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 02:54:16 -0700 Message-ID: Date: Mon, 22 May 2023 15:24:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v4] usb: typec: intel_pmc_mux: Expose IOM port status to debugfs Content-Language: en-US To: Greg KH Cc: heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230522070343.3675581-1-rajat.khandelwal@linux.intel.com> <2023052216-railway-zipfile-680f@gregkh> From: Rajat Khandelwal In-Reply-To: <2023052216-railway-zipfile-680f@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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. Anyways, removing it seems appropriate now. Also, is it OK to send you v5 on the public list directly? Thanks Rajat > thanks, > > greg k-h