]> git.openfabrics.org - ~emulex/tmp/compat-rdma/.git/commitdiff
cxgb4: pull in post-3.18 fixes
authorSteve Wise <swise@opengridcomputing.com>
Fri, 6 Feb 2015 17:04:57 +0000 (11:04 -0600)
committerSteve Wise <swise@opengridcomputing.com>
Fri, 6 Feb 2015 17:04:57 +0000 (11:04 -0600)
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
linux-next-cherry-picks/0001-cxgb4-Add-a-check-for-flashing-FW-using-ethtool.patch [new file with mode: 0644]
linux-next-cherry-picks/0002-cxgb4-Update-FW-version-string-to-match-FW-binary-ve.patch [new file with mode: 0644]
linux-next-cherry-picks/0003-cxgb4-Update-firmware-version-after-flashing-it-via-.patch [new file with mode: 0644]
linux-next-cherry-picks/0004-cxgb4-Add-support-for-QSA-modules.patch [new file with mode: 0644]
linux-next-cherry-picks/0005-cxgb4-Fix-decoding-QSA-module-for-ethtool-get-settin.patch [new file with mode: 0644]

diff --git a/linux-next-cherry-picks/0001-cxgb4-Add-a-check-for-flashing-FW-using-ethtool.patch b/linux-next-cherry-picks/0001-cxgb4-Add-a-check-for-flashing-FW-using-ethtool.patch
new file mode 100644 (file)
index 0000000..ec2693f
--- /dev/null
@@ -0,0 +1,65 @@
+From: Hariprasad Shenai <hariprasad@chelsio.com>
+Subject: [PATCH] cxgb4: Add a check for flashing FW using ethtool
+
+Don't let T4 firmware flash on a T5 adapter and vice-versa
+using ethtool
+
+Based on original work by Casey Leedom <leedom@chelsio.com>
+
+Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |   26 ++++++++++++++++++++++++++
+ 1 files changed, 26 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+@@ -1131,6 +1131,27 @@ unsigned int t4_flash_cfg_addr(struct adapter *adapter)
+               return FLASH_CFG_START;
+ }
++/* Return TRUE if the specified firmware matches the adapter.  I.e. T4
++ * firmware for T4 adapters, T5 firmware for T5 adapters, etc.  We go ahead
++ * and emit an error message for mismatched firmware to save our caller the
++ * effort ...
++ */
++static bool t4_fw_matches_chip(const struct adapter *adap,
++                             const struct fw_hdr *hdr)
++{
++      /* The expression below will return FALSE for any unsupported adapter
++       * which will keep us "honest" in the future ...
++       */
++      if ((is_t4(adap->params.chip) && hdr->chip == FW_HDR_CHIP_T4) ||
++          (is_t5(adap->params.chip) && hdr->chip == FW_HDR_CHIP_T5))
++              return true;
++
++      dev_err(adap->pdev_dev,
++              "FW image (%d) is not suitable for this adapter (%d)\n",
++              hdr->chip, CHELSIO_CHIP_VERSION(adap->params.chip));
++      return false;
++}
++
+ /**
+  *    t4_load_fw - download firmware
+  *    @adap: the adapter
+@@ -1170,6 +1191,8 @@ int t4_load_fw(struct adapter *adap, const u8 *fw_data, unsigned int size)
+                       FW_MAX_SIZE);
+               return -EFBIG;
+       }
++      if (!t4_fw_matches_chip(adap, hdr))
++              return -EINVAL;
+       for (csum = 0, i = 0; i < size / sizeof(csum); i++)
+               csum += ntohl(p[i]);
+@@ -3080,6 +3103,9 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
+       const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data;
+       int reset, ret;
++      if (!t4_fw_matches_chip(adap, fw_hdr))
++              return -EINVAL;
++
+       ret = t4_fw_halt(adap, mbox, force);
+       if (ret < 0 && !force)
+               return ret;
diff --git a/linux-next-cherry-picks/0002-cxgb4-Update-FW-version-string-to-match-FW-binary-ve.patch b/linux-next-cherry-picks/0002-cxgb4-Update-FW-version-string-to-match-FW-binary-ve.patch
new file mode 100644 (file)
index 0000000..bf536ab
--- /dev/null
@@ -0,0 +1,31 @@
+From: Hariprasad Shenai <hariprasad@chelsio.com>
+Subject: [PATCH] cxgb4: Update FW version string to match FW binary version 1.12.25.0
+
+Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/chelsio/cxgb4/cxgb4.h |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+@@ -50,13 +50,13 @@
+ #include "cxgb4_uld.h"
+ #define T4FW_VERSION_MAJOR 0x01
+-#define T4FW_VERSION_MINOR 0x0B
+-#define T4FW_VERSION_MICRO 0x1B
++#define T4FW_VERSION_MINOR 0x0C
++#define T4FW_VERSION_MICRO 0x19
+ #define T4FW_VERSION_BUILD 0x00
+ #define T5FW_VERSION_MAJOR 0x01
+-#define T5FW_VERSION_MINOR 0x0B
+-#define T5FW_VERSION_MICRO 0x1B
++#define T5FW_VERSION_MINOR 0x0C
++#define T5FW_VERSION_MICRO 0x19
+ #define T5FW_VERSION_BUILD 0x00
+ #define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
diff --git a/linux-next-cherry-picks/0003-cxgb4-Update-firmware-version-after-flashing-it-via-.patch b/linux-next-cherry-picks/0003-cxgb4-Update-firmware-version-after-flashing-it-via-.patch
new file mode 100644 (file)
index 0000000..1dadb90
--- /dev/null
@@ -0,0 +1,25 @@
+From: Hariprasad Shenai <hariprasad@chelsio.com>
+Subject: [PATCH] cxgb4: Update firmware version after flashing it via ethtool
+
+After successfully loading new firmware, reload the new firmware's version
+number information so "ethtool -i", etc. will report the right value
+
+Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+@@ -1235,6 +1235,8 @@ out:
+       if (ret)
+               dev_err(adap->pdev_dev, "firmware download failed, error %d\n",
+                       ret);
++      else
++              ret = t4_get_fw_version(adap, &adap->params.fw_vers);
+       return ret;
+ }
diff --git a/linux-next-cherry-picks/0004-cxgb4-Add-support-for-QSA-modules.patch b/linux-next-cherry-picks/0004-cxgb4-Add-support-for-QSA-modules.patch
new file mode 100644 (file)
index 0000000..bb176f0
--- /dev/null
@@ -0,0 +1,83 @@
+From: Hariprasad Shenai <hariprasad@chelsio.com>
+Subject: [PATCH] cxgb4: Add support for QSA modules
+
+Firmware 1.12.25.0 added support for QSA module, adding the driver code for it.
+Also fixes some ethtool get settings for other module types.
+
+Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/chelsio/cxgb4/cxgb4.h      |    2 +-
+ drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |   13 ++++++++++---
+ drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |    1 +
+ 3 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+@@ -385,7 +385,7 @@ struct port_info {
+       s16    xact_addr_filt;        /* index of exact MAC address filter */
+       u16    rss_size;              /* size of VI's RSS table slice */
+       s8     mdio_addr;
+-      u8     port_type;
++      enum fw_port_type port_type;
+       u8     mod_type;
+       u8     port_id;
+       u8     tx_chan;
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+@@ -2413,7 +2413,7 @@ static int identify_port(struct net_device *dev,
+       return t4_identify_port(adap, adap->fn, netdev2pinfo(dev)->viid, val);
+ }
+-static unsigned int from_fw_linkcaps(unsigned int type, unsigned int caps)
++static unsigned int from_fw_linkcaps(enum fw_port_type type, unsigned int caps)
+ {
+       unsigned int v = 0;
+@@ -2442,14 +2442,20 @@ static unsigned int from_fw_linkcaps(unsigned int type, unsigned int caps)
+                    SUPPORTED_10000baseKR_Full | SUPPORTED_1000baseKX_Full |
+                    SUPPORTED_10000baseKX4_Full;
+       else if (type == FW_PORT_TYPE_FIBER_XFI ||
+-               type == FW_PORT_TYPE_FIBER_XAUI || type == FW_PORT_TYPE_SFP) {
++               type == FW_PORT_TYPE_FIBER_XAUI ||
++               type == FW_PORT_TYPE_SFP ||
++               type == FW_PORT_TYPE_QSFP_10G ||
++               type == FW_PORT_TYPE_QSA) {
+               v |= SUPPORTED_FIBRE;
+               if (caps & FW_PORT_CAP_SPEED_1G)
+                       v |= SUPPORTED_1000baseT_Full;
+               if (caps & FW_PORT_CAP_SPEED_10G)
+                       v |= SUPPORTED_10000baseT_Full;
+-      } else if (type == FW_PORT_TYPE_BP40_BA)
++      } else if (type == FW_PORT_TYPE_BP40_BA ||
++                 type == FW_PORT_TYPE_QSFP) {
+               v |= SUPPORTED_40000baseSR4_Full;
++              v |= SUPPORTED_FIBRE;
++      }
+       if (caps & FW_PORT_CAP_ANEG)
+               v |= SUPPORTED_Autoneg;
+@@ -2484,6 +2490,7 @@ static int get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+               cmd->port = PORT_FIBRE;
+       else if (p->port_type == FW_PORT_TYPE_SFP ||
+                p->port_type == FW_PORT_TYPE_QSFP_10G ||
++               p->port_type == FW_PORT_TYPE_QSA ||
+                p->port_type == FW_PORT_TYPE_QSFP) {
+               if (p->mod_type == FW_PORT_MOD_TYPE_LR ||
+                   p->mod_type == FW_PORT_MOD_TYPE_SR ||
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+@@ -1815,6 +1815,7 @@ enum fw_port_type {
+       FW_PORT_TYPE_BP4_AP,
+       FW_PORT_TYPE_QSFP_10G,
+       FW_PORT_TYPE_QSFP,
++      FW_PORT_TYPE_QSA,
+       FW_PORT_TYPE_BP40_BA,
+       FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_MASK
diff --git a/linux-next-cherry-picks/0005-cxgb4-Fix-decoding-QSA-module-for-ethtool-get-settin.patch b/linux-next-cherry-picks/0005-cxgb4-Fix-decoding-QSA-module-for-ethtool-get-settin.patch
new file mode 100644 (file)
index 0000000..4e27fe8
--- /dev/null
@@ -0,0 +1,40 @@
+From: Hariprasad Shenai <hariprasad@chelsio.com>
+Subject: [PATCH] cxgb4: Fix decoding QSA module for ethtool get settings
+
+QSA module was getting decoded as QSFP module in ethtool get settings, this
+patch fixes it.
+
+Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c    |    2 +-
+ drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+@@ -2375,7 +2375,7 @@ const char *t4_get_port_type_description(enum fw_port_type port_type)
+               "KR/KX",
+               "KR/KX/KX4",
+               "R QSFP_10G",
+-              "",
++              "R QSA",
+               "R QSFP",
+               "R BP40_BA",
+       };
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+index xxxxxxx..xxxxxxx xxxxxx
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+@@ -1814,8 +1814,8 @@ enum fw_port_type {
+       FW_PORT_TYPE_BP_AP,
+       FW_PORT_TYPE_BP4_AP,
+       FW_PORT_TYPE_QSFP_10G,
+-      FW_PORT_TYPE_QSFP,
+       FW_PORT_TYPE_QSA,
++      FW_PORT_TYPE_QSFP,
+       FW_PORT_TYPE_BP40_BA,
+       FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_MASK