Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp385590ybt; Wed, 8 Jul 2020 02:17:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNa8szaHv71OIis4z/mR0t99ulZLefhYQkCUlIPWzlpn+Ipk587g1paGNNOYYSMjlPwsQu X-Received: by 2002:a05:6402:b9b:: with SMTP id cf27mr64671676edb.84.1594199855579; Wed, 08 Jul 2020 02:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594199855; cv=none; d=google.com; s=arc-20160816; b=LnBalEtw1LsNFXXXY5Vb8Gggzj8njgh1GG/omSslFRIeSniqVoKz3tnYQIiLDo843k ZAfeueknZg5HY4UArTfYsNOyd8uKOB56hnsdX+I15fu+LQZqk0uyY6WGXYJ5H0D4HigH rKdyXPA1NHkLDS2QcHAzEUgLHT9LmWfXkDGQG30T1vxq26euy9zIE5QQgxSsGoQp0Esc yOXSv4ubMN/gLOtUW+GoCiOlyRPv/OX06BwUw337jJICgxhLlPzSbidoZYhD6ISWFDCU 24nWtvT69+NxfByTaqWSMalbPt3pCF8P+qnoGb2cHGGRBSbJ4bcMaeFt1UeCknihPHbL qSmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uRjZHkXkzEhGi5hn40XGl/e6qRsBuLGR/qEVHC0USyI=; b=mp/ErGYrwONteI0rkzoSCn+G8RxYrYfjM/+hVarWbMgBuA/n4ZMmiT8VTWUqRX3dfE N4tSeUe6+c7BuXej0+wg1q2QfI+OEEFEMRQYVxVKDdKTdd/s+AnRAdzPWl5PEvR3PyJ2 ASJfOv86ygqLTE54DfwJd5y6dVRRiLakVgpcBr5xGyIsyd5/f3NPzQI1ahcyQ1Mty/B3 Bt7ynGEBoI6XPmjsaJ3hglGdAVNAF1GNvQ/hLYFLXqB0NJceHEi+XJnvuWe1YZJPj5// h80GxK48U8DamQp6nI83oo7L022ddo7PpOj6NnxfommJcYp8b1IPbE44u8ecH22s9s0A eKJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWdjRAoB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ly20si16509016ejb.607.2020.07.08.02.17.12; Wed, 08 Jul 2020 02:17:35 -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; dkim=pass header.i=@linaro.org header.s=google header.b=kWdjRAoB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbgGHJPC (ORCPT + 99 others); Wed, 8 Jul 2020 05:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbgGHJPC (ORCPT ); Wed, 8 Jul 2020 05:15:02 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E0C2C08C5DC for ; Wed, 8 Jul 2020 02:15:02 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id p6so7074620uaq.12 for ; Wed, 08 Jul 2020 02:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uRjZHkXkzEhGi5hn40XGl/e6qRsBuLGR/qEVHC0USyI=; b=kWdjRAoBMkPAyyXi7TjFmQ+d90N4uv7q74fpybzzAATLpMH1LQ5ZZjZptmLJkGPV3+ T9W2iTQ4XblKDTZM8pOPFoUqFJpat2uLf429wvt28z1lPMBo123+CguPP7H8O6EBkRRB d2SB1fITZM5qk8pL0UO91/p3nx9FC12I7sTSwk+GZbF5bYo+iIbvZYANX2mC2p2rs6Cn WqY6jGzhIHlea/vA6v3BxbMisLtmkAPIwuY/QKhQEe+NGULedBMlI5nNMJBIOYnuLvKJ tGC5xxXH/KxM2OUhp8IXZaSAmpZt74dCV1mSYs8Z2PDZqbTVvcQsMclPhPl65tNtbKs+ y/rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uRjZHkXkzEhGi5hn40XGl/e6qRsBuLGR/qEVHC0USyI=; b=o6cqYKQW/BgPoVZhFfyTd2IAOiEDgM/yTvEhiMzHU4m3/fjcYenlpXqACe/ZcAMrr6 eU2HZ+lvkiTezHZHgioS2aqUdCq+i4BQ1OhzQEkyyg/3EIUx4dtl0cLrx1hQZiGgAHDU Ecx1FJ953VlD8407AhmChArZnBWQcfgWBdOP5NKP8QzQEofCoPeTUOKeChK89f4polvS 0yPk+NdTBo/mLrxi7ndwidh5O70jTXJ5Q0/AKqQ0xG11LaVreVk8dgIlqiJeIw5HnXXz y8+foTalNpqaO7/0QhSFIwdRB6siuo5L4xoxOtL+4ddkjWYN8stA5OmcLVT1ZdyJ4+qf nZUQ== X-Gm-Message-State: AOAM5339TqMWpX6nF691Pv6SmlMEC7w2vO+/UaHxYyYMzIOPyIQAd9wG ij6eQ31LdTQLt53evp8MocBH1TJ40r5PYlL6OOmh7w== X-Received: by 2002:ab0:15a4:: with SMTP id i33mr6683213uae.85.1594199701485; Wed, 08 Jul 2020 02:15:01 -0700 (PDT) MIME-Version: 1.0 References: <20200706144713.1123-1-yuzenghui@huawei.com> In-Reply-To: <20200706144713.1123-1-yuzenghui@huawei.com> From: Xinliang Liu Date: Wed, 8 Jul 2020 17:14:49 +0800 Message-ID: Subject: Re: [PATCH] drm/hisilicon/hibmc: Move drm_fbdev_generic_setup() down to avoid the splat To: Zenghui Yu Cc: dri-devel , lkml , Rongrong Zou , John Stultz , Xinwei Kong , Chen Feng , David Airlie , Daniel Vetter , tzimmermann@suse.de, Sam Ravnborg , wanghaibin.wang@huawei.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Zenghui, Thanks for fixing this. Applied to drm-misc-fixes. Best, -Xinliang On Mon, 6 Jul 2020 at 22:53, Zenghui Yu wrote: > > 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 >