stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <niklas.cassel@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: gregkh@linuxfoundation.org, gustavo.pimentel@synopsys.com,
	lorenzo.pieralisi@arm.com, svarbanov@mm-sol.com,
	tpiepho@impinj.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] PCI: dwc: Move interrupt acking into the proper callback" failed to apply to 4.14-stable tree
Date: Sat, 19 Jan 2019 12:52:25 +0100	[thread overview]
Message-ID: <20190119115225.GA10212@centauri.lan> (raw)
In-Reply-To: <58351f7a-e00c-4c7a-ba9f-73482bbda1ec@arm.com>

On Fri, Jan 18, 2019 at 04:22:15PM +0000, Marc Zyngier wrote:
> On 18/01/2019 16:00, Niklas Cassel wrote:
> > On Thu, Jan 17, 2019 at 09:58:43AM +0000, Marc Zyngier wrote:
> >> On 16/01/2019 23:43, Niklas Cassel wrote:
> >>> On Tue, Jan 15, 2019 at 09:24:37AM +0100, gregkh@linuxfoundation.org wrote:
> >>>>
> >>>> The patch below does not apply to the 4.14-stable tree.
> >>>> If someone wants it applied there, or to any other stable or longterm
> >>>> tree, then please email the backport, including the original git commit
> >>>> id to <stable@vger.kernel.org>.
> >>>
> >>> Hello Marc,
> >>>
> >>> You said that you were going to backport this to 4.14, right?
> >>
> >> Me, or anyone else. Preferably someone who, like you, has the HW at hand (I don't).
> >>
> >>> IIRC, you said something about creating a simple dw_pci_bottom_ack()
> >>> (since 4.14 lacks a ack() function).
> >>
> >> Indeed. Something like this:
> >>
> >> diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
> >> index bc3e2d8d0cce..f4f3eeee10af 100644
> >> --- a/drivers/pci/dwc/pcie-designware-host.c
> >> +++ b/drivers/pci/dwc/pcie-designware-host.c
> >> @@ -45,8 +45,19 @@ static int dw_pcie_wr_own_conf(struct pcie_port *pp, int where, int size,
> >>  	return dw_pcie_write(pci->dbi_base + where, size, val);
> >>  }
> >>  
> >> +static void dwc_irq_ack(struct irq_data *d)
> >> +{
> >> +	struct msi_desc *msi = irq_data_get_msi_desc(d);
> >> +	struct pcie_port *pp = msi_desc_to_pci_sysdata(msi);
> >> +	int pos = d->hwirq % 32;
> >> +	int i = d->hwirq / 32;
> >> +
> >> +	dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, 4, BIT(pos));
> >> +}
> >> +
> > 
> > Thanks Marc.
> > 
> > This does not seem to work.
> > It appears that the ack function is never called.
> > I assume that this is because of:
> > 
> > irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_simple_irq);
> 
> Ah, indeed, I forgot about that particular nugget.
> 
> > 
> > is it safe to simply change this to handle_edge_irq?
> > (Which seems to be the case after this after this driver's
> > MSI handling was heavily refactored in 4.17.)
> 
> Yes, this should be just a matter of using the right interrupt flow.
> Please let me know if that works for you.

Hello Marc,

I ran a simple stress test during the night with your patch plus:

-       irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_simple_irq);
+       irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_edge_irq);

without any issues. (Feel free to add my Tested-by).

So this looks good to me :) Thanks!


Kind regards,
Niklas

> 
> > 
> > I know that you were against reverting 8c934095fa2f ("PCI: dwc: Clear
> > MSI interrupt status after it is handled, not before") on mainline,
> > since that wouldn't hinder people from moving around stuff in the
> > future, but perhaps reverting this commit on 4.14 is safer than
> > changing the irq handler type?
> 
> I still don't think that it is a good idea. Using the correct flow is
> just as important in order to properly honors the interrupt masking
> which the "simple" flow completely ignores.
> 
> Thanks,
> 
> 	M.
> -- 
> Jazz is not dead. It just smells funny...

      reply	other threads:[~2019-01-19 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15  8:24 FAILED: patch "[PATCH] PCI: dwc: Move interrupt acking into the proper callback" failed to apply to 4.14-stable tree gregkh
2019-01-16 23:43 ` Niklas Cassel
2019-01-17  9:58   ` Marc Zyngier
2019-01-18 16:00     ` Niklas Cassel
2019-01-18 16:22       ` Marc Zyngier
2019-01-19 11:52         ` Niklas Cassel [this message]

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=20190119115225.GA10212@centauri.lan \
    --to=niklas.cassel@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=stable@vger.kernel.org \
    --cc=svarbanov@mm-sol.com \
    --cc=tpiepho@impinj.com \
    /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;
as well as URLs for NNTP newsgroup(s).