All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Jeremy Linton <jeremy.linton@arm.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	andrew.murray@arm.com, maz@kernel.org,
	linux-kernel@vger.kernel.org,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Eric Anholt <eric@anholt.net>, Stefan Wahren <wahrenst@gmx.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com
Cc: mbrugger@suse.com, linux-pci@vger.kernel.org,
	phil@raspberrypi.org, linux-rpi-kernel@lists.infradead.org,
	james.quinlan@broadcom.com, Bjorn Helgaas <bhelgaas@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/7] PCI: brcmstb: add Broadcom STB PCIe host controller driver
Date: Tue, 3 Dec 2019 16:48:37 +0000	[thread overview]
Message-ID: <dda72ec5-3e05-a423-bfce-da34addc922c@arm.com> (raw)
In-Reply-To: <ddab6abd-68fb-543d-bb8e-057d92ac15ed@arm.com>

On 03/12/2019 4:31 pm, Jeremy Linton wrote:
> Hi,
> 
> On 11/26/19 3:19 AM, Nicolas Saenz Julienne wrote:
>> From: Jim Quinlan <james.quinlan@broadcom.com>
>>
>> This adds a basic driver for Broadcom's STB PCIe controller, for now
>> aimed at Raspberry Pi 4's SoC, bcm2711.
>>
>> Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
>> Co-developed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>>
>> ---
>>
>> Changes since v2:
>>    - Correct rc_bar2_offset sign
>>    - Invert IRQ clear and masking in setup code
>>    - Use bitfield.h, redo all register ops while keeping the register
>>      names intact
>>    - Remove all SHIFT register definitions
>>    - Get rid of all _RB writes
>>    - Get rid of of_data
>>    - Don't iterate over inexisting dma-ranges
>>    - Add comment regarding dma-ranges validation
>>    - Small cosmetic cleanups
>>    - Fix license mismatch
>>    - Set driver Kconfig tristate
>>    - Didn't add any comment about the controller not being I/O coherent
>>      for now as I wait for Jeremy's reply
> 
> I guess its fine.. In answer to the original query. It seems that this 
> PCIe bridge requires explicit cache operations for DMA from PCIe 
> endpoints. This wasn't obvious to me at first reading because I was 
> assuming the custom DMA ops were strictly to deal with the stated DMA 
> limits.

FWIW, although it might seem anathema to server folks, non-coherent PCI 
is the overwhelming norm in embedded SoCs. Either way, provided the 
presence or absence of coherency is correctly described via the DT 
"dma-coherent" or ACPI _CCA property, then it's transparently handled by 
the DMA API for the endpoint drivers and irrelevant to the host bridge 
itself - after all, in principle the exact same root complex IP could be 
integrated both coherently and non-coherently in different SoCs.

Robin.

> So if you end up respinning, it still might be worthy mentioning 
> somewhere that this is a non-coherent PCIe implementation. I still hold 
> much of my original reservations about pieces of this driver. 
> Particularly, how it might look if someone wanted to boot the RPi using 
> ACPI on linux. But, I was shown a clever bit of AML recently, which 
> solves those problems for the RPi and the attached XHCI.
> 
> So, given how much time I've looked at the root port configuration/etc 
> sections of this driver and I've not found a serious bug:
> 
> Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
> 
>>
>> Changes since v1:
>>    - Fix Kconfig
>>    - Remove pci domain check
>>    - Remove all MSI related code
>>    - Remove supend/resume code
>>    - Simplify link state wait routine
>>    - Prefix all functions
>>    - Use of_device_get_match_data()
>>    - Use devm_clk_get_optional()
>>    - Get rid of irq variable
>>    - Use STB all over the driver
>>    - Simplify map_bus() function
>>    - Fix license mismatch
>>    - Remove unused register definitions
>>    - Small cleanups, spell errors
>>
>> This is based on Jim's original submission[1] but adapted and tailored
>> specifically to bcm2711's needs (that's the Raspberry Pi 4). Support for
>> the rest of the brcmstb family will soon follow once we get support for
>> multiple dma-ranges in dma/direct.
>>
>> [1] https://patchwork.kernel.org/patch/10605959/
>>
>>   drivers/pci/controller/Kconfig        |   8 +
>>   drivers/pci/controller/Makefile       |   1 +
>>   drivers/pci/controller/pcie-brcmstb.c | 753 ++++++++++++++++++++++++++
>>   3 files changed, 762 insertions(+)
>>   create mode 100644 drivers/pci/controller/pcie-brcmstb.c
>>
> 
> Thanks,
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Jeremy Linton <jeremy.linton@arm.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	andrew.murray@arm.com, maz@kernel.org,
	linux-kernel@vger.kernel.org,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Eric Anholt <eric@anholt.net>, Stefan Wahren <wahrenst@gmx.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com
