linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Casey Leedom <leedom@chelsio.com>,
	Arjun Vynipadath <arjun@chelsio.com>,
	Ganesh Goudar <ganeshgr@chelsio.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: linux-next: manual merge of the pci tree with Linus' tree
Date: Tue, 3 Apr 2018 12:29:55 +1000	[thread overview]
Message-ID: <20180403122955.1822dbc5@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3496 bytes --]

Hi Bjorn,

Today's linux-next merge of the pci tree got a conflict in:

  drivers/pci/quirks.c

between commit:

  7dcf688d4c78 ("PCI/cxgb4: Extend T3 PCI quirk to T4+ devices")

from Linus' tree and commit:

  996058573b22 ("PCI/VPD: Move VPD quirks to vpd.c")

from the pci tree.

I fixed it up (I removed the section from this file and added the
following merge fix patch) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 3 Apr 2018 12:17:20 +1000
Subject: [PATCH] PCI/cxgb4: merge fix up for move of quirk_chelsio_extend_vpd()

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/pci/vpd.c | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index 00b8b5d37056..8617565ba561 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -617,19 +617,28 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
 
 static void quirk_chelsio_extend_vpd(struct pci_dev *dev)
 {
-	pci_set_vpd_size(dev, 8192);
+	int chip = (dev->device & 0xf000) >> 12;
+	int func = (dev->device & 0x0f00) >>  8;
+	int prod = (dev->device & 0x00ff) >>  0;
+
+	/*
+	 * If this is a T3-based adapter, there's a 1KB VPD area at offset
+	 * 0xc00 which contains the preferred VPD values.  If this is a T4 or
+	 * later based adapter, the special VPD is at offset 0x400 for the
+	 * Physical Functions (the SR-IOV Virtual Functions have no VPD
+	 * Capabilities).  The PCI VPD Access core routines will normally
+	 * compute the size of the VPD by parsing the VPD Data Structure at
+	 * offset 0x000.  This will result in silent failures when attempting
+	 * to accesses these other VPD areas which are beyond those computed
+	 * limits.
+	 */
+	if (chip == 0x0 && prod >= 0x20)
+		pci_set_vpd_size(dev, 8192);
+	else if (chip >= 0x4 && func < 0x8)
+		pci_set_vpd_size(dev, 2048);
 }
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x20, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x21, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x22, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x23, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x24, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x25, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x26, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x30, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x31, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x32, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x35, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x36, quirk_chelsio_extend_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x37, quirk_chelsio_extend_vpd);
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
+			quirk_chelsio_extend_vpd);
+
 #endif
-- 
2.16.1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-04-03  2:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03  2:29 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-13 23:45 linux-next: manual merge of the pci tree with Linus' tree Stephen Rothwell
2022-01-14  5:48 ` Sergio Paracuellos
2022-01-14  6:53   ` Stephen Rothwell
2022-01-14  6:57     ` Sergio Paracuellos
2021-08-25  0:57 Stephen Rothwell
2021-02-23  0:19 Stephen Rothwell
2020-05-14  1:02 Stephen Rothwell
2020-03-30 23:49 Stephen Rothwell
2020-03-31  8:37 ` Geert Uytterhoeven
2020-03-24 23:58 Stephen Rothwell
2019-09-19 12:33 Mark Brown
2018-07-20  1:03 Stephen Rothwell
2018-07-20  9:15 ` Lorenzo Pieralisi
2018-07-20 10:49   ` Thomas Petazzoni
2018-03-26  1:23 Stephen Rothwell
2018-03-27 16:19 ` Rob Herring
2017-06-26  0:51 Stephen Rothwell
2017-07-03  2:58 ` Stephen Rothwell
2016-12-08 23:44 Stephen Rothwell
2016-06-23  1:44 Stephen Rothwell
2016-06-23 16:43 ` Bjorn Helgaas
2016-01-20 23:33 Stephen Rothwell
2013-06-17  1:42 Stephen Rothwell
2013-06-04  1:49 Stephen Rothwell
2013-06-04  2:11 ` Bjorn Helgaas
2012-09-04  2:04 Stephen Rothwell
2012-09-04  1:59 Stephen Rothwell
2012-09-04  6:57 ` Yuval Mintz
2012-06-25  2:31 Stephen Rothwell
2012-06-25  6:32 ` huang ying
2012-06-25 14:14 ` Alan Stern
2012-06-19  1:15 Stephen Rothwell
2010-12-20  2:08 Stephen Rothwell
2009-12-07  0:25 Stephen Rothwell
2009-12-07  0:25 Stephen Rothwell
2009-10-14  0:05 Stephen Rothwell
2009-10-14  0:38 ` Jesse Barnes
2009-10-14  2:10   ` Stephen Rothwell
2009-10-14  7:41 ` David Woodhouse
2009-06-30  1:56 Stephen Rothwell
2009-06-30  2:01 ` Jesse Barnes
2009-06-30  2:16   ` Matthew Wilcox
2009-06-30 16:00     ` Jesse Barnes

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=20180403122955.1822dbc5@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=arjun@chelsio.com \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=ganeshgr@chelsio.com \
    --cc=leedom@chelsio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    /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).