LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Marek Behún" <kabel@kernel.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] PCI: aardvark: Fix reading MSI interrupt number
Date: Mon, 23 Aug 2021 17:52:10 +0100	[thread overview]
Message-ID: <871r6kqf2d.wl-maz@kernel.org> (raw)
In-Reply-To: <20210823164033.27491-2-pali@kernel.org>

On Mon, 23 Aug 2021 17:40:31 +0100,
Pali Rohár <pali@kernel.org> wrote:
> 
> Experiments showed that in register PCIE_MSI_PAYLOAD_REG is stored number
> of the last received MSI interrupt and not number of MSI interrupt which
> belongs to msi_idx bit. Therefore this implies that aardvark HW can cache
> only bits [4:0] of received MSI interrupts with effectively means that it
> supports only MSI interrupts with numbers 0-31.
> 
> Do not read PCIE_MSI_PAYLOAD_REG register for determining MSI interrupt
> number. Instead ensure that pci-aardvark.c configures only MSI numbers in
> range 0-31 and then msi_idx contains correct received MSI number.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Cc: stable@vger.kernel.org
> ---
>  drivers/pci/controller/pci-aardvark.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
> index 48fbfa7eb24c..81c4a9ff91a3 100644
> --- a/drivers/pci/controller/pci-aardvark.c
> +++ b/drivers/pci/controller/pci-aardvark.c
> @@ -1232,7 +1232,6 @@ static void advk_pcie_remove_irq_domain(struct advk_pcie *pcie)
>  static void advk_pcie_handle_msi(struct advk_pcie *pcie)
>  {
>  	u32 msi_val, msi_mask, msi_status, msi_idx;
> -	u16 msi_data;
>  	int virq;
>  
>  	msi_mask = advk_readl(pcie, PCIE_MSI_MASK_REG);
> @@ -1243,17 +1242,13 @@ static void advk_pcie_handle_msi(struct advk_pcie *pcie)
>  		if (!(BIT(msi_idx) & msi_status))
>  			continue;
>  
> -		/*
> -		 * msi_idx contains bits [4:0] of the msi_data and msi_data
> -		 * contains 16bit MSI interrupt number from MSI inner domain
> -		 */
>  		advk_writel(pcie, BIT(msi_idx), PCIE_MSI_STATUS_REG);
> -		msi_data = advk_readl(pcie, PCIE_MSI_PAYLOAD_REG) & PCIE_MSI_DATA_MASK;
> -		virq = irq_find_mapping(pcie->msi_inner_domain, msi_data);
> +
> +		virq = irq_find_mapping(pcie->msi_inner_domain, msi_idx);
>  		if (virq)
>  			generic_handle_irq(virq);

NAK.

As I have explained before, I want this API dead, and I don't feel
like doing another pass at the whole of the kernel tree to remove
these patterns.

A patch targeting stable is not a mandate for using deprecated
APIs. You can always send another patch for stable versions before
5.14.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2021-08-23 16:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15 10:36 [PATCH 0/3] PCI: aardvark: MSI interrupt fixes Pali Rohár
2021-08-15 10:36 ` [PATCH 1/3] PCI: aardvark: Fix reading MSI interrupt number Pali Rohár
2021-08-15 10:36 ` [PATCH 2/3] PCI: aardvark: Fix masking MSI interrupts Pali Rohár
2021-08-15 16:56   ` Marc Zyngier
2021-08-15 17:36     ` Pali Rohár
2021-08-15 21:55       ` Marc Zyngier
2021-08-15 23:10         ` Pali Rohár
2021-08-15 10:36 ` [PATCH 3/3] PCI: aardvark: Enable MSI-X support Pali Rohár
2021-08-23 16:40 ` [PATCH v2 0/3] PCI: aardvark: MSI interrupt fixes Pali Rohár
2021-08-23 16:40   ` [PATCH v2 1/3] PCI: aardvark: Fix reading MSI interrupt number Pali Rohár
2021-08-23 16:52     ` Marc Zyngier [this message]
2021-08-23 16:40   ` [PATCH v2 2/3] PCI: aardvark: Fix masking MSI interrupts Pali Rohár
2021-08-23 16:40   ` [PATCH v2 3/3] PCI: aardvark: Enable MSI-X support Pali Rohár

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=871r6kqf2d.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kabel@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=pali@kernel.org \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --subject='Re: [PATCH v2 1/3] PCI: aardvark: Fix reading MSI interrupt number' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).