public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.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>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
	"Bjorn Helgaas" <helgaas@kernel.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 3/3] misc: pci_endpoint_test: Fix irq_type to convey the correct type
Date: Fri, 31 Jan 2025 13:20:38 +0100	[thread overview]
Message-ID: <Z5zAFhEJzwOQUccM@ryzen> (raw)
In-Reply-To: <Z5y9zpFGkBnY2TG1@ryzen>

On Fri, Jan 31, 2025 at 01:10:54PM +0100, Niklas Cassel wrote:
> > 
> > If SET_IRQTYPE is AUTO, how will test->irq_type be set?
> 
> I was thinking something like this:
> 
> pci_endpoint_test_set_irq()
> {
> 	u32 caps = pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_CAPS);
> 
> 	...
> 
> 	if (req_irq_type == IRQ_TYPE_AUTO) {
> 		if (caps & MSI_CAPABLE)
> 			test->irq_type = IRQ_TYPE_MSI;
> 		else if (caps & MSIX_CAPABLE)
> 			test->irq_type = IRQ_TYPE_MSIX;
> 		else
> 			test->irq_type = IRQ_TYPE_INTX;
> 
> 	}
> 
> 	...
> }


Or even simpler (since it requires less changes to
pci_endpoint_test_set_irq()):

	if (req_irq_type == IRQ_TYPE_AUTO) {
		if (caps & MSI_CAPABLE)
			req_irq_type = IRQ_TYPE_MSI;
		else if (caps & MSIX_CAPABLE)
			req_irq_type = IRQ_TYPE_MSIX;
		else
			req_irq_type = IRQ_TYPE_INTX;

	}

	...

	/* Sets test->irq_type = req_irq_type; on success */
	pci_endpoint_test_alloc_irq_vectors();



Kind regards,
Niklas

  reply	other threads:[~2025-01-31 12:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250122022446.2898248-1-hayashi.kunihiko@socionext.com>
2025-01-22  2:24 ` [PATCH v2 1/3] misc: pci_endpoint_test: Avoid issue of interrupts remaining after request_irq error Kunihiko Hayashi
2025-01-28 14:12   ` Manivannan Sadhasivam
2025-01-29  7:54     ` Kunihiko Hayashi
2025-02-07 18:02       ` Manivannan Sadhasivam
2025-02-10  1:39         ` Kunihiko Hayashi
2025-01-22  2:24 ` [PATCH v2 2/3] misc: pci_endpoint_test: Fix disyplaying irq_type " Kunihiko Hayashi
2025-01-28 14:20   ` Manivannan Sadhasivam
2025-01-22  2:24 ` [PATCH v2 3/3] misc: pci_endpoint_test: Fix irq_type to convey the correct type Kunihiko Hayashi
2025-01-28 14:32   ` Manivannan Sadhasivam
2025-01-29  7:55     ` Kunihiko Hayashi
2025-01-29 11:58     ` Niklas Cassel
2025-01-31 10:16       ` Kunihiko Hayashi
2025-01-31 12:10         ` Niklas Cassel
2025-01-31 12:20           ` Niklas Cassel [this message]
2025-01-31 13:13             ` Niklas Cassel
2025-02-03  8:03           ` Kunihiko Hayashi

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=Z5zAFhEJzwOQUccM@ryzen \
    --to=cassel@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=helgaas@kernel.org \
    --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 \
    --cc=stable@vger.kernel.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