Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3967886rwd; Tue, 23 May 2023 00:47:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Eg7eKivQJS7FW8Nl4076aIJhoapYy0gVufjeF65aWJ2Dr0JAhIT9t6RT9RrqDa2PLtrdj X-Received: by 2002:a17:90a:ce07:b0:253:8c39:642 with SMTP id f7-20020a17090ace0700b002538c390642mr12241784pju.5.1684828040565; Tue, 23 May 2023 00:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684828040; cv=none; d=google.com; s=arc-20160816; b=HinZUAEzjeMZvfMYJmdiRUOhu9EEGQD5n3EDdwTZjZwuDpTHotPBaj5ENimyAsjzZX S4m4p2YRRXJk8vFfur3FnxEktmM2VSqFQsHQvv+PABCtQb3lFYOlUMvjE68BsqIM2UAQ QLBsTyxf3Sp6XEmOEiftec/4oFvxLez7UnQ4xkisGri85g0UXL4irM1chsvZ3WmGvc6e u7U3tXqCO+CKs9gnsjLruJ9J4khaP0zgS5HMz39sPoYvY2zxH0sftB5jKREcqyJvVvTu cMZokKEUfZ9DydpYm69eUJFCXjDmP4tGayvi/c9mGCyWWIIDjT7xlhqc/0hAKikHRiXx MM2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=apuJanAyBv4Gh+FFrWSwd8NJwu0kYT/gM7qkDznzR9s=; b=V3HqKkonOU83yD+ZPw0c7/zvibfTnm8lwzi2FZVUERG+j5SJgHTuxpNRolStKTKPd0 M35VqcFblhC1Q/iMbBZQPKVcufNle4d1Hx/eNAjd8Iwhh1tYQYGju9EH9cAHBTSS5x1w 0Jv//mM+pTA3+vkavaJHafCRu4KQePWK3iUXQwppGKRnQFfIvzHnPxCCvmqXaZEzJprC lAY/3kOJwfDGO9TYDqNMPwGB6QUZzTVk36vH4kCIz0M1x+EbzlAgoapX4oR8KuPvQSzN IWVQPK3o0cOqNPgoLTjxmYYpmCvQLDPgtXcIm9qMOmLoM9ZBXnjoU4wlEZunfPvtrVvM bA1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WkO+J0dg; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k185-20020a636fc2000000b005348dd43155si5943690pgc.283.2023.05.23.00.47.04; Tue, 23 May 2023 00:47:20 -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=@intel.com header.s=Intel header.b=WkO+J0dg; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235522AbjEWHoe (ORCPT + 99 others); Tue, 23 May 2023 03:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235164AbjEWHob (ORCPT ); Tue, 23 May 2023 03:44:31 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7555695; Tue, 23 May 2023 00:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684827870; x=1716363870; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=lZbI7pLXiFlhXhGMkTTyFN8Mh1aISQz9hrjO+FHTjkg=; b=WkO+J0dgiUVvWvuOCz+UtlaJuXqctOo0V52Cr65LdbH9wgMy4LnbkPy+ EgOcM244+nj2XpnGWr9CF33HF8FwAi285vbQT3jG7XVe9Z60/zgC+gURF SOckxmGTFh6noWl0Ni9jjBVMQV/kYjVcJcgjz6ErFPKqKUb0Lbc2LxP4y vaDA9TWhIdY6xKle8rxY5rndnKWBH3p++U4FWghgk7bN2px7Az7lilQu6 b5s0CHwXEURUcVU5tAUu6FPqtVGNxZNcZulztku//2zV6f/0TBbV+gTnk OVoRaatHDqocI4r9af4ZfDk2imB0ALbXPvN4SjIvTpW+b5H3+9YoDWNUA g==; X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="342623939" X-IronPort-AV: E=Sophos;i="6.00,185,1681196400"; d="scan'208";a="342623939" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 00:43:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="1033958232" X-IronPort-AV: E=Sophos;i="6.00,185,1681196400"; d="scan'208";a="1033958232" Received: from rajatkha-mobl.gar.corp.intel.com (HELO [10.67.146.41]) ([10.67.146.41]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 00:43:40 -0700 Message-ID: <81e51edf-9ae8-4ce4-c203-af05f0d82f48@linux.intel.com> Date: Tue, 23 May 2023 13:13:37 +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> <2023052215-skilled-polygraph-33dd@gregkh> From: Rajat Khandelwal In-Reply-To: <2023052215-skilled-polygraph-33dd@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hi, On 5/22/2023 9:56 PM, Greg KH wrote: > 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. Sure. > >> 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? I was under the impression that you'd again require the review internally under Intel before releasing out to public list. Anyways, sending out v5. Thanks Rajat > > confused, > > greg k-h