public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Duc Dang <dhdang@apm.com>, Feng Kan <fkan@apm.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	linux-pci@vger.kernel.org, Liviu Dudau <Liviu.Dudau@arm.com>,
	linux-kernel@vger.kernel.org,
	Grant Likely <grant.likely@linaro.org>,
	Tanmay Inamdar <tinamdar@apm.com>,
	Bjorn Helgaas <bhelgaas@google.com>, Loc Ho <lho@apm.com>
Subject: Re: [PATCH v4 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver
Date: Sun, 19 Apr 2015 21:55:41 +0200	[thread overview]
Message-ID: <3188893.aaXgNln69B@wuerfel> (raw)
In-Reply-To: <CADaLNDn_U_VKBg-ve+X_Ovvzi7TZZJkPotCTKiWjfvANXqsSPQ@mail.gmail.com>

On Sunday 19 April 2015 11:40:09 Duc Dang wrote:
> On Fri, Apr 17, 2015 at 7:10 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Friday 17 April 2015 02:50:07 Duc Dang wrote:
> >> +
> >> +       /*
> >> +        * MSIINTn (n is 0..F) indicates if there is a pending MSI interrupt
> >> +        * If bit x of this register is set (x is 0..7), one or more interupts
> >> +        * corresponding to MSInIRx is set.
> >> +        */
> >> +       grp_select = readl(xgene_msi->msi_regs + MSI_INT0 + (msi_grp << 16));
> >> +       while (grp_select) {
> >> +               msir_index = ffs(grp_select) - 1;
> >> +               /*
> >> +                * Calculate MSInIRx address to read to check for interrupts
> >> +                * (refer to termination address and data assignment
> >> +                * described in xgene_compose_msi_msg function)
> >> +                */
> >> +               msir_reg = (msi_grp << 19) + (msir_index << 16);
> >> +               msir_val = readl(xgene_msi->msi_regs + MSI_IR0 + msir_reg);
> >> +               while (msir_val) {
> >> +                       intr_index = ffs(msir_val) - 1;
> >> +                       /*
> >> +                        * Calculate MSI vector number (refer to the termination
> >> +                        * address and data assignment described in
> >> +                        * xgene_compose_msi_msg function)
> >> +                        */
> >> +                       hw_irq = (((msir_index * IRQS_PER_IDX) + intr_index) *
> >> +                                NR_HW_IRQS) + msi_grp;
> >> +                       virq = irq_find_mapping(xgene_msi->domain, hw_irq);
> >> +                       if (virq != 0)
> >> +                               generic_handle_irq(virq);
> >> +                       msir_val &= ~(1 << intr_index);
> >> +                       processed++;
> >> +               }
> >> +               grp_select &= ~(1 << msir_index);
> >> +       }
> >>
> >
> > As the MSI is forwarded to the GIC here, how do you maintain ordering
> > between DMA data getting forwarded from the PCI host bridge to RAM
> > with regard to the MSI handler getting entered from this code?
> 
> When device perform a DMA transfer, the order of PCIE inbound requests
> will be like this:
> 1. DMA data get transferred via PCIe inbound request
> 2. After devices issue DMA transfer request, the device fires an MSI
> interrupt by issuing another inbound write to write MSI data to MSI
> termination address.
> 
> As these 2 requests are transferred via PCIe bus in order, the DMA
> data will be all in DDR before the MSI data hit the termination
> address to trigger the MSI handler in interrupt handler code.

Obviously they appear on the PCI host bridge in order, because that
is a how PCI works. My question was about what happens then. On a lot
of SoCs, there is something like an AXI bus that uses posted
transactions between PCI and RAM, so you have a do a full manual
syncronization of ongoing PIC DMAs when the MSI catcher signals the
top-level interrupt. Do you have a bus between PCI and RAM that does
not require this, or does the MSI catcher have logic to flush all DMAs?

	Arnd

  reply	other threads:[~2015-04-19 19:55 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150408084448.5f0793b7@why.wild-wind.fr.eu.org>
2015-04-09 17:05 ` [PATCH v3 0/4] PCI: X-Gene: Add APM X-Gene v1 MSI/MSIX termination driver Duc Dang
2015-04-09 17:05   ` [PATCH v3 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe " Duc Dang
2015-04-09 20:11     ` Bjorn Helgaas
2015-04-09 21:52       ` Duc Dang
2015-04-09 22:39         ` Bjorn Helgaas
2015-04-09 23:26           ` Duc Dang
2015-04-10 17:20     ` Marc Zyngier
2015-04-10 23:42       ` Duc Dang
2015-04-11 12:06         ` Marc Zyngier
2015-04-14 18:20           ` Duc Dang
2015-04-15  8:16             ` Marc Zyngier
2015-04-17  9:50               ` [PATCH v4 0/4] PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-04-17  9:50                 ` [PATCH v4 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe " Duc Dang
2015-04-17 14:10                   ` Arnd Bergmann
2015-04-19 18:40                     ` Duc Dang
2015-04-19 19:55                       ` Arnd Bergmann [this message]
2015-04-20 18:49                         ` Feng Kan
2015-04-21  7:16                           ` Arnd Bergmann
2015-04-17  9:50                 ` [PATCH v4 2/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-04-17  9:50                 ` [PATCH v4 3/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-04-17  9:50                 ` [PATCH v4 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-04-17 10:00               ` [PATCH v3 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-04-17 10:17                 ` Marc Zyngier
2015-04-17 12:37                   ` Duc Dang
2015-04-17 12:45                     ` Marc Zyngier
2015-04-20 18:51                       ` Feng Kan
2015-04-21  8:32                         ` Marc Zyngier
2015-04-21  4:04                       ` [PATCH v5 0/4]PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-04-21  4:04                         ` [PATCH v5 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe " Duc Dang
2015-04-21 15:08                           ` Marc Zyngier
2015-04-22  6:15                             ` [PATCH v6 0/4]PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-04-22  6:15                               ` [PATCH v6 1/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-04-22  6:15                               ` [PATCH v6 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-04-22 12:50                                 ` Marc Zyngier
2015-05-18  9:55                                   ` [PATCH v7 0/4] PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-05-18  9:55                                     ` [PATCH v7 1/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-05-18  9:55                                     ` [PATCH v7 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-05-20  9:16                                       ` Marc Zyngier
2015-05-22 18:41                                         ` [PATCH v8 0/4] PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-05-22 18:41                                           ` [PATCH v8 1/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-05-22 18:41                                           ` [PATCH v8 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-05-25 11:52                                             ` Marc Zyngier
2015-05-27 18:27                                               ` [PATCH v9 0/4]PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-05-27 18:27                                                 ` [PATCH v9 1/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-05-27 18:27                                                 ` [PATCH v9 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-05-28  8:05                                                   ` Marc Zyngier
2015-05-28 17:16                                                     ` Duc Dang
2015-05-29 18:24                                                     ` [PATCH v10 0/4] PCI: X-Gene: Add APM X-Gene v1 " Duc Dang
2015-05-29 18:24                                                       ` [PATCH v10 1/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-05-29 18:24                                                       ` [PATCH v10 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-05-29 18:24                                                       ` [PATCH v10 3/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-05-29 18:24                                                       ` [PATCH v10 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-06-05 21:05                                                       ` [PATCH v10 0/4] PCI: X-Gene: Add APM X-Gene v1 MSI/MSIX termination driver Bjorn Helgaas
2015-06-05 21:11                                                         ` Duc Dang
2015-05-27 18:27                                                 ` [PATCH v9 3/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-05-27 18:27                                                 ` [PATCH v9 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-05-27 18:31                                               ` [PATCH v8 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-05-22 18:41                                           ` [PATCH v8 3/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-05-22 18:41                                           ` [PATCH v8 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-05-22 18:43                                         ` [PATCH v7 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-05-18  9:55                                     ` [PATCH v7 3/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-05-18  9:55                                     ` [PATCH v7 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-05-18 10:12                                   ` [PATCH v6 2/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Duc Dang
2015-04-22  6:15                               ` [PATCH v6 3/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-04-22  6:15                               ` [PATCH v6 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-04-21  4:04                         ` [PATCH v5 2/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-04-21 15:19                           ` Marc Zyngier
2015-04-21 18:01                             ` Duc Dang
2015-04-21  4:04                         ` [PATCH v5 3/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-04-21 15:42                           ` Mark Rutland
2015-04-21 17:37                             ` Duc Dang
2015-04-21  4:04                         ` [PATCH v5 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang
2015-04-22  3:02                         ` [PATCH v5 0/4]PCI: X-Gene: Add APM X-Gene v1 MSI/MSIX termination driver Jon Masters
2015-04-22  3:02                         ` Jon Masters
2015-04-11  0:16       ` [PATCH v3 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe " Feng Kan
2015-04-11 12:18         ` Marc Zyngier
2015-04-11 14:50         ` Arnd Bergmann
2015-04-10 18:13     ` Paul Bolle
2015-04-10 23:55       ` Duc Dang
2015-04-09 17:05   ` [PATCH v3 2/4] arm64: dts: Add the device tree entry for the APM X-Gene PCIe MSI node Duc Dang
2015-04-09 17:05   ` [PATCH v3 3/4] documentation: dts: Add the device tree binding for APM X-Gene v1 PCIe MSI device tree node Duc Dang
2015-04-09 17:05   ` [PATCH v3 4/4] PCI: X-Gene: Add the MAINTAINERS entry for APM X-Gene v1 PCIe MSI driver Duc Dang

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=3188893.aaXgNln69B@wuerfel \
    --to=arnd@arndb.de \
    --cc=Liviu.Dudau@arm.com \
    --cc=bhelgaas@google.com \
    --cc=dhdang@apm.com \
    --cc=fkan@apm.com \
    --cc=grant.likely@linaro.org \
    --cc=lho@apm.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=tinamdar@apm.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