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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D622C282D1 for ; Fri, 7 Mar 2025 00:55:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7778280002; Thu, 6 Mar 2025 19:55:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B2688280001; Thu, 6 Mar 2025 19:55:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EF8E280002; Thu, 6 Mar 2025 19:55:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 827C5280001 for ; Thu, 6 Mar 2025 19:55:32 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7518BB4BA7 for ; Fri, 7 Mar 2025 00:55:32 +0000 (UTC) X-FDA: 83192936904.14.FF74E7B Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf17.hostedemail.com (Postfix) with ESMTP id 621E140009 for ; Fri, 7 Mar 2025 00:55:29 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741308930; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dixenGd/UtjTzP0Fiwe9IvP3ozqmBxh0QTv6HDw+qgc=; b=QLZBA+65Bv37xV60I3NDeh59dCsgiYqCKu0gKNvyOgEOTT6RNzQqd8gwulJdsfEI7IGNVz w2Ova2k36WoVIl9eDd52jAYarrLVwrwkeHID4MnLQH0dmKHpMNfuyVzY6lHZ/RjaVNkHRC Xmdh0IXpdThdyg4Gz1CU2I3W+wOtVko= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741308930; a=rsa-sha256; cv=none; b=wpQJYRhMZg9FROnTrSeInb/xzcwiv6W0xwmuZOhtsj0ugdHQcwuH+8TewMuhONAJrrL4/l EJnKTBztbRZc42EIB8edIU5kEKJzZ/cicbp0VtEKw807/Qz9ui/DG1TB18YkHnFHZs4ZSa 6uTMqInIDwFDask2ZpUakVjDJF5RxZg= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Z875G5wYhz6L5DY; Fri, 7 Mar 2025 08:51:14 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id E089F140A08; Fri, 7 Mar 2025 08:55:25 +0800 (CST) Received: from localhost (10.48.43.65) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 7 Mar 2025 01:55:09 +0100 Date: Fri, 7 Mar 2025 08:55:07 +0800 From: Jonathan Cameron To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 1/8] cxl: Add helper function to retrieve a feature entry Message-ID: <20250307085445.00005f5d@huawei.com> In-Reply-To: <20250227223816.2036-2-shiju.jose@huawei.com> References: <20250227223816.2036-1-shiju.jose@huawei.com> <20250227223816.2036-2-shiju.jose@huawei.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.43.65] X-ClientProxiedBy: lhrpeml500010.china.huawei.com (7.191.174.240) To frapeml500008.china.huawei.com (7.182.85.71) X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 621E140009 X-Stat-Signature: 39xzag5j54wdjirmhb7nnooeuthbdugc X-HE-Tag: 1741308929-491441 X-HE-Meta: U2FsdGVkX18NSvPSjWPUhJMW1R5uh12Z1oKVib5gRXLQkLFtUszwP1SF4nGRGpXugd56CfvyFptEq6rY0OLLeNv1HGwqxEJYRUeNKYGLMb8sQLTwWfKChn9ZIuWK7m42WYIYrLkMLmFbjoEh580Xrt+O97sEsHQ1uBT2Kf+kjeziLC63Z/TVaVnwEGqcuf3mJi719PloGc89DTRhDE36jjV4RhKEB6rDdPscrbxhLvsaPZSYipdCR2ftDO/r71KpMi+nTkihE0l/1Wub+nzTWT2BCUezOLYcB7oztCxPRNToWFRZ6ppHQoH4Vg0ASt9wxAmH5Mjxu9YlSfhM4aHffl8Ui38RIG7arR1FW8s3HbBkaM4tUIc4j6g7z7qs/4fle3XAKWeGU9IAsL5q/+biMxtZ0UcGA7bqM7mLmAF67MI+0GyujMfuj7l8wb06XM7BpEqTLQRXFQ30zQ+VFWIhXO6a9pLYiRaPt7Lbo7lmhGIFZjv6iDQkH9F1U1rJ6VqqAZebx9sPqY72WNGhRqEfPVoVyHoNYuyb0IJ3vsaiYvTLGeln+9rzX1nKFzwX5yUtrvEwx8AmzzLaK2SAqpbuQ3k7VAggg3Pr/OYCtby0kqbrKAmQNqjhih991SJImWE/4++OOKdx4vWCq0hlvuQNEFBnk5HlRZzzGG5gUE7OdE0U14tpkECrMlVyWrgJE4Oay3+ngNkLM1Ai68BsiUBnQAIpAknMWuhFRVoE9SHgvUT3wK+vZcLII1dattBP2zqfZRf9gWBuosBrmeLS0eQ6w5vAIPtt6jHXCEzzx6v+Oizxy3UxlAGKfwTViRdl6pLGx7OIX4agyigXrEUvqN2qvnyOAZ3QhquYcSCzUMLkZiqRsreP9h9yPaHv7wyUJW69wYJPJaRQrCVGvNx1Lqx0QUmkC+B1MtT40FEdqhi8cOMGn//0ncwGnxUCL9rNz1YCKGgz+xOgh1/Fr3SySLn CHFDvGNW 3xINEVwmlLErkmUXayS8LVMVx5pjAkxlrIXrRIzQHDtCdcUd7VN9iLH1rFtDxS6fuXh8s5YMJvozdHAQH3PhcZqCLJ8TpFYyXi2UKVl1SVxbcMn5vQbJPeg61uksN0fhvJLYmWSP6QDDomyELaYpcCF07JcAAcRRM+Uj4XIGGBu+m6aPl97F4kV1ELhtz7OIxLBJF3j4i03So8eyeWcFsHf/TEhPnH5vEv2jmslsdMYzgBsQ9pKTjXgweo4WRTEr1UKc1SPM0etzcuNEXMh7gyPKJaZlDhud/9zCzckoG2ymXYI0ut/W3hNZCRg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 27 Feb 2025 22:38:08 +0000 wrote: > From: Shiju Jose > > Add helper function to retrieve a feature entry from the supported > features list, if supported. > I think this came from within the core cxl features series but got pulled out due to lack of users until this set? > Signed-off-by: Shiju Jose Either way it's a trivial and useful helper. Reviewed-by: Jonathan Cameron > --- > drivers/cxl/core/core.h | 2 ++ > drivers/cxl/core/features.c | 20 ++++++++++++++++++++ > 2 files changed, 22 insertions(+) > > diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h > index 3d3b00835446..6c83f6f18122 100644 > --- a/drivers/cxl/core/core.h > +++ b/drivers/cxl/core/core.h > @@ -120,6 +120,8 @@ int cxl_port_get_switch_dport_bandwidth(struct cxl_port *port, > int cxl_gpf_port_setup(struct device *dport_dev, struct cxl_port *port); > > #ifdef CONFIG_CXL_FEATURES > +struct cxl_feat_entry *cxl_get_feature_entry(struct cxl_dev_state *cxlds, > + const uuid_t *feat_uuid); > size_t cxl_get_feature(struct cxl_mailbox *cxl_mbox, const uuid_t *feat_uuid, > enum cxl_get_feat_selection selection, > void *feat_out, size_t feat_out_size, u16 offset, > diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c > index 048ba4fc3538..c822fb4a8c33 100644 > --- a/drivers/cxl/core/features.c > +++ b/drivers/cxl/core/features.c > @@ -203,6 +203,26 @@ int devm_cxl_setup_features(struct cxl_dev_state *cxlds) > } > EXPORT_SYMBOL_NS_GPL(devm_cxl_setup_features, "CXL"); > > +struct cxl_feat_entry *cxl_get_feature_entry(struct cxl_dev_state *cxlds, > + const uuid_t *feat_uuid) > +{ > + struct cxl_features_state *cxlfs = to_cxlfs(cxlds); > + struct cxl_feat_entry *feat_entry; > + int count; > + > + /* > + * Retrieve the feature entry from the supported features list, > + * if the feature is supported. > + */ > + feat_entry = cxlfs->entries->ent; > + for (count = 0; count < cxlfs->entries->num_features; count++, feat_entry++) { > + if (uuid_equal(&feat_entry->uuid, feat_uuid)) > + return feat_entry; > + } > + > + return ERR_PTR(-ENOENT); > +} > + > size_t cxl_get_feature(struct cxl_mailbox *cxl_mbox, const uuid_t *feat_uuid, > enum cxl_get_feat_selection selection, > void *feat_out, size_t feat_out_size, u16 offset,