Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp320368ybt; Mon, 6 Jul 2020 10:06:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGhz/rboMLxBTvp9COK9qeqdbwu4q73rbgOdd3AHrdnaNDWs9yEubH+IW6Mp7HwQLScyFr X-Received: by 2002:a17:906:2714:: with SMTP id z20mr43894008ejc.469.1594055174201; Mon, 06 Jul 2020 10:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594055174; cv=none; d=google.com; s=arc-20160816; b=RiDMzVeah6RoKDKuWh6yFdsXblvZm+MkdDhg7wAnCfw61NKXb18W8LxFrkGamJuuGc dva4jYs6CH+9WdWxdCraB9MAn5N7TAX8KQaqMVV+iC7aS+jImnczh3QxT0mOmjK/45Tb Q3yW+Je19HcaUkGaktqAEANjp/c49dUziFyVqgqlLvlx/g86d3I2kQ8gXYAEsagcTDSv rvRw20K0TkyF7Xm24SDDgsEdqKemGYHoQ0TFaBl0659u2PN7omvzndZnH3h833kKCQsf TfNt5AqV+eUqFu1m6+/xddGo1roKtLMc6it2LigPuDYp9FYuXBlyGAi0GI+6XX0nJwba 6+6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zYdw9PUr2eIRnslvA5j4QJjJUw/BgdVkXI3l8j6IODI=; b=Irazn6oijnKxhV9IaSd3AzAeTpXAPnp6zK0+rmzcDJ5K5PXRMDdRArQMFW4OLFAxbK 01NVxeBghYbnfnVTYwuxrnTK6/E+fjkbonEILfhbzUkz+/AhEIbfxCHwflckM/RcNdja Pauzu+L+yYoT122rxHvr36TfkiPxXl0Ph1t/RJahcGr2G6c2VKhEuS+2MmDxF6SkqZUU nKieHpolHQ2lwAkxtznkQCf7c9OC+GYm758nBPENI4H4cAKmGA5/niZ2xIP7NNCftgDO OX6/NgLG3/QrY7Tox7giYmtSqAyk1xKNzRRie6SPKYun0CbX95gjhCWms04v4f/ScLhk 1PhQ== 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 k8si12112002ejs.735.2020.07.06.10.05.49; Mon, 06 Jul 2020 10:06:14 -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 S1729569AbgGFRDt (ORCPT + 99 others); Mon, 6 Jul 2020 13:03:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:57134 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729537AbgGFRDt (ORCPT ); Mon, 6 Jul 2020 13:03:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 53FC5ADBB; Mon, 6 Jul 2020 17:03:47 +0000 (UTC) Subject: Re: [PATCH] drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat To: Zenghui Yu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: xinliang.liu@linaro.org, zourongrong@gmail.com, john.stultz@linaro.org, kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com, airlied@linux.ie, daniel@ffwll.ch, sam@ravnborg.org, wanghaibin.wang@huawei.com References: <20200706144713.1123-1-yuzenghui@huawei.com> From: Thomas Zimmermann Message-ID: Date: Mon, 6 Jul 2020 19:03:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200706144713.1123-1-yuzenghui@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="psdtDZbLPzNtKiLFO86PfXRfZN7ZR5WeQ" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --psdtDZbLPzNtKiLFO86PfXRfZN7ZR5WeQ Content-Type: multipart/mixed; boundary="GppCVzr4jNWe7h8V8yOrotUUhX0kAb6Bw"; protected-headers="v1" From: Thomas Zimmermann To: Zenghui Yu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: xinliang.liu@linaro.org, zourongrong@gmail.com, john.stultz@linaro.org, kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com, airlied@linux.ie, daniel@ffwll.ch, sam@ravnborg.org, wanghaibin.wang@huawei.com Message-ID: Subject: Re: [PATCH] drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat References: <20200706144713.1123-1-yuzenghui@huawei.com> In-Reply-To: <20200706144713.1123-1-yuzenghui@huawei.com> --GppCVzr4jNWe7h8V8yOrotUUhX0kAb6Bw Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 06.07.20 um 16:47 schrieb Zenghui Yu: > The HiSilicon hibmc driver triggers a splat at boot time as below >=20 > [ 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_helpe= r.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 ]--- >=20 > This turned out to be due to the fbdev device hasn't been registered wh= en > 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"). >=20 > Signed-off-by: Zenghui Yu Reviewed-by: Thomas Zimmermann > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > 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); > =20 > - drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth); > - > return 0; > =20 > 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; > =20 > err_unload: >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --GppCVzr4jNWe7h8V8yOrotUUhX0kAb6Bw-- --psdtDZbLPzNtKiLFO86PfXRfZN7ZR5WeQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl8DWWwUHHR6aW1tZXJt YW5uQHN1c2UuZGUACgkQaA3BHVMLeiNuXQgAu2j4csMKFEV7y/0lj0/L9VLa/Sgm w45pdN0fodDKl7UiBUrohv0LBWrHfEO6ID5ym2ClmUZ/3ATsTdpT9qdQ6X487s4M E/te3KziwlC+lN8+nmvTiypJIqW2buzw61QaZHmGpWufriKPRifON5GN2RyFWq9K tJZnsHTR5c027ZwX8Ye76pU/plYrHtyMLbIzNXsWriRnhcAqk2ytdwE65Qd+LGSq Q9jX4cc8QzIxCX0r9ZCbEngXKF1Q9a13IiQ5HHc0CCb3UnkUdAHRsAWVo3njW4xj 7GU1rlMX6hCQeqoEYPcy4jaMF689RO8O++5Tse8KFKt55TvxZWRGp45jjA== =Jjj6 -----END PGP SIGNATURE----- --psdtDZbLPzNtKiLFO86PfXRfZN7ZR5WeQ--