From patchwork Fri May 28 08:26:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 12287847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E38C4C47082 for ; Sat, 29 May 2021 10:14:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E558610A2 for ; Sat, 29 May 2021 10:14:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E558610A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34C276E14C; Sat, 29 May 2021 10:14:12 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1871B6E3D2 for ; Fri, 28 May 2021 08:25:42 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 589E7613DA; Fri, 28 May 2021 08:25:40 +0000 (UTC) From: Huacai Chen To: David Airlie , Daniel Vetter Subject: [PATCH] vgaarb: Call vga_arb_device_init() after PCI enumeration Date: Fri, 28 May 2021 16:26:07 +0800 Message-Id: <20210528082607.2015145-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 29 May 2021 10:14:11 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xuefeng Li , dri-devel@lists.freedesktop.org, Huacai Chen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We should call vga_arb_device_init() after PCI enumeration, otherwise it may fail to select the default VGA device. Since vga_arb_device_init() and PCI enumeration function (i.e., pcibios_init() or acpi_init()) are both wrapped by subsys_initcall(), their sequence is not assured. So, we use subsys_initcall_sync() instead of subsys_initcall() to wrap vga_arb_ device_init(). Signed-off-by: Huacai Chen --- drivers/gpu/vga/vgaarb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 5180c5687ee5..4b8a62af34cf 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -1564,4 +1564,4 @@ static int __init vga_arb_device_init(void) pr_info("loaded\n"); return rc; } -subsys_initcall(vga_arb_device_init); +subsys_initcall_sync(vga_arb_device_init);