Cc: mbrugger@suse.com, linux-pci@vger.kernel.org,
	phil@raspberrypi.org, linux-rpi-kernel@lists.infradead.org,
	james.quinlan@broadcom.com, Bjorn Helgaas <bhelgaas@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/7] PCI: brcmstb: add Broadcom STB PCIe host controller driver
Date: Tue, 3 Dec 2019 16:48:37 +0000	[thread overview]
Message-ID: <dda72ec5-3e05-a423-bfce-da34addc922c@arm.com> (raw)
In-Reply-To: <ddab6abd-68fb-543d-bb8e-057d92ac15ed@arm.com>

On 03/12/2019 4:31 pm, Jeremy Linton wrote:
> Hi,
> 
> On 11/26/19 3:19 AM, Nicolas Saenz Julienne wrote:
>> From: Jim Quinlan <james.quinlan@broadcom.com>
>>
>> This adds a basic driver for Broadcom's STB PCIe controller, for now
>> aimed at Raspberry Pi 4's SoC, bcm2711.
>>
>> Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
>> Co-developed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>>
>> ---
>>
>> Changes since v2:
>>    - Correct rc_bar2_offset sign
>>    - Invert IRQ clear and masking in setup code
>>    - Use bitfield.h, redo all register ops while keeping the register
>>      names intact
>>    - Remove all SHIFT register definitions
>>    - Get rid of all _RB writes
>>    - Get rid of of_data
>>    - Don't iterate over inexisting dma-ranges
>>    - Add comment regarding dma-ranges validation
>>    - Small cosmetic cleanups
>>    - Fix license mismatch
>>    - Set driver Kconfig tristate
>>    - Didn't add any comment about the controller not being I/O coherent
>>      for now as I wait for Jeremy's reply
> 
> I guess its fine.. In answer to the original query. It seems that this 
> PCIe bridge requires explicit cache operations for DMA from PCIe 
> endpoints. This wasn't obvious to me at first reading because I was 
> assuming the custom DMA ops were strictly to deal with the stated DMA 
> limits.

FWIW, although it might seem anathema to server folks, non-coherent PCI 
is the overwhelming norm in embedded SoCs. Either way, provided the 
presence or absence of coherency is correctly described via the DT 
"dma-coherent" or ACPI _CCA property, then it's transparently handled by 
the DMA API for the endpoint drivers and irrelevant to the host bridge 
itself - after all, in principle the exact same root complex IP could be 
integrated both coherently and non-coherently in different SoCs.

Robin.

