All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
To: JeffyChen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	Vicente Bergas <vicencb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Klaus Goger
	<klaus.goger-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org>,
	Jakob Unterwurzacher
	<jakob.unterwurzacher-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org>,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Subject: Re: [regression] HDMI breakage just before poweroff
Date: Thu, 3 May 2018 13:14:22 +0100	[thread overview]
Message-ID: <0284fa4f-abd6-26f6-31e2-1a6d24777733@arm.com> (raw)
In-Reply-To: <5AEA873A.7080701-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

On 03/05/18 04:51, JeffyChen wrote:
> Hi Vincente,
> 
> Thanks for your mail.
> 
> On 05/03/2018 03:36 AM, Vicente Bergas wrote:
>> Hello,
>> on rk3399-sapphire there is a missing feature: the poweroff command is
>> unable to poweroff the system and the display stays on.
>> When the system is halted, power needs to be removed manually.
> according to the dtsi, the rk3399-sapphire is using rk808 pimc right?
> 
> i think the power off flow would be:
> 1/ rk808 set the pm_power_off callback:
> drivers/mfd/rk808.c
>          switch (rk808->variant) {
>          case RK805_ID:
>      ...
>                  pm_pwroff_fn = rk805_device_shutdown;
>      ...
> 
>          pm_off = of_property_read_bool(np,
>                                  "rockchip,system-power-controller");
>          if (pm_off && !pm_power_off) {
>                  rk808_i2c_client = client;
>                  pm_power_off = pm_pwroff_fn;
>          }
> 
> 2/ the poweroff command would call kernel_power_off:
> kernel/reboot.c:
> void kernel_power_off(void)
> {
> ...
>          machine_power_off();
> }
> 
> 3/ arm64's machine_power_off() would call pm_power_off to let rk808 
> cutoff the power.

Doesn't PSCI's pm_power_off take precedence, though? This sounds similar 
to what my RK3328 does - I looked into that briefly a while ago, and 
from what I remember it appeared that the firmware SYSTEM_OFF handler 
tries to turn off the PMIC by driving the SLEEP pin, but the kernel 
driver never actually configures it into the correct mode for that to 
work. Thus the box just ends up spinning in the firmware until you pull 
the plug manually.

>> With Linux kernel 4.16, when reaching the halted state, the HDMI console
>> shows the last messages before halting.
> if it ends up halted, maybe something wrong during setup the pm_power_off?
> kernel/reboot.c:
>          /* Instead of trying to make the power_off code look like
>           * halt when pm_power_off is not set do it the easy way.
>           */
>          if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
>                  cmd = LINUX_REBOOT_CMD_HALT;
> 
>>
>> With 4.17.0-rc3, when reaching the halted state, the HDMI console
>> shows colorful static noise.
>>
> we've added a shutdown() to the iommu driver:
> https://patchwork.kernel.org/patch/10230817/
> 
> any chance related?

For sure - the IOMMU shutdown disables paging, so if the VOP is still 
scanning out then that will result in whatever IOVAs it was using now 
going straight out onto the bus as physical addresses. Between the 
RK3399 memory map and the way the IOVA allocator works, that probably 
means it's reading from all over the peripherals region, which, er, 
isn't ideal.

Robin.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  parent reply	other threads:[~2018-05-03 12:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 19:36 [regression] HDMI breakage just before poweroff Vicente Bergas
     [not found] ` <CAAMcf8D86ssM+YeFAXaYDm9QwwAQLdaOgWyC2F8yQ-_-UNyY+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-05-03  3:51   ` JeffyChen
     [not found]     ` <5AEA873A.7080701-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-05-03 12:14       ` Robin Murphy [this message]
     [not found]         ` <0284fa4f-abd6-26f6-31e2-1a6d24777733-5wv7dgnIgG8@public.gmane.org>
2018-05-03 15:10           ` JeffyChen
     [not found]             ` <5AEB2670.9090305-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-05-03 20:33               ` Vicente Bergas
2018-05-03 21:15           ` Vicente Bergas
2018-06-11 22:04           ` Vicente Bergas
     [not found]             ` <CAAMcf8BJ1skbmR7AazyTPkkdyMoyuA0ihj=Gbnhb9nKWf3FSGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-12  3:52               ` JeffyChen
     [not found]                 ` <5B1F4375.7000000-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-06-12  8:54                   ` Marc Zyngier
     [not found]                     ` <77e4c6e1-015f-5fac-66b6-c942bb2dc9d8-5wv7dgnIgG8@public.gmane.org>
2018-06-12 10:27                       ` JeffyChen
     [not found]                         ` <5B1F9FF7.5070203-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-06-12 10:30                           ` Tomasz Figa
     [not found]                             ` <CAAFQd5D__ArEYSVoWL5A40X6vbYxJ-vOYpsXxiLujC-XK9u2+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-12 11:02                               ` Marc Zyngier
     [not found]                                 ` <86efhc8dyg.wl-marc.zyngier-5wv7dgnIgG8@public.gmane.org>
2018-06-13  7:15                                   ` Vicente Bergas
     [not found]                                     ` <CAAMcf8AmuMStdSUHGEQhii7BUtTRHOSyLhop43rf_nX0GROnnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-13 10:26                                       ` Marc Zyngier
     [not found]                                         ` <cc147c40-dbad-b714-3fe6-858854a56004-5wv7dgnIgG8@public.gmane.org>
2018-06-13 10:46                                           ` JeffyChen
     [not found]                                             ` <5B20F5F0.9090101-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-06-15 16:39                                               ` Vicente Bergas
     [not found]                                                 ` <CAAMcf8D1-7YvOeOMd+rJOWX7XNQwKeAYjfmyAHOR8TC6vc=G1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-15 16:51                                                   ` Marc Zyngier
     [not found]                                                     ` <7ce78e65-51b6-9204-5bb4-e515e36576d4-5wv7dgnIgG8@public.gmane.org>
2018-06-15 18:46                                                       ` Vicente Bergas
     [not found]                                                         ` <CAAMcf8C3fS1SdZVKrsu9zRMn69BcAtFL44QvWMJ8zn4CySnfcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-16 10:35                                                           ` Marc Zyngier
2018-08-05 14:09                                               ` [PATCH] drm/rockchip: shutdown drm subsystem on shutdown Vicente Bergas
     [not found]                                                 ` <20180805140911.19205-1-vicencb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-05 16:50                                                   ` Marc Zyngier
     [not found]                                                     ` <20180805175038.1d3a0c5e-Fmn/x+r+pSA9//JtdbceeD8Kkb2uy4ct@public.gmane.org>
2018-08-05 17:38                                                       ` Vicente Bergas
     [not found]                                                         ` <CAAMcf8CyUri0LigtJWvahLK62ihPUYa_UvA+2q_EA8m+TL2cqw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-05 18:23                                                           ` Marc Zyngier
2018-08-07 12:44                                                   ` Heiko Stuebner
2018-08-07 16:05                                                     ` Vicente Bergas
     [not found]                                                       ` <CAAMcf8D8Vwgi-Amqt8ou9LbDrsRTePjCvwDXWo1JUTGTxLyn_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-07 16:07                                                         ` Heiko Stuebner
2018-08-07 16:20                                                           ` Vicente Bergas
     [not found]                                                             ` <CAAMcf8DJhBk8rG65SmQR4vwtj1zfm7jfKJJ4nAx6OsAeu52T2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-09 13:43                                                               ` Marc Zyngier
     [not found]                                                                 ` <20180909144300.3908a11b-Fmn/x+r+pSA9//JtdbceeD8Kkb2uy4ct@public.gmane.org>
2018-09-10  9:08                                                                   ` Heiko Stuebner
2018-09-10  9:57                                                                     ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0284fa4f-abd6-26f6-31e2-1a6d24777733@arm.com \
    --to=robin.murphy-5wv7dgnigg8@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=jakob.unterwurzacher-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org \
    --cc=jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=klaus.goger-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=vicencb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.