Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3518874pxf; Mon, 15 Mar 2021 11:20:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBPDTuDMqi3emPi9UmRQG4vl8Le4+LMF9tTWE54I0x7MNfTxx05gcBbJqQwdMq3UAIvhUE X-Received: by 2002:a05:6402:11c9:: with SMTP id j9mr31445788edw.348.1615832436155; Mon, 15 Mar 2021 11:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832436; cv=none; d=google.com; s=arc-20160816; b=Z1GGHbndqdRHUyRbZpVPqcCXh2xHK/qJAyKiNgPmxsVkfMrof//XUB+TYssTKbA/D1 kjt8X5qgGdpeeoQ/JJuUaWYG4PRqDehg3AM+O7R5ofZNCBBrcTb342gMP1ye6k84JgwQ WdmqTIoj9mMiMrjpIBykaftyM/P857KSF2WmwnpY08v3+csNW8ZkHxoecCY4xZJ1k5gt 7vdvFBsDZFzuRmzr64AZt/FuXiIgVi0F4Q8+U8T4L1CxeuZLhsPdEh46xPfUfOOY04F+ i+FQYwdLpNCrBuHg+9K2bb4Q0RzNZ4FAAo+UhZIW9Tm2Ra1CJDArE9KhFjQfMW3hkjjm fM0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OLJqVu9xglalerc68fNoaOelKNoPdtLRH+2/f2A189A=; b=o58keLw3wxRRlMlGcJ5C1bfDa/9SoviLSvc+sQKrrGCCgJ+TKQAi3wwsiS/nR9OBeG zdGAOoFtfTS/y/4RVJnHxA6EvqQXOCspevFmTq72B9HSXWLgk+39ADVDMm2Nbxqq6+Uv QK8S791WTEA4ix1lvcZ+E5eUK53wRrRe3D6r6+yW0scf5rg2rPaAyBjijs2Wlt1U1J6S oqyVmcBVBCVJC3jhBhXCI9LjzHEbtGHOkubLFaifM0dBC+8KC9Qh/WSg4JoMlQJWTq6c EwH1ZwLNMMzpX93k1Ur4BQ7LhDhJWZVF/zKdJ3X5FA8avwNDU+d/wyE33Zl6SadzMuJr J63g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YbTqZH0J; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m15si12456863edj.170.2021.03.15.11.20.13; Mon, 15 Mar 2021 11:20:36 -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=@linuxfoundation.org header.s=korg header.b=YbTqZH0J; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237279AbhCOORf (ORCPT + 99 others); Mon, 15 Mar 2021 10:17:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232743AbhCON7i (ORCPT ); Mon, 15 Mar 2021 09:59:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2900F64F26; Mon, 15 Mar 2021 13:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816761; bh=zsm7c2CocJClkWFlhV/LJUeWDesaPLDHC3t5mDlzhEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YbTqZH0J7FLbh2l3XoydFpFbQ1wsFf82CpOQVTZZXC2F7yNGDKz+si5vqBsyVyWkP pQ3UzpvsEDSNVgbSrGtQJlal41gLD/PqmWkVWDUJjEaDnbsi/+m2h1/Yht0L7oDqvI KPVCfmyDdVajHSQ1AWw897u5fu2kJajwbPeWX6T0= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Artem Lapkin , Christian Hewitt , Neil Armstrong , Kevin Hilman , Maarten Lankhorst Subject: [PATCH 5.11 109/306] drm: meson_drv add shutdown function Date: Mon, 15 Mar 2021 14:52:52 +0100 Message-Id: <20210315135511.334646740@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Artem Lapkin commit fa0c16caf3d73ab4d2e5d6fa2ef2394dbec91791 upstream. Problem: random stucks on reboot stage about 1/20 stuck/reboots // debug kernel log [ 4.496660] reboot: kernel restart prepare CMD:(null) [ 4.498114] meson_ee_pwrc c883c000.system-controller:power-controller: shutdown begin [ 4.503949] meson_ee_pwrc c883c000.system-controller:power-controller: shutdown domain 0:VPU... ...STUCK... Solution: add shutdown function to meson_drm driver // debug kernel log [ 5.231896] reboot: kernel restart prepare CMD:(null) [ 5.246135] [drm:meson_drv_shutdown] ... [ 5.259271] meson_ee_pwrc c883c000.system-controller:power-controller: shutdown begin [ 5.274688] meson_ee_pwrc c883c000.system-controller:power-controller: shutdown domain 0:VPU... [ 5.338331] reboot: Restarting system [ 5.358293] psci: PSCI_0_2_FN_SYSTEM_RESET reboot_mode:0 cmd:(null) bl31 reboot reason: 0xd bl31 reboot reason: 0x0 system cmd 1. ...REBOOT... Tested: on VIM1 VIM2 VIM3 VIM3L khadas sbcs - 1000+ successful reboots and Odroid boards, WeTek Play2 (GXBB) Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Artem Lapkin Tested-by: Christian Hewitt Acked-by: Neil Armstrong Acked-by: Kevin Hilman Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20210302042202.3728113-1-art@khadas.com Signed-off-by: Maarten Lankhorst Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/meson/meson_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -482,6 +482,16 @@ static int meson_probe_remote(struct pla return count; } +static void meson_drv_shutdown(struct platform_device *pdev) +{ + struct meson_drm *priv = dev_get_drvdata(&pdev->dev); + struct drm_device *drm = priv->drm; + + DRM_DEBUG_DRIVER("\n"); + drm_kms_helper_poll_fini(drm); + drm_atomic_helper_shutdown(drm); +} + static int meson_drv_probe(struct platform_device *pdev) { struct component_match *match = NULL; @@ -553,6 +563,7 @@ static const struct dev_pm_ops meson_drv static struct platform_driver meson_drm_platform_driver = { .probe = meson_drv_probe, + .shutdown = meson_drv_shutdown, .driver = { .name = "meson-drm", .of_match_table = dt_match,