Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp224809ybt; Mon, 6 Jul 2020 07:54:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0YV4IjiutUHPaN5HPbosZV2vGQyPtjj4lXWGwuXHuBBPmmp884IFMXoc8c/b322ta/Own X-Received: by 2002:aa7:c656:: with SMTP id z22mr43414570edr.101.1594047270115; Mon, 06 Jul 2020 07:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594047270; cv=none; d=google.com; s=arc-20160816; b=p4SWS6qJ9KCTG9fGXR9gcTnQBxCQeC/HcATsogur7wzHdYqtnTWjpxy6fgwX+yux6s 9aKormmvdi6lxZCOOQLZAvAdo6qr6B8+Y99J5LRFzVjMkm4lUf/Tz/B4Mk6hfZ0EvF22 ugA2lNXBXCGWOcYhJLz7i0o2w2y3cOBVjA+yo86IOe1fkDTOYOuLM26A6Ru7dbGv+kwZ XxTFoE88W+TXcCiylt9SSUmMoFkJayp7uOhJ2Jsj8J6KiPi1wIzCu8r9Xb1lWhjs6z6p iQ6hekiAzxsZsTaE9SgchhOxzeDmjdbcpxcV5zv87IimGH85YpuI5U19Nyg6vUt1hrwr YEwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ykZh93BEbkXkSlYInyKYwQA13+lWUE2Fjrztf28smCc=; b=sW+0TGZ2vLd627kdLHaxVhlrkU0eNF/VtmHF0jI1ruE7C05UQpoWMJMJlqVEiy8/cO ujmBGQtPkNYmvgTd+2lFRXZ0kxLeoZeld4sChL7XM6TPBLJ7Ev9BwpZ7E5gxmNecNQ/K lmooPmK8CvlpbZV5gjUJjMJcPoEh0vG5I/NAq5WmfPyO1wjUgCCj9jveP5+IGjlrUGvV x5yIxZg6mYelvpfK4Dm5tEbppAVl/qlewNwJRGBnVt/1z2LIOXdYlUyTxPQ3lfIGQF4T 9k/LHK8e6DUuFIYui5WYQsV7sv0UJ2lrrLuKK/TCnLOsqlLwfLAi2y9Mf5GuRAmb4jbJ KM5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp14si13357768ejb.93.2020.07.06.07.54.07; Mon, 06 Jul 2020 07:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729413AbgGFOx6 (ORCPT + 99 others); Mon, 6 Jul 2020 10:53:58 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7256 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729205AbgGFOx6 (ORCPT ); Mon, 6 Jul 2020 10:53:58 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 57FE0F2D4B30F8383611; Mon, 6 Jul 2020 22:47:30 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.174.185.226) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Mon, 6 Jul 2020 22:47:23 +0800 From: Zenghui Yu To: , CC: , , , , , , , , , , Zenghui Yu Subject: [PATCH] drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat Date: Mon, 6 Jul 2020 22:47:13 +0800 Message-ID: <20200706144713.1123-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.185.226] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The HiSilicon hibmc driver triggers a splat at boot time as below [ 14.137806] ------------[ cut here ]------------ [ 14.142405] hibmc-drm 0000:0a:00.0: Device has not been registered. [ 14.148661] WARNING: CPU: 0 PID: 496 at drivers/gpu/drm/drm_fb_helper.c:2233 drm_fbdev_generic_setup+0x15c/0x1b8 [ 14.158787] [...] [ 14.278307] Call trace: [ 14.280742] drm_fbdev_generic_setup+0x15c/0x1b8 [ 14.285337] hibmc_pci_probe+0x354/0x418 [ 14.289242] local_pci_probe+0x44/0x98 [ 14.292974] work_for_cpu_fn+0x20/0x30 [ 14.296708] process_one_work+0x1c4/0x4e0 [ 14.300698] worker_thread+0x2c8/0x528 [ 14.304431] kthread+0x138/0x140 [ 14.307646] ret_from_fork+0x10/0x18 [ 14.311205] ---[ end trace a2000ec2d838af4d ]--- This turned out to be due to the fbdev device hasn't been registered when drm_fbdev_generic_setup() is invoked. Let's fix the splat by moving it down after drm_dev_register() which will follow the "Display driver example" documented by commit de99f0600a79 ("drm/drv: DOC: Add driver example code"). Signed-off-by: Zenghui Yu --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index a6fd0c29e5b8..544b9993c99e 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -307,8 +307,6 @@ static int hibmc_load(struct drm_device *dev) /* reset all the states of crtc/plane/encoder/connector */ drm_mode_config_reset(dev); - drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth); - return 0; err: @@ -355,6 +353,9 @@ static int hibmc_pci_probe(struct pci_dev *pdev, ret); goto err_unload; } + + drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth); + return 0; err_unload: -- 2.19.1