From patchwork Fri Dec 1 20:10:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 172635 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1388798vqy; Fri, 1 Dec 2023 12:11:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEi+pBc+lKMOjV18YWzth1snKPkmoFkgeNATvStnUvppAiGVd36GsycYaO6N/3pgzcfekE7 X-Received: by 2002:a05:6a20:3948:b0:18a:e003:21aa with SMTP id r8-20020a056a20394800b0018ae00321aamr27463818pzg.13.1701461495041; Fri, 01 Dec 2023 12:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701461495; cv=none; d=google.com; s=arc-20160816; b=AUcv3qLZc2uYcCehqoszMRJqqkKzR55Ov7jO1+iCVJBEeX8FHcD1sZ30u3vuqiRotL sjxpTzSXBRkEeKPr5PmjRXb3b2zJNmi8rZi1Zc7+fFP0uTM53XPpL22bR1ROn+mDvPMq SlTPJOR++vZpPhzgp/33pYRuYVe9NvsedYqMFBE7skPYM3KFWFmRmBxmBB36OZqhZEJ8 gbQ8V1eNJ7XCYqCM+fGVRo/wzxBWEsZHtlhx65E74x8oumqqj1ih1owAz/x1ZsMComgZ WUVTc+Trsx/T33Em/twFY5+U6ml0JOM9+tKka/aQDGspNDUn9a6+/JOo5fafgAoL+V7/ /raA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+ZkouoOXFIToCAPJcKkfDzX1W3mk8932RW726ZUQpBg=; fh=CKy338m5MbqOKLCytkQoYDn9hkoAEvElo6dffmo/qoM=; b=dtFgLuZV7cQoc7zY7XZ6/r35rfWJs0Y6ZoGSg9CtuVTa35Ms9NXq+AILp53DeEYxvR qhCuv8HE5VXCiYXkyh58NeNyKao5T/xU8ynkb/zui7c+GgpHI2+GRZt73TZMY4MqyPtn 4DY1H64VVneFEUTCr48xT0Kci8EPTqreHdgmDOsYVoyfIoLh3nb7ILBF6ktMDSfZzIpr LZSzl/VCzbdClryBJ1jRiBEAqxBMMsDE4Xp1OQrh8lIOcMFSw4ilImLtr9XN1rohL9LD hBnLYY7fCGkO1kVgjitKKc4TJPSQ7Uq8emZeJr3a7tgBWG7qRPK6S7wc1AJ7H7KfEZpF pLqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C5uqzDXJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c21-20020a63d155000000b005b86b35778fsi3769457pgj.180.2023.12.01.12.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:11:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C5uqzDXJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 915CA807A59F; Fri, 1 Dec 2023 12:11:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379601AbjLAULB (ORCPT + 99 others); Fri, 1 Dec 2023 15:11:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379591AbjLAUK7 (ORCPT ); Fri, 1 Dec 2023 15:10:59 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 482AF103; Fri, 1 Dec 2023 12:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701461463; x=1732997463; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=buoGPdrkkKx4hhUIceeTcYHbzYQ9xgtGVojseC0ReWs=; b=C5uqzDXJOig6els6eSQNIsYQ2lgRZi4t8SJhob8WhbWElTM/cJq9NqYD e18jEd66G/gVWAafZyDQlt2x24Kt09CQmjzJrcLf6Z9aBAc+1/0p2/STG 4BUS6f2zdFD5ZRbg9qLTrBs40oS4l7m0l6V8ErANfzh+PPf+/7qsztzEX gwAg5yjGZzFqw9Aqn7xB3dS+vyHwgB864F2Ou3E5sPWjU5GxPG2kpe5cn x/Kpwi/gR53Qd/H5aG0S3KmrMOeBIeDT3h0WVii8f/tsvy8gwcmeOEtfN WG8P2++S1EYdDuzutkNtKjs91dUE7WAeywN8haCBEzUWKV8vQ2PDUWkEQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="427749" X-IronPort-AV: E=Sophos;i="6.04,242,1695711600"; d="scan'208";a="427749" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2023 12:10:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="860671125" X-IronPort-AV: E=Sophos;i="6.04,242,1695711600"; d="scan'208";a="860671125" Received: from temersox-mobl2.amr.corp.intel.com (HELO tzanussi-mobl1.amr.corp.intel.com) ([10.213.166.197]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2023 12:10:41 -0800 From: Tom Zanussi To: herbert@gondor.apana.org.au, davem@davemloft.net, fenghua.yu@intel.com, vkoul@kernel.org Cc: dave.jiang@intel.com, tony.luck@intel.com, wajdi.k.feghali@intel.com, james.guilford@intel.com, kanchana.p.sridhar@intel.com, vinodh.gopal@intel.com, giovanni.cabiddu@intel.com, pavel@ucw.cz, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org Subject: [PATCH v11 01/14] dmaengine: idxd: add external module driver support for dsa_bus_type Date: Fri, 1 Dec 2023 14:10:22 -0600 Message-Id: <20231201201035.172465-2-tom.zanussi@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231201201035.172465-1-tom.zanussi@linux.intel.com> References: <20231201201035.172465-1-tom.zanussi@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 01 Dec 2023 12:11:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784111688495295723 X-GMAIL-MSGID: 1784111688495295723 From: Dave Jiang Add support to allow an external driver to be registered to the dsa_bus_type and also auto-loaded. Signed-off-by: Dave Jiang Signed-off-by: Tom Zanussi Reviewed-by: Fenghua Yu Acked-by: Vinod Koul --- drivers/dma/idxd/bus.c | 6 ++++++ drivers/dma/idxd/idxd.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/dma/idxd/bus.c b/drivers/dma/idxd/bus.c index 6f84621053c6..0c9e689a2e77 100644 --- a/drivers/dma/idxd/bus.c +++ b/drivers/dma/idxd/bus.c @@ -67,11 +67,17 @@ static void idxd_config_bus_remove(struct device *dev) idxd_drv->remove(idxd_dev); } +static int idxd_bus_uevent(const struct device *dev, struct kobj_uevent_env *env) +{ + return add_uevent_var(env, "MODALIAS=" IDXD_DEVICES_MODALIAS_FMT, 0); +} + struct bus_type dsa_bus_type = { .name = "dsa", .match = idxd_config_bus_match, .probe = idxd_config_bus_probe, .remove = idxd_config_bus_remove, + .uevent = idxd_bus_uevent, }; EXPORT_SYMBOL_GPL(dsa_bus_type); diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h index 1e89c80a07fc..e541d19f14d0 100644 --- a/drivers/dma/idxd/idxd.h +++ b/drivers/dma/idxd/idxd.h @@ -655,6 +655,9 @@ static inline int idxd_wq_driver_name_match(struct idxd_wq *wq, struct device *d return (strncmp(wq->driver_name, dev->driver->name, strlen(dev->driver->name)) == 0); } +#define MODULE_ALIAS_IDXD_DEVICE(type) MODULE_ALIAS("idxd:t" __stringify(type) "*") +#define IDXD_DEVICES_MODALIAS_FMT "idxd:t%d" + int __must_check __idxd_driver_register(struct idxd_device_driver *idxd_drv, struct module *module, const char *mod_name); #define idxd_driver_register(driver) \