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: 11603041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DAA8618 for ; Sat, 13 Jun 2020 22:30:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6AD1320792 for ; Sat, 13 Jun 2020 22:30:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qN6yoY3F"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="k4TzTSdw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AD1320792 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=OU3fWBno6FrDyDeHfhrz6CSys57nvwGvenadvu/B0KM=; b=qN6yoY3F56JzBi WQHCeNcDam4Q0nKY7CPnQJTQhmEQOekKTZWAN/XMUE/A6pxKKGFNrUFDTVRCCvt9KMWUuvkF3q9mz guWgHvuFelGkuduTtbKMOSwIl4UVo/ZU52Ksj/ejCFP+Hs+JRMfu4FNfvoY6thcdC1Cu0FXKLE07I ByogWammgw+YurgOKlsHu6sdu4eOr7+dVwbtWO5w4VoQp9+AMjAml+anEp1XeN30+rGt3od4bhVDh t9NwbDulj97gKHmyZM6bSFUSZzuFfAUUpIo/5Cg5z7tUXOXEGv+8Z9XcwPCty55m1cr+J8b6D1qmH HgOl47zdEL72Q906/OdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkEff-0005s0-IO; Sat, 13 Jun 2020 22:30:39 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkEfc-0005rI-SO for linux-arm-kernel@lists.infradead.org; Sat, 13 Jun 2020 22:30:38 +0000 Received: by mail-lj1-x241.google.com with SMTP id e4so15003076ljn.4 for ; Sat, 13 Jun 2020 15:30:35 -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=i1zSZycsATLLuTvwqURtbLV3OkM8mCwkgcDP8L5HZGmAXeJVCnssCUHqVJX6AV7r2w gKhlc0IIyCuXfOsv9X72FDjv7i2Y+Uj4g62Q6e4Ycpii9gekWbx0x0SjxYeKmVWnOCi8 C8pMiyZIGJGxoGAo/a9T3lUm1FeZEP+khP1DmOe3wZuF0N74tVYw56ghDVJ524p6g1iG WM5hk2RjT5y5aYHXXjcjUaszkcSOBx1oha7DrinzYOw+4BocFwDc28FtT+ypm0+ZnI44 FEK3LID1+LmI+f6xTArAaBjcChnIp+kBd9ol/yaWGoLaGCzI+ZW0hATBMS/qTckumttg YMjw== X-Gm-Message-State: AOAM532NaU4BMcEQBhPfe5VB9A11gCw4Tg0gWsyY0c9lFYLRqs3tidsa lLb1hJHuekq8coZapDvFFXCMGA== X-Google-Smtp-Source: ABdhPJyUf7EfwBdgX4MbsmqireeqO0m6LckflQVhSKKESBt72onjFwr5HHppP0IHQAqEb2dZF9/h2Q== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200613_153036_952229_F1662415 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/mcde/mcde_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: 11603045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F144260D for ; Sat, 13 Jun 2020 22:30:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9838120792 for ; Sat, 13 Jun 2020 22:30:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sLFMC7Xo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TjwCM6P1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9838120792 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PeFBQGToJryqUZaJk3k1ToKDh/D35zeuC0OHWE7ZUNI=; b=sLFMC7Xo8X8IAL 1w1DjiX6wjwE3fsMJb/0OWmcEuqf8yxTma1bdUSrdFc6gdaKBXi9GQbq2ssXe7a13Ewqcw+Uv1d6N LO8HJqLZAkz2QgdLDMDZa6QrNv0un7OV6KRnR9vtUvgVTaNXstiGBtK3zZ5LC5wvi8JkLZhaXWaaT PzH36KBE29XuHnohINHtfqIqRszkHWr+2+J4VvM61vqdrT2pOP1VBGYPeejPZTeOU+WrLvPl/sNv9 1xa1i13WVHMd8HKG/2zgSacPmmBRSLHbX+jJch1xy7fvVr0CpSU/LGz9P2hsiwps+/dzBztpU/Ene X19RHlIvIF4h92r+1zAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkEfl-0005yR-Vm; Sat, 13 Jun 2020 22:30:45 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkEfe-0005rh-92 for linux-arm-kernel@lists.infradead.org; Sat, 13 Jun 2020 22:30:39 +0000 Received: by mail-lj1-x241.google.com with SMTP id z9so14953296ljh.13 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=ZGWk3SrqyDc0Xedg/v0NOpZdlM50jmYMcaRokmCqHOzUTzZXhbpHlCFjqmRq2ZVYTK iBXVwt/naGqsq6iavl0lV2W+E5on6zRTHPZb35/LeJ3V2z6Q4b2gAuqFppC9ijGUM1Zj SIOXiCOvC0ttko32S3Tv0vR6KIDvI0euUZqqYcMuCB5IIiXJt/Y2KDrQ/pDiVdPOij9x a2G8majdh1X3uRQaUYB87SNZo+IWBgUMG68AiKSAbh19suR4G5Ftd0r7xyeZp0ELTR7A 2rhche/qAcDQVnyg7Q4QS2gd7wjGCBo3Ugtajc3folbrKOJfjdodsLqyPIUSSprKQ2pv 9BgQ== X-Gm-Message-State: AOAM5314/+1jQU1b5FiFQdjRBE7jsPAZt48espa085c7qwKc3o5mGLfT Ew22C8xnlsCIhyg5w0SyhhsHCA== X-Google-Smtp-Source: ABdhPJzauTuCb/B4dM7ikR/2Hs1ksRVcmYgu1KxjqMiw8W6wcGUWxBWOxzvTay2o0MTZztb7CcRydw== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200613_153038_315678_7B6918DD X-CRM114-Status: GOOD ( 12.98 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Linus Walleij , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/mcde/mcde_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;