From: Greg KH <gregkh@linuxfoundation.org>
To: Julian Vetter <jvetter@kalrayinc.com>
Cc: linux-kernel@vger.kernel.org, ysionneau@kalrayinc.com
Subject: Re: [PATCH 2/2] msi: Add sanity check if more than MAX_DEV_MSIS MSIs are requested
Date: Thu, 9 Jun 2022 19:57:21 +0200 [thread overview]
Message-ID: <YqI0gRCF4YOTnRMi@kroah.com> (raw)
In-Reply-To: <20220609153843.1991-3-jvetter@kalrayinc.com>
On Thu, Jun 09, 2022 at 05:38:43PM +0200, Julian Vetter wrote:
> If a device requests more than MAX_DEV_MSIS the MSI index will collide with
> the devid and might cause Linux to compute twice the same virtual interrupt
> number for two different devices.
>
> Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
> Reviewed-by: Yann Sionneau <ysionneau@kalrayinc.com>
> ---
> drivers/base/platform-msi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
> index 4b0b2fe3a7ff..627d8f6b83ea 100644
> --- a/drivers/base/platform-msi.c
> +++ b/drivers/base/platform-msi.c
> @@ -40,6 +40,8 @@ static irq_hw_number_t platform_msi_calc_hwirq(struct msi_desc *desc)
> {
> u32 devid = desc->dev->msi.data->platform_data->devid;
>
> + WARN_ON(desc->msi_index >= MAX_DEV_MSIS);
So you just caused a system to reboot if you have panic-on-warn? What
is someone supposed to do if this is ever hit? Why can't you handle it
as an error and properly recover instead of just ignoring it?
thanks,
greg k-h
prev parent reply other threads:[~2022-06-09 17:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 15:38 [PATCH 0/2] Check for MSI allocation Julian Vetter
2022-06-09 15:38 ` [PATCH 1/2] msi: The MSI framework only supports 2048 platform MSIs Julian Vetter
2022-06-09 15:38 ` [PATCH 2/2] msi: Add sanity check if more than MAX_DEV_MSIS MSIs are requested Julian Vetter
2022-06-09 17:57 ` Greg KH [this message]
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=YqI0gRCF4YOTnRMi@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jvetter@kalrayinc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ysionneau@kalrayinc.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®