> So if you end up respinning, it still might be worthy mentioning 
> somewhere that this is a non-coherent PCIe implementation. I still hold 
> much of my original reservations about pieces of this driver. 
> Particularly, how it might look if someone wanted to boot the RPi using 
> ACPI on linux. But, I was shown a clever bit of AML recently, which 
> solves those problems for the RPi and the attached XHCI.
> 
> So, given how much time I've looked at the root port configuration/etc 
> sections of this driver and I've not found a serious bug:
> 
> Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
> 
>>
>> Changes since v1:
>>    - Fix Kconfig
>>    - Remove pci domain check
>>    - Remove all MSI related code
>>    - Remove supend/resume code
>>    - Simplify link state wait routine
>>    - Prefix all functions
>>    - Use of_device_get_match_data()
>>    - Use devm_clk_get_optional()
>>    - Get rid of irq variable
>>    - Use STB all over the driver
>>    - Simplify map_bus() function
>>    - Fix license mismatch
>>    - Remove unused register definitions
>>    - Small cleanups, spell errors
>>
>> This is based on Jim's original submission[1] but adapted and tailored
>> specifically to bcm2711's needs (that's the Raspberry Pi 4). Support for
>> the rest of the brcmstb family will soon follow once we get support for
>> multiple dma-ranges in dma/direct.
>>
>> [1] https://patchwork.kernel.org/patch/10605959/
>>
>>   drivers/pci/controller/Kconfig        |   8 +
>>   drivers/pci/controller/Makefile       |   1 +
>>   drivers/pci/controller/pcie-brcmstb.c | 753 ++++++++++++++++++++++++++
>>   3 files changed, 762 insertions(+)
>>   create mode 100644 drivers/pci/controller/pcie-brcmstb.c
>>
> 
> Thanks,
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

  reply	other threads:[~2019-12-03 16:48 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  9:19 [PATCH v3 0/7] Raspberry Pi 4 PCIe support Nicolas Saenz Julienne
2019-11-26  9:19 ` Nicolas Saenz Julienne
2019-11-26  9:19 ` Nicolas Saenz Julienne
2019-11-26  9:19 ` [PATCH v3 1/7] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-11-26 12:51   ` Leon Romanovsky
2019-11-26 12:51     ` Leon Romanovsky
2019-11-26 12:51     ` Leon Romanovsky
2019-11-26 12:51     ` Leon Romanovsky
2019-11-27 18:06     ` Robin Murphy
2019-11-27 18:06       ` Robin Murphy
2019-11-27 18:06       ` Robin Murphy
2019-11-27 18:06       ` Robin Murphy
2019-11-27 18:24       ` Nicolas Saenz Julienne
2019-11-27 18:24         ` Nicolas Saenz Julienne
2019-11-27 18:24         ` Nicolas Saenz Julienne
2019-11-27 18:24         ` Nicolas Saenz Julienne
2019-11-27 19:06         ` Robin Murphy
2019-11-27 19:06           ` Robin Murphy
2019-11-27 19:06           ` Robin Murphy
2019-11-27 19:06           ` Robin Murphy
2019-11-27 19:12           ` Leon Romanovsky
2019-11-27 19:12             ` Leon Romanovsky
2019-11-27 19:12             ` Leon Romanovsky
2019-11-27 19:12             ` Leon Romanovsky
2019-11-27 19:16           ` Nicolas Saenz Julienne
2019-11-27 19:16             ` Nicolas Saenz Julienne
2019-11-27 19:16             ` Nicolas Saenz Julienne
2019-11-27 19:16             ` Nicolas Saenz Julienne
2019-11-27 17:36   ` Nicolas Saenz Julienne
2019-11-27 17:36     ` Nicolas Saenz Julienne
2019-11-27 17:36     ` Nicolas Saenz Julienne
2019-11-26  9:19 ` [PATCH v3 2/7] dt-bindings: PCI: Add bindings for brcmstb's PCIe device Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-12-02 16:39   ` Rob Herring
2019-12-02 16:39     ` Rob Herring
2019-11-26  9:19 ` [PATCH v3 3/7] ARM: dts: bcm2711: Enable PCIe controller Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-11-26  9:37   ` Phil Elwell
2019-11-26  9:37     ` Phil Elwell
2019-11-26  9:43     ` Nicolas Saenz Julienne
2019-11-26  9:43       ` Nicolas Saenz Julienne
2019-11-26  9:19 ` [PATCH v3 4/7] PCI: brcmstb: add Broadcom STB PCIe host controller driver Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-12-02 15:01   ` Andrew Murray
2019-12-02 15:01     ` Andrew Murray
2019-12-02 15:49     ` Jim Quinlan
2019-12-02 15:49       ` Jim Quinlan
2019-12-03 16:31   ` Jeremy Linton
2019-12-03 16:31     ` Jeremy Linton
2019-12-03 16:48     ` Robin Murphy [this message]
2019-12-03 16:48       ` Robin Murphy
2019-12-03 17:23     ` Nicolas Saenz Julienne
2019-12-03 17:23       ` Nicolas Saenz Julienne
2019-11-26  9:19 ` [PATCH v3 5/7] PCI: brcmstb: add MSI capability Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-11-29 15:46   ` Andrew Murray
2019-11-29 15:46     ` Andrew Murray
2019-12-02  9:59     ` Nicolas Saenz Julienne
2019-12-02  9:59       ` Nicolas Saenz Julienne
2019-12-02 12:20       ` Andrew Murray
2019-12-02 12:20         ` Andrew Murray
2019-12-02 12:22         ` Nicolas Saenz Julienne
2019-12-02 12:22           ` Nicolas Saenz Julienne
2019-11-26  9:19 ` [PATCH v3 6/7] MAINTAINERS: Add brcmstb PCIe controller Nicolas Saenz Julienne
2019-11-26  9:19 ` [PATCH v3 7/7] arm64: defconfig: Enable Broadcom's STB " Nicolas Saenz Julienne
2019-11-26  9:19   ` Nicolas Saenz Julienne
2019-11-26 21:50 ` [PATCH v3 0/7] Raspberry Pi 4 PCIe support Bjorn Helgaas
2019-11-26 21:50   ` Bjorn Helgaas
2019-11-26 21:50   ` Bjorn Helgaas
2019-11-27 17:28   ` Nicolas Saenz Julienne
2019-11-27 17:28     ` Nicolas Saenz Julienne
2019-11-27 17:28     ` Nicolas Saenz Julienne

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=dda72ec5-3e05-a423-bfce-da34addc922c@arm.com \
    --to=robin.murphy@arm.com \
    --cc=andrew.murray@arm.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=jeremy.linton@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=mbrugger@suse.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=phil@raspberrypi.org \
    --cc=wahrenst@gmx.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.