mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: Anup Patel <anup@brainfault.org>
Cc: Anup Patel <apatel@ventanamicro.com>,
	Atish Patra <atishp@atishpatra.org>,
	Alexandre Ghiti <alex@ghiti.fr>, <robh@kernel.org>,
	Alexandre Ghiti <alexghiti@rivosinc.com>,
	<jeeheng.sia@starfivetech.com>, <linux-kernel@vger.kernel.org>,
	<palmer@rivosinc.com>, <leyfoon.tan@starfivetech.com>,
	<mason.huo@starfivetech.com>, Guo Ren <guoren@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Song Shuai <suagrfillet@gmail.com>,
	<linux-riscv@lists.infradead.org>,
	Andrew Jones <ajones@ventanamicro.com>
Subject: Re: Bug report: kernel paniced when system hibernates
Date: Thu, 25 May 2023 15:20:35 +0100	[thread overview]
Message-ID: <20230525-citric-waged-a2f78d27eb0c@wendy> (raw)
In-Reply-To: <CAAhSdy3SqeLdAfaojUki=ht21nr4ZUPMkW_t9M6ntQCt6Ds4Nw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3189 bytes --]

On Thu, May 25, 2023 at 07:29:46PM +0530, Anup Patel wrote:
> On Thu, May 25, 2023 at 7:26 PM Conor Dooley <conor.dooley@microchip.com> wrote:
> >
> > On Thu, May 25, 2023 at 07:13:11PM +0530, Anup Patel wrote:
> > > On Thu, May 25, 2023 at 7:08 PM Conor Dooley <conor.dooley@microchip.com> wrote:
> > > >
> > > > On Thu, May 25, 2023 at 06:51:28PM +0530, Anup Patel wrote:
> > > >
> > > > > > We should only rely on this node name for known bad versions of opensbi
> > > > > > IMO. Going forward, if something needs to be reserved for firmware, the
> > > > > > firmware should make sure that it is reserved by using the property for
> > > > > > that purpose :)
> > > >
> > > > > There is no issue with OpenSBI since it does the right thing by marking
> > > > > memory as reserved in the DT. This real issue is with the kernel handling
> > > > > of reserved memory for hibernate.
> > > >
> > > > I don't think we are talking about the same thing here. I meant the
> > > > no-map property which OpenSBI does not set.
> > >
> > > Yes, we are talking about the same thing. It's not just OpenSBI not
> > > setting no-map property in reserved memory node because other
> > > SBI implementations would be doing the same thing (i.e. not setting
> > > no-map property)
> >
> > Other SBI implementations doing the same thing doesn't make it any more
> > correct though, right?
> 
> Like multiple folks suggested, we need DT binding for distinguishing
> firmware reserved memory from other reserved memory.

And I have agreed with multiple times!

> Until that
> happens we should either mark hibernate support as experimental
> or revert it.

That works for me. How about the below?

-- >8 --
From 1d4381290a1600eff9b29b8ace6be73955d9726c Mon Sep 17 00:00:00 2001
From: Conor Dooley <conor.dooley@microchip.com>
Date: Thu, 25 May 2023 15:09:08 +0100
Subject: [PATCH] RISC-V: mark hibernation as broken

Hibernation support depends on firmware marking its reserved
regions as not mappable by Linux. As things stand, the de-facto SBI
implementation (OpenSBI) does not do this, and other implementations may
not do so either, resulting in kernel panics during hibernation ([1],
[2]).

Disable support for hibernation until such time that an SBI
implementation independent way to communicate what regions are reserved
has been agreed upon.

Reported-by: Song Shuai <suagrfillet@gmail.com>
Link: https://lore.kernel.org/all/CAAYs2=gQvkhTeioMmqRDVGjdtNF_vhB+vm_1dHJxPNi75YDQ_Q@mail.gmail.com/ [1]
Reported-by: JeeHeng Sia <jeeheng.sia@starfivetech.com>
Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ITXwaKfA6z8
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 13f058490608..b2495192f35a 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -801,7 +801,7 @@ menu "Power management options"
 source "kernel/power/Kconfig"
 
 config ARCH_HIBERNATION_POSSIBLE
