From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 42AB6C4708F for ; Tue, 1 Jun 2021 17:12:32 +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 E3D50613BD for ; Tue, 1 Jun 2021 17:12:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3D50613BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org 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 603F06EABD; Tue, 1 Jun 2021 17:12:31 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id EEF376EABD for ; Tue, 1 Jun 2021 17:12:29 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A324613AE; Tue, 1 Jun 2021 17:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622567549; bh=KX4h2s+GpBEPaONxtUBAeF7ApM3lm3gJ37zgQbJoER4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U13gRsJrqMYTd3n8+PgWIMmM5FGFEYcPoELZKPW8GOEhYZpQo8ajneIkQV2I10LSP Bdw1OsDCshQpxBRiUAy8yBX+TOAYv3Im1Q/mDqqU6U8y9LFkaLkK/6yMq3rU4OjFXV So0779IgwcouAy0D+DmBemDxtDAxb6xuVk2a/YHQ= Date: Tue, 1 Jun 2021 19:12:27 +0200 From: Greg KH To: Daniel Vetter Subject: Re: [PATCH] vgaarb: Call vga_arb_device_init() after PCI enumeration Message-ID: References: <20210528082607.2015145-1-chenhuacai@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Bjorn Helgaas , David Airlie , Xuefeng Li , dri-devel@lists.freedesktop.org, Huacai Chen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Jun 01, 2021 at 05:56:40PM +0200, Daniel Vetter wrote: > On Fri, May 28, 2021 at 04:26:07PM +0800, Huacai Chen wrote: > > 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(). Trying to juggle levels like this always fails if you build the code as a module. Why not fix it properly and handle the out-of-order loading by returning a "deferred" error if you do not have your resources yet? thanks, greg k-h