Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2728632pxb; Tue, 9 Mar 2021 09:24:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZQxtMBwER+GeZgMTt5jN6gDvB4rM/lROe+3InlnP1XT4dMHxSJcnLLbLVTBDjBtosLDL2 X-Received: by 2002:a05:6402:6ca:: with SMTP id n10mr5418905edy.312.1615310654556; Tue, 09 Mar 2021 09:24:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615310654; cv=none; d=google.com; s=arc-20160816; b=pzsVFrMPGhybGSa4Rw9ALaMVSG9NcQngTWkzeYFyuwP8lagfKThf43O4B41VqAlSmo va4SmRT5oZ29mKUFMvkY4LTp1U2MZJblWo0RP0duvF4FNPZw0FMXRm6mYyLntsgEXmRV d99ctqqayoR6oL0LuO9dgjfyRbCSxjhWk0fN6fkGXJnugmLTuE4HZTfycaHHYSRdIrKJ 1WlswtTjlvub2A5frZmCrnRqarvTZzrp6PdhdD53OhUw5qNzQCcpf44cv+4UNdGX8FeL kIIoQPs9XXQEhcIWVrVNrHg5WF77w2KWoLTmf2/BQZ1DQyW8a7crSo/rJq4AGPPEoIHv mwgw== 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=62Pu5sBR5nx/jUzaP/qRm1YBEm5frpGuQUSWypR3GX8=; b=GXXxI0pjAWFLudSevh6UgZ0NmcRBFFrYib5Nu1H2crJHP+Imef/97eMOhaqtxl/WrF 6b6yVZ94wPbbChP1X260RqmNGghRly78OM3kl5hedWOf5fubnTzHGb7hwCICRIPI05IM Js6VasEshWeDxkl9rpHOHlvv6EiJNdxb1LhmE9+NgGsxBXbH6yCWE6QkTY2G3y082f6i ylayFNLd+Tb7kZ5tK3PxotHjSyNWuMEKNaeK8eDTFpnE9d5AVVpfSjmr1aof5wf5O30Y QdmnJFwenF+/jHudvyaCgb/W23qrHF67fLbZDm1PBXfnncFCID7BcHxy2p3OIfbUC8Jn 35Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=U6fXiHEP; 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 r21si10213064edy.321.2021.03.09.09.23.50; Tue, 09 Mar 2021 09:24:14 -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=U6fXiHEP; 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 S230303AbhCIRWm (ORCPT + 99 others); Tue, 9 Mar 2021 12:22:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbhCIRWb (ORCPT ); Tue, 9 Mar 2021 12:22:31 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05ABBC06174A for ; Tue, 9 Mar 2021 09:22:31 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id w11so17222687wrr.10 for ; Tue, 09 Mar 2021 09:22:30 -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=62Pu5sBR5nx/jUzaP/qRm1YBEm5frpGuQUSWypR3GX8=; b=U6fXiHEPH3L4q0wNrcCtUSPM+4WKrol1Mytk36zpQNWtBDBc2nYz0xgv3vvrk+ivsv iSeH2W32SP9Ey1qRWxXoU3cnCvdJf/wd7oVJip97+D/qmQ3rR58ruTCUQLQxyN0C7iyP TOCrKF8HN1Rf2zEl3iaJDKbs4G+veyMQH/sE4UZHQ7R7jSII0I6SoZxv8hWiixb3aP7y hOmn+UrXSwVV2nocf3o0H6KD6piSIo+DZ8nJlAQIN6Dbh5bZOO4zXoikiXi703A3UiWt 8eU0E1hxnlQJvM+K0GYcwCN3njsIeDWPCNnPRa4XNzRg/CG5eyBtPi8ql6QKt2oWT4J2 Y+7w== 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=62Pu5sBR5nx/jUzaP/qRm1YBEm5frpGuQUSWypR3GX8=; b=Xcjc8YvpOHxa0a5CkNJXrrQExazltS7bv3HQ6FQoJvg8vI8iUxgnRlzRKR2gFBGedW o9/yy1wT6IMPzaXopZ33iBiKgbHQVI73mKPRsJuCRjViY/Cj3pqnh0yJ2UN5I+c61Jx/ CDjBsSm6wv++oaiU3yCnB84zpCt1agl44KFqRK3F5Ww/oBdgUtImuBEwr4KEBbrmeI2X WJaf5yjVB7ycm/jBz5og9rVY62eHc5X8Stcdf+FcaxsLvCOE47cyHEnXjjqyFbGwh3jM I04rCmi06vPpaVTgF+UTpq68sKbPuRDbTwmMla2+ksbjeWq2UpA4XY9XxZel/p7Sikgn /v4Q== X-Gm-Message-State: AOAM5315T8cCqhqNFtU36MlYayCVoiAq77P3/5BxLzYNuZx0tQ3cEB9t NEvP+CKD6SSk30gmnu2yLpfBRA== X-Received: by 2002:a5d:638f:: with SMTP id p15mr29029496wru.220.1615310549582; Tue, 09 Mar 2021 09:22:29 -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 b15sm5378450wmd.41.2021.03.09.09.22.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Mar 2021 09:22:29 -0800 (PST) Subject: Re: [PATCH] drm: meson_drv add shutdown function To: Kevin Hilman , Artem Lapkin Cc: 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> <7h35x42qtt.fsf@baylibre.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 RqvgB62oKOFlgOTYC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eekQrTvyoASw 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: <875c606f-baf9-f92a-4820-39d3d7312607@baylibre.com> Date: Tue, 9 Mar 2021 18:22:27 +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: <7h35x42qtt.fsf@baylibre.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 09/03/2021 18:13, Kevin Hilman wrote: > Hi Neil, > > Neil Armstrong writes: > >> 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, > > Could you submit this as a fix to stable (v5.10+) also? It should be done automagically since I added the Fixes tag neil > > Thanks, > > Kevin >