Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2015-04-22 09:56:31 +0200
committerJiri Kosina <jkosina@suse.cz>2015-04-22 09:56:31 +0200
commit3da0a945f751cf6f0242a9ea53f43f018b6e1132 (patch)
treee5616274a8913769707e372d24a212d910240d21
parent2d43a2f6b928e6d90cf43775240aeed91bacd2a5 (diff)
parentad7fb8e8ed1fbba05edb4a637c04d9309b33df09 (diff)
Merge branch 'SLE11-SP4' of kerncvs.suse.de:/home/git/kernel-source into SLE11-SP4rpm-3.0.101-56
-rw-r--r--patches.drivers/mlx4-0001-net-mlx4_core-Introduce-ACCESS_REG-CMD-and-eth_prot_.patch254
-rw-r--r--patches.drivers/mlx4-0002-net-mlx4_core-Add-ethernet-backplane-autoneg-device-.patch58
-rw-r--r--patches.drivers/mlx4-0003-ethtool-net-mlx4_en-Add-100M-20G-56G-speeds-ethtool-.patch148
-rw-r--r--patches.drivers/mlx4-0004-net-mlx4_en-Use-PTYS-register-to-query-ethtool-setti.patch437
-rw-r--r--patches.drivers/mlx4-0005-net-mlx4_en-Use-PTYS-register-to-set-ethtool-setting.patch146
-rw-r--r--patches.fixes/0001-ACPI-sysfs-Treat-the-count-field-of-counter_show-as-.patch45
-rw-r--r--patches.fixes/0001-SUNRPC-Fix-the-execution-time-statistics-in-the-face.patch78
-rw-r--r--patches.fixes/rtc-cmos-add-more-quirks-for-TGCS.patch54
-rw-r--r--series.conf16
9 files changed, 1233 insertions, 3 deletions
diff --git a/patches.drivers/mlx4-0001-net-mlx4_core-Introduce-ACCESS_REG-CMD-and-eth_prot_.patch b/patches.drivers/mlx4-0001-net-mlx4_core-Introduce-ACCESS_REG-CMD-and-eth_prot_.patch
new file mode 100644
index 0000000000..e2aab00e4f
--- /dev/null
+++ b/patches.drivers/mlx4-0001-net-mlx4_core-Introduce-ACCESS_REG-CMD-and-eth_prot_.patch
@@ -0,0 +1,254 @@
+From: Saeed Mahameed <saeedm@mellanox.com>
+Date: Mon, 27 Oct 2014 11:37:37 +0200
+Subject: net/mlx4_core: Introduce ACCESS_REG CMD and eth_prot_ctrl dev cap
+Patch-mainline: v3.19-rc1
+Git-commit: adbc7ac5c15eb5e9d70393428345e72a1a897d6a
+References: bug#924311
+
+Adding ACCESS REG mlx4 command and use it to implement Query method for
+PTYS (Port Type and Speed Register).
+Query and store eth_prot_ctrl dev cap.
+
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Amir Vadai <amirv@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Benjamin Poirier <bpoirier@suse.de>
+---
+ drivers/net/ethernet/mellanox/mlx4/cmd.c | 9 ++
+ drivers/net/ethernet/mellanox/mlx4/fw.c | 118 ++++++++++++++++++++++++++++++-
+ include/linux/mlx4/cmd.h | 2
+ include/linux/mlx4/device.h | 40 ++++++++++
+ 4 files changed, 166 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
++++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
+@@ -1324,6 +1324,15 @@ static struct mlx4_cmd_info cmd_info[] =
+ .verify = NULL,
+ .wrapper = mlx4_QUERY_IF_STAT_wrapper
+ },
++ {
++ .opcode = MLX4_CMD_ACCESS_REG,
++ .has_inbox = true,
++ .has_outbox = true,
++ .out_is_imm = false,
++ .encode_slave_id = false,
++ .verify = NULL,
++ .wrapper = NULL,
++ },
+ /* Native multicast commands are not available for guests */
+ {
+ .opcode = MLX4_CMD_QP_ATTACH,
+--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
+@@ -137,7 +137,8 @@ static void dump_dev_cap_flags2(struct m
+ [8] = "Dynamic QP updates support",
+ [11] = "MAD DEMUX (Secure-Host) support",
+ [12] = "Large cache line (>64B) CQE stride support",
+- [13] = "Large cache line (>64B) EQE stride support"
++ [13] = "Large cache line (>64B) EQE stride support",
++ [14] = "Ethernet protocol control support"
+ };
+ int i;
+
+@@ -541,6 +542,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
+ #define QUERY_DEV_CAP_FLOW_STEERING_RANGE_EN_OFFSET 0x76
+ #define QUERY_DEV_CAP_FLOW_STEERING_MAX_QP_OFFSET 0x77
+ #define QUERY_DEV_CAP_CQ_EQ_CACHE_LINE_STRIDE 0x7a
++#define QUERY_DEV_CAP_ETH_PROT_CTRL_OFFSET 0x7a
+ #define QUERY_DEV_CAP_RDMARC_ENTRY_SZ_OFFSET 0x80
+ #define QUERY_DEV_CAP_QPC_ENTRY_SZ_OFFSET 0x82
+ #define QUERY_DEV_CAP_AUX_ENTRY_SZ_OFFSET 0x84
+@@ -715,11 +717,12 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
+ MLX4_GET(size, outbox, QUERY_DEV_CAP_MAX_DESC_SZ_RQ_OFFSET);
+ dev_cap->max_rq_desc_sz = size;
+ MLX4_GET(field, outbox, QUERY_DEV_CAP_CQ_EQ_CACHE_LINE_STRIDE);
++ if (field & (1 << 5))
++ dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL;
+ if (field & (1 << 6))
+ dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_CQE_STRIDE;
+ if (field & (1 << 7))
+ dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_EQE_STRIDE;
+-
+ MLX4_GET(dev_cap->bmme_flags, outbox,
+ QUERY_DEV_CAP_BMME_FLAGS_OFFSET);
+ MLX4_GET(dev_cap->reserved_lkey, outbox,
+@@ -2087,3 +2090,114 @@ out:
+ mlx4_free_cmd_mailbox(dev, mailbox);
+ return err;
+ }
++
++/* Access Reg commands */
++enum mlx4_access_reg_masks {
++ MLX4_ACCESS_REG_STATUS_MASK = 0x7f,
++ MLX4_ACCESS_REG_METHOD_MASK = 0x7f,
++ MLX4_ACCESS_REG_LEN_MASK = 0x7ff
++};
++
++struct mlx4_access_reg {
++ __be16 constant1;
++ u8 status;
++ u8 resrvd1;
++ __be16 reg_id;
++ u8 method;
++ u8 constant2;
++ __be32 resrvd2[2];
++ __be16 len_const;
++ __be16 resrvd3;
++#define MLX4_ACCESS_REG_HEADER_SIZE (20)
++ u8 reg_data[MLX4_MAILBOX_SIZE-MLX4_ACCESS_REG_HEADER_SIZE];
++} __attribute__((__packed__));
++
++/**
++ * mlx4_ACCESS_REG - Generic access reg command.
++ * @dev: mlx4_dev.
++ * @reg_id: register ID to access.
++ * @method: Access method Read/Write.
++ * @reg_len: register length to Read/Write in bytes.
++ * @reg_data: reg_data pointer to Read/Write From/To.
++ *
++ * Access ConnectX registers FW command.
++ * Returns 0 on success and copies outbox mlx4_access_reg data
++ * field into reg_data or a negative error code.
++ */
++static int mlx4_ACCESS_REG(struct mlx4_dev *dev, u16 reg_id,
++ enum mlx4_access_reg_method method,
++ u16 reg_len, void *reg_data)
++{
++ struct mlx4_cmd_mailbox *inbox, *outbox;
++ struct mlx4_access_reg *inbuf, *outbuf;
++ int err;
++
++ inbox = mlx4_alloc_cmd_mailbox(dev);
++ if (IS_ERR(inbox))
++ return PTR_ERR(inbox);
++
++ outbox = mlx4_alloc_cmd_mailbox(dev);
++ if (IS_ERR(outbox)) {
++ mlx4_free_cmd_mailbox(dev, inbox);
++ return PTR_ERR(outbox);
++ }
++
++ inbuf = inbox->buf;
++ outbuf = outbox->buf;
++
++ inbuf->constant1 = cpu_to_be16(0x1<<11 | 0x4);
++ inbuf->constant2 = 0x1;
++ inbuf->reg_id = cpu_to_be16(reg_id);
++ inbuf->method = method & MLX4_ACCESS_REG_METHOD_MASK;
++
++ reg_len = min(reg_len, (u16)(sizeof(inbuf->reg_data)));
++ inbuf->len_const =
++ cpu_to_be16(((reg_len/4 + 1) & MLX4_ACCESS_REG_LEN_MASK) |
++ ((0x3) << 12));
++
++ memcpy(inbuf->reg_data, reg_data, reg_len);
++ err = mlx4_cmd_box(dev, inbox->dma, outbox->dma, 0, 0,
++ MLX4_CMD_ACCESS_REG, MLX4_CMD_TIME_CLASS_C,
++ MLX4_CMD_NATIVE);
++ if (err)
++ goto out;
++
++ if (outbuf->status & MLX4_ACCESS_REG_STATUS_MASK) {
++ err = outbuf->status & MLX4_ACCESS_REG_STATUS_MASK;
++ mlx4_err(dev,
++ "MLX4_CMD_ACCESS_REG(%x) returned REG status (%x)\n",
++ reg_id, err);
++ goto out;
++ }
++
++ memcpy(reg_data, outbuf->reg_data, reg_len);
++out:
++ mlx4_free_cmd_mailbox(dev, inbox);
++ mlx4_free_cmd_mailbox(dev, outbox);
++ return err;
++}
++
++/* ConnectX registers IDs */
++enum mlx4_reg_id {
++ MLX4_REG_ID_PTYS = 0x5004,
++};
++
++/**
++ * mlx4_ACCESS_PTYS_REG - Access PTYs (Port Type and Speed)
++ * register
++ * @dev: mlx4_dev.
++ * @method: Access method Read/Write.
++ * @ptys_reg: PTYS register data pointer.
++ *
++ * Access ConnectX PTYS register, to Read/Write Port Type/Speed
++ * configuration
++ * Returns 0 on success or a negative error code.
++ */
++int mlx4_ACCESS_PTYS_REG(struct mlx4_dev *dev,
++ enum mlx4_access_reg_method method,
++ struct mlx4_ptys_reg *ptys_reg)
++{
++ return mlx4_ACCESS_REG(dev, MLX4_REG_ID_PTYS,
++ method, sizeof(*ptys_reg), ptys_reg);
++}
++EXPORT_SYMBOL_GPL(mlx4_ACCESS_PTYS_REG);
+--- a/include/linux/mlx4/cmd.h
++++ b/include/linux/mlx4/cmd.h
+@@ -67,6 +67,8 @@ enum {
+ MLX4_CMD_MAP_ICM_AUX = 0xffc,
+ MLX4_CMD_UNMAP_ICM_AUX = 0xffb,
+ MLX4_CMD_SET_ICM_SIZE = 0xffd,
++ MLX4_CMD_ACCESS_REG = 0x3b,
++
+ /*master notify fw on finish for slave's flr*/
+ MLX4_CMD_INFORM_FLR_DONE = 0x5b,
+ MLX4_CMD_GET_OP_REQ = 0x59,
+--- a/include/linux/mlx4/device.h
++++ b/include/linux/mlx4/device.h
+@@ -176,7 +176,8 @@ enum {
+ MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8,
+ MLX4_DEV_CAP_FLAG2_MAD_DEMUX = 1LL << 11,
+ MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 12,
+- MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13
++ MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13,
++ MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 14
+ };
+
+ enum {
+@@ -1202,4 +1203,41 @@ static inline bool mlx4_low_memory_profi
+ return is_kdump_kernel();
+ }
+
++/* ACCESS REG commands */
++enum mlx4_access_reg_method {
++ MLX4_ACCESS_REG_QUERY = 0x1,
++ MLX4_ACCESS_REG_WRITE = 0x2,
++};
++
++/* ACCESS PTYS Reg command */
++enum mlx4_ptys_proto {
++ MLX4_PTYS_IB = 1<<0,
++ MLX4_PTYS_EN = 1<<2,
++};
++
++struct mlx4_ptys_reg {
++ u8 resrvd1;
++ u8 local_port;
++ u8 resrvd2;
++ u8 proto_mask;
++ __be32 resrvd3[2];
++ __be32 eth_proto_cap;
++ __be16 ib_width_cap;
++ __be16 ib_speed_cap;
++ __be32 resrvd4;
++ __be32 eth_proto_admin;
++ __be16 ib_width_admin;
++ __be16 ib_speed_admin;
++ __be32 resrvd5;
++ __be32 eth_proto_oper;
++ __be16 ib_width_oper;
++ __be16 ib_speed_oper;
++ __be32 resrvd6;
++ __be32 eth_proto_lp_adv;
++} __packed;
++
++int mlx4_ACCESS_PTYS_REG(struct mlx4_dev *dev,
++ enum mlx4_access_reg_method method,
++ struct mlx4_ptys_reg *ptys_reg);
++
+ #endif /* MLX4_DEVICE_H */
diff --git a/patches.drivers/mlx4-0002-net-mlx4_core-Add-ethernet-backplane-autoneg-device-.patch b/patches.drivers/mlx4-0002-net-mlx4_core-Add-ethernet-backplane-autoneg-device-.patch
new file mode 100644
index 0000000000..582ffdfc86
--- /dev/null
+++ b/patches.drivers/mlx4-0002-net-mlx4_core-Add-ethernet-backplane-autoneg-device-.patch
@@ -0,0 +1,58 @@
+From: Saeed Mahameed <saeedm@mellanox.com>
+Date: Mon, 27 Oct 2014 11:37:38 +0200
+Subject: net/mlx4_core: Add ethernet backplane autoneg device capability
+Patch-mainline: v3.19-rc1
+Git-commit: a53e3e8c1db547981e13d1ebf24a659bd4e87710
+References: bug#924311
+
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Amir Vadai <amirv@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Benjamin Poirier <bpoirier@suse.de>
+---
+ drivers/net/ethernet/mellanox/mlx4/fw.c | 7 ++++++-
+ include/linux/mlx4/device.h | 3 ++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
+@@ -138,7 +138,8 @@ static void dump_dev_cap_flags2(struct m
+ [11] = "MAD DEMUX (Secure-Host) support",
+ [12] = "Large cache line (>64B) CQE stride support",
+ [13] = "Large cache line (>64B) EQE stride support",
+- [14] = "Ethernet protocol control support"
++ [14] = "Ethernet protocol control support",
++ [15] = "Ethernet Backplane autoneg support"
+ };
+ int i;
+
+@@ -556,6 +557,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
+ #define QUERY_DEV_CAP_BMME_FLAGS_OFFSET 0x94
+ #define QUERY_DEV_CAP_RSVD_LKEY_OFFSET 0x98
+ #define QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET 0xa0
++#define QUERY_DEV_CAP_ETH_BACKPL_OFFSET 0x9c
+ #define QUERY_DEV_CAP_FW_REASSIGN_MAC 0x9d
+ #define QUERY_DEV_CAP_MAD_DEMUX_OFFSET 0xb0
+
+@@ -727,6 +729,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
+ QUERY_DEV_CAP_BMME_FLAGS_OFFSET);
+ MLX4_GET(dev_cap->reserved_lkey, outbox,
+ QUERY_DEV_CAP_RSVD_LKEY_OFFSET);
++ MLX4_GET(field32, outbox, QUERY_DEV_CAP_ETH_BACKPL_OFFSET);
++ if (field32 & (1 << 0))
++ dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP;
+ MLX4_GET(field, outbox, QUERY_DEV_CAP_FW_REASSIGN_MAC);
+ if (field & 1<<6)
+ dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN;
+--- a/include/linux/mlx4/device.h
++++ b/include/linux/mlx4/device.h
+@@ -177,7 +177,8 @@ enum {
+ MLX4_DEV_CAP_FLAG2_MAD_DEMUX = 1LL << 11,
+ MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 12,
+ MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13,
+- MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 14
++ MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 14,
++ MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 15
+ };
+
+ enum {
diff --git a/patches.drivers/mlx4-0003-ethtool-net-mlx4_en-Add-100M-20G-56G-speeds-ethtool-.patch b/patches.drivers/mlx4-0003-ethtool-net-mlx4_en-Add-100M-20G-56G-speeds-ethtool-.patch
new file mode 100644
index 0000000000..646cf952ec
--- /dev/null
+++ b/patches.drivers/mlx4-0003-ethtool-net-mlx4_en-Add-100M-20G-56G-speeds-ethtool-.patch
@@ -0,0 +1,148 @@
+From: Saeed Mahameed <saeedm@mellanox.com>
+Date: Mon, 27 Oct 2014 11:37:39 +0200
+Subject: ethtool, net/mlx4_en: Add 100M, 20G, 56G speeds ethtool reporting
+ support
+Patch-mainline: v3.19-rc1
+Git-commit: dcf972a334dd76975bf144ca57350c1f3132c947
+References: bug#924311
+
+Added 100M, 20G and 56G ethtool speed reporting support.
+Update mlx4_en_test_speed self test with the new speeds.
+
+Defined new link speeds in include/uapi/linux/ethtool.h:
++#define SPEED_20000 20000
++#define SPEED_40000 40000
++#define SPEED_56000 56000
+
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Amir Vadai <amirv@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Benjamin Poirier <bpoirier@suse.de>
+---
+ drivers/net/ethernet/mellanox/mlx4/en_port.c | 15 ++++++++++++---
+ drivers/net/ethernet/mellanox/mlx4/en_port.h | 9 ++++++---
+ drivers/net/ethernet/mellanox/mlx4/en_selftest.c | 12 ++++++++----
+ include/linux/ethtool.h | 14 +++++++++++++-
+ 4 files changed, 39 insertions(+), 11 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/en_port.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c
+@@ -91,15 +91,24 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_de
+ * already synchronized, no need in locking */
+ state->link_state = !!(qport_context->link_up & MLX4_EN_LINK_UP_MASK);
+ switch (qport_context->link_speed & MLX4_EN_SPEED_MASK) {
++ case MLX4_EN_100M_SPEED:
++ state->link_speed = SPEED_100;
++ break;
+ case MLX4_EN_1G_SPEED:
+- state->link_speed = 1000;
++ state->link_speed = SPEED_1000;
+ break;
+ case MLX4_EN_10G_SPEED_XAUI:
+ case MLX4_EN_10G_SPEED_XFI:
+- state->link_speed = 10000;
++ state->link_speed = SPEED_10000;
++ break;
++ case MLX4_EN_20G_SPEED:
++ state->link_speed = SPEED_20000;
+ break;
+ case MLX4_EN_40G_SPEED:
+- state->link_speed = 40000;
++ state->link_speed = SPEED_40000;
++ break;
++ case MLX4_EN_56G_SPEED:
++ state->link_speed = SPEED_56000;
+ break;
+ default:
+ state->link_speed = -1;
+--- a/drivers/net/ethernet/mellanox/mlx4/en_port.h
++++ b/drivers/net/ethernet/mellanox/mlx4/en_port.h
+@@ -54,10 +54,13 @@ enum {
+ };
+
+ enum {
+- MLX4_EN_1G_SPEED = 0x02,
+- MLX4_EN_10G_SPEED_XFI = 0x01,
++ MLX4_EN_100M_SPEED = 0x04,
+ MLX4_EN_10G_SPEED_XAUI = 0x00,
++ MLX4_EN_10G_SPEED_XFI = 0x01,
++ MLX4_EN_1G_SPEED = 0x02,
++ MLX4_EN_20G_SPEED = 0x08,
+ MLX4_EN_40G_SPEED = 0x40,
++ MLX4_EN_56G_SPEED = 0x20,
+ MLX4_EN_OTHER_SPEED = 0x0f,
+ };
+
+@@ -68,7 +71,7 @@ struct mlx4_en_query_port_context {
+ __be16 mtu;
+ u8 reserved2;
+ u8 link_speed;
+-#define MLX4_EN_SPEED_MASK 0x43
++#define MLX4_EN_SPEED_MASK 0x6f
+ u16 reserved3[5];
+ __be64 mac;
+ u8 transceiver;
+--- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
+@@ -129,11 +129,15 @@ static int mlx4_en_test_speed(struct mlx
+ if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
+ return -ENOMEM;
+
+- /* The device supports 1G, 10G and 40G speeds */
+- if (priv->port_state.link_speed != 1000 &&
+- priv->port_state.link_speed != 10000 &&
+- priv->port_state.link_speed != 40000)
++ /* The device supports 100M, 1G, 10G, 20G, 40G and 56G speed */
++ if (priv->port_state.link_speed != SPEED_100 &&
++ priv->port_state.link_speed != SPEED_1000 &&
++ priv->port_state.link_speed != SPEED_10000 &&
++ priv->port_state.link_speed != SPEED_20000 &&
++ priv->port_state.link_speed != SPEED_40000 &&
++ priv->port_state.link_speed != SPEED_56000)
+ return priv->port_state.link_speed;
++
+ return 0;
+ }
+
+--- a/include/linux/ethtool.h
++++ b/include/linux/ethtool.h
+@@ -1146,6 +1146,10 @@ struct ethtool_ops {
+ #define SUPPORTED_40000baseCR4_Full (1 << 24)
+ #define SUPPORTED_40000baseSR4_Full (1 << 25)
+ #define SUPPORTED_40000baseLR4_Full (1 << 26)
++#define SUPPORTED_56000baseKR4_Full (1 << 27)
++#define SUPPORTED_56000baseCR4_Full (1 << 28)
++#define SUPPORTED_56000baseSR4_Full (1 << 29)
++#define SUPPORTED_56000baseLR4_Full (1 << 30)
+
+ /* Indicates what features are advertised by the interface. */
+ #define ADVERTISED_10baseT_Half (1 << 0)
+@@ -1175,6 +1179,10 @@ struct ethtool_ops {
+ #define ADVERTISED_40000baseCR4_Full (1 << 24)
+ #define ADVERTISED_40000baseSR4_Full (1 << 25)
+ #define ADVERTISED_40000baseLR4_Full (1 << 26)
++#define ADVERTISED_56000baseKR4_Full (1 << 27)
++#define ADVERTISED_56000baseCR4_Full (1 << 28)
++#define ADVERTISED_56000baseSR4_Full (1 << 29)
++#define ADVERTISED_56000baseLR4_Full (1 << 30)
+
+ /* The following are all involved in forcing a particular link
+ * mode for the device for setting things. When getting the
+@@ -1182,12 +1190,16 @@ struct ethtool_ops {
+ * it was forced up into this mode or autonegotiated.
+ */
+
+-/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
++/* The forced speed, 10Mb, 100Mb, gigabit, [2.5|10|20|40|56]GbE. */
+ #define SPEED_10 10
+ #define SPEED_100 100
+ #define SPEED_1000 1000
+ #define SPEED_2500 2500
+ #define SPEED_10000 10000
++#define SPEED_20000 20000
++#define SPEED_40000 40000
++#define SPEED_56000 56000
++
+ #define SPEED_UNKNOWN -1
+
+ /* Duplex, half or full. */
diff --git a/patches.drivers/mlx4-0004-net-mlx4_en-Use-PTYS-register-to-query-ethtool-setti.patch b/patches.drivers/mlx4-0004-net-mlx4_en-Use-PTYS-register-to-query-ethtool-setti.patch
new file mode 100644
index 0000000000..c3656ff080
--- /dev/null
+++ b/patches.drivers/mlx4-0004-net-mlx4_en-Use-PTYS-register-to-query-ethtool-setti.patch
@@ -0,0 +1,437 @@
+From: Saeed Mahameed <saeedm@mellanox.com>
+Date: Mon, 27 Oct 2014 11:37:40 +0200
+Subject: net/mlx4_en: Use PTYS register to query ethtool settings
+Patch-mainline: v3.19-rc1
+Git-commit: 2c762679435dc812b7031ef9a839b901827294a9
+References: bug#924311
+
+- If dev cap MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL is ON, query PTYS register to fill ethtool settings.
+else use default values.
+- Use autoneg port cap and dev backplane autoneg cap to reprort autoneg interface capbilities.
+- Fix typo in mlx4_en_port_state struct field (transciver to transceiver).
+
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Amir Vadai <amirv@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Benjamin Poirier <bpoirier@suse.de>
+---
+ drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 311 ++++++++++++++++++++++--
+ drivers/net/ethernet/mellanox/mlx4/en_port.c | 9
+ drivers/net/ethernet/mellanox/mlx4/en_port.h | 26 +-
+ drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 8
+ 4 files changed, 338 insertions(+), 16 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+@@ -355,7 +355,277 @@ static void mlx4_en_get_strings(struct n
+ }
+ }
+
+-static int mlx4_en_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
++static u32 mlx4_en_autoneg_get(struct net_device *dev)
++{
++ struct mlx4_en_priv *priv = netdev_priv(dev);
++ struct mlx4_en_dev *mdev = priv->mdev;
++ u32 autoneg = AUTONEG_DISABLE;
++
++ if ((mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP) &&
++ (priv->port_state.flags & MLX4_EN_PORT_ANE))
++ autoneg = AUTONEG_ENABLE;
++
++ return autoneg;
++}
++
++static u32 ptys_get_supported_port(struct mlx4_ptys_reg *ptys_reg)
++{
++ u32 eth_proto = be32_to_cpu(ptys_reg->eth_proto_cap);
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_T)
++ | MLX4_PROT_MASK(MLX4_1000BASE_T)
++ | MLX4_PROT_MASK(MLX4_100BASE_TX))) {
++ return SUPPORTED_TP;
++ }
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_CR)
++ | MLX4_PROT_MASK(MLX4_10GBASE_SR)
++ | MLX4_PROT_MASK(MLX4_56GBASE_SR4)
++ | MLX4_PROT_MASK(MLX4_40GBASE_CR4)
++ | MLX4_PROT_MASK(MLX4_40GBASE_SR4)
++ | MLX4_PROT_MASK(MLX4_1000BASE_CX_SGMII))) {
++ return SUPPORTED_FIBRE;
++ }
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_56GBASE_KR4)
++ | MLX4_PROT_MASK(MLX4_40GBASE_KR4)
++ | MLX4_PROT_MASK(MLX4_20GBASE_KR2)
++ | MLX4_PROT_MASK(MLX4_10GBASE_KR)
++ | MLX4_PROT_MASK(MLX4_10GBASE_KX4)
++ | MLX4_PROT_MASK(MLX4_1000BASE_KX))) {
++ return SUPPORTED_Backplane;
++ }
++ return 0;
++}
++
++static u32 ptys_get_active_port(struct mlx4_ptys_reg *ptys_reg)
++{
++ u32 eth_proto = be32_to_cpu(ptys_reg->eth_proto_oper);
++
++ if (!eth_proto) /* link down */
++ eth_proto = be32_to_cpu(ptys_reg->eth_proto_cap);
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_T)
++ | MLX4_PROT_MASK(MLX4_1000BASE_T)
++ | MLX4_PROT_MASK(MLX4_100BASE_TX))) {
++ return PORT_TP;
++ }
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_SR)
++ | MLX4_PROT_MASK(MLX4_56GBASE_SR4)
++ | MLX4_PROT_MASK(MLX4_40GBASE_SR4)
++ | MLX4_PROT_MASK(MLX4_1000BASE_CX_SGMII))) {
++ return PORT_FIBRE;
++ }
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_CR)
++ | MLX4_PROT_MASK(MLX4_56GBASE_CR4)
++ | MLX4_PROT_MASK(MLX4_40GBASE_CR4))) {
++ return PORT_DA;
++ }
++
++ if (eth_proto & (MLX4_PROT_MASK(MLX4_56GBASE_KR4)
++ | MLX4_PROT_MASK(MLX4_40GBASE_KR4)
++ | MLX4_PROT_MASK(MLX4_20GBASE_KR2)
++ | MLX4_PROT_MASK(MLX4_10GBASE_KR)
++ | MLX4_PROT_MASK(MLX4_10GBASE_KX4)
++ | MLX4_PROT_MASK(MLX4_1000BASE_KX))) {
++ return PORT_NONE;
++ }
++ return PORT_OTHER;
++}
++
++#define MLX4_LINK_MODES_SZ \
++ (FIELD_SIZEOF(struct mlx4_ptys_reg, eth_proto_cap) * 8)
++
++enum ethtool_report {
++ SUPPORTED = 0,
++ ADVERTISED = 1,
++ SPEED = 2
++};
++
++/* Translates mlx4 link mode to equivalent ethtool Link modes/speed */
++static u32 ptys2ethtool_map[MLX4_LINK_MODES_SZ][3] = {
++ [MLX4_100BASE_TX] = {
++ SUPPORTED_100baseT_Full,
++ ADVERTISED_100baseT_Full,
++ SPEED_100
++ },
++
++ [MLX4_1000BASE_T] = {
++ SUPPORTED_1000baseT_Full,
++ ADVERTISED_1000baseT_Full,
++ SPEED_1000
++ },
++ [MLX4_1000BASE_CX_SGMII] = {
++ SUPPORTED_1000baseKX_Full,
++ ADVERTISED_1000baseKX_Full,
++ SPEED_1000
++ },
++ [MLX4_1000BASE_KX] = {
++ SUPPORTED_1000baseKX_Full,
++ ADVERTISED_1000baseKX_Full,
++ SPEED_1000
++ },
++
++ [MLX4_10GBASE_T] = {
++ SUPPORTED_10000baseT_Full,
++ ADVERTISED_10000baseT_Full,
++ SPEED_10000
++ },
++ [MLX4_10GBASE_CX4] = {
++ SUPPORTED_10000baseKX4_Full,
++ ADVERTISED_10000baseKX4_Full,
++ SPEED_10000
++ },
++ [MLX4_10GBASE_KX4] = {
++ SUPPORTED_10000baseKX4_Full,
++ ADVERTISED_10000baseKX4_Full,
++ SPEED_10000
++ },
++ [MLX4_10GBASE_KR] = {
++ SUPPORTED_10000baseKR_Full,
++ ADVERTISED_10000baseKR_Full,
++ SPEED_10000
++ },
++ [MLX4_10GBASE_CR] = {
++ SUPPORTED_10000baseKR_Full,
++ ADVERTISED_10000baseKR_Full,
++ SPEED_10000
++ },
++ [MLX4_10GBASE_SR] = {
++ SUPPORTED_10000baseKR_Full,
++ ADVERTISED_10000baseKR_Full,
++ SPEED_10000
++ },
++
++ [MLX4_20GBASE_KR2] = {
++ SUPPORTED_20000baseMLD2_Full | SUPPORTED_20000baseKR2_Full,
++ ADVERTISED_20000baseMLD2_Full | ADVERTISED_20000baseKR2_Full,
++ SPEED_20000
++ },
++
++ [MLX4_40GBASE_CR4] = {
++ SUPPORTED_40000baseCR4_Full,
++ ADVERTISED_40000baseCR4_Full,
++ SPEED_40000
++ },
++ [MLX4_40GBASE_KR4] = {
++ SUPPORTED_40000baseKR4_Full,
++ ADVERTISED_40000baseKR4_Full,
++ SPEED_40000
++ },
++ [MLX4_40GBASE_SR4] = {
++ SUPPORTED_40000baseSR4_Full,
++ ADVERTISED_40000baseSR4_Full,
++ SPEED_40000
++ },
++
++ [MLX4_56GBASE_KR4] = {
++ SUPPORTED_56000baseKR4_Full,
++ ADVERTISED_56000baseKR4_Full,
++ SPEED_56000
++ },
++ [MLX4_56GBASE_CR4] = {
++ SUPPORTED_56000baseCR4_Full,
++ ADVERTISED_56000baseCR4_Full,
++ SPEED_56000
++ },
++ [MLX4_56GBASE_SR4] = {
++ SUPPORTED_56000baseSR4_Full,
++ ADVERTISED_56000baseSR4_Full,
++ SPEED_56000
++ },
++};
++
++static u32 ptys2ethtool_link_modes(u32 eth_proto, enum ethtool_report report)
++{
++ int i;
++ u32 link_modes = 0;
++
++ for (i = 0; i < MLX4_LINK_MODES_SZ; i++) {
++ if (eth_proto & MLX4_PROT_MASK(i))
++ link_modes |= ptys2ethtool_map[i][report];
++ }
++ return link_modes;
++}
++
++static int ethtool_get_ptys_settings(struct net_device *dev,
++ struct ethtool_cmd *cmd)
++{
++ struct mlx4_en_priv *priv = netdev_priv(dev);
++ struct mlx4_ptys_reg ptys_reg;
++ u32 eth_proto;
++ int ret;
++
++ memset(&ptys_reg, 0, sizeof(ptys_reg));
++ ptys_reg.local_port = priv->port;
++ ptys_reg.proto_mask = MLX4_PTYS_EN;
++ ret = mlx4_ACCESS_PTYS_REG(priv->mdev->dev,
++ MLX4_ACCESS_REG_QUERY, &ptys_reg);
++ if (ret) {
++ en_warn(priv, "Failed to run mlx4_ACCESS_PTYS_REG status(%x)",
++ ret);
++ return ret;
++ }
++ en_dbg(DRV, priv, "ptys_reg.proto_mask %x\n",
++ ptys_reg.proto_mask);
++ en_dbg(DRV, priv, "ptys_reg.eth_proto_cap %x\n",
++ be32_to_cpu(ptys_reg.eth_proto_cap));
++ en_dbg(DRV, priv, "ptys_reg.eth_proto_admin %x\n",
++ be32_to_cpu(ptys_reg.eth_proto_admin));
++ en_dbg(DRV, priv, "ptys_reg.eth_proto_oper %x\n",
++ be32_to_cpu(ptys_reg.eth_proto_oper));
++ en_dbg(DRV, priv, "ptys_reg.eth_proto_lp_adv %x\n",
++ be32_to_cpu(ptys_reg.eth_proto_lp_adv));
++
++ cmd->supported = 0;
++ cmd->advertising = 0;
++
++ cmd->supported |= ptys_get_supported_port(&ptys_reg);
++
++ eth_proto = be32_to_cpu(ptys_reg.eth_proto_cap);
++ cmd->supported |= ptys2ethtool_link_modes(eth_proto, SUPPORTED);
++
++ eth_proto = be32_to_cpu(ptys_reg.eth_proto_admin);
++ cmd->advertising |= ptys2ethtool_link_modes(eth_proto, ADVERTISED);
++
++ cmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
++ cmd->advertising |= (priv->prof->tx_pause) ? ADVERTISED_Pause : 0;
++
++ cmd->advertising |= (priv->prof->tx_pause ^ priv->prof->rx_pause) ?
++ ADVERTISED_Asym_Pause : 0;
++
++ cmd->port = ptys_get_active_port(&ptys_reg);
++ cmd->transceiver = (SUPPORTED_TP & cmd->supported) ?
++ XCVR_EXTERNAL : XCVR_INTERNAL;
++
++ if (mlx4_en_autoneg_get(dev)) {
++ cmd->supported |= SUPPORTED_Autoneg;
++ cmd->advertising |= ADVERTISED_Autoneg;
++ }
++
++ cmd->autoneg = (priv->port_state.flags & MLX4_EN_PORT_ANC) ?
++ AUTONEG_ENABLE : AUTONEG_DISABLE;
++
++ eth_proto = be32_to_cpu(ptys_reg.eth_proto_lp_adv);
++ cmd->lp_advertising = ptys2ethtool_link_modes(eth_proto, ADVERTISED);
++
++ cmd->lp_advertising |= (priv->port_state.flags & MLX4_EN_PORT_ANC) ?
++ ADVERTISED_Autoneg : 0;
++
++ cmd->phy_address = 0;
++ cmd->mdio_support = 0;
++ cmd->maxtxpkt = 0;
++ cmd->maxrxpkt = 0;
++ cmd->eth_tp_mdix = ETH_TP_MDI_INVALID;
++ cmd->eth_tp_mdix_ctrl = ETH_TP_MDI_AUTO;
++
++ return ret;
++}
++
++static void ethtool_get_default_settings(struct net_device *dev,
++ struct ethtool_cmd *cmd)
+ {
+ struct mlx4_en_priv *priv = netdev_priv(dev);
+ int trans_type;
+@@ -363,18 +633,7 @@ static int mlx4_en_get_settings(struct n
+ cmd->autoneg = AUTONEG_DISABLE;
+ cmd->supported = SUPPORTED_10000baseT_Full;
+ cmd->advertising = ADVERTISED_10000baseT_Full;
+-
+- if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
+- return -ENOMEM;
+-
+- trans_type = priv->port_state.transciver;
+- if (netif_carrier_ok(dev)) {
+- ethtool_cmd_speed_set(cmd, priv->port_state.link_speed);
+- cmd->duplex = DUPLEX_FULL;
+- } else {
+- ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
+- cmd->duplex = DUPLEX_UNKNOWN;
+- }
++ trans_type = priv->port_state.transceiver;
+
+ if (trans_type > 0 && trans_type <= 0xC) {
+ cmd->port = PORT_FIBRE;
+@@ -390,6 +649,32 @@ static int mlx4_en_get_settings(struct n
+ cmd->port = -1;
+ cmd->transceiver = -1;
+ }
++}
++
++static int mlx4_en_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
++{
++ struct mlx4_en_priv *priv = netdev_priv(dev);
++ int ret = -EINVAL;
++
++ if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
++ return -ENOMEM;
++
++ en_dbg(DRV, priv, "query port state.flags ANC(%x) ANE(%x)\n",
++ priv->port_state.flags & MLX4_EN_PORT_ANC,
++ priv->port_state.flags & MLX4_EN_PORT_ANE);
++
++ if (priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL)
++ ret = ethtool_get_ptys_settings(dev, cmd);
++ if (ret) /* ETH PROT CRTL is not supported or PTYS CMD failed */
++ ethtool_get_default_settings(dev, cmd);
++
++ if (netif_carrier_ok(dev)) {
++ ethtool_cmd_speed_set(cmd, priv->port_state.link_speed);
++ cmd->duplex = DUPLEX_FULL;
++ } else {
++ ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
++ cmd->duplex = DUPLEX_UNKNOWN;
++ }
+ return 0;
+ }
+
+--- a/drivers/net/ethernet/mellanox/mlx4/en_port.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c
+@@ -114,7 +114,14 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_de
+ state->link_speed = -1;
+ break;
+ }
+- state->transciver = qport_context->transceiver;
++
++ state->transceiver = qport_context->transceiver;
++
++ state->flags = 0; /* Reset and recalculate the port flags */
++ state->flags |= (qport_context->link_up & MLX4_EN_ANC_MASK) ?
++ MLX4_EN_PORT_ANC : 0;
++ state->flags |= (qport_context->autoneg & MLX4_EN_AUTONEG_MASK) ?
++ MLX4_EN_PORT_ANE : 0;
+
+ out:
+ mlx4_free_cmd_mailbox(mdev->dev, mailbox);
+--- a/drivers/net/ethernet/mellanox/mlx4/en_port.h
++++ b/drivers/net/ethernet/mellanox/mlx4/en_port.h
+@@ -53,6 +53,28 @@ enum {
+ MLX4_MCAST_ENABLE = 2,
+ };
+
++enum mlx4_link_mode {
++ MLX4_1000BASE_CX_SGMII = 0,
++ MLX4_1000BASE_KX = 1,
++ MLX4_10GBASE_CX4 = 2,
++ MLX4_10GBASE_KX4 = 3,
++ MLX4_10GBASE_KR = 4,
++ MLX4_20GBASE_KR2 = 5,
++ MLX4_40GBASE_CR4 = 6,
++ MLX4_40GBASE_KR4 = 7,
++ MLX4_56GBASE_KR4 = 8,
++ MLX4_10GBASE_CR = 12,
++ MLX4_10GBASE_SR = 13,
++ MLX4_40GBASE_SR4 = 15,
++ MLX4_56GBASE_CR4 = 17,
++ MLX4_56GBASE_SR4 = 18,
++ MLX4_100BASE_TX = 24,
++ MLX4_1000BASE_T = 25,
++ MLX4_10GBASE_T = 26,
++};
++
++#define MLX4_PROT_MASK(link_mode) (1<<link_mode)
++
+ enum {
+ MLX4_EN_100M_SPEED = 0x04,
+ MLX4_EN_10G_SPEED_XAUI = 0x00,
+@@ -67,7 +89,9 @@ enum {
+ struct mlx4_en_query_port_context {
+ u8 link_up;
+ #define MLX4_EN_LINK_UP_MASK 0x80
+- u8 reserved;
++#define MLX4_EN_ANC_MASK 0x40
++ u8 autoneg;
++#define MLX4_EN_AUTONEG_MASK 0x80
+ __be16 mtu;
+ u8 reserved2;
+ u8 link_speed;
+--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
++++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+@@ -402,10 +402,16 @@ struct mlx4_en_rss_map {
+ enum mlx4_qp_state indir_state;
+ };
+
++enum mlx4_en_port_flag {
++ MLX4_EN_PORT_ANC = 1<<0, /* Auto-negotiation complete */
++ MLX4_EN_PORT_ANE = 1<<1, /* Auto-negotiation enabled */
++};
++
+ struct mlx4_en_port_state {
+ int link_state;
+ int link_speed;
+- int transciver;
++ int transceiver;
++ u32 flags;
+ };
+
+ struct mlx4_en_pkt_stats {
diff --git a/patches.drivers/mlx4-0005-net-mlx4_en-Use-PTYS-register-to-set-ethtool-setting.patch b/patches.drivers/mlx4-0005-net-mlx4_en-Use-PTYS-register-to-set-ethtool-setting.patch
new file mode 100644
index 0000000000..40689c96f7
--- /dev/null
+++ b/patches.drivers/mlx4-0005-net-mlx4_en-Use-PTYS-register-to-set-ethtool-setting.patch
@@ -0,0 +1,146 @@
+From: Saeed Mahameed <saeedm@mellanox.com>
+Date: Mon, 27 Oct 2014 11:37:41 +0200
+Subject: net/mlx4_en: Use PTYS register to set ethtool settings (Speed)
+Patch-mainline: v3.19-rc1
+Git-commit: d48b3ab4c0e4356f3b1ccaea8cb838cf1292f7da
+References: bug#924311
+
+Added Support to set speed or advertised link modes via ethtool:
+ethtool -s <ifname> [speed <speed>] [advertise <link modes>]
+
+Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
+Signed-off-by: Amir Vadai <amirv@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Benjamin Poirier <bpoirier@suse.de>
+---
+ drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 108 +++++++++++++++++++++++-
+ 1 file changed, 104 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
++++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+@@ -550,6 +550,31 @@ static u32 ptys2ethtool_link_modes(u32 e
+ return link_modes;
+ }
+
++static u32 ethtool2ptys_link_modes(u32 link_modes, enum ethtool_report report)
++{
++ int i;
++ u32 ptys_modes = 0;
++
++ for (i = 0; i < MLX4_LINK_MODES_SZ; i++) {
++ if (ptys2ethtool_map[i][report] & link_modes)
++ ptys_modes |= 1 << i;
++ }
++ return ptys_modes;
++}
++
++/* Convert actual speed (SPEED_XXX) to ptys link modes */
++static u32 speed2ptys_link_modes(u32 speed)
++{
++ int i;
++ u32 ptys_modes = 0;
++
++ for (i = 0; i < MLX4_LINK_MODES_SZ; i++) {
++ if (ptys2ethtool_map[i][SPEED] == speed)
++ ptys_modes |= 1 << i;
++ }
++ return ptys_modes;
++}
++
+ static int ethtool_get_ptys_settings(struct net_device *dev,
+ struct ethtool_cmd *cmd)
+ {
+@@ -678,14 +703,89 @@ static int mlx4_en_get_settings(struct n
+ return 0;
+ }
+
++/* Calculate PTYS admin according ethtool speed (SPEED_XXX) */
++static __be32 speed_set_ptys_admin(struct mlx4_en_priv *priv, u32 speed,
++ __be32 proto_cap)
++{
++ __be32 proto_admin = 0;
++
++ if (!speed) { /* Speed = 0 ==> Reset Link modes */
++ proto_admin = proto_cap;
++ en_info(priv, "Speed was set to 0, Reset advertised Link Modes to default (%x)\n",
++ be32_to_cpu(proto_cap));
++ } else {
++ u32 ptys_link_modes = speed2ptys_link_modes(speed);
++
++ proto_admin = cpu_to_be32(ptys_link_modes) & proto_cap;
++ en_info(priv, "Setting Speed to %d\n", speed);
++ }
++ return proto_admin;
++}
++
+ static int mlx4_en_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ {
+- if ((cmd->autoneg == AUTONEG_ENABLE) ||
+- (ethtool_cmd_speed(cmd) != SPEED_10000) ||
+- (cmd->duplex != DUPLEX_FULL))
++ struct mlx4_en_priv *priv = netdev_priv(dev);
++ struct mlx4_ptys_reg ptys_reg;
++ __be32 proto_admin;
++ int ret;
++
++ u32 ptys_adv = ethtool2ptys_link_modes(cmd->advertising, ADVERTISED);
++ int speed = ethtool_cmd_speed(cmd);
++
++ en_dbg(DRV, priv, "Set Speed=%d adv=0x%x autoneg=%d duplex=%d\n",
++ speed, cmd->advertising, cmd->autoneg, cmd->duplex);
++
++ if (!(priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL) ||
++ (cmd->autoneg == AUTONEG_ENABLE) || (cmd->duplex == DUPLEX_HALF))
+ return -EINVAL;
+
+- /* Nothing to change */
++ memset(&ptys_reg, 0, sizeof(ptys_reg));
++ ptys_reg.local_port = priv->port;
++ ptys_reg.proto_mask = MLX4_PTYS_EN;
++ ret = mlx4_ACCESS_PTYS_REG(priv->mdev->dev,
++ MLX4_ACCESS_REG_QUERY, &ptys_reg);
++ if (ret) {
++ en_warn(priv, "Failed to QUERY mlx4_ACCESS_PTYS_REG status(%x)\n",
++ ret);
++ return 0;
++ }
++
++ proto_admin = cpu_to_be32(ptys_adv);
++ if (speed >= 0 && speed != priv->port_state.link_speed)
++ /* If speed was set then speed decides :-) */
++ proto_admin = speed_set_ptys_admin(priv, speed,
++ ptys_reg.eth_proto_cap);
++
++ proto_admin &= ptys_reg.eth_proto_cap;
++
++ if (proto_admin == ptys_reg.eth_proto_admin)
++ return 0; /* Nothing to change */
++
++ if (!proto_admin) {
++ en_warn(priv, "Not supported link mode(s) requested, check supported link modes.\n");
++ return -EINVAL; /* nothing to change due to bad input */
++ }
++
++ en_dbg(DRV, priv, "mlx4_ACCESS_PTYS_REG SET: ptys_reg.eth_proto_admin = 0x%x\n",
++ be32_to_cpu(proto_admin));
++
++ ptys_reg.eth_proto_admin = proto_admin;
++ ret = mlx4_ACCESS_PTYS_REG(priv->mdev->dev, MLX4_ACCESS_REG_WRITE,
++ &ptys_reg);
++ if (ret) {
++ en_warn(priv, "Failed to write mlx4_ACCESS_PTYS_REG eth_proto_admin(0x%x) status(0x%x)",
++ be32_to_cpu(ptys_reg.eth_proto_admin), ret);
++ return ret;
++ }
++
++ en_warn(priv, "Port link mode changed, restarting port...\n");
++ mutex_lock(&priv->mdev->state_lock);
++ if (priv->port_up) {
++ mlx4_en_stop_port(dev, 1);
++ if (mlx4_en_start_port(dev))
++ en_err(priv, "Failed restarting port %d\n", priv->port);
++ }
++ mutex_unlock(&priv->mdev->state_lock);
+ return 0;
+ }
+
diff --git a/patches.fixes/0001-ACPI-sysfs-Treat-the-count-field-of-counter_show-as-.patch b/patches.fixes/0001-ACPI-sysfs-Treat-the-count-field-of-counter_show-as-.patch
new file mode 100644
index 0000000000..1ebcbdc8a1
--- /dev/null
+++ b/patches.fixes/0001-ACPI-sysfs-Treat-the-count-field-of-counter_show-as-.patch
@@ -0,0 +1,45 @@
+From 7b1a13228b321ea27bd53070bcd332417069ace8 Mon Sep 17 00:00:00 2001
+From: Nan Li <nli@suse.com>
+Date: Wed, 4 Mar 2015 18:48:35 +0800
+Subject: [PATCH] ACPI / sysfs: Treat the count field of counter_show() as
+ unsigned
+
+Git-commit: 7b1a13228b321ea27bd53070bcd332417069ace8
+Patch-mainline: v4.1
+References: bnc#909312
+Target: SLE-11 SP3
+
+The count field is an unsigned 32bit value, and the
+counter_show() function should also treat it as a unsigned
+value.
+
+Otherwise the counter may show negative number as we found on a
+machine:
+...
+gpe23: 0 invalid
+gpe24: -2071733 enabled
+gpe25: 0 invalid
+...
+gpe_all: -2070980
+sci: -2070949
+
+Signed-off-by: Nan Li <nli@suse.com>
+Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+---
+ drivers/acpi/sysfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux-3.0-SLE11-SP3/drivers/acpi/sysfs.c
+===================================================================
+--- linux-3.0-SLE11-SP3.orig/drivers/acpi/sysfs.c
++++ linux-3.0-SLE11-SP3/drivers/acpi/sysfs.c
+@@ -524,7 +524,7 @@ static ssize_t counter_show(struct kobje
+ acpi_irq_not_handled;
+ all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
+ acpi_gpe_count;
+- size = sprintf(buf, "%8d", all_counters[index].count);
++ size = sprintf(buf, "%8u", all_counters[index].count);
+
+ /* "gpe_all" or "sci" */
+ if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
diff --git a/patches.fixes/0001-SUNRPC-Fix-the-execution-time-statistics-in-the-face.patch b/patches.fixes/0001-SUNRPC-Fix-the-execution-time-statistics-in-the-face.patch
new file mode 100644
index 0000000000..d7fc138e6b
--- /dev/null
+++ b/patches.fixes/0001-SUNRPC-Fix-the-execution-time-statistics-in-the-face.patch
@@ -0,0 +1,78 @@
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Thu, 1 Dec 2011 14:00:15 -0500
+Subject: [PATCH] SUNRPC: Fix the execution time statistics in the face of RPC
+ restarts
+Git-commit: 7fdcf13b292e8b2e38e42de24be2503e37b2cf97
+Patch-mainline: v3.2
+References: bnc#924271
+
+If the rpc_task gets restarted, then we want to ensure that we don't
+double-count the execution time statistics, timeout data, etc.
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Acked-by: NeilBrown <neilb@suse.de>
+
+---
+ net/sunrpc/sched.c | 30 +++++++++++++++++++++++-------
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+--- linux-3.0-SLE11-SP3.orig/net/sunrpc/sched.c
++++ linux-3.0-SLE11-SP3/net/sunrpc/sched.c
+@@ -649,6 +649,27 @@ void rpc_prepare_task(struct rpc_task *t
+ task->tk_ops->rpc_call_prepare(task, task->tk_calldata);
+ }
+
++static void
++rpc_init_task_statistics(struct rpc_task *task)
++{
++ /* Initialize retry counters */
++ task->tk_garb_retry = 2;
++ task->tk_cred_retry = 2;
++ task->tk_rebind_retry = 2;
++
++ /* starting timestamp */
++ task->tk_start = ktime_get();
++}
++
++static void
++rpc_reset_task_statistics(struct rpc_task *task)
++{
++ task->tk_timeouts = 0;
++ task->tk_flags &= ~(RPC_CALL_MAJORSEEN|RPC_TASK_KILLED|RPC_TASK_SENT);
++
++ rpc_init_task_statistics(task);
++}
++
+ /*
+ * Helper that calls task->tk_ops->rpc_call_done if it exists
+ */
+@@ -661,6 +682,7 @@ void rpc_exit_task(struct rpc_task *task
+ WARN_ON(RPC_ASSASSINATED(task));
+ /* Always release the RPC slot and buffer memory */
+ xprt_release(task);
++ rpc_reset_task_statistics(task);
+ }
+ }
+ }
+@@ -869,11 +891,6 @@ static void rpc_init_task(struct rpc_tas
+ task->tk_calldata = task_setup_data->callback_data;
+ INIT_LIST_HEAD(&task->tk_task);
+
+- /* Initialize retry counters */
+- task->tk_garb_retry = 2;
+- task->tk_cred_retry = 2;
+- task->tk_rebind_retry = 2;
+-
+ task->tk_priority = task_setup_data->priority - RPC_PRIORITY_LOW;
+ task->tk_owner = current->tgid;
+
+@@ -883,8 +900,7 @@ static void rpc_init_task(struct rpc_tas
+ if (task->tk_ops->rpc_call_prepare != NULL)
+ task->tk_action = rpc_prepare_task;
+
+- /* starting timestamp */
+- task->tk_start = ktime_get();
++ rpc_init_task_statistics(task);
+
+ dprintk("RPC: new task initialized, procpid %u\n",
+ task_pid_nr(current));
diff --git a/patches.fixes/rtc-cmos-add-more-quirks-for-TGCS.patch b/patches.fixes/rtc-cmos-add-more-quirks-for-TGCS.patch
new file mode 100644
index 0000000000..dc7e2996b2
--- /dev/null
+++ b/patches.fixes/rtc-cmos-add-more-quirks-for-TGCS.patch
@@ -0,0 +1,54 @@
+From: Takashi Iwai <tiwai@suse.de>
+Subject: [PATCH] rtc: Add more TGCS models for alarm disable quirk
+Patch-mainline: To be upstreamed
+References: bnc#927262
+
+The recent TGCS POS machines with Baytrail need the same workaround
+like Truman model for avoiding spurious reboot at shtudown.
+The model numbers are:
+ 6140 # for Darth, Ichigan
+ 4900 # for Jade, Pearl
+ 4810 # for Jaspar, Opal
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/rtc/rtc-cmos.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+--- a/drivers/rtc/rtc-cmos.c
++++ b/drivers/rtc/rtc-cmos.c
+@@ -402,6 +402,33 @@ static const struct dmi_system_id rtc_qu
+ DMI_MATCH(DMI_PRODUCT_NAME, "4852570"),
+ },
+ },
++ /* https://bugzilla.novell.com/show_bug.cgi?id=927262 */
++ {
++ .callback = set_alarm_disable_quirk,
++ .ident = "TGCS POS",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "6140"),
++ },
++ },
++ /* https://bugzilla.novell.com/show_bug.cgi?id=927262 */
++ {
++ .callback = set_alarm_disable_quirk,
++ .ident = "TGCS POS",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "4900"),
++ },
++ },
++ /* https://bugzilla.novell.com/show_bug.cgi?id=927262 */
++ {
++ .callback = set_alarm_disable_quirk,
++ .ident = "TGCS POS",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "4810"),
++ },
++ },
+ /* https://bugzilla.novell.com/show_bug.cgi?id=812592 */
+ {
+ .callback = set_alarm_disable_quirk,
diff --git a/series.conf b/series.conf
index cf5924a194..5ad3214f9f 100644
--- a/series.conf
+++ b/series.conf
@@ -5373,6 +5373,7 @@
patches.fixes/0001-NFS-remove-incorrect-Lock-reclaim-failed-warning.patch
patches.fixes/0002-nfs-fix-inverted-test-for-delegation-in-nfs4_reclaim.patch
patches.fixes/0001-NFSv4-nfs4_open_done-first-must-check-that-GETATTR-d.patch
+ patches.fixes/0001-SUNRPC-Fix-the-execution-time-statistics-in-the-face.patch
patches.fixes/guarantee_unique_inodes_in_proc.patch
patches.fixes/isofs-Fix-infinite-looping-over-CE-entries.patch
@@ -17066,6 +17067,11 @@
patches.drivers/mlx4-0295-net-mlx4_core-Call-synchronize_irq-before-freeing-EQ.patch
patches.drivers/mlx4-0296-net-mlx4_core-Limit-count-field-to-24-bits-in-qp_all.patch
patches.drivers/net-mlx4-Cache-line-CQE-EQE-stride-fixes.patch
+ patches.drivers/mlx4-0001-net-mlx4_core-Introduce-ACCESS_REG-CMD-and-eth_prot_.patch
+ patches.drivers/mlx4-0002-net-mlx4_core-Add-ethernet-backplane-autoneg-device-.patch
+ patches.drivers/mlx4-0003-ethtool-net-mlx4_en-Add-100M-20G-56G-speeds-ethtool-.patch
+ patches.drivers/mlx4-0004-net-mlx4_en-Use-PTYS-register-to-query-ethtool-setti.patch
+ patches.drivers/mlx4-0005-net-mlx4_en-Use-PTYS-register-to-set-ethtool-setting.patch
patches.drivers/net-mlx4_en-Doorbell-is-byteswapped-in-Little-Endian.patch
patches.drivers/mlx4-0001-net-mlx4_core-Maintain-a-persistent-memory-for-mlx4-.patch
patches.drivers/mlx4-0002-net-mlx4_core-Set-device-configuration-data-to-be-pe.patch
@@ -22374,6 +22380,7 @@
# bnc#805740 Truman reboot quirk, updated with upstream version
patches.fixes/rtc-cmos-add-an-alarm-disable-quirk-upstream_version.patch
patches.fixes/drivers-rtc-interface.c-fix-infinite-loop-in-initial.patch
+ patches.fixes/rtc-cmos-add-more-quirks-for-TGCS.patch
# bnc#833588: sporadic failure to mount root partition
patches.drivers/libata-set-proper-sk-when-ck_cond-is-set.patch
@@ -22424,6 +22431,12 @@
# bnc#882900, bnc#879695
patches.fixes/acpi-fix-bug-when-acpi-reset-register-is-implemented-in-system-memory.patch
+ # bnc#877456 long delays when booting under VMware Workstation
+ patches.fixes/0001-ACPI-osl-speedup-grace-period-in-acpi_os_map_cleanup.patch
+
+ # bsc#909312 busy kworker due to high ACPI event rate
+ patches.fixes/0001-ACPI-sysfs-Treat-the-count-field-of-counter_show-as-.patch
+
# bnc#860441
patches.suse/0001-pm-hibernate-create-a-radix-tree-to-store-memory-bitmap
patches.suse/0002-pm-hibernate-add-memory_rtree_find_bit-function
@@ -22528,9 +22541,6 @@
patches.arch/mce-acpi-apei-add-a-boot-option-to-disable-ff-mode-for-corrected-errors.patch
patches.arch/mce-acpi-apei-soft-offline-a-page-on-firmware-ghes-notification.patch
- # bnc#877456 long delays when booting under VMware Workstation
- patches.fixes/0001-ACPI-osl-speedup-grace-period-in-acpi_os_map_cleanup.patch
-
# FATE#317449
patches.drivers/0001-x86-efi-Add-EFI-framebuffer-earlyprintk-support.patch
patches.drivers/0002-x86-efi-Fix-earlyprintk-off-by-one-bug.patch