Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1590020pxb; Mon, 8 Mar 2021 01:05:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYtwW2fV964zOo6ojto7M/xaSrR6JbEHTYQ9Amq4m1LIpkX95uuSVz9BNpa3oyhHGgslWC X-Received: by 2002:a50:d302:: with SMTP id g2mr20920406edh.75.1615194308096; Mon, 08 Mar 2021 01:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615194308; cv=none; d=google.com; s=arc-20160816; b=OhMOxd+UEvWnwg7PyEn6hoKT7md7pwWR1s/ZLdVFzIEHo5Aa0T1m/a/6SaAstagRlw ROPY9RFmgg+CsLD+TJsVfWdQGYxkZn4T4LJtuYMBq+5tJhY1QJhYPJ4L9CVjVCMfYWDM Jb9auEonKEX+wr/UR5ra3ZsYkG8fseO+FYHCmZW8zwrkx1XWiEzy+CKsi6C3A2cVpJjE hThv8QJVwASMD6Y795P/IcdH8gdQHJbNXfDMVXBs5ko0IkrQAXzr7VMSSSUkhdnoYvrO Oc75ga+19JQGGszxDGwwJAA4Vp8MHEntttZ0SFgfGy5vc2iR7fsvV5eccpg/2ZU9K+qQ h2Nw== 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=VduCoy9cY/POZZOiEWzngRwLsbws5z84iVhRIR40VNU=; b=YcYvg6WzHC6AYXrxGPgAAaVmpYxXr8UsiT0lFQIbcVx9DgiULNhGVEncVx9G9Xjf/s d4XemAospXS1lLPb980zkm/2ekxsvI6N59aqYIFesVxmyiCFPHLWQ33GwGcnCgG7i3sL cls8rQ1hS3R/NPQ7Q9PWP6mBlurLJ/dzXteDK1Xuh1pBEV47nJ9vYGfrZhKtYXbOfvwl CLyKSWirubtE1WtRCD+YZe0Aw3mbwx5jBb9dnyGDvoAIoAiGXLVomLpNXDUPGy2LsYxe a0DthGns6oBTysNE0P3DllJzCIRbhkduWrKXXLu1Edq00wWrmZHRCoLluCabxlyRSwo6 da0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=x2smg4jR; 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 b4si6993049edn.586.2021.03.08.01.04.45; Mon, 08 Mar 2021 01:05:08 -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=x2smg4jR; 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 S229787AbhCHJDS (ORCPT + 99 others); Mon, 8 Mar 2021 04:03:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhCHJDC (ORCPT ); Mon, 8 Mar 2021 04:03:02 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2287CC06174A for ; Mon, 8 Mar 2021 01:03:02 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so342054wmj.2 for ; Mon, 08 Mar 2021 01:03:02 -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=VduCoy9cY/POZZOiEWzngRwLsbws5z84iVhRIR40VNU=; b=x2smg4jRl66r5msS9Ra8Bf5luC9Q4x3G6RAvuNOlXyTD3q3j34dQ5a3PbDZUa2fju7 oNgDc6xvV0BdxK33za3HYCXXCD8jIzgTCtH1HOFRGXMnEBXk/Ysh8wCSsz12OOD6Z/R7 JVfPefEYX1rYHDt4Tm9vzgz+nS7pQqxU7slmSukfGLTqmytPq/UZ5JPZ+TFSpovNCLQC fvg0KsYnt15PF4DiWfEJzIXIOrHq0aqn4/wEXosQ8KeUzv82BYLr+uiU1S033OPH2ZgO oYHQ1yIZ8Fe1WcUNa7N+hcs1Wtw2KLKogoaAZ5wHa6usk0GDk+m86y2UO+6vkdcQbXT0 wBdg== 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=VduCoy9cY/POZZOiEWzngRwLsbws5z84iVhRIR40VNU=; b=slBnBn3sv6JiG6G7qaq/T2ZEFokW8jIuZR4gpp3RVd62OELOXoOxQPmAgXjh3KDw8k pAS1KcRdU5xwOD73DvE85WI8u5tsL4QD3OK7tfJVsL2pW5WPMz07FO5zA5XShBt/2YHR VtyLPsJz7VtqyTGJLfaYs7BhEhUC0zoyf1Q7z12VHMwmIGfBMPLfsf6x5/sGSmTmKNWc 3a2WGRnHKbMfLxB08VUQQwzzgfKRC2TWp/IU30gk76PfZ1T8h1Nx2u+OMBCrP8kgJSHs iucQiQySmswLKGhzU23qq6J9AwT7NO2AhYOBTyvhAXCjOIs2UZCMEWXny3BNvtPlbokP jlIA== X-Gm-Message-State: AOAM533qqDE6nNb0ZL7wBGBOJRyJ2nWGcWFuTIdJvdzhsMsEtAOao8ON 8c1uZRa+u26NXxLlyOG2V3fk/A== X-Received: by 2002:a7b:c842:: with SMTP id c2mr21301749wml.100.1615194180723; Mon, 08 Mar 2021 01:03:00 -0800 (PST) Received: from [192.168.1.10] ([88.164.51.138]) by smtp.gmail.com with ESMTPSA id y10sm17441439wrl.19.2021.03.08.01.02.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Mar 2021 01:03:00 -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 RqvgB62oKOFlgOTYCMkYpm2aAOZZLf6VKHKc7DoVwuUkjHfIRXdslbrxi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ZB3Xfe6sOp24PQTHAKGtjTHNP/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: Mon, 8 Mar 2021 10:00:48 +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) > Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") > 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, > Acked-by: Neil Armstrong