Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3516505pxf; Mon, 15 Mar 2021 11:16:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPSvAXn3z3tfgvTWIsaISDZCZO1R+F1sPQvBVIY/2QiG2wWF4zFrPvKy6a23Sz4J91t9yB X-Received: by 2002:a05:6402:1a3c:: with SMTP id be28mr31610850edb.125.1615832207194; Mon, 15 Mar 2021 11:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832207; cv=none; d=google.com; s=arc-20160816; b=ohlmbogE8SM6ykW18zs3OylW8wJqzb8Xnx0YhGpcQ2EShu9cFYwiWNvW3+iWBVl/dI k5rFbiDv5aQEa0mw95gG1ZN42aX6UYsrfoihxki0+nsEB2FGPrGWG5hq1qEgGVhx83Nh WStL6OuNeUFc53eZwrfThhQenhIGL7tF85T3K3KFG541Phk89g8SZdXxptKCil1lMzQL vMG8O2n0mmviZnaIZmime45W5iXimWiJnkTIhIk12qBgGoWJU70iMxPcpusSQE/+KrJV ZCB/7cJFSbfUe21Q/3UefJxF2BCVE69T7Yzh0+o0Qizqt1uzR9QYe9SeC0A6lzjXoilj jSWw== 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=NvMW5rsm7sGdMtvd/X/cVd4UxOF7OexLe8gCZg/HVQ4=; b=c6ltNulsNV/wPO+8Cagn9SIM/88S3lbyVukGwmpFOhePxHDGHbRVmrBED/o6jKhHKT YUuyRukq4kM5a8wxfCrB0GllEtMkTs8T3G+eAzouALFvuNPY1xS0S8Hzc1EM2X0fhx3l O7p6F61euFlEhGz9eXresB4WZjKubJ03bxeDZXyq/WRG3aqf8jNxlBuyujD2fuOr1+5L Svg9MNGSycP1XItaE0QUBZNFKV6RJJVs7kUpuNtJ6VuVT6BLg57w1oKQtJ4PZiPFM2Ko vKGy5SaIuYx7ibZxZbh8qasPdz5V7qVnJXfKj1Hy2Vwy5v+cAg7WCYgxNgILhF9Qczpr /cgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fy7n8MNf; 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 a10si11323379ejr.227.2021.03.15.11.16.24; Mon, 15 Mar 2021 11:16:47 -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=fy7n8MNf; 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 S231435AbhCOONY (ORCPT + 99 others); Mon, 15 Mar 2021 10:13:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:37632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232590AbhCON7E (ORCPT ); Mon, 15 Mar 2021 09:59:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 052C164F27; Mon, 15 Mar 2021 13:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816735; bh=hepS+Tc5vHcHzMEc+y9tZCTW8rVIiunFcbg1cP8+axI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fy7n8MNfpI/y+ZKOoNeBFwlcc1A8zJ6hVc7R8YDfJDibred1qFB1qJPcyB7zNGcQM gadq2DPkGb9MP083QoFJGJc3y8VBnVFLXzuOOxlqRgTcXKPKIUCy1UF1gGbCtlkdfm K77QnpRXyyfATgN9/55aWWZ2gG+DFlbgx9Oy3u9g= 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 4.19 035/120] drm: meson_drv add shutdown function Date: Mon, 15 Mar 2021 14:56:26 +0100 Message-Id: <20210315135721.139245136@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -384,6 +384,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; @@ -428,6 +438,7 @@ MODULE_DEVICE_TABLE(of, dt_match); 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,