Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2076435rdh; Tue, 26 Sep 2023 11:34:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTh+KL+WpdmzgEOTcYxzzOVLoS2XB6Lwc1GryNdUHRecOFfragzKV687GP+BRQ7/nElaHa X-Received: by 2002:a05:6808:18a:b0:3a8:5133:4832 with SMTP id w10-20020a056808018a00b003a851334832mr12166538oic.23.1695753248910; Tue, 26 Sep 2023 11:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695753248; cv=none; d=google.com; s=arc-20160816; b=Xc/UJw+a3RsmUYF0GP44RmJm5IStx2kENP/G8XJrfmCBAtYze0czkkOWRLa3huJawt Ej1UkEdUYiaJe0QxP+JlnJHzCApXAUy832pk9rqTp+xL1ncmj9mdCYNTLTZ9u7fR5itV ySvZt7BLNmG75L3dPoObgXjsP6o7nKHn8OI3WSYrf6vEHDJEWKI5lYXeUz245hTi4KmG qO7JBExwUTU6czVoR+liQxPlkx785E7coP9i6WlDD1absxSQBCoQiK4aA7q6b4gYINYp De+iX37xyxVrRClG8MDN/c1TsdSvm2ZZP7J6qdt2jmfIiDp8OrlrhtEvoW5izuNYCb2U tWzA== 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=qXzQL+SVmZ+o/XriicTWoha/o/sahOjvToKUk50s78M=; fh=sfmJjT07mOzaJ3NDCocXWSNUbB7msqFqiMEes6p2IRg=; b=fDrKvpSHt4BkLQsCgc/L/sROpuulwaoUiHtCd/NXSinqx9tnSirbZC73wSFejJUB3A GFVfXJpV+c9Fn/eFzrj1EPVTKLnoAsyOIPDFZEcrPh6tLlaYVRWpt8jqhYVh8kBrstDp yAzXy4mr/RTQyWtrinQonjgCt+BNPd2k8y8JJoR25/2/hKaMO5QM8qmU6IwtQQlgEzB2 PyjW/Z3DTX4gynZd3HM1BEm3joz6yf2rG0nOsHlowYSsEK7qhexnteyoQHcxS+o23d4N NFXGD9Ayk/flXhABPqp71tq+5Vwt8QLV/fz1IVw3vUzLE4PxWbYiYz8Vg4ppaOQlfpF9 rdGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c6wXDAvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bv64-20020a632e43000000b0057745d87b50si12987947pgb.139.2023.09.26.11.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 11:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c6wXDAvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CA3C58063BF4; Tue, 26 Sep 2023 03:05:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233494AbjIZKF3 (ORCPT + 99 others); Tue, 26 Sep 2023 06:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjIZKF2 (ORCPT ); Tue, 26 Sep 2023 06:05:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D372597 for ; Tue, 26 Sep 2023 03:05:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75B6FC433C7; Tue, 26 Sep 2023 10:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695722721; bh=FRY+2/YiUx0GUA9zrZNTOcop5bKxxb0FkPII665yLe8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c6wXDAvx09MwQSbEG/KS/MCClUoRd8vdwsocvrUHjhzaw52fGEreFjMzciKxioW38 PUlSPMxQ0s2lOi9K0Ah4az6D23Duhh7eKyaR6oi3l91Z/gR5YGk+E62RZwm/2j1pKF 3MGAoo/AAkjx9zD3J867j6X8wOOg25nJF33jWCJg= Date: Tue, 26 Sep 2023 12:05:16 +0200 From: Greg KH To: Abhijit Gangurde Cc: masahiroy@kernel.org, linux-kernel@vger.kernel.org, Nipun.Gupta@amd.com, nikhil.agarwal@amd.com, puneet.gupta@amd.com, git@amd.com, michal.simek@amd.com, Pieter Jansen van Vuuren Subject: Re: [PATCH v5 3/5] cdx: add support for bus enable and disable Message-ID: <2023092613-clean-antitoxic-077c@gregkh> References: <20230922101828.33456-1-abhijit.gangurde@amd.com> <20230922101828.33456-4-abhijit.gangurde@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922101828.33456-4-abhijit.gangurde@amd.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 03:05:28 -0700 (PDT) On Fri, Sep 22, 2023 at 03:48:26PM +0530, Abhijit Gangurde wrote: > CDX bus needs to be disabled before updating/writing devices > in the FPGA. Once the devices are written, the bus shall be > rescanned. This change provides sysfs entry to enable/disable the > CDX bus. > > Co-developed-by: Nipun Gupta > Signed-off-by: Nipun Gupta > Signed-off-by: Abhijit Gangurde > Reviewed-by: Pieter Jansen van Vuuren > Tested-by: Nikhil Agarwal > --- > Changes in v5: > - Rebased on Linux 6.6 > > Changes in v4: > - Add sparse marking for lock around cdx_find_controller() function > > Changes in v3: > - Use platform bus to locate controller > > Changes in v2: > - Improve documentation > - Split sysfs entry enable to enable and disable > - sysfs entry enable and disable take bus number as an argument > > Documentation/ABI/testing/sysfs-bus-cdx | 27 +++++++ > drivers/cdx/cdx.c | 97 +++++++++++++++++++++++++ > drivers/cdx/controller/cdx_controller.c | 50 +++++++++++++ > drivers/cdx/controller/mc_cdx_pcol.h | 54 ++++++++++++++ > drivers/cdx/controller/mcdi_functions.c | 24 ++++++ > drivers/cdx/controller/mcdi_functions.h | 18 +++++ > include/linux/cdx/cdx_bus.h | 12 +++ > 7 files changed, 282 insertions(+) > > diff --git a/Documentation/ABI/testing/sysfs-bus-cdx b/Documentation/ABI/testing/sysfs-bus-cdx > index 7af477f49998..04c8dfe7e201 100644 > --- a/Documentation/ABI/testing/sysfs-bus-cdx > +++ b/Documentation/ABI/testing/sysfs-bus-cdx > @@ -11,6 +11,33 @@ Description: > > # echo 1 > /sys/bus/cdx/rescan > > +What: /sys/bus/cdx/enable > +Date: July 2023 > +Contact: nipun.gupta@amd.com > +Description: > + Writing bus number in hex to this file will attempt to enable > + the CDX bus. The bus number for the cdx devices can be found > + at /sys/bus/cdx/devices/cdx-BB:DD, where BB denotes the bus > + number for the respective device. > + > + For example :: > + > + # echo 00 > /sys/bus/cdx/enable > + > +What: /sys/bus/cdx/disable > +Date: July 2023 > +Contact: nipun.gupta@amd.com > +Description: > + Writing bus number in hex to this file will attempt to disable > + the CDX bus. CDX bus should be disabled before updating the > + devices in FPGA. The bus number for the cdx devices can be > + found at /sys/bus/cdx/devices/cdx-BB:DD, where BB denotes the > + bus number for the respective device. > + > + For example :: > + > + # echo 00 > /sys/bus/cdx/disable > + I can't remember, but why aren't these just attributes on the bus controller for that specific bus, and not a bus-wide attribute? Wouldn't that make more sense and remove the need for parsing values of a bus number and make it more obvious what bus was and was not enabled at any point in time (i.e. you can't read to see what bus is enabled/disabled right now with this change.) thanks, greg k-h