public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Joseph Jang <jjang@nvidia.com>
Cc: shuah@kernel.org, mochs@nvidia.com, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-tegra@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/1] selftest: drivers: Add support its msi hwirq checking
Date: Wed, 31 Jul 2024 14:24:36 -0500	[thread overview]
Message-ID: <20240731192436.GA76176@bhelgaas> (raw)
In-Reply-To: <20240530012727.324611-2-jjang@nvidia.com>

[+cc Thomas]

On Wed, May 29, 2024 at 06:27:27PM -0700, Joseph Jang wrote:
> Validate there are no duplicate ITS-MSI hwirqs from the
> /sys/kernel/irq/*/hwirq.
> 
> One example log show 2 duplicated MSI entries in the /proc/interrupts.
> 
> 150: 0 ... ITS-MSI 3355443200 Edge      pciehp
> 152: 0 ... ITS-MSI 3355443200 Edge      pciehp

I don't know how ITS-MSI works, so I don't know whether it's an error
that both entries mention 3355443200.

3355443200 == 0xc8000000, which looks like it could be an address or
address/data pair or something, and it does make sense to me that if
two devices write the same MSI address/data, it should result in the
same IRQ.

It seems like maybe this is a generic issue, i.e., if this is a
problem, maybe it would affect *other* kinds of MSI too, not just
ITS-MSI?

> Kernel patch ("PCI/MSI: Fix MSI hwirq truncation") [1] fix above issue.
> [1]: https://lore.kernel.org/all/20240115135649.708536-1-vidyas@nvidia.com/
> 
> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com>
> Signed-off-by: Joseph Jang <jjang@nvidia.com>
> ---
>  tools/testing/selftests/drivers/irq/Makefile  |  5 +++++
>  .../selftests/drivers/irq/its-msi-irq-test.sh | 20 +++++++++++++++++++
>  2 files changed, 25 insertions(+)
>  create mode 100644 tools/testing/selftests/drivers/irq/Makefile
>  create mode 100755 tools/testing/selftests/drivers/irq/its-msi-irq-test.sh
> 
> diff --git a/tools/testing/selftests/drivers/irq/Makefile b/tools/testing/selftests/drivers/irq/Makefile
> new file mode 100644
> index 000000000000..569df5de22ee
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/irq/Makefile
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +TEST_PROGS := its-msi-irq-test.sh
> +
> +include ../../lib.mk
> diff --git a/tools/testing/selftests/drivers/irq/its-msi-irq-test.sh b/tools/testing/selftests/drivers/irq/its-msi-irq-test.sh
> new file mode 100755
> index 000000000000..87c88674903f
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/irq/its-msi-irq-test.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +if [ -z "$(grep "ITS-MSI" /proc/interrupts)" ]; then
> +	echo "SKIP: no ITS-MSI irq."
> +	exit 4
> +fi
> +
> +# Get ITS-MSI hwirq list from /sys/kernel/irq/*/hwirq.
> +its_msi_irq_list=$(grep "ITS-MSI" /sys/kernel/irq/*/chip_name |

Is there a limit on the size of the "*" expansion here?

> +				   awk -F ':' '{print $1}' |
> +				   xargs -I {} sh -c 'cat $(dirname {})/hwirq' | sort -V)
> +
> +# Check whether could find duplicated its-msi hwirq or not.
> +if [ -n "$(echo "$its_msi_irq_list" | uniq -cd)" ]; then
> +	echo "ERROR: find duplicated its-msi hwirq."
> +	exit 1
> +fi
> +
> +exit 0
> -- 
> 2.34.1
> 

  reply	other threads:[~2024-07-31 19:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  1:27 [PATCH 0/1] selftest: drivers: Add support its msi hwirq checking Joseph Jang
2024-05-30  1:27 ` [PATCH 1/1] " Joseph Jang
2024-07-31 19:24   ` Bjorn Helgaas [this message]
2024-07-31 20:42     ` Thomas Gleixner
2024-07-31 23:12       ` Thomas Gleixner
2024-07-30 20:59 ` [PATCH 0/1] " Shuah Khan

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=20240731192436.GA76176@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=jjang@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mochs@nvidia.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /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