public inbox for opensbi@lists.infradead.org
 help / color / mirror / Atom feed
From: Ben Zong-You Xie <ben717@andestech.com>
To: Andrew Jones <andrew.jones@oss.qualcomm.com>
Cc: <opensbi@lists.infradead.org>, Leo Yu-Chi Liang <ycliang@andestech.com>
Subject: Re: [PATCH 5/5] lib: utils/suspend: add Andes ATCSMU suspend driver
Date: Mon, 23 Feb 2026 11:53:47 +0800	[thread overview]
Message-ID: <aZvPSxOfGExHKOX4@swlinux02> (raw)
In-Reply-To: <47gaecm2iwnihliide4hfjnp4b5ygmk3edjltvl2mdp4wwaydx@5ggtizp65f2t>

> >
> > -     ae350_non_ret_save(sbi_scratch_thishart_ptr());
> >       ae350_disable_coherency();
> >       wfi();
> > -     return 0;
> > +
> > +     /* Light sleep resumes here */
> > +     ae350_enable_coherency();
> > +
> > +     return SBI_ENOTSUPP;
>
> I just skimmed this patch really fast, so I probably missed something,
> but it seems odd to return SBI_ENOTSUPP here.
>
> Thanks,
> drew

Hi Drew,

The reason for returning SBI_ENOTSUPP here is to satisfy the logic in
sbi_hsm_exit(). In sbi_hsm_exit(), there is a specific check:

  if (hsm_device_has_hart_hotplug()) {
    if (hsm_device_hart_stop() != SBI_ENOTSUPP)
      goto fail_exit;
  }

  /**
    * As platform is lacking support for hotplug, directly jump to warmboot
    * and wait for interrupts in warmboot. We do it preemptively in order
    * preserve the hart states and reuse the code path for hotplug.
    */
  jump_warmboot();

If we return 0 (SBI_OK), the condition (0 != SBI_ENOTSUPP) evaluates to
true, and the code jumps to fail_exit, hanging the hart.

Returning SBI_ENOTSUPP allows the execution to fall through to the
jump_warmboot() path, which is the intended behavior for 'light sleep'
on AE350 platform.

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

  reply	other threads:[~2026-02-23  3:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29  7:19 [PATCH 0/5] Add hart state management and system suspend support for AE350 Ben Zong-You Xie
2025-12-29  7:19 ` [PATCH 1/5] lib: utils/hsm: factor out ATCSMU code into an HSM driver Ben Zong-You Xie
2025-12-29  7:19 ` [PATCH 2/5] platform: generic/andes: add CSR save and restore functions for AE350 platform Ben Zong-You Xie
2025-12-29  7:19 ` [PATCH 3/5] lib: utils/cache: add cache enable function Ben Zong-You Xie
2025-12-29  7:19 ` [PATCH 4/5] lib: utils/cache: add Andes last level cache controller Ben Zong-You Xie
2025-12-29  7:19 ` [PATCH 5/5] lib: utils/suspend: add Andes ATCSMU suspend driver Ben Zong-You Xie
2026-02-11 15:59   ` Andrew Jones
2026-02-23  3:53     ` Ben Zong-You Xie [this message]
2026-02-11  6:24 ` [PATCH 0/5] Add hart state management and system suspend support for AE350 Anup Patel

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=aZvPSxOfGExHKOX4@swlinux02 \
    --to=ben717@andestech.com \
    --cc=andrew.jones@oss.qualcomm.com \
    --cc=opensbi@lists.infradead.org \
    --cc=ycliang@andestech.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