Message ID | 20230924162232.1409454-1-fenghua.yu@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp770564vqu; Sun, 24 Sep 2023 10:40:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8oxmNOH6zJPcby8mzvmmuifYM03zbg+Hh+3jeyhJTukoxIJJr4b+9kPT6ufj4I5Bz2TP0 X-Received: by 2002:a05:6870:ea8a:b0:1bb:7d24:eabb with SMTP id s10-20020a056870ea8a00b001bb7d24eabbmr7463740oap.0.1695577222260; Sun, 24 Sep 2023 10:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695577222; cv=none; d=google.com; s=arc-20160816; b=Q3dyIvnQU+M/O2QRU33pxfFVWCwsNHfv3yjrEeEqcb0HvAlPLB8oTcR8/fcqBrZ773 LMY+SAFXnnuGyGTVD6JZ48Fm/9XWy+7lLMF70FNCFmRZLbK0aCaJOX3FQyJ+9VQDnypF xO7lWzoftgqZb0vhrLuaJFZMnMfrhs9KuyPPLUtBFFxKLyeeuJcZAJld/niY0+yqDzeu 8L0ubjOozLvCCLPxgqoMKPgN4RrERNIgB5rh72UaSTegv2oPghMJ1kXMGTAl3BssbBTW 6Lzr0NUwjd+t51QXK4oU6+xw0m9srBG2irk0vyB4IEU2ZQEhHLGni6+ZukvpKh4Z45g+ xYhw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=B3CmVtDADx7RAPyam+3/gaGvj4hHwC4BzXnu5fb9rYs=; fh=3RYpvW0rAz3vmgLzg/xY7a9HQexPOrQl+ctv7W73qEU=; b=vrJBbqXqPARx1oa1BQ6Zyn82gNALmqimlV8Xpc4jitUXvkEvAx8pjr6AuTciDSlRP+ WnUsoF/Ozw0e6IT/c2jIzCYQzsClS0gj102u0gp/w9VRSPxh1xQfnMCNigiDWvOeLsT3 f4wkYxV4o4bxyT6WsxvWe6n3Y1pHQoiFJN9L3FqLKEmng1++a+Dg3XrA1O5JSpWi0frk ceumrIs9PhZqXonopupQaiJVVLIKK6KhMXFA+B6AjtagydZUaovfnTJhc4jBA7zbGB7l GYZ0mdZrXRjBzlwf/eRrAw2v47K7acZs9Roni5kT5P03z+IWJ78Rw+BmUPNTuF82Euf9 IByQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UIP707D+; 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=intel.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l9-20020a655609000000b00578faac74a4si8499933pgs.577.2023.09.24.10.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 10:40:22 -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=@intel.com header.s=Intel header.b=UIP707D+; 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=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 78EDD8030984; Sun, 24 Sep 2023 09:22:56 -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 S229921AbjIXQW4 (ORCPT <rfc822;pusanteemu@gmail.com> + 30 others); Sun, 24 Sep 2023 12:22:56 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <fenghua.yu@intel.com> To: "Vinod Koul" <vkoul@kernel.org>, "Dave Jiang" <dave.jiang@intel.com> Cc: dmaengine@vger.kernel.org, "linux-kernel" <linux-kernel@vger.kernel.org>, Fenghua Yu <fenghua.yu@intel.com>, Michael Prinke <michael.prinke@intel.com> 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: 8bit 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: <linux-kernel.vger.kernel.org> 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]); Sun, 24 Sep 2023 09:22:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777941581812003545 X-GMAIL-MSGID: 1777941581812003545 |
Series |
dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers
|
|
Commit Message
Fenghua Yu
Sept. 24, 2023, 4:22 p.m. UTC
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' because 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 <michael.prinke@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
drivers/dma/idxd/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On 9/24/2023 11:22 AM, Fenghua Yu wrote: > 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' because 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 <michael.prinke@intel.com> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> > --- I guess it was always configured as CONFIG_INTEL_IDXD=m. Good catch on =y scenario. Reviewed-by: Lijun Pan <lijun.pan@intel.com> Tested-by: Lijun Pan <lijun.pan@intel.com> > 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 += -DDEFAULT_SYMBOL_NAMESPACE=IDXD > > +obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o > +idxd_bus-y := bus.o > + > obj-$(CONFIG_INTEL_IDXD) += idxd.o > idxd-y := init.o irq.o device.o sysfs.o submit.o dma.o cdev.o debugfs.o > > idxd-$(CONFIG_INTEL_IDXD_PERFMON) += perfmon.o > > -obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o > -idxd_bus-y := bus.o > - > obj-$(CONFIG_INTEL_IDXD_COMPAT) += idxd_compat.o > idxd_compat-y := compat.o
On 9/24/23 09:22, Fenghua Yu wrote: > 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' because 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 <michael.prinke@intel.com> > Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> > --- > 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 += -DDEFAULT_SYMBOL_NAMESPACE=IDXD > > +obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o > +idxd_bus-y := bus.o > + > obj-$(CONFIG_INTEL_IDXD) += idxd.o > idxd-y := init.o irq.o device.o sysfs.o submit.o dma.o cdev.o debugfs.o > > idxd-$(CONFIG_INTEL_IDXD_PERFMON) += perfmon.o > > -obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o > -idxd_bus-y := bus.o > - > obj-$(CONFIG_INTEL_IDXD_COMPAT) += idxd_compat.o > idxd_compat-y := compat.o
On Sun, 24 Sep 2023 09:22:32 -0700, Fenghua Yu wrote: > 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: > > [...] Applied, thanks! [1/1] dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers commit: 88928addeec577386e8c83b48b5bc24d28ba97fd Best regards,
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 += -DDEFAULT_SYMBOL_NAMESPACE=IDXD +obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o +idxd_bus-y := bus.o + obj-$(CONFIG_INTEL_IDXD) += idxd.o idxd-y := init.o irq.o device.o sysfs.o submit.o dma.o cdev.o debugfs.o idxd-$(CONFIG_INTEL_IDXD_PERFMON) += perfmon.o -obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o -idxd_bus-y := bus.o - obj-$(CONFIG_INTEL_IDXD_COMPAT) += idxd_compat.o idxd_compat-y := compat.o