+ ib-ipath-support-more-models-of-infinipath-hardware.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     IB/ipath: support more models of InfiniPath hardware

has been added to the -mm tree.  Its filename is

     ib-ipath-support-more-models-of-infinipath-hardware.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: IB/ipath: support more models of InfiniPath hardware
From: "Bryan O'Sullivan" <bos@xxxxxxxxxxxxx>

We do a few more explicit checks for specific models, and now also support the
old PathScale serial number style, or new QLogic style.

This is backwards compatible with previous versions of software and hardware. 
That is, older software will see a plausible serial number and correct GUID
when used with a new board, while newer software will correctly handle an
older board.

Signed-off-by: Mike Albaugh <mike.albaugh@xxxxxxxxxx>
Signed-off-by: Dave Olson <dave.olson@xxxxxxxxxx>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@xxxxxxxxxx>
Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxxxxxx>
Cc: Roland Dreier <rolandd@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/infiniband/hw/ipath/ipath_common.h |   12 ++++----
 drivers/infiniband/hw/ipath/ipath_eeprom.c |   27 +++++++++++++++++--
 drivers/infiniband/hw/ipath/ipath_kernel.h |    7 +++-
 drivers/infiniband/hw/ipath/ipath_pe800.c  |    2 -
 4 files changed, 38 insertions(+), 10 deletions(-)

diff -puN drivers/infiniband/hw/ipath/ipath_common.h~ib-ipath-support-more-models-of-infinipath-hardware drivers/infiniband/hw/ipath/ipath_common.h
--- a/drivers/infiniband/hw/ipath/ipath_common.h~ib-ipath-support-more-models-of-infinipath-hardware
+++ a/drivers/infiniband/hw/ipath/ipath_common.h
@@ -476,7 +476,7 @@ struct ipath_sma_pkt
  * Data layout in I2C flash (for GUID, etc.)
  * All fields are little-endian binary unless otherwise stated
  */
