Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2649493pxk; Mon, 14 Sep 2020 21:01:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIlLv+AMNe4mzaqruHSiOcokV8kqVyzWqBvlsXxOPRFHLO6sgPEtRyV6EZrdBcdiXZrviF X-Received: by 2002:a50:fe98:: with SMTP id d24mr20055897edt.223.1600142482254; Mon, 14 Sep 2020 21:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600142482; cv=none; d=google.com; s=arc-20160816; b=PrvuIug3YWsiwkE0Lcy1vyda06Z4UUd5btlWiq+XUQsfsaq5SJo9g9ghYCRCPLddr7 eS9nBP02tuFNhBgEuARCq90XG4IlnuNPbqhBYgxR6beVErxtvpHjnsozMlgrMI2bKcdK Z3om64ZvV1p4MgX/seR7yH+3hrdCheDmmyGjL7EF8na3J/1+cpSYyml3mjo/DVgx06he c7jTk4izJvZy02IHx2BE6DUHJh3gACaEP08as9X+vtXA0+zJ16qKEDm0mv9e8/W8LQXl /G7cK1aYb+hODfzPrVdQBU/vwuwprUNbD4nUuH5eJ6eYvikDuLw0zf+8kkzCyuynFXcB CzdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=s/pseMDxGgOy9sMfqXmUqWf/bvkoNENN6WX97+nvh5w=; b=VFM4NlUB8osRR3mmQVTspVPDrZd6vOXoZRkkHY7uNrDmwv1DI+6rsjdHdrfZHdGe2e Hz540mKYy5bF54iBmQEW3vmj5GrWnbpaJrwenGCc60OmBbHq87SoNZnyrICUutm6k841 GDQaBkA6WK5PZMB3nxhXC1RWs+Smr72NpfAfDaC9M6Bc9EHEg0vdusgGDR6fr1HUn9jY sC2FAmQyw67itwlgYK+d47GXbsy1E1cW0yX+qu47wBX33JW1HbRXUMejSuuG0GiiS2e9 fihqYQEFbqIJ4Hw4++j2FvHe/b6l8s+YKWdiXTIExv0vbB/EYUBq/OTU5UWOwba12vEV ZUSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id br19si8177321ejb.151.2020.09.14.21.01.00; Mon, 14 Sep 2020 21:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbgIOD7e (ORCPT + 99 others); Mon, 14 Sep 2020 23:59:34 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42477 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbgIOD73 (ORCPT ); Mon, 14 Sep 2020 23:59:29 -0400 Received: by mail-pf1-f194.google.com with SMTP id d6so1149831pfn.9; Mon, 14 Sep 2020 20:59:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=s/pseMDxGgOy9sMfqXmUqWf/bvkoNENN6WX97+nvh5w=; b=IC1BaSvv8ejL//TO8AzV8d9RIy1O0cKeJpiBasQJ9uEX0OlsSZ9Vx5GHIXun+uoj6m sIzo15SOk1RIbCUIVKnrWocVj6C/s4HL109HsMzU4Xyij/ic0uprs5u+HofSBMvRInb/ TjkG7Piky0JA7t4yRHlegPcpoWt84RmDdr3K0fg31W/jDMEMQpLDYbIMKCv62AfboHL8 RDqFg91U4L7gIfo2V3wEHnwdZylHAUQN4fZG/B4bcL7qXSK4MduR+phWzry6kF+rBChN VVJMSJXJJwfY9WbGeLplxLD676ltImcvxztmoXDAMfVORNajtniLCJxXFctoW75mz5i7 ivPw== X-Gm-Message-State: AOAM532/Mc7KUIVjOi5hdH8hnCXn+OJokJzGvQ8evl4xkdew5tT7qFWZ Lxh1AQ0fUtp5/uONt2uF488= X-Received: by 2002:a62:503:0:b029:13e:d13d:a0f9 with SMTP id 3-20020a6205030000b029013ed13da0f9mr15796057pff.21.1600142368047; Mon, 14 Sep 2020 20:59:28 -0700 (PDT) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id i2sm9973815pfq.89.2020.09.14.20.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 20:59:27 -0700 (PDT) Date: Mon, 14 Sep 2020 20:59:27 -0700 From: Moritz Fischer To: Xu Yilun Cc: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, masahiroy@kernel.org, trix@redhat.com, lgoncalv@redhat.com, Wu Hao , Matthew Gerlach , Russ Weight Subject: Re: [PATCH v2 2/4] dfl: add dfl bus support to MODULE_DEVICE_TABLE() Message-ID: <20200915035927.GB2217@epycbox.lan> References: <1600140473-12351-1-git-send-email-yilun.xu@intel.com> <1600140473-12351-3-git-send-email-yilun.xu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1600140473-12351-3-git-send-email-yilun.xu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 11:27:51AM +0800, Xu Yilun wrote: > Device Feature List (DFL) is a linked list of feature headers within the > device MMIO space. It is used by FPGA to enumerate multiple sub features > within it. Each feature can be uniquely identified by DFL type and > feature id, which can be read out from feature headers. > > A dfl bus helps DFL framework modularize DFL device drivers for different > sub features. The dfl bus matches its devices and drivers by DFL type and > feature id. > > This patch add dfl bus support to MODULE_DEVICE_TABLE() by adding info > about struct dfl_device_id in devicetable-offsets.c and add a dfl entry > point in file2alias.c. > > Signed-off-by: Xu Yilun > Signed-off-by: Wu Hao > Signed-off-by: Matthew Gerlach > Signed-off-by: Russ Weight > Acked-by: Wu Hao > --- > v2: add comments for the format of modalias > --- > scripts/mod/devicetable-offsets.c | 4 ++++ > scripts/mod/file2alias.c | 17 +++++++++++++++++ > 2 files changed, 21 insertions(+) > > diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c > index 27007c1..d8350ee 100644 > --- a/scripts/mod/devicetable-offsets.c > +++ b/scripts/mod/devicetable-offsets.c > @@ -243,5 +243,9 @@ int main(void) > DEVID(mhi_device_id); > DEVID_FIELD(mhi_device_id, chan); > > + DEVID(dfl_device_id); > + DEVID_FIELD(dfl_device_id, type); > + DEVID_FIELD(dfl_device_id, feature_id); > + > return 0; > } > diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c > index 2417dd1..9fd2e60 100644 > --- a/scripts/mod/file2alias.c > +++ b/scripts/mod/file2alias.c > @@ -1368,6 +1368,22 @@ static int do_mhi_entry(const char *filename, void *symval, char *alias) > return 1; > } > > +/* Looks like: dfl:tNfN */ > +static int do_dfl_entry(const char *filename, void *symval, char *alias) > +{ > + DEF_FIELD(symval, dfl_device_id, type); > + DEF_FIELD(symval, dfl_device_id, feature_id); > + > + /* > + * type contains 4 valid bits and feature_id contains 12 valid bits > + * according to DFL specification. > + */ > + sprintf(alias, "dfl:t%01Xf%03X", type, feature_id); > + > + add_wildcard(alias); > + return 1; > +} > + > /* Does namelen bytes of name exactly match the symbol? */ > static bool sym_is(const char *name, unsigned namelen, const char *symbol) > { > @@ -1442,6 +1458,7 @@ static const struct devtable devtable[] = { > {"tee", SIZE_tee_client_device_id, do_tee_entry}, > {"wmi", SIZE_wmi_device_id, do_wmi_entry}, > {"mhi", SIZE_mhi_device_id, do_mhi_entry}, > + {"dfl", SIZE_dfl_device_id, do_dfl_entry}, > }; > > /* Create MODULE_ALIAS() statements. > -- > 2.7.4 > Applied to for-next, Thanks