From nobody Fri Feb 13 12:43:53 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3E32CE7A8A for ; Sun, 24 Sep 2023 16:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbjIXQW5 (ORCPT ); Sun, 24 Sep 2023 12:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjIXQWx (ORCPT ); Sun, 24 Sep 2023 12:22:53 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CBA983; Sun, 24 Sep 2023 09:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695572567; x=1727108567; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DUrY6tSBOGske6jp8+x7dYv9XL1Dlwpcfsix6g79S4k=; b=UIP707D+n/3r6eYPTmbc7eTJhe+kjDe0O4NylZYvurT8ukW3o2MHRSBY GsuxVQMCQ8hgF9UsyAVI29tlvtDIZWaFii6ojhQb9DFrd9VG1zarv/1Hw 8/ympHgRh3UhAlfD3DG39ElyHNeSn16U+7dO32dM7UB5cowGKwfA+Vt1l GTsvetbeRFfUbEVYfQj8oe9JV3ISGMumO06uK/G7mbdOid4OuGAZy6w9X MuzE7BAgr8jzxA3RoAe2Vb2bPQgMw0vNRiRiJE6yRUvhvURZiRJnuPlhQ mA19hh2zA3Qh6EzRVXcFGvGFLOqIqCfKCN8XU95vLORU1tv5o30mRfnnF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="447594101" X-IronPort-AV: E=Sophos;i="6.03,173,1694761200"; d="scan'208";a="447594101" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 09:22:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="921732331" X-IronPort-AV: E=Sophos;i="6.03,173,1694761200"; d="scan'208";a="921732331" Received: from fyu1.sc.intel.com ([172.25.103.126]) by orsmga005.jf.intel.com with ESMTP; 24 Sep 2023 09:22:46 -0700 From: Fenghua Yu To: "Vinod Koul" , "Dave Jiang" Cc: dmaengine@vger.kernel.org, "linux-kernel" , Fenghua Yu , Michael Prinke Subject: [PATCH] dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers Date: Sun, 24 Sep 2023 09:22:32 -0700 Message-Id: <20230924162232.1409454-1-fenghua.yu@intel.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" idxd sub-drivers belong to bus dsa_bus_type. Thus, dsa_bus_type must be registered in dsa bus init before idxd drivers can be registered. But the order is wrong when both idxd and idxd_bus are builtin drivers. In this case, idxd driver is compiled and linked before idxd_bus driver. Since the initcall order is determined by the link order, idxd sub-drivers are registered in idxd initcall before dsa_bus_type is registered in idxd_bus initcall. idxd initcall fails: [ 21.562803] calling idxd_init_module+0x0/0x110 @ 1 [ 21.570761] Driver 'idxd' was unable to register with bus_type 'dsa' bec= ause the bus was not initialized. [ 21.586475] initcall idxd_init_module+0x0/0x110 returned -22 after 15717= usecs [ 21.597178] calling dsa_bus_init+0x0/0x20 @ 1 To fix the issue, compile and link idxd_bus driver before idxd driver to ensure the right registration order. Fixes: d9e5481fca74 ("dmaengine: dsa: move dsa_bus_type out of idxd driver = to standalone") Reported-by: Michael Prinke Signed-off-by: Fenghua Yu Reviewed-by: Dave Jiang Reviewed-by: Lijun Pan Tested-by: Lijun Pan --- drivers/dma/idxd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/idxd/Makefile b/drivers/dma/idxd/Makefile index dc096839ac63..c5e679070e46 100644 --- a/drivers/dma/idxd/Makefile +++ b/drivers/dma/idxd/Makefile @@ -1,12 +1,12 @@ ccflags-y +=3D -DDEFAULT_SYMBOL_NAMESPACE=3DIDXD =20 +obj-$(CONFIG_INTEL_IDXD_BUS) +=3D idxd_bus.o +idxd_bus-y :=3D bus.o + obj-$(CONFIG_INTEL_IDXD) +=3D idxd.o idxd-y :=3D init.o irq.o device.o sysfs.o submit.o dma.o cdev.o debugfs.o =20 idxd-$(CONFIG_INTEL_IDXD_PERFMON) +=3D perfmon.o =20 -obj-$(CONFIG_INTEL_IDXD_BUS) +=3D idxd_bus.o -idxd_bus-y :=3D bus.o - obj-$(CONFIG_INTEL_IDXD_COMPAT) +=3D idxd_compat.o idxd_compat-y :=3D compat.o --=20 2.37.1