diff mbox series

[Artful] UBUNTU: SAUCE: PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon

Message ID 20170921193437.iwpo7orpetbqcf3k@xps13.dannf
State New
Headers show
Series [Artful] UBUNTU: SAUCE: PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon | expand

Commit Message

dann frazier Sept. 21, 2017, 7:34 p.m. UTC
From: Ashok Kumar Sekar <asekar@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/1718760

PCI BAR 5 is not setup correctly for the on-board AHCI
controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
by using BAR 4's resources which are populated correctly but NOT used
by the AHCI controller actually.

Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Signed-off-by: Robert Richter <rrichter@cavium.com>
(cherry picked from commit 92febd16344569eed7aed1cbd75a7faca1b0bf1e)
[ dannf: *** There is no need to carry this forward beyond artful *** ]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
---
 drivers/pci/quirks.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Seth Forshee Sept. 22, 2017, 4:59 p.m. UTC | #1
On Thu, Sep 21, 2017 at 01:34:37PM -0600, dann frazier wrote:
> From: Ashok Kumar Sekar <asekar@redhat.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1718760
> 
> PCI BAR 5 is not setup correctly for the on-board AHCI
> controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
> by using BAR 4's resources which are populated correctly but NOT used
> by the AHCI controller actually.
> 
> Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
> Signed-off-by: Jayachandran C <jchandra@broadcom.com>
> Signed-off-by: Robert Richter <rrichter@cavium.com>
> (cherry picked from commit 92febd16344569eed7aed1cbd75a7faca1b0bf1e)

I don't see a commit with that sha1 in Linus' tree or linux-next. So
where did you cherry pick it from?

> [ dannf: *** There is no need to carry this forward beyond artful *** ]
> Signed-off-by: dann frazier <dann.frazier@canonical.com>
> ---
>  drivers/pci/quirks.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index b7832fd4dbf4..73bad58d587a 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4009,6 +4009,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
>  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
>  				quirk_bridge_cavm_thrx2_pcie_root);
>  
> +/*
> + * PCI BAR 5 is not setup correctly for the on-board AHCI controller
> + * on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by
> + * using BAR 4's resources which are populated correctly and NOT
> + * actually used by the AHCI controller.
> + */
> +static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev)
> +{
> +	struct resource *r =  &dev->resource[4];
> +
> +	if (!(r->flags & IORESOURCE_MEM) || (r->start == 0))
> +		return;
> +
> +	/* Set BAR5 resource to BAR4 */
> +	dev->resource[5] = *r;
> +
> +	/* Update BAR5 in pci config space */
> +	pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start);
> +
> +	/* Clear BAR4's resource */
> +	memset(r, 0, sizeof(*r));
> +}
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars);
> +
>  /*
>   * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
>   * class code.  Fix it.
> -- 
> 2.14.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
dann frazier Sept. 22, 2017, 5:08 p.m. UTC | #2
On Fri, Sep 22, 2017 at 10:59 AM, Seth Forshee
<seth.forshee@canonical.com> wrote:
> On Thu, Sep 21, 2017 at 01:34:37PM -0600, dann frazier wrote:
>> From: Ashok Kumar Sekar <asekar@redhat.com>
>>
>> BugLink: http://bugs.launchpad.net/bugs/1718760
>>
>> PCI BAR 5 is not setup correctly for the on-board AHCI
>> controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
>> by using BAR 4's resources which are populated correctly but NOT used
>> by the AHCI controller actually.
>>
>> Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
>> Signed-off-by: Jayachandran C <jchandra@broadcom.com>
>> Signed-off-by: Robert Richter <rrichter@cavium.com>
>> (cherry picked from commit 92febd16344569eed7aed1cbd75a7faca1b0bf1e)
>
> I don't see a commit with that sha1 in Linus' tree or linux-next. So
> where did you cherry pick it from?

Seth,
  Sorry, this was a cherry-pick from a personal tree - I shouldn't
have included that line.
I'll re-send.

  -dann
diff mbox series

Patch

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index b7832fd4dbf4..73bad58d587a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4009,6 +4009,30 @@  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
 				quirk_bridge_cavm_thrx2_pcie_root);
 
+/*
+ * PCI BAR 5 is not setup correctly for the on-board AHCI controller
+ * on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by
+ * using BAR 4's resources which are populated correctly and NOT
+ * actually used by the AHCI controller.
+ */
+static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev)
+{
+	struct resource *r =  &dev->resource[4];
+
+	if (!(r->flags & IORESOURCE_MEM) || (r->start == 0))
+		return;
+
+	/* Set BAR5 resource to BAR4 */
+	dev->resource[5] = *r;
+
+	/* Update BAR5 in pci config space */
+	pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start);
+
+	/* Clear BAR4's resource */
+	memset(r, 0, sizeof(*r));
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars);
+
 /*
  * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
  * class code.  Fix it.