-#define IPATH_FLASH_VERSION 1
+#define IPATH_FLASH_VERSION 2
 struct ipath_flash {
 	/* flash layout version (IPATH_FLASH_VERSION) */
 	__u8 if_fversion;
@@ -484,14 +484,14 @@ struct ipath_flash {
 	__u8 if_csum;
 	/*
 	 * valid length (in use, protected by if_csum), including
-	 * if_fversion and if_sum themselves)
+	 * if_fversion and if_csum themselves)
 	 */
 	__u8 if_length;
 	/* the GUID, in network order */
 	__u8 if_guid[8];
 	/* number of GUIDs to use, starting from if_guid */
 	__u8 if_numguid;
-	/* the board serial number, in ASCII */
+	/* the (last 10 characters of) board serial number, in ASCII */
 	char if_serial[12];
 	/* board mfg date (YYYYMMDD ASCII) */
 	char if_mfgdate[8];
@@ -503,8 +503,10 @@ struct ipath_flash {
 	__u8 if_powerhour[2];
 	/* ASCII free-form comment field */
 	char if_comment[32];
-	/* 78 bytes used, min flash size is 128 bytes */
-	__u8 if_future[50];
+	/* Backwards compatible prefix for longer QLogic Serial Numbers */
+	char if_sprefix[4];
+	/* 82 bytes used, min flash size is 128 bytes */
+	__u8 if_future[46];
 };
 
 /*
diff -puN drivers/infiniband/hw/ipath/ipath_eeprom.c~ib-ipath-support-more-models-of-infinipath-hardware drivers/infiniband/hw/ipath/ipath_eeprom.c
--- a/drivers/infiniband/hw/ipath/ipath_eeprom.c~ib-ipath-support-more-models-of-infinipath-hardware
+++ a/drivers/infiniband/hw/ipath/ipath_eeprom.c
@@ -602,8 +602,31 @@ void ipath_get_eeprom_info(struct ipath_
 		guid = *(__be64 *) ifp->if_guid;
 	dd->ipath_guid = guid;
 	dd->ipath_nguid = ifp->if_numguid;
-	memcpy(dd->ipath_serial, ifp->if_serial,
-	       sizeof(ifp->if_serial));
+	/*
+	 * Things are slightly complicated by the desire to transparently
+	 * support both the Pathscale 10-digit serial number and the QLogic
+	 * 13-character version.
+	 */
+	if ((ifp->if_fversion > 1) && ifp->if_sprefix[0]
+		&& ((u8 *)ifp->if_sprefix)[0] != 0xFF) {
+		/* This board has a Serial-prefix, which is stored
+		 * elsewhere for backward-compatibility.
+		 */
+		char *snp = dd->ipath_serial;
+		int len;
+		memcpy(snp, ifp->if_sprefix, sizeof ifp->if_sprefix);
+		snp[sizeof ifp->if_sprefix] = '\0';
+		len = strlen(snp);
+		snp += len;
+		len = (sizeof dd->ipath_serial) - len;
+		if (len > sizeof ifp->if_serial) {
+			len = sizeof ifp->if_serial;
+		}
+		memcpy(snp, ifp->if_serial, len);
+	} else
+		memcpy(dd->ipath_serial, ifp->if_serial,
+		       sizeof ifp->if_serial);
+
 	ipath_cdbg(VERBOSE, "Initted GUID to %llx from eeprom\n",
 		   (unsigned long long) be64_to_cpu(dd->ipath_guid));
 
diff -puN drivers/infiniband/hw/ipath/ipath_kernel.h~ib-ipath-support-more-models-of-infinipath-hardware drivers/infiniband/hw/ipath/ipath_kernel.h
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h~ib-ipath-support-more-models-of-infinipath-hardware
+++ a/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -491,8 +491,11 @@ struct ipath_devdata {
 	u16 ipath_lid;
 	/* list of pkeys programmed; 0 if not set */
 	u16 ipath_pkeys[4];
-	/* ASCII serial number, from flash */
-	u8 ipath_serial[12];
+	/*
+	 * ASCII serial number, from flash, large enough for original
+	 * all digit strings, and longer QLogic serial number format
+	 */
+	u8 ipath_serial[16];
 	/* human readable board version */
 	u8 ipath_boardversion[80];
 	/* chip major rev, from ipath_revision */
diff -puN drivers/infiniband/hw/ipath/ipath_pe800.c~ib-ipath-support-more-models-of-infinipath-hardware drivers/infiniband/hw/ipath/ipath_pe800.c
--- a/drivers/infiniband/hw/ipath/ipath_pe800.c~ib-ipath-support-more-models-of-infinipath-hardware
+++ a/drivers/infiniband/hw/ipath/ipath_pe800.c
@@ -533,7 +533,7 @@ static int ipath_pe_boardname(struct ipa
 	if (n)
 		snprintf(name, namelen, "%s", n);
 
-	if (dd->ipath_majrev != 4 || dd->ipath_minrev != 1) {
+	if (dd->ipath_majrev != 4 || !dd->ipath_minrev || dd->ipath_minrev>2) {
 		ipath_dev_err(dd, "Unsupported PE-800 revision %u.%u!\n",
 			      dd->ipath_majrev, dd->ipath_minrev);
 		ret = 1;
_

Patches currently in -mm which might be from bos@xxxxxxxxxxxxx are

ib-ipath-name-zero-counter-offsets-so-its-clear.patch
ib-ipath-update-copyrights-and-other-strings-to.patch
ib-ipath-share-more-common-code-between-rc-and-uc.patch
ib-ipath-fix-an-indenting-problem.patch
ib-ipath-fix-shared-receive-queues-for-rc.patch
ib-ipath-allow-diags-on-any-unit.patch
ib-ipath-update-some-comments-and-fix-typos.patch
ib-ipath-remove-some-duplicate-code.patch
ib-ipath-dont-allow-resources-to-be-created-with.patch
ib-ipath-fix-some-memory-leaks-on-failure-paths.patch
ib-ipath-return-an-error-for-unknown-multicast-gid.patch
ib-ipath-report-correct-device-identification.patch
ib-ipath-enforce-device-resource-limits.patch
ib-ipath-removed-unused-field-ipath_kregvirt-from.patch
ib-ipath-print-better-debug-info-when-handling.patch
ib-ipath-enable-freeze-mode-when-shutting-down.patch
ib-ipath-use-more-appropriate-gfp-flags.patch
ib-ipath-use-vmalloc-to-allocate-struct.patch
ib-ipath-memory-management-cleanups.patch
ib-ipath-reduce-overhead-on-receive-interrupts.patch
ib-ipath-fixed-bug-9776.patch
ib-ipath-fix-lost-interrupts-on-ht-400.patch
ib-ipath-disallow-send-of-invalid-packet-sizes.patch
ib-ipath-dont-confuse-the-max-message-size-with.patch
ib-ipath-removed-redundant-statements.patch
ib-ipath-check-for-valid-lid-and-multicast-lids.patch
ib-ipath-fixes-to-performance-get-counters-for-ib.patch
ib-ipath-fixes-a-bug-where-our-delay-for-eeprom-no.patch
ib-ipath-rc-receive-interrupt-performance-changes.patch
ib-ipath-purge-sps_lid-and-sps_mlid-arrays.patch
ib-ipath-drop-the-stats-sysfs-attribute-group.patch
ib-ipath-support-more-models-of-infinipath-hardware.patch
ib-ipath-read-write-correct-sizes-through-diag.patch
ib-ipath-fix-a-bug-that-results-in-addresses-near.patch
ib-ipath-remove-some-if-0-code-related-to.patch
ib-ipath-ignore-receive-queue-size-if-srq-is.patch
ib-ipath-namespace-cleanup-replace-ips-with-ipath.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux