OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
To: opensbi@lists.infradead.org
Subject: [PATCH 1/1] lib: utils: identify supported GPIO reset methods
Date: Wed, 29 Sep 2021 14:03:19 +0200	[thread overview]
Message-ID: <e747166b-0f6e-3a48-5dbc-8831aa4abbcb@canonical.com> (raw)
In-Reply-To: <20210929121411.4af6684d@redslave.neermore.group>

On 9/29/21 11:14, Nikita Shubin wrote:
> On Wed, 29 Sep 2021 09:46:55 +0530
> Anup Patel <anup@brainfault.org> wrote:
> 
>> +Nikita
>>
>> On Tue, Sep 28, 2021 at 5:13 PM Heinrich Schuchardt
>> <heinrich.schuchardt@canonical.com> wrote:
>>>
>>> The GPIO reset driver supports reset and poweroff. But not all
>>> boards support both. gpio_system_reset_check() must detect this
>>> situation.
>>>
>>> Signed-off-by: Heinrich Schuchardt
>>> <heinrich.schuchardt@canonical.com>
>>
>> Looks good to me.
>>
>> Reviewed-by: Anup Patel <anup.patel@wdc.com>
>>
>> I had mentioned on the PMIC reset series that we need to improve
>> the sbi_system.h device registration such that reset drivers can
>> register a reset device for a range of reset types. This will allow
>> separate reset drivers (e.g. PMIC+GPIO) for SiFive Unmatched.
>> Also, reset_check() callback will not be required anymore.
>>
>> Regards,
>> Anup
> 
> Looks good to me, however
> 
>>> +       /* hang !!! */
>>> +       sbi_hart_hang();
>>>   }
> 
> Heinrich do we really need to hang here ?
> 
> Despite the gpio_system_reset should never reach the end of function,
> i remember you talked something about returning from function back to
> the sbi_system_reset.

Thanks for reviewing.

As we are calling the check function before invoking the reset function 
this hang will only be running until the power supply is drained.

A calling function is defined as __no_return. Once we correct the whole 
reset driver framework as proposed by Anup we have to remove the 
sbi_hart_hang() here and in other drivers. We then need a small wait 
here and shall return SBI_EFAIL in the most improbable case.

Best regards

Heinrich



  reply	other threads:[~2021-09-29 12:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 11:42 [PATCH 1/1] lib: utils: identify supported GPIO reset methods Heinrich Schuchardt
2021-09-29  4:16 ` Anup Patel
2021-09-29  7:01   ` Heinrich Schuchardt
2021-09-29 12:38     ` Anup Patel
2021-09-30 10:29       ` Heinrich Schuchardt
2021-09-30 13:13         ` Anup Patel
2021-09-29  9:14   ` Nikita Shubin
2021-09-29 12:03     ` Heinrich Schuchardt [this message]
2021-10-01  4:58   ` 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=e747166b-0f6e-3a48-5dbc-8831aa4abbcb@canonical.com \
    --to=heinrich.schuchardt@canonical.com \
    --cc=opensbi@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox