Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3325470pxf; Mon, 15 Mar 2021 07:10:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFb2cZwcN8jL3CJ9ORRcaCOEisZ2Z4z2nVOzn79R1JoY66aWfyysQO106y+8XxzkpHB3mE X-Received: by 2002:a05:6402:3495:: with SMTP id v21mr29943271edc.117.1615817448972; Mon, 15 Mar 2021 07:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817448; cv=none; d=google.com; s=arc-20160816; b=vUeYlCtfcJCpBJctXubiwwPyzKcLSl+dH6icq0TEeHhOiBrGiRMpCj2r2RggxKZQ/O jHmLtx/Hk+E5wkVnIzc5FoNf0TDBjrh6fTkHTYI5y/Ohd7q28SS68iQX1JV/lpoE4/Da GlKYmkSPEm4JUloIarJvwVyBD7WMoxXAmANthzZDUOKRG6EAUAXhNcwT+TMxo+pO5RED MyqnXJt28SEXJz+cQOyXAWZA47qAuuOm8JBxQr1EdmgzzIl9SVkUugw6UQPUxikgjUx6 icnyEGpmG8LeNrEX7JNIv8/1rnM+4dbIAeTb0VcsRKn7Z7tCUf2vojiW5ZtQf7gYcKbG hx5A== 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=W2kkRqljEnGAStiVoRB8ABycj56yIpBtyLKUTaYDo8k=; b=HE38REigMu7qKUhq4nLmy9pjZXDuov/L1NbfU5+7iPJ2SEyRXG/Kdk/XagD7vSse7E ozk9+z7efJbtcK4iGhOIzWznxes8sVRit3lsEd3OWgGHQmn3rgHfbyKhPsTVq1jnt6oH l4RmIStKAu8GL2VZ6v012MsRso5fcV32AA2BCZCAbSxJvFdvf9OExel9I7fkvsS/2lEO ItQxiJO5G9pwwJ7UE3qxoOQWXdJXLqyRtG7t+NoI7/6p7LgPZCVSV96vcGjbik4llIgq fIyK4b6mptG144vqCxnpXjA2XdtD2dlLxCYDdq14xhEksmyevnK1WrJD1MVTTMZe/H1M 4p7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XSwEmxlc; 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 gv18si11050125ejc.674.2021.03.15.07.10.26; Mon, 15 Mar 2021 07:10:48 -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=XSwEmxlc; 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 S235068AbhCOOI1 (ORCPT + 99 others); Mon, 15 Mar 2021 10:08:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhCON6M (ORCPT ); Mon, 15 Mar 2021 09:58:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0624B64F21; Mon, 15 Mar 2021 13:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816692; bh=C9XG2ZmAaHp8d8auUA80xRgC6+gRI5xSHtSh6SNd1sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSwEmxlcN3iOwJl3k2uixDc4wWoxoUCPpEJySAfTr0/GSPOZ4SpEKaKqQpFkIvqz/ Fhg8FivmSpLSeBXWCi4CJT2oqEQjsLpfzy2YARKuYC8sX1YrTd/JNBdwbaHu1RXRXl SN4aeLLQWSUJeBrtC36cVl6qkQCShj7e31/eM9W4= 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.4 050/168] drm: meson_drv add shutdown function Date: Mon, 15 Mar 2021 14:54:42 +0100 Message-Id: <20210315135552.003445595@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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 @@ -420,6 +420,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; @@ -469,6 +479,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,