From: Manivannan Sadhasivam <mani@kernel.org>
To: Niklas Cassel <nks@flawful.org>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Niklas Cassel" <niklas.cassel@wdc.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] misc: pci_endpoint_test: Use a unique test pattern for each BAR
Date: Mon, 18 Dec 2023 21:48:55 +0530 [thread overview]
Message-ID: <20231218161855.GD50521@thinkpad> (raw)
In-Reply-To: <20231215105952.1531683-1-nks@flawful.org>
On Fri, Dec 15, 2023 at 11:59:51AM +0100, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@wdc.com>
>
> Use a unique test pattern for each BAR in. This makes it easier to
> detect/debug address translation issues, since a developer can dump
> the backing memory on the EP side, using e.g. devmem, to verify that
> the address translation for each BAR is actually correct.
>
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> drivers/misc/pci_endpoint_test.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index a765a05f0c64..7ac1922475af 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -263,6 +263,15 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test)
> return false;
> }
>
> +static const u32 bar_test_pattern[] = {
> + 0xA0A0A0A0,
> + 0xA1A1A1A1,
> + 0xA2A2A2A2,
> + 0xA3A3A3A3,
> + 0xA4A4A4A4,
> + 0xA5A5A5A5,
> +};
> +
> static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
> enum pci_barno barno)
> {
> @@ -280,11 +289,12 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
> size = 0x4;
>
> for (j = 0; j < size; j += 4)
> - pci_endpoint_test_bar_writel(test, barno, j, 0xA0A0A0A0);
> + pci_endpoint_test_bar_writel(test, barno, j,
> + bar_test_pattern[barno]);
>
> for (j = 0; j < size; j += 4) {
> val = pci_endpoint_test_bar_readl(test, barno, j);
> - if (val != 0xA0A0A0A0)
> + if (val != bar_test_pattern[barno])
> return false;
> }
>
> --
> 2.43.0
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-12-18 16:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 10:59 [PATCH] misc: pci_endpoint_test: Use a unique test pattern for each BAR Niklas Cassel
2023-12-18 10:03 ` Damien Le Moal
2023-12-18 16:18 ` Manivannan Sadhasivam [this message]
2024-01-06 5:03 ` Krzysztof Wilczyński
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=20231218161855.GD50521@thinkpad \
--to=mani@kernel.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=niklas.cassel@wdc.com \
--cc=nks@flawful.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