From: Alexandre Ghiti <alex@ghiti.fr>
To: Andrea Parri <parri.andrea@gmail.com>
Cc: Xu Lu <luxu.kernel@bytedance.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH] riscv: Fix local irq restore when flags indicates irq disabled
Date: Tue, 18 Jun 2024 13:52:35 +0200 [thread overview]
Message-ID: <9268589d-9ccc-4cdd-9de2-5019407ef313@ghiti.fr> (raw)
In-Reply-To: <ZnFqDRXRjoHMaJXW@andrea>
Hi Andrea,
On 18/06/2024 13:05, Andrea Parri wrote:
> (merging replies)
>
>>>> However, if local_irq_save() is called when irq is disabled. The SR_IE bit of
>>>> flag returned is clear. If some code between local_irq_save() and
>>>> local_irq_restore() reenables irq, causing the SR_IE bit of CSR_STATUS
>>>> back to 1, then local_irq_restore() can not restore irq status back to disabled.
> But doesn't that represent some bogus manipulation of the irq flags? cf.
>
> config DEBUG_IRQFLAGS
> bool "Debug IRQ flag manipulation"
> help
> Enables checks for potentially unsafe enabling or disabling of
> interrupts, such as calling raw_local_irq_restore() when interrupts
> are enabled.
>
> in particular, raw_check_bogus_irq_restore() in raw_local_irq_restore().
>
>
>> This got lost but this is still correct and needed.
> You mean because of the mentioned rtl8723e example? are there other such
> instances? IOW, why do you say that the changes in question are needed?
Simply because the scenario in this driver and I looked at the arm64
implementation which restores flags unconditionally.
But if that's considered bogus, let's drop this. Sorry Xu for the noise,
and thanks Andrea for pointing this.
Alex
>
> Andrea
next prev parent reply other threads:[~2024-06-18 11:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 7:05 Xu Lu
2023-08-09 6:05 ` Palmer Dabbelt
2023-08-09 6:58 ` [External] " 旭路
2023-08-24 12:08 ` Xu Lu
2024-06-18 9:45 ` Alexandre Ghiti
2024-06-18 10:00 ` Xu Lu
2024-06-18 10:02 ` Alexandre Ghiti
2024-06-18 11:05 ` Andrea Parri
2024-06-18 11:52 ` Alexandre Ghiti [this message]
2024-06-19 3:53 ` Xu Lu
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=9268589d-9ccc-4cdd-9de2-5019407ef313@ghiti.fr \
--to=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=luxu.kernel@bytedance.com \
--cc=palmer@dabbelt.com \
--cc=parri.andrea@gmail.com \
--cc=paul.walmsley@sifive.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®