From patchwork Sat Jun 13 22:30:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 187914 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1540658ilo; Sat, 13 Jun 2020 15:30:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp0nf0KUZ7gX2uqs80/QkE7Y8TDx3Js4clIxluygmQzFctJ/gu3irdggUayFrzvwMuKKVh X-Received: by 2002:a62:8f45:: with SMTP id n66mr17471352pfd.236.1592087441700; Sat, 13 Jun 2020 15:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592087441; cv=none; d=google.com; s=arc-20160816; b=FQAWqwi4tyL5Mtlv6sYcuHecVKdH8T9yzsWM+xh/WTwZ9zp7Ic7+y8zWcb4EX5+ZaK 1bVWoDlAOpEBAWTJ2/0XBbUkx3twcXee/iyCLI3P4DE6oZcJTHWHiMqDJSDTcB68y3Yh dVQ9xxoDUrXsuWvDACqPyn639wQBeFgzfDrcPEjrFvIwUbHMEX9GwFG8fPdFIxsKdeZB 5yje3Gp/jzLpKXuHNn5bFQiJ64Nvgz3CaIqqrO11VkcWliIEYv/26ZKVQ5oJk/shQqbW HovjbUafRJh12GIKCwfoxlVKLfKSNHWd9o37OVvkil9a9CQCo0lYjDBtaPYHCNMCBBw0 LzOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=CSthbLLx8rSzzKlknJAHjW6V+Uoc4dz+kmVUi6T40Hs=; b=r/MHn7Ch8dRvcHJn4e81hwP+tOEnL4YXe/VabHvagAfY53ylfXB9ZjqNPTQjtTgRPT z/SS7Xonm3iVmOKiQ7QnVrkFRBt/E+Bua7kHYrsH456p7KKSvj2npvkGJ2bgcjtrqAGF CDn1xqiAm1o3pSFkHJkRb4i9DvVrjSToArXh6V6oUGDGti8DlMdHsxocXylzU3PpcOs5 MZk9wVsUDKREGa83BIqHtn5+lNkDbt4uInfa2SRKgD5NrUv+0LeQI0jZ5q8l7Ry7MwMu ci3M8fwZ9cIEsXHmuC4mIXI+6l+VCvk4jQP8r5+FIG04P5KllU9HoY5AJhDh/sw/ahyg la5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k4TzTSdw; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id n82si6374876pfd.106.2020.06.13.15.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 15:30:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k4TzTSdw; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BBBC6E461; Sat, 13 Jun 2020 22:30:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id A9B346E461 for ; Sat, 13 Jun 2020 22:30:36 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id i3so10439956ljg.3 for ; Sat, 13 Jun 2020 15:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZVmpYpdcLJwl2DSPAje1OikSpkykl0PP+kQhQUL22OQ=; b=k4TzTSdw7lly8trfcqMwra4DmSkI4MQ/iTmYv7KHHtfai16TeRlOPF0uSFdmNbyi5g rtMMuGe5pWYw3pEYqvgHDJJfaHO3EgQG33NxwnAwZhNthAMjXOEFPcIIyZDNFYUo93UB At4lNZq/62wBKTh/QCAbpRGNFHu5ckD/ijsF1ujB2kzVl65vavcGYKg7UXiAx7dbdSZ/ brjIHKxQC2Owfa4xg0gYWccVr6JzZVTlLjFvzG3BRKNx/bkV0ZwBSIu42MKCALiS0VP9 17EGLm6OfpU92sJx+VPd9qbH7pQtSBgwy6gd+1uW3HsMvqwtV/ETGb08aLScAncpot7Y jBcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZVmpYpdcLJwl2DSPAje1OikSpkykl0PP+kQhQUL22OQ=; b=kBChrQpP2vcKdnJSw5lPlIJdMiAOl6i6ELvOXpQMPHXUfv7a3OiW/Ad/b3zrqf1YJ/ iHXQKMenC3cz/4Lare/FjMpxJYnn/XoYcAgC1sJdaObVbnY9HhyMgVYawDoAl9JSEUou 2Xb4e1cL6RzBqZA/Usfu9ZzNLcZ4fDAhLDNcnu3ZSnFMo5qPHbL8OzbnuTv6HDQdjsRV SNHuYcxuHsUjO+7day1EcC4gjMiyEFZvBd3gGIaavXZdq96dbeRl6NNt4bMTg1Ptzhvc BCTTD2LmB0jJKsqZbciH69YcPBr0RRhMh0osqtvT2cgNpnPnhzw8TDPGvkCYJ9rjypEn QYAQ== X-Gm-Message-State: AOAM53009tOa/cE+VnbUo4vlrez5+g7XxBPjSdo3+5AOx1MCOTcgDIa5 GgIUUnfczFBE1+3sWqggYNLvNSRwCbWZGA== X-Received: by 2002:a2e:818f:: with SMTP id e15mr9433758ljg.376.1592087434532; Sat, 13 Jun 2020 15:30:34 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id 15sm2888027ljw.46.2020.06.13.15.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 15:30:33 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH 1/2] drm: mcde: Fix display initialization problem Date: Sun, 14 Jun 2020 00:30:26 +0200 Message-Id: <20200613223027.4189309-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 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: linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The following bug appeared in the MCDE driver/display initialization during the recent merge window. First the place we call drm_fbdev_generic_setup() in the wrong place: this needs to be called AFTER calling drm_dev_register() else we get this splat: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at ../drivers/gpu/drm/drm_fb_helper.c:2198 drm_fbdev_generic_setup+0x164/0x1a8 mcde a0350000.mcde: Device has not been registered. Modules linked in: Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x9c/0xb0) [] (dump_stack) from [] (__warn+0xb8/0xd0) [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8) [] (warn_slowpath_fmt) from [] (drm_fbdev_generic_setup+0x164/0x1a8) [] (drm_fbdev_generic_setup) from [] (mcde_drm_bind+0xc4/0x160) [] (mcde_drm_bind) from [] (try_to_bring_up_master+0x15c/0x1a4) (...) Signed-off-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Sam Ravnborg diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index 84f3e2dbd77b..80082d6dce3a 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -209,7 +209,6 @@ static int mcde_modeset_init(struct drm_device *drm) drm_mode_config_reset(drm); drm_kms_helper_poll_init(drm); - drm_fbdev_generic_setup(drm, 32); return 0; } @@ -264,6 +263,8 @@ static int mcde_drm_bind(struct device *dev) if (ret < 0) goto unbind; + drm_fbdev_generic_setup(drm, 32); + return 0; unbind: From patchwork Sat Jun 13 22:30:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 187915 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1540681ilo; Sat, 13 Jun 2020 15:30:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFjqIUt4VDqEXoFtNeymlX17pCyEj63cAznL+lKWGaYJlaedPb13XXd5etW/a8Qaq2GG95 X-Received: by 2002:a65:458e:: with SMTP id o14mr15089293pgq.87.1592087444734; Sat, 13 Jun 2020 15:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592087444; cv=none; d=google.com; s=arc-20160816; b=o3H1izbMwukDfsafCIqztMpPvmmWAwlPoiJY0qDvDlgEolMSAk4CrviavYRV7OSmEl 5pQBiOYTadrLqCwSkOr0TF8uObfoQ6fAFG3T/m4usEShOYXJVzypCdBww8CWrt5EuXi2 mT+b5otNsujq/aDI0sI4lV9d9RCLKnU/ZWZi/TLgO9cBbg7O3GFhKrVCWxWbRbd/2I7Y gChqCcIDm3uIPZWOMwF9sRKXKF3w1kZGmE7y2JvBkAf259yPo/ZxoI0jRno5RpKdnmtx V9KUqFNdDnzwyeXXsLG+8a6eAspVXM6cd1aBn/9lE5yMBWfgOSRr0TBK5RqSLe9nUgxa ywbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=b+od35XklTMnNw5mFBLkI025q/QjP9KhRwU40a8hm24=; b=Q6T8DQJFdVzKSLzbvVxN8cJMY+b8MJdjTe0eCwsseW6gdYIn1lHTc3FkzGrACBEQmT JWGwb3M7kqmsNgNMR3dBvdIaMXil18Le3Hu5I77TEeZFpL/a4x6ifyCIsAC3S9VUE0Kw B/klFrDt6GZT8v8GWD9tRrpx4wjbGRG7haaHtAxygzIOJUGMM1mS/KfFEMTOclHtVPuP Kr0LIQ8XQmOkcY2GFb0Uu7y3nn0Xs0LqejoadpZfenBlJ56a1NlUZKirGTifNZOjvI6f Nnbt0+d2G35/nc6nfaEqLj+xOP0l3/tX1ztn22LWMIOh+1MO/PIROIz2Myp7Dm1tQUFp ubAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TjwCM6P1; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id 5si6397190pgc.495.2020.06.13.15.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 15:30:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TjwCM6P1; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E37F36E48D; Sat, 13 Jun 2020 22:30:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id C74B76E48D for ; Sat, 13 Jun 2020 22:30:38 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id s1so15004188ljo.0 for ; Sat, 13 Jun 2020 15:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FzAJhGZfJiBSb9p+is0pbxXE5BziQFr+Nhe+PHcOYR4=; b=TjwCM6P1n68Q47GQjOq65qJkd1Ay81L7arLF7RCzt0hiMckHCmqN3WZ9XlAERRnzFl +RHLK08gCF7pYL7er8z7x5gA2HR4Bhdj1HmhVKDhkf0ZEIFXoth4ZcVnAXtMz1jk/a4B bxi+r6EeDH+w3NgzwB4OI7u0YcjBrTMZjB8PcS/tH6S+vW6pCI6BwV1aCj11TewuwoKp XRNOeRLToLWfA2PM/+L5zwJw02r8+E8+YC5CmQGneDEvX+6SiGiIEjdguXFRSgXqeuBJ 6PJVgc9L0MUG6NJBbwMtnvJIbpSHz19WIsaTkqjXor1GF4wuOZEC9QcLcaYJaUIMdtVb kOBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FzAJhGZfJiBSb9p+is0pbxXE5BziQFr+Nhe+PHcOYR4=; b=e0HK8x5xyRfcDBzEqmWHj+oIGqBzCiz3Q5s1C2eTvS8jbXyygx5HoxkKbpngPPXtTr Vxkl5bYFD8RVpXsjVIaSPcBi9RGFd1x8dbygAj+OfYP9vpcTvbYAZAbropGO8J7K0FTk 8HSer8s9Wa6g3M75r3SUOQiBf6b2faFzTRW6V8x+SyBT81Xeoa9O0zNq13tgFJB6XfsS tJ0/06yQ6EdqI09Fyk0bdl+zgDe/chXOxfTnLmD+FI8zQ5WhnhpFE63XfS+Ko9enWZug uQFTgq6rvZaH4dutzcQItP2pdF8HeKBEURjbG7D6WPJ1WEKly0pAeUDPWgi+Y+Ew+qRt qCKw== X-Gm-Message-State: AOAM5308brLeSJTVdyRzHzvisy04ihwNJ2eObxrkQDvS7ZK1x2z6SPau Iv+jfF3Y/GBC2IpdVg/7gHfcIeX+Q4X41Q== X-Received: by 2002:a2e:860f:: with SMTP id a15mr10231173lji.127.1592087436933; Sat, 13 Jun 2020 15:30:36 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id 15sm2888027ljw.46.2020.06.13.15.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 15:30:36 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH 2/2] drm: mcde: Fix forgotten user of drm->dev_private Date: Sun, 14 Jun 2020 00:30:27 +0200 Message-Id: <20200613223027.4189309-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200613223027.4189309-1-linus.walleij@linaro.org> References: <20200613223027.4189309-1-linus.walleij@linaro.org> MIME-Version: 1.0 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: Daniel Vetter , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We forgot one call site directly using drm->dev_private. This leads to a crash like this: 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000918 pgd = (ptrval) [00000918] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.0-15001-gfa384b50b96b-dirty #514 Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support) PC is at mcde_display_enable+0x78/0x7c0 LR is at mcde_display_enable+0x78/0x7c0 Fix this by using to_mcde() as in other functions. Cc: Daniel Vetter Fixes: fd7ee85cfe7b ("drm/mcde: Don't use drm_device->dev_private") Signed-off-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Sam Ravnborg diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c index b319a474f801..212aee60cf61 100644 --- a/drivers/gpu/drm/mcde/mcde_display.c +++ b/drivers/gpu/drm/mcde/mcde_display.c @@ -838,7 +838,7 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc *crtc = &pipe->crtc; struct drm_plane *plane = &pipe->plane; struct drm_device *drm = crtc->dev; - struct mcde *mcde = drm->dev_private; + struct mcde *mcde = to_mcde(drm); const struct drm_display_mode *mode = &cstate->mode; struct drm_framebuffer *fb = plane->state->fb; u32 format = fb->format->format;