-	def_bool y
+	def_bool n
 
 config ARCH_HIBERNATION_HEADER
 	def_bool HIBERNATION
-- 
2.39.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-05-25 14:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16  9:24 Song Shuai
2023-05-16  9:55 ` JeeHeng Sia
2023-05-16 11:14   ` Alexandre Ghiti
2023-05-16 11:27     ` JeeHeng Sia
2023-05-17  8:33       ` Alexandre Ghiti
2023-05-18  4:06         ` JeeHeng Sia
2023-05-16 11:12 ` Alexandre Ghiti
2023-05-17  8:58   ` Alexandre Ghiti
2023-05-17 11:05     ` Song Shuai
     [not found]       ` <CAHVXubgjgMvFV0MOABbtKr+2TH85+0kow7wOrjxFCP5iXt1saQ@mail.gmail.com>
2023-05-17 14:42         ` Fwd: " Alexandre Ghiti
2023-05-18  1:29           ` JeeHeng Sia
2023-05-18  9:13             ` Alexandre Ghiti
2023-05-18  3:29           ` Song Shuai
2023-05-18 11:54             ` Alexandre Ghiti
2023-05-17 11:27     ` Conor Dooley
2023-05-17 14:55       ` Alexandre Ghiti
2023-05-18  6:53         ` Anup Patel
2023-05-18  7:59           ` Conor Dooley
2023-05-18  8:41             ` Alexandre Ghiti
2023-05-18 10:35               ` Conor Dooley
2023-05-18 11:58                 ` Alexandre Ghiti
2023-05-24 23:53                   ` Atish Patra
2023-05-25 12:55                     ` Conor Dooley
2023-05-18 12:21                 ` JeeHeng Sia
2023-05-18 12:09           ` Alexandre Ghiti
2023-05-18 14:04             ` Anup Patel
2023-05-24 13:49               ` Conor Dooley
2023-05-24 13:57                 ` Alexandre Ghiti
2023-05-24 15:59                   ` Conor Dooley
2023-05-24 23:45               ` Atish Patra
2023-05-25 13:08                 ` Conor Dooley
2023-05-25 13:21                   ` Anup Patel
2023-05-25 13:37                     ` Conor Dooley
2023-05-25 13:43                       ` Anup Patel
2023-05-25 13:55                         ` Conor Dooley
2023-05-25 13:59                           ` Anup Patel
2023-05-25 14:20                             ` Conor Dooley [this message]
2023-05-25 17:39                               ` Atish Patra
2023-05-25 18:22                                 ` Conor Dooley
2023-05-25 18:37                                   ` Atish Patra
2023-05-25 18:39                                     ` Conor Dooley
2023-05-25 20:06                                       ` Atish Patra
2023-05-25 21:24                                         ` Conor Dooley
2023-05-26 13:14                                           ` Alexandre Ghiti
2023-05-26 14:59                                             ` Conor Dooley
2023-05-26 15:12                                               ` Alexandre Ghiti
2023-05-26 15:17                                                 ` Anup Patel
2023-05-26 15:22                                                   ` Alexandre Ghiti
2023-05-26 18:48                                                     ` Atish Patra
2023-05-16 11:35 ` Conor Dooley

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=20230525-citric-waged-a2f78d27eb0c@wendy \
    --to=conor.dooley@microchip.com \
    --cc=ajones@ventanamicro.com \
    --cc=alex@ghiti.fr \
    --cc=alexghiti@rivosinc.com \
    --cc=anup@brainfault.org \
    --cc=apatel@ventanamicro.com \
    --cc=atishp@atishpatra.org \
    --cc=guoren@kernel.org \
    --cc=jeeheng.sia@starfivetech.com \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mason.huo@starfivetech.com \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=suagrfillet@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®