Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3517608pxf; Mon, 15 Mar 2021 11:18:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyei83v8oO99EhNzsCWT6IohnS0cbozKX6o9Ytq4Gi/bFgpQchrlfwkrNPLg9+VcA/Lvqv2 X-Received: by 2002:a17:907:c16:: with SMTP id ga22mr25251116ejc.120.1615832305937; Mon, 15 Mar 2021 11:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832305; cv=none; d=google.com; s=arc-20160816; b=NauuojKlvkAaFFRXOLnCu72LeqROfHeO7MShPHZ/f7vtJeMCkAo7ADGF9kVBrRFzLi aXcI5uHWo24KzI7+bUzyS4weg2rp3zOj+iP1Ej26KN+RpaPgZO5KIStw+ivc2osZSBNH 8wyuFvGFKeGFn5pwl/TlaixHFUd/w+8SJnHTjkRA3fmUkd5sKSZ+kYr/Zvwly8+mPRO+ TJpZXVWPu5IqSIfpa8iNgCWIjGPKrlv+wl3KgCF6wlD39xz4NbHbJmMBOOVmYDjOTK9b FHqsUZa3p/suBsgDZpg3711PTCD/IKo6/QHMjVZA1MuYetsTP8K0GAtGfZmnWmmbmSS8 tp8A== 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=MN8GzHlkon6dtD0QbIynZRod+1kfPzhICwsb1+KlnNuh4cjluDuDG1nm/PPFatj9Xp +p+PpxtePZjbI/YxRNEVulmq8EJFD1TpLYX20AeJQEHAsRJUOORVBbcjXcgYf3Q6LXH2 8t0HUkG1z5j0utvmnkmhMe/s1KCPlVjgK5dxYyIqWqRCCzCp0kQDxdTqFl4OFfzfVAoJ 7S8/taL7YTLiipDfYyoDf2xh9SEv5W/KvQY+ggo2DWiiDSQjDm2Kh/n9ZPCX4wnhYSvx 1KGfi8RhmSgdPoB3znisZw5ra+G6hB/EcxzTv9FeSjyNPGOKIrsbi+VXaLotvIf8TImi iPOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KqJSWU6j; 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 a7si13303161edb.607.2021.03.15.11.18.03; Mon, 15 Mar 2021 11:18:25 -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=KqJSWU6j; 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 S237055AbhCOORQ (ORCPT + 99 others); Mon, 15 Mar 2021 10:17:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:37670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232719AbhCON7g (ORCPT ); Mon, 15 Mar 2021 09:59:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E64664F69; Mon, 15 Mar 2021 13:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816755; bh=zsm7c2CocJClkWFlhV/LJUeWDesaPLDHC3t5mDlzhEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KqJSWU6j9cxC4vJwjWpJcbkQ+5lgIgFEhkOKjtNVSrLWx4i2cfP7i90zh7Gbwfn2w Kt7/fKMBFX1bjxa2X19mJd/uKDQ4yTRhIUyv0MKAgYUV1lk+RDvKqvOaupz08GIPh7 brIe3UMIdcAPzIJsjx+hYSj+9J1Nlf5YGhU4iy/c= 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.10 095/290] drm: meson_drv add shutdown function Date: Mon, 15 Mar 2021 14:53:08 +0100 Message-Id: <20210315135545.132503808@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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,