The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: <honghui.zhang@mediatek.com>
To: <joro@8bytes.org>, <lorenzo.pieralisi@arm.com>,
	<treding@nvidia.com>, <mark.rutland@arm.com>,
	<matthias.bgg@gmail.com>, <robh@kernel.org>,
	<robin.murphy@arm.com>
Cc: <p.zabel@pengutronix.de>, <devicetree@vger.kernel.org>,
	<pebolle@tiscali.nl>, <kendrick.hsu@mediatek.com>,
	<arnd@arndb.de>, <srv_heupstream@mediatek.com>,
	<catalin.marinas@arm.com>, <will.deacon@arm.com>,
	<linux-kernel@vger.kernel.org>, <tfiga@google.com>,
	<iommu@lists.linux-foundation.org>, <robh+dt@kernel.org>,
	<djkurtz@google.com>, <kernel@pengutronix.de>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>, <l.stach@pengutronix.de>,
	<yingjoe.chen@mediatek.com>, <eddie.huang@mediatek.com>,
	<youlin.pei@mediatek.com>, <erin.lo@mediatek.com>,
	Honghui Zhang <honghui.zhang@mediatek.com>
Subject: [PATCH v2 2/2] PCI: mediatek: Fixup class type for MT7622
Date: Thu, 21 Dec 2017 10:08:50 +0800	[thread overview]
Message-ID: <1513822130-18213-3-git-send-email-honghui.zhang@mediatek.com> (raw)
In-Reply-To: <1513822130-18213-1-git-send-email-honghui.zhang@mediatek.com>

From: Honghui Zhang <honghui.zhang@mediatek.com>

The host bridge of MT7622 has hardware code the class code to an
arbitrary, meaningless value, fix that.

Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com>
---
 drivers/pci/host/pcie-mediatek.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c
index 3248771..ae8d367 100644
--- a/drivers/pci/host/pcie-mediatek.c
+++ b/drivers/pci/host/pcie-mediatek.c
@@ -1174,3 +1174,15 @@ static struct platform_driver mtk_pcie_driver = {
 	},
 };
 builtin_platform_driver(mtk_pcie_driver);
+
+/* The host bridge of MT7622 advertises the wrong device class. */
+static void mtk_fixup_class(struct pci_dev *dev)
+{
+	dev->class = PCI_CLASS_BRIDGE_PCI << 8;
+}
+
+/*
+ * The HW default value of vendor id and device id for mt7622 are 0x0e8d,
+ * 0x3258, which are arbitrary, meaningless values.
+ */
+DECLARE_PCI_FIXUP_EARLY(0x0e8d, 0x3258, mtk_fixup_class);
-- 
2.6.4

  parent reply	other threads:[~2017-12-21  2:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21  2:08 [PATCH v2 0/2] PCI: mediatek: Fixups for the IRQ handle routine and MT7622's class code honghui.zhang
2017-12-21  2:08 ` [PATCH v2 1/2] PCI: mediatek: Clear IRQ status after IRQ dispatched to avoid reentry honghui.zhang
2017-12-21  2:08 ` honghui.zhang [this message]
2017-12-21  2:13 ` [PATCH v2 0/2] PCI: mediatek: Fixups for the IRQ handle routine and MT7622's class code Honghui Zhang
  -- strict thread matches above, loose matches on Subject: below --
2017-12-21  2:11 honghui.zhang
2017-12-21  2:11 ` [PATCH v2 2/2] PCI: mediatek: Fixup class type for MT7622 honghui.zhang
2017-12-21  6:41   ` Yong Wu
2017-12-21  7:01     ` Honghui Zhang
2017-12-22  0:27       ` Bjorn Helgaas
2017-12-22  0:56         ` Honghui Zhang
2017-12-22  3:15           ` 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=1513822130-18213-3-git-send-email-honghui.zhang@mediatek.com \
    --to=honghui.zhang@mediatek.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@google.com \
    --cc=eddie.huang@mediatek.com \
    --cc=erin.lo@mediatek.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kendrick.hsu@mediatek.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pebolle@tiscali.nl \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tfiga@google.com \
    --cc=treding@nvidia.com \
    --cc=will.deacon@arm.com \
    --cc=yingjoe.chen@mediatek.com \
    --cc=youlin.pei@mediatek.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