linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
To: Marc Zyngier <marc.zyngier@arm.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"paul.gortmaker@windriver.com" <paul.gortmaker@windriver.com>,
	"colin.king@canonical.com" <colin.king@canonical.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Cc: Ravikiran Gummaluri <rgummal@xilinx.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>
Subject: RE: [PATCH v5] PCI: Xilinx NWL: Modifying irq chip for legacy interrupts
Date: Tue, 7 Mar 2017 05:48:03 +0000	[thread overview]
Message-ID: <8520D5D51A55D047800579B094147198263FBCF4@XAP-PVEXMBX02.xlnx.xilinx.com> (raw)
In-Reply-To: 2196f028-b834-9d32-cc3a-e3eb5ed6c3b1@arm.com

Hi Marc,

can you please look into my last comments ?

Regards,
Bharat
> Subject: RE: [PATCH v5] PCI: Xilinx NWL: Modifying irq chip for legacy interrupts
> 
> Waiting for Marc's Reply...
> 
> > > -----Original Message-----
> > > From: Marc Zyngier [mailto:marc.zyngier@arm.com]
> > > Sent: Thursday, February 09, 2017 9:33 PM
> > > To: Bharat Kumar Gogada <bharatku@xilinx.com>; bhelgaas@google.com;
> > > robh@kernel.org; paul.gortmaker@windriver.com;
> > > colin.king@canonical.com; linux-pci@vger.kernel.org
> > > Cc: linux-arm-kernel@lists.infradead.org;
> > > linux-kernel@vger.kernel.org; michal.simek@xilinx.com;
> > > arnd@arndb.de; Ravikiran Gummaluri <rgummal@xilinx.com>
> > > Subject: Re: [PATCH v5] PCI: Xilinx NWL: Modifying irq chip for
> > > legacy
> > interrupts
> > >
> > > On 09/02/17 15:16, Bharat Kumar Gogada wrote:
> > > >>
> > > >> On 09/02/17 12:01, Bharat Kumar Gogada wrote:
> > > >>>> On 06/02/17 07:03, Bharat Kumar Gogada wrote:
> > > >>>>> +static struct irq_chip nwl_leg_irq_chip = {
> > > >>>>> +	.name = "nwl_pcie:legacy",
> > > >>>>> +	.irq_enable = nwl_unmask_leg_irq,
> > > >>>>> +	.irq_disable = nwl_mask_leg_irq,
> > > >>>>
> > > >>>> You don't need these two if they are implemented in terms of
> > > mask/unmask.
> > > >>>
> > > >>> These are being invoked by some drivers other than interrupt flow.
> > > >>> Ex: drivers/net/wireless/ath/ath9k/main.c
> > > >>> static int ath_reset_internal(struct ath_softc *sc, struct
> > > >>> ath9k_channel *hchan) {
> > > >>>          ....
> > > >>>          disable_irq(sc->irq);
> > > >>>          tasklet_disable(&sc->intr_tq);
> > > >>>         ...
> > > >>>         ...
> > > >>>         enable_irq(sc->irq);
> > > >>>         spin_unlock_bh(&sc->sc_pcu_lock); } For us
> > > >>> masking/unmasking is the way to enable/disable interrupts.
> > > >>
> > > >> And if you looked at the way disable_irq is implemented, you
> > > >> would have found out that it falls back to masking if there is no
> > > >> disable method, preserving the semantic you expect.
> > > >>
> > > > Yes I did see, but this fall back requires extra
> > > > "IRQ_DISABLE_UNLAZY" flag to
> > > be set to each virq.
> > >
> > > No it doesn't. If you do a disable_irq(), the interrupt is flagged
> > > as disabled, but nothing gets done. If an interrupt actually fires,
> > > then the interrupts gets
> > masked,
> > > and the handler is not called.
> > Yes agreed, this is where the problem comes for us. Here is the
> > scenario Ex:drivers/net/wireless/ath/ath9k/main.c
> > static int ath_reset_internal(struct ath_softc *sc, struct
> > ath9k_channel *hchan) {
> >   ....
> >    ath9k_hw_set_interrupts(ah);
> >    ath9k_hw_enable_interrupts(ah);
> >    ...
> >   enable_irq(sc->irq);
> >   ...
> > }
> > If you observe this they enable hardware interrupts first and then
> > call enable_irq, at this point of time virq is in disabled state. So,
> > if interrupt is raised in this period of time the handler is never
> > invoked and DEASEERT_INTx will not be seen. As I mentioned in my
> > subject the irq line between bridge and GIC goes low only after it
> > sees DEASSERT_INTx. But since DEASSERT_INTx is never seen line is
> > always high causing cpu stall.
> > So for this kind of EP's we need those two methods.
> >
> > Bharat

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2017-03-07  5:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06  7:03 [PATCH v5] PCI: Xilinx NWL: Modifying irq chip for legacy interrupts Bharat Kumar Gogada
2017-02-09  8:51 ` Marc Zyngier
2017-02-09 12:01   ` Bharat Kumar Gogada
2017-02-09 12:14     ` Marc Zyngier
2017-02-09 15:16       ` Bharat Kumar Gogada
2017-02-09 16:03         ` Marc Zyngier
2017-02-09 16:25           ` Bharat Kumar Gogada
2017-03-01  9:47           ` Bharat Kumar Gogada
2017-03-07  5:48           ` Bharat Kumar Gogada [this message]
2017-04-14 15:04 Bharat Kumar Gogada
2017-05-17 22:13 ` Bjorn Helgaas

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=8520D5D51A55D047800579B094147198263FBCF4@XAP-PVEXMBX02.xlnx.xilinx.com \
    --to=bharat.kumar.gogada@xilinx.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=colin.king@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=rgummal@xilinx.com \
    --cc=robh@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;
as well as URLs for NNTP newsgroup(s).