From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Noa Osherovich <noaos@mellanox.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
gwshan@linux.vnet.ibm.com, majd@mellanox.com
Subject: Re: [PATCH 2/4] PCI: Convert Mellanox quirks to be for listed devices only
Date: Mon, 14 Nov 2016 10:39:24 +1100 [thread overview]
Message-ID: <20161113233924.GA14481@gwshan> (raw)
In-Reply-To: <1479046901-25360-3-git-send-email-noaos@mellanox.com>
On Sun, Nov 13, 2016 at 04:21:40PM +0200, Noa Osherovich wrote:
>Change Mellanox's broken_intx_masking quirk from an "all Mellanox
>devices" to a quirk for listed devices only.
>
>Signed-off-by: Noa Osherovich <noaos@mellanox.com>
>Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>---
> drivers/pci/quirks.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 52 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
>index 85048fdf2474..d3977c847e1f 100644
>--- a/drivers/pci/quirks.c
>+++ b/drivers/pci/quirks.c
>@@ -3158,8 +3158,59 @@ static void quirk_broken_intx_masking(struct pci_dev *dev)
> */
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REALTEK, 0x8169,
> quirk_broken_intx_masking);
>+
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_SDR 0x6340
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_DDR 0x634a
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_QDR 0x6354
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_DDR_GEN2 0x6732
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_QDR_GEN2 0x673c
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_EN 0x6368
>+#define PCI_DEVICE_ID_MELLANOX_HERMON_EN_GEN2 0x6750
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX_EN 0x6372
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX_EN_T_GEN2 0x675a
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX_EN_GEN2 0x6764
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX_EN_5_GEN2 0x6746
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX2 0x676e
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX3 0x1003
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX3_PRO 0x1007
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTIB 0x1011
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX4 0x1013
>+#define PCI_DEVICE_ID_MELLANOX_CONNECTX4_LX 0x1015
>+
>+static u16 mellanox_broken_intx_devs[] = {
>+ PCI_DEVICE_ID_MELLANOX_HERMON_SDR,
>+ PCI_DEVICE_ID_MELLANOX_HERMON_DDR,
>+ PCI_DEVICE_ID_MELLANOX_HERMON_QDR,
>+ PCI_DEVICE_ID_MELLANOX_HERMON_DDR_GEN2,
>+ PCI_DEVICE_ID_MELLANOX_HERMON_QDR_GEN2,
>+ PCI_DEVICE_ID_MELLANOX_HERMON_EN,
>+ PCI_DEVICE_ID_MELLANOX_HERMON_EN_GEN2,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX_EN,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX_EN_T_GEN2,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX_EN_GEN2,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX_EN_5_GEN2,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX2,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX3,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX3_PRO,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTIB,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX4,
>+ PCI_DEVICE_ID_MELLANOX_CONNECTX4_LX
>+};
>+
>+static void mellanox_check_broken_intx_masking(struct pci_dev *dev)
>+{
>+ int i;
>+
>+ for (i = 0; i < ARRAY_SIZE(mellanox_broken_intx_devs); i++) {
>+ if (dev->device == mellanox_broken_intx_devs[i]) {
>+ dev->broken_intx_masking = 1;
>+ return;
>+ }
>+ }
>+}
>+
@dev might be replaced with @pdev. Usually, @dev means "struct device"
instance while @pdev represents "struct pci_dev" instance. The older
PCI code seems using them interchangeably.
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID,
>- quirk_broken_intx_masking);
>+ mellanox_check_broken_intx_masking);
>
> /*
> * Intel i40e (XL710/X710) 10/20/40GbE NICs all have broken INTx masking,
Thanks,
Gavin
next prev parent reply other threads:[~2016-11-13 23:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-13 14:21 [PATCH 0/4] Cover letter Noa Osherovich
2016-11-13 14:21 ` [PATCH 1/4] PCI: Use FINAL fixup to mark broken INTx masking Noa Osherovich
2016-11-13 23:27 ` Gavin Shan
2016-11-13 14:21 ` [PATCH 2/4] PCI: Convert Mellanox quirks to be for listed devices only Noa Osherovich
2016-11-13 23:39 ` Gavin Shan [this message]
2016-11-13 14:21 ` [PATCH 3/4] PCI: Add checks to mellanox_check_broken_intx_masking Noa Osherovich
2016-11-14 0:15 ` Gavin Shan
2016-11-14 22:35 ` Bjorn Helgaas
2016-11-15 6:11 ` Noa Osherovich
2016-11-13 23:24 ` [PATCH 0/4] Cover letter Gavin Shan
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=20161113233924.GA14481@gwshan \
--to=gwshan@linux.vnet.ibm.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=majd@mellanox.com \
--cc=noaos@mellanox.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;
as well as URLs for NNTP newsgroup(s).