Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2375635pxb; Tue, 9 Mar 2021 00:26:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9cPPYQnOKND0ZUh+YQ9Ezvt+e0yLWSEJ8jEhwijbe14qsiW4iC/Ay5Vu/c5Vs+wr17x6s X-Received: by 2002:a17:907:2093:: with SMTP id pv19mr19346100ejb.134.1615278372834; Tue, 09 Mar 2021 00:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615278372; cv=none; d=google.com; s=arc-20160816; b=xrsfK96PIjmWUQ6pkKC3ZCcu4bcM7SGs4K/MBJ2r14zoDlAlt1mRuAQaHn6ofX8PSx jCZ10JPi0nE/17Hza2Et2E1vYzc+kDBTQh5RejFinrmdbwRuShSddkWUo0N8QmuQtPDS wnCH9Xcw6Il2i2+bfcErgLreFXR376FOrA9O+lLYMWdCeuua9vj7ZOmGOAdYPfhZU57b lqKw/pTYZC4np9d3gmVY+M35uzR+bT+5MaLa96NU9Jw9eqRa/3rHr8TjdH4c9TFkCVIo kRcPYXXQOjOY1W72eBpkqBIVplIePFqmh6AhNeatR+uEps8ZERWG5loL+OC4XOYpfT95 9wwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :autocrypt:from:references:cc:to:subject:dkim-signature; bh=9cPnnSQlxmMCFI6VmQiQRtghj9ImqPX1eHI8dBxARVo=; b=L+llTF82wpas3lBK9LsvBR3ezy8YgTawx4Hy9b5P7mDHTHa2PecolkfgI8wRO5jgIP USW6fh7RaO2Qn3UpCNJrKgAtJ0oiOQRHcBXdO78Q0W0Pc6FmT93kjLJpLoBizyAAPdMf lw+tlcewMvoBwq4B/hUAJX+hyn89UjGceMqm0fsLc3WU6m6BUBl2YgqDUggKOJ4kQsAr uXTWR7JF2J96weTfJHPGqnST4en2Dw+cDn+Xm0ZpOlNZijQEeK1+NR5jo66OgZ2r0KF/ C8rC9Cg6EdBqC2jKm/KmwHOxJQ9vFHBzfZKGeBvgNNgvkGOLBYLjGKVii6MMsPqpSRpa zY5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=C6XZkxWj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si8335383eje.581.2021.03.09.00.25.50; Tue, 09 Mar 2021 00:26:12 -0800 (PST) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=C6XZkxWj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbhCIIYH (ORCPT + 99 others); Tue, 9 Mar 2021 03:24:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhCIIX7 (ORCPT ); Tue, 9 Mar 2021 03:23:59 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78823C06174A for ; Tue, 9 Mar 2021 00:23:59 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so5395066wmj.1 for ; Tue, 09 Mar 2021 00:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:autocrypt:organization:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9cPnnSQlxmMCFI6VmQiQRtghj9ImqPX1eHI8dBxARVo=; b=C6XZkxWjwllzIpsHsIoSLKUVVNoGjndT+Eu2oTFKcQWq5oi3bNKGr8yktY9W51iqr7 CtIdLaIewWyuSITI2VvzxP8WgMWbeL1RjMaM8ZbhK/gCvEX7pasWMB3/e4piDyjXjKvg uI13OuIDq71Xb1FhVqaPtxyP9VRWGPf0f9CU6hav7j/XR0gX6vkvKTykTdc6/Oz+Jfbe EEKqQoQMlhlRg58gdkfBbjcss7st3fBwgg1JvWTbYxyyDzUPCAyrkhgD2+zLxa7Hlphi /d6oYHjgaHEK3eBhoT90nY89T6iTvjNYtI4JEqiKEkd5CRiCQn72SeZKOUG2YrIR5T3N ZzSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=9cPnnSQlxmMCFI6VmQiQRtghj9ImqPX1eHI8dBxARVo=; b=Uicrla0INyhhmiTNSE5zID8fDikw4534ipxymHPfTv9nh3fKPvDrDL7Kw8wo5u6QQd wHJ5CapU/+2tPI8EO3wjbWqcbPw9e0cFefsoFygBJR/Pl/diiVtg6uL2K71f8/XmOPf8 4dfb4UnzE2gPaJKVIBonRH/HIms/V7m2h7CwSPGSpAf52c9BziKP/K0zXWQJOj57Ryaq c8m0rOoW0aNr1R/gUpDLToiv/+984EtxyW9tiNWUUZHCFdDmIZVubCxTPEkh84YqOLIe /DYYTsd9UDA6EvZbakvpPDXggbf8X6MwZFmAoCSCAj3vkIfIBYjQ+3ecRuYNxV+gGAix 9FoA== X-Gm-Message-State: AOAM532q7GTZAse5scZK4FqPtwuqKnd3uVYqWe7h8fNizg/90U31S2J6 2XIasXjKZmB9jWvj7Wp1yrRQRw== X-Received: by 2002:a1c:c244:: with SMTP id s65mr2713032wmf.96.1615278238107; Tue, 09 Mar 2021 00:23:58 -0800 (PST) Received: from ?IPv6:2a01:e0a:90c:e290:74c5:b3db:b181:e284? ([2a01:e0a:90c:e290:74c5:b3db:b181:e284]) by smtp.gmail.com with ESMTPSA id o9sm2882859wmc.8.2021.03.09.00.23.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Mar 2021 00:23:57 -0800 (PST) Subject: Re: [PATCH] drm: meson_drv add shutdown function To: Artem Lapkin Cc: khilman@baylibre.com, jbrunet@baylibre.com, martin.blumenstingl@googlemail.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, christianshewitt@gmail.com, art@khadas.com, nick@khadas.com, gouwa@khadas.com References: <20210302042202.3728113-1-art@khadas.com> From: Neil Armstrong Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= mQENBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAG0KE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT6JATsEEwEKACUC GyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheABQJXDO2CAhkBAAoJEBaat7Gkz/iubGIH/iyk RqvgB62o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aBNympfcbQJeekQrTvyoASw EOTPKE6CVWrcQIztUp0WFTdRGgMK0cZB3Xfe6sOp24PQTHAKGtjTHNP/THomkH24Fum9K3iM /4Wh4V2eqGEgpdeSp5K+LdaNyNgaqzMOtt4HYk86LYLSHfFXywdlbGrY9+TqiJ+ZVW4trmui NIJCOku8SYansq34QzYM0x3UFRwff+45zNBEVzctSnremg1mVgrzOfXU8rt+4N1b2MxorPF8 619aCwVP7U16qNSBaqiAJr4e5SNEnoAq18+1Gp8QsFG0ARY8xp+qaKBByWES7lRi3QbqAKZf yOHS6gmYo9gBmuAhc65/VtHMJtxwjpUeN4Bcs9HUpDMDVHdfeRa73wM+wY5potfQ5zkSp0Jp bxnv/cRBH6+c43stTffprd//4Hgz+nJcCgZKtCYIAPkUxABC85ID2CidzbraErVACmRoizhT KR2OiqSLW2x4xdmSiFNcIWkWJB6Qdri0Fzs2dHe8etD1HYaht1ZhZ810s7QOL7JwypO8dscN KTEkyoTGn6cWj0CX+PeP4xp8AR8ot4d0BhtUY34UPzjE1/xyrQFAdnLd0PP4wXxdIUuRs0+n WLY9Aou/vC1LAdlaGsoTVzJ2gX4fkKQIWhX0WVk41BSFeDKQ3RQ2pnuzwedLO94Bf6X0G48O VsbXrP9BZ6snXyHfebPnno/te5XRqZTL9aJOytB/1iUna+1MAwBxGFPvqeEUUyT+gx1l3Acl ZaTUOEkgIor5losDrePdPgE= Organization: Baylibre Message-ID: Date: Tue, 9 Mar 2021 09:23:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210302042202.3728113-1-art@khadas.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/2021 05:22, Artem Lapkin wrote: > 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) > > Tested-by: Christian Hewitt > Signed-off-by: Artem Lapkin > > --- > drivers/gpu/drm/meson/meson_drv.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c > index 42c5d3246..693bb1293 100644 > --- 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 platform_device *pdev, > 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_pm_ops = { > > 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, > Applied to drm-misc-fixes, Thanks !