From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Krzysztof Wilczynski <kw@linux.com>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] misc: pci_endpoint_test: Remove global irq_type
Date: Thu, 13 Feb 2025 19:21:59 +0900 [thread overview]
Message-ID: <fe8763e5-2d59-4b14-8a1c-b72e6df95520@socionext.com> (raw)
In-Reply-To: <Z6opssGJ91MVWgRC@ryzen>
Hi Niklas,
On 2025/02/11 1:30, Niklas Cassel wrote:
> On Mon, Feb 10, 2025 at 04:58:11PM +0900, Kunihiko Hayashi wrote:
>> The global variable "irq_type" preserves the current value of
>> ioctl(GET_IRQTYPE), however, it's enough to use test->irq_type.
>> Remove the variable, and replace with test->irq_type.
>
> I think the commit message is missing the biggest point.
>
> ioctl(SET_IRQTYPE) sets test->irq_type.
> PCITEST_WRITE/PCITEST_READ/PCITEST_COPY all use test->irq_type when
> writing the PCI_ENDPOINT_TEST_IRQ_TYPE register in test_reg_bar.
>
> The endpoint function driver (pci-epf-test) will look at
> PCI_ENDPOINT_TEST_IRQ_TYPE register in test_reg_bar when determining
> which type of IRQ it should raise.
>
> This means that the kernel module parameter is basically useless,
> since it is unused if anyone has called ioctl(SET_IRQTYPE).
>
> Both the old pcitest.sh and the new pci_endpoint_test kselftest call
> ioctl(SET_IRQTYPE), so in practice the irq_type kernel module parameter
> is dead code.
Thank you for pointing out.
Surely, global "irq_type" is only used for return value of ioctl(GET_IRQTYPE).
It isn't used in the test case, and the test is completed with test->irq_type
and the register.
I'll add this point to the explanation.
>>
>> The ioctl(GET_IRQTYPE) returns an error if test->irq_type has
>> IRQ_TYPE_UNDEFINED.
>>
>> Suggested-by: Niklas Cassel <cassel@kernel.org>
>> Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> ---
>> drivers/misc/pci_endpoint_test.c | 13 ++++---------
>> 1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/misc/pci_endpoint_test.c
> b/drivers/misc/pci_endpoint_test.c
>> index 6a0972e7674f..8d98cd18634d 100644
>> --- a/drivers/misc/pci_endpoint_test.c
>> +++ b/drivers/misc/pci_endpoint_test.c
>> @@ -100,10 +100,6 @@ static bool no_msi;
>> module_param(no_msi, bool, 0444);
>> MODULE_PARM_DESC(no_msi, "Disable MSI interrupt in pci_endpoint_test");
>
> Considering that you are removing the irq_type kernel module parameter,
> it doesn't make sense to keep the no_msi kernel module parameter IMO.
>
> The exact same argument for why we are removing irq_type, can be made for
> no_msi.
Agreed.
Even if chip doesn't have MSI, test->irq_type starts with IRQ_TYPE_UNDEFINED
and will be changed with ioctl(SET_IRQTYPE).
"no_msi" can also be removed.
Thank you,
---
Best Regards
Kunihiko Hayashi
next prev parent reply other threads:[~2025-02-13 10:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 7:58 [PATCH v3 0/5] Fix some issues related to an interrupt type in pci_endpoint_test Kunihiko Hayashi
2025-02-10 7:58 ` [PATCH v3 1/5] misc: pci_endpoint_test: Avoid issue of interrupts remaining after request_irq error Kunihiko Hayashi
2025-02-14 17:21 ` Manivannan Sadhasivam
2025-02-17 11:24 ` Kunihiko Hayashi
2025-02-10 7:58 ` [PATCH v3 2/5] misc: pci_endpoint_test: Fix disyplaying irq_type " Kunihiko Hayashi
2025-02-10 7:58 ` [PATCH v3 3/5] misc: pci_endpoint_test: Fix irq_type to convey the correct type Kunihiko Hayashi
2025-02-10 16:01 ` Niklas Cassel
2025-02-13 10:21 ` Kunihiko Hayashi
2025-02-13 13:26 ` Niklas Cassel
2025-02-14 17:25 ` Manivannan Sadhasivam
2025-02-17 11:26 ` Kunihiko Hayashi
2025-02-20 7:41 ` Manivannan Sadhasivam
2025-02-10 7:58 ` [PATCH v3 4/5] misc: pci_endpoint_test: Remove global irq_type Kunihiko Hayashi
2025-02-10 16:30 ` Niklas Cassel
2025-02-13 10:21 ` Kunihiko Hayashi [this message]
2025-02-14 17:27 ` Manivannan Sadhasivam
2025-02-10 7:58 ` [PATCH v3 5/5] misc: pci_endpoint_test: Do not use managed irq functions Kunihiko Hayashi
2025-02-14 17:29 ` Manivannan Sadhasivam
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=fe8763e5-2d59-4b14-8a1c-b72e6df95520@socionext.com \
--to=hayashi.kunihiko@socionext.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo.pimentel@synopsys.com \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.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