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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 84890C4708F for ; Wed, 2 Jun 2021 07:43:30 +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 4D5366138C for ; Wed, 2 Jun 2021 07:43:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D5366138C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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 C8C996E041; Wed, 2 Jun 2021 07:43:29 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BC736E041 for ; Wed, 2 Jun 2021 07:43:28 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 65632613BD for ; Wed, 2 Jun 2021 07:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622619808; bh=aB/TfA6DIFveBQ15BANW3ioheXeZgKwKIJrAEAY1v0E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Qv3TZ1uHlFJUAvbYUP7e2WB+EAwAxxYVrgM/MP4amEeEGlv38kTGCnJyc8Dwf17Ty 8gb1s5kgojg6C4PZdcPaQujjutU09t7avPcpy23aPSIw3uVw73ykfbYbA4UA7tIaTj WXlsEAfkv696ugfZCU3qUkzGdI4r7V1q6SWKialSYOXJOSg8ttDPgxTed8B2hcDf2f cC0qjNJ8nt6sd/kTN7+iPh65ahZjUJxld3tiItThNN69S1x72lbV/DmDTngT2YSB7/ mw+/ovs3iKgc/VioHnIiDpZl8r9M1Jhx2ZK5gkSCg/Q+OshQaStrtwrAuadGbQwBsH DLPi4C2sD9hYQ== Received: by mail-il1-f179.google.com with SMTP id r6so1307520ilj.1 for ; Wed, 02 Jun 2021 00:43:28 -0700 (PDT) X-Gm-Message-State: AOAM5310yAoGqji17yZj1VuN6vQq+KHC9Y2FJcWqROjJqN7Ta4QE44rw 1oKmq1fVPKZ/dHJgepO6JGym4gCOmNnCxUGn+b8= X-Google-Smtp-Source: ABdhPJyF8yfNrNm6baTU6Lxoww3+rGYzMEKRSK6BeiTYLqWROANvWAgTwpn5dZXmPrrw4vbdcXo7j7y8z1Hg3kBoSBI= X-Received: by 2002:a92:260b:: with SMTP id n11mr24888187ile.134.1622619807946; Wed, 02 Jun 2021 00:43:27 -0700 (PDT) MIME-Version: 1.0 References: <20210528082607.2015145-1-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Wed, 2 Jun 2021 15:43:16 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] vgaarb: Call vga_arb_device_init() after PCI enumeration To: Daniel Vetter Content-Type: text/plain; charset="UTF-8" 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: David Airlie , Greg KH , Maling list - DRI developers , Bjorn Helgaas , Xuefeng Li , Huacai Chen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, Daniel, On Tue, Jun 1, 2021 at 11:56 PM 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(). > > > > Signed-off-by: Huacai Chen > > Is there a bug report for this? Should we mark this cc: stable? No bug report yet, we just found vga_arb_device_init() has no effect on Loongson platform. Huacai > > Also adding Bjorn/Greg since I have no idea whether this is the right fix. > It does do what it says on the tin, but that's maybe not the best approach > here. > -Daniel > > > --- > > 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); > > -- > > 2.27.0 > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch