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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 664ABC433EF for ; Fri, 20 May 2022 14:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350233AbiETOXP (ORCPT ); Fri, 20 May 2022 10:23:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350230AbiETOXO (ORCPT ); Fri, 20 May 2022 10:23:14 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2DCCE166D58 for ; Fri, 20 May 2022 07:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653056592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YJC1yK9IYkMDQ2u1869gK2NvV1iKqVWIKXw6SqG9e5g=; b=ZhKreSA486nntNPN1kSNfsOim/uMqk9XOp756U+h5Wot7DJEUtgH4WHGJR7Km9YZ5VGYBV b2DpTzqmSgDKHgDEQh4djjKQzh8gaI/0SEBVXoRJlgeru560tXomKrLxlw4gnoaR36mR6S EIZSWU24AwP4W9nWE6ZkOoGySJP09aY= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-Qb7NEY66OMW60FppBmd69A-1; Fri, 20 May 2022 10:23:10 -0400 X-MC-Unique: Qb7NEY66OMW60FppBmd69A-1 Received: by mail-wr1-f72.google.com with SMTP id e17-20020adfe391000000b0020e64e7dd15so2193974wrm.4 for ; Fri, 20 May 2022 07:23:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=YJC1yK9IYkMDQ2u1869gK2NvV1iKqVWIKXw6SqG9e5g=; b=HsQGsMhkuFrClwhJEyB6/OKUDeq1MhTNAM9bD9CrYzJNFQRhZFBDn1TqTE2/mFzqIQ 6SBPGnoGkAN/IMf7baNnhyqCR18KuPDR5mwv8VFSkLZdLyjGrk+HeN/bcsvxxXAr2fAm uPIWWwrZqszpWYDKQMAKAJBC6XEfmM5rathcj0+h4Th9tptijJQ3bwvI4X9lOfPlAT7h e0pCLKSfhH/Tk05D/flFfoTbkHUzYE1QsFImIT0TUrX7ox0vkFuDhxFzWlqgdTGMiw18 m/GoO0oipX3sTO4+nu7VuzwyVPY9dmfK3qOa4HSEy5WIkrKxS/a1N7/Th2czBcR3PaFH OTFg== X-Gm-Message-State: AOAM533nMcF4EMmWjcw3LBajy6hC6cRzMU7jGqfhegbY4a5F/JIeEeto uGsZ28Wq9hy6U/X2GcBWWsmIaQoPCqQF8JuzfJqEDV2OQNWKT9oXtgmAkYRnDaD4nV+RmKzVuSD 16dVpxANTOVV0mLgV33EZlA== X-Received: by 2002:adf:f584:0:b0:20d:431:27f8 with SMTP id f4-20020adff584000000b0020d043127f8mr8650005wro.577.1653056589486; Fri, 20 May 2022 07:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjZMXOW3Se1xcwWM1GByTHWAdauwNMswM1vYef9PHHlEOhrXQN4r8cthb7UZYLjMT4wI6OcA== X-Received: by 2002:adf:f584:0:b0:20d:431:27f8 with SMTP id f4-20020adff584000000b0020d043127f8mr8649980wro.577.1653056589274; Fri, 20 May 2022 07:23:09 -0700 (PDT) Received: from [192.168.1.129] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id t16-20020adfa2d0000000b0020d0a070c80sm2683251wra.35.2022.05.20.07.23.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 May 2022 07:23:08 -0700 (PDT) Message-ID: Date: Fri, 20 May 2022 16:23:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH V11 09/22] LoongArch: Add boot and setup routines Content-Language: en-US To: Huacai Chen Cc: Ard Biesheuvel , Huacai Chen , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , Linux Doc Mailing List , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Guo Ren , Xuerui Wang , Jiaxun Yang , Stephen Rothwell , linux-efi References: <20220518092619.1269111-1-chenhuacai@loongson.cn> <20220518092619.1269111-10-chenhuacai@loongson.cn> <0bae0df1-48ae-d02f-bce4-d1f69acf269e@redhat.com> From: Javier Martinez Canillas In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org Hello Huacai, On 5/20/22 16:09, Huacai Chen wrote: [snip] >> >> In summary, just enable the following to use the firmware framebuffer: >> >> CONFIG_DRM_SIMPLEDRM=y >> CONFIG_DRM_FBDEV_EMULATION=y >> CONFIG_SYSFB=y >> CONFIG_SYSFB_SIMPLEFB=y > Thank you very much, since 5.15 sysfb_init() do all things of > register_gop_device(), so register_gop_device() here can be removed. Correct. > But there is another small problem: if simpledrm or efifb driver is > built-in, there is no display. The reason is both sysfb_init() and > display driver are in the same initcall level (device_initcall()). > From the comments I know that sysfb_init() should after PCI > enumeration which is in subsys_initcall(), so, could we make > sysfb_init() to be a subsys_initcall_sync()? > I don't understand why we would need that... it shouldn't matter the order in which the driver's init and sysfb_init() are done. If the driver's init is executed first, then the driver will be registered and later when the sysfb_init() registers the device, it will match the driver and probe. Conversely, if the sysfb_init() is executed first then the platform device will be registered and latter when the driver's init register the driver this will match the already registered device. In other words, it will be handled by the Linux device model and we should not attempt to hand pick the initcall level for each. That's quite fragile. Or am I missing something here ? -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat