stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init
@ 2017-10-07 22:36 Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 02/50] crypto: ccp - Set the AES size field for all modes Levin, Alexander (Sasha Levin)
                   ` (45 more replies)
  0 siblings, 46 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Rafael J. Wysocki, Levin, Alexander (Sasha Levin)

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

[ Upstream commit f451014692ae34e587b00de6745e16661cf734d8 ]

If new_policy is set in cpufreq_online(), the policy object has just
been created and its real_cpus mask has been zeroed on allocation,
and the driver's ->init() callback should not touch it.

It doesn't need to be cleared again, so don't do that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/cpufreq/cpufreq.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 286d4d61bd0b..530f255a898b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1172,8 +1172,6 @@ static int cpufreq_online(unsigned int cpu)
 	if (new_policy) {
 		/* related_cpus should at least include policy->cpus. */
 		cpumask_copy(policy->related_cpus, policy->cpus);
-		/* Clear mask of registered CPUs */
-		cpumask_clear(policy->real_cpus);
 	}
 
 	/*
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 02/50] crypto: ccp - Set the AES size field for all modes
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 03/50] staging: fsl-mc: Add missing header Levin, Alexander (Sasha Levin)
                   ` (44 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Gary R Hook, Herbert Xu, Levin, Alexander (Sasha Levin)

From: Gary R Hook <gary.hook@amd.com>

[ Upstream commit f7cc02b3c3a33a10dd5bb9e5dfd22e47e09503a2 ]

Ensure that the size field is correctly populated for
all AES modes.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/crypto/ccp/ccp-dev-v5.c | 3 +--
 drivers/crypto/ccp/ccp-dev.h    | 1 +
 drivers/crypto/ccp/ccp-ops.c    | 8 ++++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index 17b19a68e269..71980c41283b 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -278,8 +278,7 @@ static int ccp5_perform_aes(struct ccp_op *op)
 	CCP_AES_ENCRYPT(&function) = op->u.aes.action;
 	CCP_AES_MODE(&function) = op->u.aes.mode;
 	CCP_AES_TYPE(&function) = op->u.aes.type;
-	if (op->u.aes.mode == CCP_AES_MODE_CFB)
-		CCP_AES_SIZE(&function) = 0x7f;
+	CCP_AES_SIZE(&function) = op->u.aes.size;
 
 	CCP5_CMD_FUNCTION(&desc) = function.raw;
 
diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h
index e23c36c7691c..347b77108baa 100644
--- a/drivers/crypto/ccp/ccp-dev.h
+++ b/drivers/crypto/ccp/ccp-dev.h
@@ -470,6 +470,7 @@ struct ccp_aes_op {
 	enum ccp_aes_type type;
 	enum ccp_aes_mode mode;
 	enum ccp_aes_action action;
+	unsigned int size;
 };
 
 struct ccp_xts_aes_op {
diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index 64deb006c3be..7d4cd518e602 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -692,6 +692,14 @@ static int ccp_run_aes_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
 			goto e_ctx;
 		}
 	}
+	switch (aes->mode) {
+	case CCP_AES_MODE_CFB: /* CFB128 only */
+	case CCP_AES_MODE_CTR:
+		op.u.aes.size = AES_BLOCK_SIZE * BITS_PER_BYTE - 1;
+		break;
+	default:
+		op.u.aes.size = 0;
+	}
 
 	/* Prepare the input and output data workareas. For in-place
 	 * operations we need to set the dma direction to BIDIRECTIONAL
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 03/50] staging: fsl-mc: Add missing header
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 02/50] crypto: ccp - Set the AES size field for all modes Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 05/50] PM / wakeirq: report a wakeup_event on dedicated wekup irq Levin, Alexander (Sasha Levin)
                   ` (43 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Bogdan Purcareata, Greg Kroah-Hartman, Levin, Alexander (Sasha Levin)

From: Bogdan Purcareata <bogdan.purcareata@gmail.com>

[ Upstream commit 07e9ef146071adf316312b3dd4abfe41c9a45a7d ]

Compiling the fsl-mc bus driver will yield a couple of static analysis
errors:
warning: symbol 'fsl_mc_msi_domain_alloc_irqs' was not declared
warning: symbol 'fsl_mc_msi_domain_free_irqs' was not declared.
warning: symbol 'its_fsl_mc_msi_init' was not declared.
warning: symbol 'its_fsl_mc_msi_cleanup' was not declared.

Since these are properly declared, but the header is not included, add
it in the source files. This way the symbol is properly exported.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c                | 1 +
 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
index 3d46b1b1fa18..7de992c19ff6 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
@@ -17,6 +17,7 @@
 #include <linux/irqdomain.h>
 #include <linux/msi.h>
 #include "../include/mc-bus.h"
+#include "fsl-mc-private.h"
 
 /*
  * Generate a unique ID identifying the interrupt (only used within the MSI
diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 7a6ac640752f..eaeb3c51e14b 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -17,6 +17,7 @@
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include "../include/mc-bus.h"
+#include "fsl-mc-private.h"
 
 static struct irq_chip its_msi_irq_chip = {
 	.name = "fsl-mc-bus-msi",
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 07/50] mmc: s3cmci: include linux/interrupt.h for tasklet_struct
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (2 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 05/50] PM / wakeirq: report a wakeup_event on dedicated wekup irq Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 06/50] scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool Levin, Alexander (Sasha Levin)
                   ` (41 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Arnd Bergmann, Ulf Hansson, Levin, Alexander (Sasha Levin)

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit e1c6ec26b853e9062f0b3daaf695c546d0702953 ]

I got this new build error on today's linux-next

drivers/mmc/host/s3cmci.h:69:24: error: field 'pio_tasklet' has incomplete type
  struct tasklet_struct pio_tasklet;
drivers/mmc/host/s3cmci.c: In function 's3cmci_enable_irq':
drivers/mmc/host/s3cmci.c:390:4: error: implicit declaration of function 'enable_irq';did you mean 'enable_imask'? [-Werror=implicit-function-declaration]

While I haven't found out why this happened now and not earlier, the
solution is obvious, we should include the header that defines
the structure.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/mmc/host/s3cmci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index c531deef3258..8f27fe35e8af 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -21,6 +21,7 @@
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/gpio.h>
+#include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 04/50] IB/mlx5: Assign DSCP for R-RoCE QPs Address Path
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (4 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 06/50] scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 10/50] bnxt_en: Added PCI IDs for BCM57452 and BCM57454 ASICs Levin, Alexander (Sasha Levin)
                   ` (39 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Majd Dibbiny, Achiad Shochat, Leon Romanovsky, Doug Ledford,
	Levin, Alexander (Sasha Levin)

From: Majd Dibbiny <majd@mellanox.com>

[ Upstream commit ed88451e1f2d400fd6a743d0a481631cf9f97550 ]

For Routable RoCE QPs, the DSCP should be set in the QP's
address path.

The DSCP's value is derived from the traffic class.

Fixes: 2811ba51b049 ("IB/mlx5: Add RoCE fields to Address Vector")
Cc: Achiad Shochat <achiad@mellanox.com>
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/hw/mlx5/main.c    | 21 +++++++++++++++++++++
 drivers/infiniband/hw/mlx5/mlx5_ib.h |  2 ++
 drivers/infiniband/hw/mlx5/qp.c      |  7 +++++++
 3 files changed, 30 insertions(+)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 282c9fb0ba95..786f640fc462 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -325,6 +325,27 @@ __be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port_num,
 	return cpu_to_be16(MLX5_CAP_ROCE(dev->mdev, r_roce_min_src_udp_port));
 }
 
+int mlx5_get_roce_gid_type(struct mlx5_ib_dev *dev, u8 port_num,
+			   int index, enum ib_gid_type *gid_type)
+{
+	struct ib_gid_attr attr;
+	union ib_gid gid;
+	int ret;
+
+	ret = ib_get_cached_gid(&dev->ib_dev, port_num, index, &gid, &attr);
+	if (ret)
+		return ret;
+
+	if (!attr.ndev)
+		return -ENODEV;
+
+	dev_put(attr.ndev);
+
+	*gid_type = attr.gid_type;
+
+	return 0;
+}
+
 static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev)
 {
 	if (MLX5_CAP_GEN(dev->mdev, port_type) == MLX5_CAP_PORT_TYPE_IB)
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 7d689903c87c..86e1e08125ff 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -892,6 +892,8 @@ int mlx5_ib_set_vf_guid(struct ib_device *device, int vf, u8 port,
 
 __be16 mlx5_get_roce_udp_sport(struct mlx5_ib_dev *dev, u8 port_num,
 			       int index);
+int mlx5_get_roce_gid_type(struct mlx5_ib_dev *dev, u8 port_num,
+			   int index, enum ib_gid_type *gid_type);
 
 /* GSI QP helper functions */
 struct ib_qp *mlx5_ib_gsi_create_qp(struct ib_pd *pd,
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index aee3942ec68d..2665414b4875 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2226,6 +2226,7 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 {
 	enum rdma_link_layer ll = rdma_port_get_link_layer(&dev->ib_dev, port);
 	int err;
+	enum ib_gid_type gid_type;
 
 	if (attr_mask & IB_QP_PKEY_INDEX)
 		path->pkey_index = cpu_to_be16(alt ? attr->alt_pkey_index :
@@ -2244,10 +2245,16 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 	if (ll == IB_LINK_LAYER_ETHERNET) {
 		if (!(ah->ah_flags & IB_AH_GRH))
 			return -EINVAL;
+		err = mlx5_get_roce_gid_type(dev, port, ah->grh.sgid_index,
+					     &gid_type);
+		if (err)
+			return err;
 		memcpy(path->rmac, ah->dmac, sizeof(ah->dmac));
 		path->udp_sport = mlx5_get_roce_udp_sport(dev, port,
 							  ah->grh.sgid_index);
 		path->dci_cfi_prio_sl = (ah->sl & 0x7) << 4;
+		if (gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP)
+			path->ecn_dscp = (ah->grh.traffic_class >> 2) & 0x3f;
 	} else {
 		path->fl_free_ar = (path_flags & MLX5_PATH_FLAG_FL) ? 0x80 : 0;
 		path->fl_free_ar |=
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 06/50] scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (3 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 07/50] mmc: s3cmci: include linux/interrupt.h for tasklet_struct Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 04/50] IB/mlx5: Assign DSCP for R-RoCE QPs Address Path Levin, Alexander (Sasha Levin)
                   ` (40 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Shivasharan S, Kashyap Desai, Martin K . Petersen, Levin,
	Alexander (Sasha Levin)

From: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>

[ Upstream commit 1d6dbd1752fb4347a4a5db06c8f5cd35dd1919f4 ]

FIX - firmware wants non-RW SYS PD IOs to avoid FastPath for better
tracking and other functionalities if the device is task management
capable.

Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index bd04bd01d34a..a156451553a7 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1960,7 +1960,8 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance,
  */
 static void
 megasas_build_syspd_fusion(struct megasas_instance *instance,
-	struct scsi_cmnd *scmd, struct megasas_cmd_fusion *cmd, u8 fp_possible)
+	struct scsi_cmnd *scmd, struct megasas_cmd_fusion *cmd,
+	bool fp_possible)
 {
 	u32 device_id;
 	struct MPI2_RAID_SCSI_IO_REQUEST *io_request;
@@ -2064,6 +2065,8 @@ megasas_build_io_fusion(struct megasas_instance *instance,
 	u16 sge_count;
 	u8  cmd_type;
 	struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request;
+	struct MR_PRIV_DEVICE *mr_device_priv_data;
+	mr_device_priv_data = scp->device->hostdata;
 
 	/* Zero out some fields so they don't get reused */
 	memset(io_request->LUN, 0x0, 8);
@@ -2092,12 +2095,14 @@ megasas_build_io_fusion(struct megasas_instance *instance,
 		megasas_build_ld_nonrw_fusion(instance, scp, cmd);
 		break;
 	case READ_WRITE_SYSPDIO:
+		megasas_build_syspd_fusion(instance, scp, cmd, true);
+		break;
 	case NON_READ_WRITE_SYSPDIO:
-		if (instance->secure_jbod_support &&
-			(cmd_type == NON_READ_WRITE_SYSPDIO))
-			megasas_build_syspd_fusion(instance, scp, cmd, 0);
+		if (instance->secure_jbod_support ||
+		    mr_device_priv_data->is_tm_capable)
+			megasas_build_syspd_fusion(instance, scp, cmd, false);
 		else
-			megasas_build_syspd_fusion(instance, scp, cmd, 1);
+			megasas_build_syspd_fusion(instance, scp, cmd, true);
 		break;
 	default:
 		break;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 05/50] PM / wakeirq: report a wakeup_event on dedicated wekup irq
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 02/50] crypto: ccp - Set the AES size field for all modes Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 03/50] staging: fsl-mc: Add missing header Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 07/50] mmc: s3cmci: include linux/interrupt.h for tasklet_struct Levin, Alexander (Sasha Levin)
                   ` (42 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Grygorii Strashko, Tony Lindgren, Rafael J . Wysocki, Levin,
	Alexander (Sasha Levin)

From: Grygorii Strashko <grygorii.strashko@ti.com>

[ Upstream commit 09bb6e93956ae5175b96905b723ec879c3ca0765 ]

There are two reasons for reporting wakeup event when dedicated wakeup
IRQ is triggered:

- wakeup events accounting, so proper statistical data will be
  displayed in sysfs and debugfs;

- there are small window when System is entering suspend during which
  dedicated wakeup IRQ can be lost:

dpm_suspend_noirq()
  |- device_wakeup_arm_wake_irqs()
      |- dev_pm_arm_wake_irq(X)
         |- IRQ is enabled and marked as wakeup source
[1]...
  |- suspend_device_irqs()
     |- suspend_device_irq(X)
	|- irqd_set(X, IRQD_WAKEUP_ARMED);
	   |- wakup IRQ armed

The wakeup IRQ can be lost if it's triggered at point [1]
and not armed yet.

Hence, fix above cases by adding simple pm_wakeup_event() call in
handle_threaded_wake_irq().

Fixes: 4990d4fe327b (PM / Wakeirq: Add automated device wake IRQ handling)
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Keerthy <j-keerthy@ti.com>
[ tony@atomide.com: added missing return to avoid warnings ]
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/base/power/wakeirq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index 404d94c6c8bc..feba1b211898 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -141,6 +141,13 @@ static irqreturn_t handle_threaded_wake_irq(int irq, void *_wirq)
 	struct wake_irq *wirq = _wirq;
 	int res;
 
+	/* Maybe abort suspend? */
+	if (irqd_is_wakeup_set(irq_get_irq_data(irq))) {
+		pm_wakeup_event(wirq->dev, 0);
+
+		return IRQ_HANDLED;
+	}
+
 	/* We don't want RPM_ASYNC or RPM_NOWAIT here */
 	res = pm_runtime_resume(wirq->dev);
 	if (res < 0)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 09/50] mfd: axp20x: Fix axp288 PEK_DBR and PEK_DBF irqs being swapped
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (7 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 11/50] staging: rtl8712u: Fix endian settings for structs describing network packets Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 08/50] mfd: ab8500-sysctrl: Handle probe deferral Levin, Alexander (Sasha Levin)
                   ` (36 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Lee Jones, Levin, Alexander (Sasha Levin)

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit 1af468ebe45591651ec3bafc2e9ddc6fdef70ae0 ]

The R in PEK_DBR stands for rising, so it should be mapped to
AXP288_IRQ_POKP where the last P stands for positive edge.

Likewise PEK_DBF should be mapped to the falling edge, aka the
_N_egative edge, so it should be mapped to AXP288_IRQ_POKN.

This fixes the inverted powerbutton status reporting by the
axp20x-pek driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/mfd/axp20x.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index ba130be32e61..9617fc323e15 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -205,14 +205,14 @@ static struct resource axp22x_pek_resources[] = {
 static struct resource axp288_power_button_resources[] = {
 	{
 		.name	= "PEK_DBR",
-		.start	= AXP288_IRQ_POKN,
-		.end	= AXP288_IRQ_POKN,
+		.start	= AXP288_IRQ_POKP,
+		.end	= AXP288_IRQ_POKP,
 		.flags	= IORESOURCE_IRQ,
 	},
 	{
 		.name	= "PEK_DBF",
-		.start	= AXP288_IRQ_POKP,
-		.end	= AXP288_IRQ_POKP,
+		.start	= AXP288_IRQ_POKN,
+		.end	= AXP288_IRQ_POKN,
 		.flags	= IORESOURCE_IRQ,
 	},
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 08/50] mfd: ab8500-sysctrl: Handle probe deferral
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (8 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 09/50] mfd: axp20x: Fix axp288 PEK_DBR and PEK_DBF irqs being swapped Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 15/50] ext4: do not use stripe_width if it is not set Levin, Alexander (Sasha Levin)
                   ` (35 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Linus Walleij, Lee Jones, Levin, Alexander (Sasha Levin)

From: Linus Walleij <linus.walleij@linaro.org>

[ Upstream commit 7e9c40c63933a643908d686bd89dfc2315e8c70a ]

In the current boot, clients making use of the AB8500 sysctrl
may be probed before the ab8500-sysctrl driver. This gives them
-EINVAL, but should rather give -EPROBE_DEFER.

Before this, the abx500 clock driver didn't probe properly,
and as a result the codec driver in turn using the clocks did
not probe properly. After this patch, everything probes
properly.

Also add OF compatible-string probing. This driver is all
device tree, so let's just make a drive-by-fix of that as
well.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/mfd/ab8500-sysctrl.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 207cc497958a..8062d37b4ba4 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -98,7 +98,7 @@ int ab8500_sysctrl_read(u16 reg, u8 *value)
 	u8 bank;
 
 	if (sysctrl_dev == NULL)
-		return -EINVAL;
+		return -EPROBE_DEFER;
 
 	bank = (reg >> 8);
 	if (!valid_bank(bank))
@@ -114,11 +114,13 @@ int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value)
 	u8 bank;
 
 	if (sysctrl_dev == NULL)
-		return -EINVAL;
+		return -EPROBE_DEFER;
 
 	bank = (reg >> 8);
-	if (!valid_bank(bank))
+	if (!valid_bank(bank)) {
+		pr_err("invalid bank\n");
 		return -EINVAL;
+	}
 
 	return abx500_mask_and_set_register_interruptible(sysctrl_dev, bank,
 		(u8)(reg & 0xFF), mask, value);
@@ -145,9 +147,15 @@ static int ab8500_sysctrl_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ab8500_sysctrl_match[] = {
+	{ .compatible = "stericsson,ab8500-sysctrl", },
+	{}
+};
+
 static struct platform_driver ab8500_sysctrl_driver = {
 	.driver = {
 		.name = "ab8500-sysctrl",
+		.of_match_table = ab8500_sysctrl_match,
 	},
 	.probe = ab8500_sysctrl_probe,
 	.remove = ab8500_sysctrl_remove,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 11/50] staging: rtl8712u: Fix endian settings for structs describing network packets
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (6 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 10/50] bnxt_en: Added PCI IDs for BCM57452 and BCM57454 ASICs Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 09/50] mfd: axp20x: Fix axp288 PEK_DBR and PEK_DBF irqs being swapped Levin, Alexander (Sasha Levin)
                   ` (37 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Larry Finger, Greg Kroah-Hartman, Levin, Alexander (Sasha Levin)

From: Larry Finger <Larry.Finger@lwfinger.net>

[ Upstream commit 221c46d28957bd6e2158abc2179ce4a8c9ce07d3 ]

The headers describing a number of network packets do not have the
correct endian settings for several types of data.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/staging/rtl8712/ieee80211.h | 84 ++++++++++++++++++-------------------
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h
index 67ab58084e8a..68fd65e80906 100644
--- a/drivers/staging/rtl8712/ieee80211.h
+++ b/drivers/staging/rtl8712/ieee80211.h
@@ -138,51 +138,51 @@ struct ieee_ibss_seq {
 };
 
 struct ieee80211_hdr {
-	u16 frame_ctl;
-	u16 duration_id;
+	__le16 frame_ctl;
+	__le16 duration_id;
 	u8 addr1[ETH_ALEN];
 	u8 addr2[ETH_ALEN];
 	u8 addr3[ETH_ALEN];
-	u16 seq_ctl;
+	__le16 seq_ctl;
 	u8 addr4[ETH_ALEN];
-} __packed;
+}  __packed __aligned(2);
 
 struct ieee80211_hdr_3addr {
-	u16 frame_ctl;
-	u16 duration_id;
+	__le16 frame_ctl;
+	__le16 duration_id;
 	u8 addr1[ETH_ALEN];
 	u8 addr2[ETH_ALEN];
 	u8 addr3[ETH_ALEN];
-	u16 seq_ctl;
-} __packed;
+	__le16 seq_ctl;
+}  __packed __aligned(2);
 
 struct	ieee80211_hdr_qos {
-	u16 frame_ctl;
-	u16 duration_id;
+	__le16 frame_ctl;
+	__le16 duration_id;
 	u8 addr1[ETH_ALEN];
 	u8 addr2[ETH_ALEN];
 	u8 addr3[ETH_ALEN];
-	u16 seq_ctl;
+	__le16 seq_ctl;
 	u8 addr4[ETH_ALEN];
-	u16	qc;
-}  __packed;
+	__le16	qc;
+}   __packed __aligned(2);
 
 struct  ieee80211_hdr_3addr_qos {
-	u16 frame_ctl;
-	u16 duration_id;
+	__le16 frame_ctl;
+	__le16 duration_id;
 	u8  addr1[ETH_ALEN];
 	u8  addr2[ETH_ALEN];
 	u8  addr3[ETH_ALEN];
-	u16 seq_ctl;
-	u16 qc;
+	__le16 seq_ctl;
+	__le16 qc;
 }  __packed;
 
 struct eapol {
 	u8 snap[6];
-	u16 ethertype;
+	__be16 ethertype;
 	u8 version;
 	u8 type;
-	u16 length;
+	__le16 length;
 } __packed;
 
 enum eap_type {
@@ -514,13 +514,13 @@ struct ieee80211_security {
  */
 
 struct ieee80211_header_data {
-	u16 frame_ctl;
-	u16 duration_id;
+	__le16 frame_ctl;
+	__le16 duration_id;
 	u8 addr1[6];
 	u8 addr2[6];
 	u8 addr3[6];
-	u16 seq_ctrl;
-};
+	__le16 seq_ctrl;
+} __packed __aligned(2);
 
 #define BEACON_PROBE_SSID_ID_POSITION 12
 
@@ -552,18 +552,18 @@ struct ieee80211_info_element {
 /*
  * These are the data types that can make up management packets
  *
-	u16 auth_algorithm;
-	u16 auth_sequence;
-	u16 beacon_interval;
-	u16 capability;
+	__le16 auth_algorithm;
+	__le16 auth_sequence;
+	__le16 beacon_interval;
+	__le16 capability;
 	u8 current_ap[ETH_ALEN];
-	u16 listen_interval;
+	__le16 listen_interval;
 	struct {
 		u16 association_id:14, reserved:2;
 	} __packed;
-	u32 time_stamp[2];
-	u16 reason;
-	u16 status;
+	__le32 time_stamp[2];
+	__le16 reason;
+	__le16 status;
 */
 
 #define IEEE80211_DEFAULT_TX_ESSID "Penguin"
@@ -571,16 +571,16 @@ struct ieee80211_info_element {
 
 struct ieee80211_authentication {
 	struct ieee80211_header_data header;
-	u16 algorithm;
-	u16 transaction;
-	u16 status;
+	__le16 algorithm;
+	__le16 transaction;
+	__le16 status;
 } __packed;
 
 struct ieee80211_probe_response {
 	struct ieee80211_header_data header;
-	u32 time_stamp[2];
-	u16 beacon_interval;
-	u16 capability;
+	__le32 time_stamp[2];
+	__le16 beacon_interval;
+	__le16 capability;
 	struct ieee80211_info_element info_element;
 } __packed;
 
@@ -590,16 +590,16 @@ struct ieee80211_probe_request {
 
 struct ieee80211_assoc_request_frame {
 	struct ieee80211_hdr_3addr header;
-	u16 capability;
-	u16 listen_interval;
+	__le16 capability;
+	__le16 listen_interval;
 	struct ieee80211_info_element_hdr info_element;
 } __packed;
 
 struct ieee80211_assoc_response_frame {
 	struct ieee80211_hdr_3addr header;
-	u16 capability;
-	u16 status;
-	u16 aid;
+	__le16 capability;
+	__le16 status;
+	__le16 aid;
 } __packed;
 
 struct ieee80211_txb {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 10/50] bnxt_en: Added PCI IDs for BCM57452 and BCM57454 ASICs
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (5 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 04/50] IB/mlx5: Assign DSCP for R-RoCE QPs Address Path Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 11/50] staging: rtl8712u: Fix endian settings for structs describing network packets Levin, Alexander (Sasha Levin)
                   ` (38 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Deepak Khungar, Michael Chan, David S . Miller, Levin,
	Alexander (Sasha Levin)

From: Deepak Khungar <deepak.khungar@broadcom.com>

[ Upstream commit 32b40798c1b40343641f04cdfd09652af70ea0e9 ]

Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 20e569bd978a..333df540b375 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -97,6 +97,8 @@ enum board_idx {
 	BCM57407_NPAR,
 	BCM57414_NPAR,
 	BCM57416_NPAR,
+	BCM57452,
+	BCM57454,
 	NETXTREME_E_VF,
 	NETXTREME_C_VF,
 };
@@ -131,6 +133,8 @@ static const struct {
 	{ "Broadcom BCM57407 NetXtreme-E Ethernet Partition" },
 	{ "Broadcom BCM57414 NetXtreme-E Ethernet Partition" },
 	{ "Broadcom BCM57416 NetXtreme-E Ethernet Partition" },
+	{ "Broadcom BCM57452 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet" },
+	{ "Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet" },
 	{ "Broadcom NetXtreme-E Ethernet Virtual Function" },
 	{ "Broadcom NetXtreme-C Ethernet Virtual Function" },
 };
@@ -166,6 +170,8 @@ static const struct pci_device_id bnxt_pci_tbl[] = {
 	{ PCI_VDEVICE(BROADCOM, 0x16ed), .driver_data = BCM57414_NPAR },
 	{ PCI_VDEVICE(BROADCOM, 0x16ee), .driver_data = BCM57416_NPAR },
 	{ PCI_VDEVICE(BROADCOM, 0x16ef), .driver_data = BCM57416_NPAR },
+	{ PCI_VDEVICE(BROADCOM, 0x16f1), .driver_data = BCM57452 },
+	{ PCI_VDEVICE(BROADCOM, 0x1614), .driver_data = BCM57454 },
 #ifdef CONFIG_BNXT_SRIOV
 	{ PCI_VDEVICE(BROADCOM, 0x16c1), .driver_data = NETXTREME_E_VF },
 	{ PCI_VDEVICE(BROADCOM, 0x16cb), .driver_data = NETXTREME_C_VF },
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 14/50] ext4: fix stripe-unaligned allocations
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (12 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 12/50] PCI/MSI: Return failure when msix_setup_entries() fails Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 16/50] net/ena: change driver's default timeouts Levin, Alexander (Sasha Levin)
                   ` (31 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jan Kara, Theodore Ts'o, Levin, Alexander (Sasha Levin)

From: Jan Kara <jack@suse.cz>

[ Upstream commit d9b22cf9f5466a057f2a4f1e642b469fa9d73117 ]

When a filesystem is created using:

	mkfs.ext4 -b 4096 -E stride=512 <dev>

and we try to allocate 64MB extent, we will end up directly in
ext4_mb_complex_scan_group(). This is because the request is detected
as power-of-two allocation (so we start in ext4_mb_regular_allocator()
with ac_criteria == 0) however the check before
ext4_mb_simple_scan_group() refuses the direct buddy scan because the
allocation request is too large. Since cr == 0, the check whether we
should use ext4_mb_scan_aligned() fails as well and we fall back to
ext4_mb_complex_scan_group().

Fix the problem by checking for upper limit on power-of-two requests
directly when detecting them.

Reported-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/ext4/mballoc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 846b57ff58de..64056c6eb857 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2136,8 +2136,10 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
 	 * We search using buddy data only if the order of the request
 	 * is greater than equal to the sbi_s_mb_order2_reqs
 	 * You can tune it via /sys/fs/ext4/<partition>/mb_order2_req
+	 * We also support searching for power-of-two requests only for
+	 * requests upto maximum buddy size we have constructed.
 	 */
-	if (i >= sbi->s_mb_order2_reqs) {
+	if (i >= sbi->s_mb_order2_reqs && i <= sb->s_blocksize_bits + 2) {
 		/*
 		 * This should tell if fe_len is exactly power of 2
 		 */
@@ -2207,7 +2209,7 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
 			}
 
 			ac->ac_groups_scanned++;
-			if (cr == 0 && ac->ac_2order < sb->s_blocksize_bits+2)
+			if (cr == 0)
 				ext4_mb_simple_scan_group(ac, &e4b);
 			else if (cr == 1 && sbi->s_stripe &&
 					!(ac->ac_g_ex.fe_len % sbi->s_stripe))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 13/50] net: mvneta: fix build errors when linux/phy*.h is removed from net/dsa.h
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (10 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 15/50] ext4: do not use stripe_width if it is not set Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 12/50] PCI/MSI: Return failure when msix_setup_entries() fails Levin, Alexander (Sasha Levin)
                   ` (33 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Russell King, David S . Miller, Levin, Alexander (Sasha Levin)

From: Russell King <rmk+kernel@armlinux.org.uk>

[ Upstream commit 9303ab2b3402b60f6c39abfdbfa4ce00fce8bee4 ]

drivers/net/ethernet/marvell/mvneta.c:2694:26: error: storage size of 'status' isn't known
drivers/net/ethernet/marvell/mvneta.c:2695:26: error: storage size of 'changed' isn't known
drivers/net/ethernet/marvell/mvneta.c:2695:9: error: variable 'changed' has initializer but incomplete type
drivers/net/ethernet/marvell/mvneta.c:2709:2: error: implicit declaration of function 'fixed_phy_update_state' [-Werror=implicit-function-declaration]

Add linux/phy_fixed.h to mvneta.c

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 707bc4680b9b..6ea10a9f33e8 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -28,6 +28,7 @@
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/phy.h>
+#include <linux/phy_fixed.h>
 #include <linux/platform_device.h>
 #include <linux/skbuff.h>
 #include <net/hwbm.h>
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 15/50] ext4: do not use stripe_width if it is not set
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (9 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 08/50] mfd: ab8500-sysctrl: Handle probe deferral Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 13/50] net: mvneta: fix build errors when linux/phy*.h is removed from net/dsa.h Levin, Alexander (Sasha Levin)
                   ` (34 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jan Kara, Theodore Ts'o, Levin, Alexander (Sasha Levin)

From: Jan Kara <jack@suse.cz>

[ Upstream commit 5469d7c3087ecaf760f54b447f11af6061b7c897 ]

Avoid using stripe_width for sbi->s_stripe value if it is not actually
set. It prevents using the stride for sbi->s_stripe.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/ext4/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f72535e1898f..1f581791b39d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2628,9 +2628,9 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi)
 
 	if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group)
 		ret = sbi->s_stripe;
-	else if (stripe_width <= sbi->s_blocks_per_group)
+	else if (stripe_width && stripe_width <= sbi->s_blocks_per_group)
 		ret = stripe_width;
-	else if (stride <= sbi->s_blocks_per_group)
+	else if (stride && stride <= sbi->s_blocks_per_group)
 		ret = stride;
 	else
 		ret = 0;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 12/50] PCI/MSI: Return failure when msix_setup_entries() fails
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (11 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 13/50] net: mvneta: fix build errors when linux/phy*.h is removed from net/dsa.h Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 14/50] ext4: fix stripe-unaligned allocations Levin, Alexander (Sasha Levin)
                   ` (32 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Christophe JAILLET, Bjorn Helgaas, Levin, Alexander (Sasha Levin)

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 3adfb572f2978a980b250a9e1a56f84f3a031001 ]

If alloc_msi_entry() fails, we free resources and set ret = -ENOMEM.

However, msix_setup_entries() returns 0 unconditionally.  Return the error
code instead.

Fixes: e75eafb9b039 ("genirq/msi: Switch to new irq spreading infrastructure")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/pci/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 3455f752d5e4..0e9a9dbeb184 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -730,7 +730,7 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
 	ret = 0;
 out:
 	kfree(masks);
-	return 0;
+	return ret;
 }
 
 static void msix_program_entries(struct pci_dev *dev,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 19/50] perf tools: Only increase index if perf_evsel__new_idx() succeeds
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (15 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 18/50] drm/amdgpu: when dpm disabled, also need to stop/start vce Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 17/50] i2c: riic: correctly finish transfers Levin, Alexander (Sasha Levin)
                   ` (28 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Taeung Song, Jiri Olsa, Namhyung Kim, Peter Zijlstra, Wang Nan,
	Arnaldo Carvalho de Melo, Levin, Alexander (Sasha Levin)

From: Taeung Song <treeze.taeung@gmail.com>

[ Upstream commit 75fc5ae5cc53fff71041ecadeb3354a2b4c9fe42 ]

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1485952447-7013-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 tools/perf/util/parse-events.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 4e778eae1510..415a9c38d9f0 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -309,10 +309,11 @@ __add_event(struct list_head *list, int *idx,
 
 	event_attr_init(attr);
 
-	evsel = perf_evsel__new_idx(attr, (*idx)++);
+	evsel = perf_evsel__new_idx(attr, *idx);
 	if (!evsel)
 		return NULL;
 
+	(*idx)++;
 	evsel->cpus     = cpu_map__get(cpus);
 	evsel->own_cpus = cpu_map__get(cpus);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 18/50] drm/amdgpu: when dpm disabled, also need to stop/start vce.
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (14 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 16/50] net/ena: change driver's default timeouts Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 19/50] perf tools: Only increase index if perf_evsel__new_idx() succeeds Levin, Alexander (Sasha Levin)
                   ` (29 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rex Zhu, Alex Deucher, Levin, Alexander (Sasha Levin)

From: Rex Zhu <Rex.Zhu@amd.com>

[ Upstream commit 28ed5504ab4b211a4e589e648e5ebd1e0caa7a6a ]

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index 7fe8fd884f06..743a12df6971 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -315,6 +315,10 @@ static void amdgpu_vce_idle_work_handler(struct work_struct *work)
 			amdgpu_dpm_enable_vce(adev, false);
 		} else {
 			amdgpu_asic_set_vce_clocks(adev, 0, 0);
+			amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+							    AMD_PG_STATE_GATE);
+			amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+							    AMD_CG_STATE_GATE);
 		}
 	} else {
 		schedule_delayed_work(&adev->vce.idle_work, VCE_IDLE_TIMEOUT);
@@ -340,6 +344,11 @@ void amdgpu_vce_ring_begin_use(struct amdgpu_ring *ring)
 			amdgpu_dpm_enable_vce(adev, true);
 		} else {
 			amdgpu_asic_set_vce_clocks(adev, 53300, 40000);
+			amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+							    AMD_CG_STATE_UNGATE);
+			amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+							    AMD_PG_STATE_UNGATE);
+
 		}
 	}
 	mutex_unlock(&adev->vce.idle_mutex);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 17/50] i2c: riic: correctly finish transfers
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (16 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 19/50] perf tools: Only increase index if perf_evsel__new_idx() succeeds Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 23/50] net: phy: dp83867: Recover from "port mirroring" N/A MODE4 Levin, Alexander (Sasha Levin)
                   ` (27 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Chris Brandt, Wolfram Sang, Levin, Alexander (Sasha Levin)

From: Chris Brandt <chris.brandt@renesas.com>

[ Upstream commit 71ccea095ea1d4efd004dab971be6d599e06fc3f ]

This fixes the condition where the controller has not fully completed its
final transfer and leaves the bus and controller in a undesirable state.

At the end of the last transmitted byte, the existing driver would just
signal for a STOP condition to be transmitted then immediately signal
completion. However, the full STOP procedure might not have fully taken
place by the time the runtime PM shuts off the peripheral clock, leaving
the bus in a suspended state.

Alternatively, the STOP condition on the bus may have completed, but when
the next transaction is requested by the upper layer, not all the
necessary register cleanup was finished from the last transfer which made
the driver return BUS BUSY when it really wasn't.

This patch now makes all transmit and receive transactions wait for the
STOP condition to fully complete before signaling a completed transaction.
With this new method, runtime PM no longer seems to be an issue.

Fixes: 310c18a41450 ("i2c: riic: add driver")
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/i2c/busses/i2c-riic.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
index 6263ea82d6ac..8f11d347b3ec 100644
--- a/drivers/i2c/busses/i2c-riic.c
+++ b/drivers/i2c/busses/i2c-riic.c
@@ -80,6 +80,7 @@
 #define ICIER_TEIE	0x40
 #define ICIER_RIE	0x20
 #define ICIER_NAKIE	0x10
+#define ICIER_SPIE	0x08
 
 #define ICSR2_NACKF	0x10
 
@@ -216,11 +217,10 @@ static irqreturn_t riic_tend_isr(int irq, void *data)
 		return IRQ_NONE;
 	}
 
-	if (riic->is_last || riic->err)
+	if (riic->is_last || riic->err) {
+		riic_clear_set_bit(riic, 0, ICIER_SPIE, RIIC_ICIER);
 		writeb(ICCR2_SP, riic->base + RIIC_ICCR2);
-
-	writeb(0, riic->base + RIIC_ICIER);
-	complete(&riic->msg_done);
+	}
 
 	return IRQ_HANDLED;
 }
@@ -240,13 +240,13 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data)
 
 	if (riic->bytes_left == 1) {
 		/* STOP must come before we set ACKBT! */
-		if (riic->is_last)
+		if (riic->is_last) {
+			riic_clear_set_bit(riic, 0, ICIER_SPIE, RIIC_ICIER);
 			writeb(ICCR2_SP, riic->base + RIIC_ICCR2);
+		}
 
 		riic_clear_set_bit(riic, 0, ICMR3_ACKBT, RIIC_ICMR3);
 
-		writeb(0, riic->base + RIIC_ICIER);
-		complete(&riic->msg_done);
 	} else {
 		riic_clear_set_bit(riic, ICMR3_ACKBT, 0, RIIC_ICMR3);
 	}
@@ -259,6 +259,21 @@ static irqreturn_t riic_rdrf_isr(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
+static irqreturn_t riic_stop_isr(int irq, void *data)
+{
+	struct riic_dev *riic = data;
+
+	/* read back registers to confirm writes have fully propagated */
+	writeb(0, riic->base + RIIC_ICSR2);
+	readb(riic->base + RIIC_ICSR2);
+	writeb(0, riic->base + RIIC_ICIER);
+	readb(riic->base + RIIC_ICIER);
+
+	complete(&riic->msg_done);
+
+	return IRQ_HANDLED;
+}
+
 static u32 riic_func(struct i2c_adapter *adap)
 {
 	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
@@ -326,6 +341,7 @@ static struct riic_irq_desc riic_irqs[] = {
 	{ .res_num = 0, .isr = riic_tend_isr, .name = "riic-tend" },
 	{ .res_num = 1, .isr = riic_rdrf_isr, .name = "riic-rdrf" },
 	{ .res_num = 2, .isr = riic_tdre_isr, .name = "riic-tdre" },
+	{ .res_num = 3, .isr = riic_stop_isr, .name = "riic-stop" },
 	{ .res_num = 5, .isr = riic_tend_isr, .name = "riic-nack" },
 };
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 16/50] net/ena: change driver's default timeouts
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (13 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 14/50] ext4: fix stripe-unaligned allocations Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 18/50] drm/amdgpu: when dpm disabled, also need to stop/start vce Levin, Alexander (Sasha Levin)
                   ` (30 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Netanel Belgazal, David S . Miller, Levin, Alexander (Sasha Levin)

From: Netanel Belgazal <netanel@annapurnalabs.com>

[ Upstream commit 7102a18ac3f323805e3cd8f3dc64907644608c1e ]

The timeouts were too agressive and sometimes cause false alarms.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/amazon/ena/ena_com.c    | 4 ++--
 drivers/net/ethernet/amazon/ena/ena_netdev.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index 3066d9c99984..e2512ab41168 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -36,9 +36,9 @@
 /*****************************************************************************/
 
 /* Timeout in micro-sec */
-#define ADMIN_CMD_TIMEOUT_US (1000000)
+#define ADMIN_CMD_TIMEOUT_US (3000000)
 
-#define ENA_ASYNC_QUEUE_DEPTH 4
+#define ENA_ASYNC_QUEUE_DEPTH 16
 #define ENA_ADMIN_QUEUE_DEPTH 32
 
 #define MIN_ENA_VER (((ENA_COMMON_SPEC_VERSION_MAJOR) << \
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 69d7e9ed5bc8..c5eaf7616939 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -100,7 +100,7 @@
 /* Number of queues to check for missing queues per timer service */
 #define ENA_MONITORED_TX_QUEUES	4
 /* Max timeout packets before device reset */
-#define MAX_NUM_OF_TIMEOUTED_PACKETS 32
+#define MAX_NUM_OF_TIMEOUTED_PACKETS 128
 
 #define ENA_TX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1))
 
@@ -116,9 +116,9 @@
 #define ENA_IO_IRQ_IDX(q)		(ENA_IO_IRQ_FIRST_IDX + (q))
 
 /* ENA device should send keep alive msg every 1 sec.
- * We wait for 3 sec just to be on the safe side.
+ * We wait for 6 sec just to be on the safe side.
  */
-#define ENA_DEVICE_KALIVE_TIMEOUT	(3 * HZ)
+#define ENA_DEVICE_KALIVE_TIMEOUT	(6 * HZ)
 
 #define ENA_MMIO_DISABLE_REG_READ	BIT(0)
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 23/50] net: phy: dp83867: Recover from "port mirroring" N/A MODE4
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (17 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 17/50] i2c: riic: correctly finish transfers Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 22/50] clocksource/drivers/arm_arch_timer: Add dt binding for hisilicon-161010101 erratum Levin, Alexander (Sasha Levin)
                   ` (26 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Lukasz Majewski, David S . Miller, Levin, Alexander (Sasha Levin)

From: Lukasz Majewski <lukma@denx.de>

[ Upstream commit ac6e058b75be71208e98a5808453aae9a17be480 ]

The DP83867 when not properly bootstrapped - especially with LED_0 pin -
can enter N/A MODE4 for "port mirroring" feature.

To provide normal operation of the PHY, one needs not only to explicitly
disable the port mirroring feature, but as well stop some IC internal
testing (which disables RGMII communication).

To do that the STRAP_STS1 (0x006E) register must be read and RESERVED bit
11 examined. When it is set, the another RESERVED bit (11) at PHYCR
(0x0010) register must be clear to disable testing mode and enable RGMII
communication.

Thorough explanation of the problem can be found at following e2e thread:
"DP83867IR: Problem with RESERVED bits in PHY Control Register (PHYCR) -
Linux driver"

https://e2e.ti.com/support/interface/ethernet/f/903/p/571313/2096954#2096954

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/phy/dp83867.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 01cf094bee18..8f8496102926 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -33,6 +33,7 @@
 
 /* Extended Registers */
 #define DP83867_RGMIICTL	0x0032
+#define DP83867_STRAP_STS1	0x006E
 #define DP83867_RGMIIDCTL	0x0086
 
 #define DP83867_SW_RESET	BIT(15)
@@ -56,9 +57,13 @@
 #define DP83867_RGMII_TX_CLK_DELAY_EN		BIT(1)
 #define DP83867_RGMII_RX_CLK_DELAY_EN		BIT(0)
 
+/* STRAP_STS1 bits */
+#define DP83867_STRAP_STS1_RESERVED		BIT(11)
+
 /* PHY CTRL bits */
 #define DP83867_PHYCR_FIFO_DEPTH_SHIFT		14
 #define DP83867_PHYCR_FIFO_DEPTH_MASK		(3 << 14)
+#define DP83867_PHYCR_RESERVED_MASK		BIT(11)
 
 /* RGMIIDCTL bits */
 #define DP83867_RGMII_TX_CLK_DELAY_SHIFT	4
@@ -141,7 +146,7 @@ static int dp83867_of_init(struct phy_device *phydev)
 static int dp83867_config_init(struct phy_device *phydev)
 {
 	struct dp83867_private *dp83867;
-	int ret, val;
+	int ret, val, bs;
 	u16 delay;
 
 	if (!phydev->priv) {
@@ -164,6 +169,22 @@ static int dp83867_config_init(struct phy_device *phydev)
 			return val;
 		val &= ~DP83867_PHYCR_FIFO_DEPTH_MASK;
 		val |= (dp83867->fifo_depth << DP83867_PHYCR_FIFO_DEPTH_SHIFT);
+
+		/* The code below checks if "port mirroring" N/A MODE4 has been
+		 * enabled during power on bootstrap.
+		 *
+		 * Such N/A mode enabled by mistake can put PHY IC in some
+		 * internal testing mode and disable RGMII transmission.
+		 *
+		 * In this particular case one needs to check STRAP_STS1
+		 * register's bit 11 (marked as RESERVED).
+		 */
+
+		bs = phy_read_mmd_indirect(phydev, DP83867_STRAP_STS1,
+					   DP83867_DEVADDR);
+		if (bs & DP83867_STRAP_STS1_RESERVED)
+			val &= ~DP83867_PHYCR_RESERVED_MASK;
+
 		ret = phy_write(phydev, MII_DP83867_PHYCTRL, val);
 		if (ret)
 			return ret;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 20/50] iwlwifi: mvm: use the PROBE_RESP_QUEUE to send deauth to unknown station
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (19 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 22/50] clocksource/drivers/arm_arch_timer: Add dt binding for hisilicon-161010101 erratum Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 21/50] drm/fsl-dcu: check for clk_prepare_enable() error Levin, Alexander (Sasha Levin)
                   ` (24 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Emmanuel Grumbach, Luca Coelho, Levin, Alexander (Sasha Levin)

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

[ Upstream commit d45cb20e123c5d7d6cd56301bc98f0bfd725cd77 ]

When we send a deauth to a station we don't know about, we
need to use the PROBE_RESP queue. This can happen when we
send a deauth to a station that is not associated to us.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index 0556d139b719..092ae0024f22 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -499,15 +499,17 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
 	switch (info->control.vif->type) {
 	case NL80211_IFTYPE_AP:
 		/*
-		 * handle legacy hostapd as well, where station may be added
-		 * only after assoc.
+		 * Handle legacy hostapd as well, where station may be added
+		 * only after assoc. Take care of the case where we send a
+		 * deauth to a station that we don't have.
 		 */
-		if (ieee80211_is_probe_resp(fc) || ieee80211_is_auth(fc))
+		if (ieee80211_is_probe_resp(fc) || ieee80211_is_auth(fc) ||
+		    ieee80211_is_deauth(fc))
 			return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
 		if (info->hw_queue == info->control.vif->cab_queue)
 			return info->hw_queue;
 
-		WARN_ON_ONCE(1);
+		WARN_ONCE(1, "fc=0x%02x", le16_to_cpu(fc));
 		return IWL_MVM_DQA_AP_PROBE_RESP_QUEUE;
 	case NL80211_IFTYPE_P2P_DEVICE:
 		if (ieee80211_is_mgmt(fc))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 22/50] clocksource/drivers/arm_arch_timer: Add dt binding for hisilicon-161010101 erratum
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (18 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 23/50] net: phy: dp83867: Recover from "port mirroring" N/A MODE4 Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 20/50] iwlwifi: mvm: use the PROBE_RESP_QUEUE to send deauth to unknown station Levin, Alexander (Sasha Levin)
                   ` (25 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ding Tianhong, Mark Rutland, Daniel Lezcano, Levin,
	Alexander (Sasha Levin)

From: Ding Tianhong <dingtianhong@huawei.com>

[ Upstream commit 729e55225b1f6225ee7a2a358d5141a3264627c4 ]

This erratum describes a bug in logic outside the core, so MIDR can't be
used to identify its presence, and reading an SoC-specific revision
register from common arch timer code would be awkward.  So, describe it
in the device tree.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 Documentation/devicetree/bindings/arm/arch_timer.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/arch_timer.txt b/Documentation/devicetree/bindings/arm/arch_timer.txt
index ad440a2b8051..e926aea1147d 100644
--- a/Documentation/devicetree/bindings/arm/arch_timer.txt
+++ b/Documentation/devicetree/bindings/arm/arch_timer.txt
@@ -31,6 +31,12 @@ to deliver its interrupts via SPIs.
   This also affects writes to the tval register, due to the implicit
   counter read.
 
+- hisilicon,erratum-161010101 : A boolean property. Indicates the
+  presence of Hisilicon erratum 161010101, which says that reading the
+  counters is unreliable in some cases, and reads may return a value 32
+  beyond the correct value. This also affects writes to the tval
+  registers, due to the implicit counter read.
+
 ** Optional properties:
 
 - arm,cpu-registers-not-fw-configured : Firmware does not initialize
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 21/50] drm/fsl-dcu: check for clk_prepare_enable() error
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (20 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 20/50] iwlwifi: mvm: use the PROBE_RESP_QUEUE to send deauth to unknown station Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 28/50] mtd: nand: sunxi: Fix the non-polling case in sunxi_nfc_wait_events() Levin, Alexander (Sasha Levin)
                   ` (23 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Fabio Estevam, Stefan Agner, Levin, Alexander (Sasha Levin)

From: Fabio Estevam <fabio.estevam@nxp.com>

[ Upstream commit ef15d36154cc741d7ded4ae4fa0cf7987354e313 ]

clk_prepare_enable() may fail, so we should better check its return
value.

Also place the of_node_put() function right after clk_prepare_enable(),
in order to avoid calling of_node_put() twice in case clk_prepare_enable()
fails.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
index 3194e544ee27..faacc813254c 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
@@ -89,9 +89,13 @@ struct fsl_tcon *fsl_tcon_init(struct device *dev)
 		goto err_node_put;
 	}
 
-	of_node_put(np);
-	clk_prepare_enable(tcon->ipg_clk);
+	ret = clk_prepare_enable(tcon->ipg_clk);
+	if (ret) {
+		dev_err(dev, "Couldn't enable the TCON clock\n");
+		goto err_node_put;
+	}
 
+	of_node_put(np);
 	dev_info(dev, "Using TCON in bypass mode\n");
 
 	return tcon;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 24/50] [media] cx231xx: Fix I2C on Internal Master 3 Bus
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (24 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 26/50] clk: sunxi-ng: Check kzalloc() for errors and cleanup error path Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 27/50] drm/msm/dsi: Set msm_dsi->encoders before initializing bridge Levin, Alexander (Sasha Levin)
                   ` (19 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Oleh Kravchenko, Mauro Carvalho Chehab, Levin, Alexander (Sasha Levin)

From: Oleh Kravchenko <oleg@kaa.org.ua>

[ Upstream commit 6c5da8031a3abfad259190d35f83d89568b72ee2 ]

Internal Master 3 Bus can send and receive only 4 bytes per time.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/media/usb/cx231xx/cx231xx-core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index 8b099fe1d592..71b65ab573ac 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -356,7 +356,12 @@ int cx231xx_send_vendor_cmd(struct cx231xx *dev,
 	 */
 	if ((ven_req->wLength > 4) && ((ven_req->bRequest == 0x4) ||
 					(ven_req->bRequest == 0x5) ||
-					(ven_req->bRequest == 0x6))) {
+					(ven_req->bRequest == 0x6) ||
+
+					/* Internal Master 3 Bus can send
+					 * and receive only 4 bytes per time
+					 */
+					(ven_req->bRequest == 0x2))) {
 		unsend_size = 0;
 		pdata = ven_req->pBuff;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 26/50] clk: sunxi-ng: Check kzalloc() for errors and cleanup error path
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (23 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 25/50] ath10k: fix reading sram contents for QCA4019 Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 24/50] [media] cx231xx: Fix I2C on Internal Master 3 Bus Levin, Alexander (Sasha Levin)
                   ` (20 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Stephen Boyd, Chen-Yu Tsai, Levin, Alexander (Sasha Levin)

From: Stephen Boyd <sboyd@codeaurora.org>

[ Upstream commit 5d806f9fc8e63d7a44e0fd1ef26a7c27efae0e51 ]

This kzalloc() could fail. Let's bail out with -ENOMEM here
instead of NULL dereferencing. That silences static checkers. We
should also cleanup on the error path even though this function
returning an error probably means the system won't boot.

Cc: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/clk/sunxi-ng/ccu_common.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/clk/sunxi-ng/ccu_common.c b/drivers/clk/sunxi-ng/ccu_common.c
index 51d4bac97ab3..01d0594c9716 100644
--- a/drivers/clk/sunxi-ng/ccu_common.c
+++ b/drivers/clk/sunxi-ng/ccu_common.c
@@ -70,6 +70,11 @@ int sunxi_ccu_probe(struct device_node *node, void __iomem *reg,
 		goto err_clk_unreg;
 
 	reset = kzalloc(sizeof(*reset), GFP_KERNEL);
+	if (!reset) {
+		ret = -ENOMEM;
+		goto err_alloc_reset;
+	}
+
 	reset->rcdev.of_node = node;
 	reset->rcdev.ops = &ccu_reset_ops;
 	reset->rcdev.owner = THIS_MODULE;
@@ -85,6 +90,16 @@ int sunxi_ccu_probe(struct device_node *node, void __iomem *reg,
 	return 0;
 
 err_of_clk_unreg:
+	kfree(reset);
+err_alloc_reset:
+	of_clk_del_provider(node);
 err_clk_unreg:
+	while (--i >= 0) {
+		struct clk_hw *hw = desc->hw_clks->hws[i];
+
+		if (!hw)
+			continue;
+		clk_hw_unregister(hw);
+	}
 	return ret;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 25/50] ath10k: fix reading sram contents for QCA4019
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (22 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 28/50] mtd: nand: sunxi: Fix the non-polling case in sunxi_nfc_wait_events() Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 26/50] clk: sunxi-ng: Check kzalloc() for errors and cleanup error path Levin, Alexander (Sasha Levin)
                   ` (21 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ashok Raj Nagarajan, Kalle Valo, Levin, Alexander (Sasha Levin)

From: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>

[ Upstream commit 7f622593cc5add77a99cd39404e8a851be9de792 ]

With QCA4019 platform, SRAM address can be accessed directly from host but
currently, we are assuming sram addresses cannot be accessed directly and
hence we convert the addresses.

While there, clean up growing hw checks during conversion of target CPU
address to CE address. Now we have function pointer pertaining to different
chips.

Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/wireless/ath/ath10k/ahb.c | 23 ++++++++++++++++
 drivers/net/wireless/ath/ath10k/pci.c | 51 ++++++++++++++++++++++-------------
 drivers/net/wireless/ath/ath10k/pci.h |  5 ++++
 3 files changed, 60 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c
index 766c63bf05c4..45226dbee5ce 100644
--- a/drivers/net/wireless/ath/ath10k/ahb.c
+++ b/drivers/net/wireless/ath/ath10k/ahb.c
@@ -33,6 +33,9 @@ static const struct of_device_id ath10k_ahb_of_match[] = {
 
 MODULE_DEVICE_TABLE(of, ath10k_ahb_of_match);
 
+#define QCA4019_SRAM_ADDR      0x000C0000
+#define QCA4019_SRAM_LEN       0x00040000 /* 256 kb */
+
 static inline struct ath10k_ahb *ath10k_ahb_priv(struct ath10k *ar)
 {
 	return &((struct ath10k_pci *)ar->drv_priv)->ahb[0];
@@ -699,6 +702,25 @@ static int ath10k_ahb_hif_power_up(struct ath10k *ar)
 	return ret;
 }
 
+static u32 ath10k_ahb_qca4019_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
+{
+	u32 val = 0, region = addr & 0xfffff;
+
+	val = ath10k_pci_read32(ar, PCIE_BAR_REG_ADDRESS);
+
+	if (region >= QCA4019_SRAM_ADDR && region <=
+	    (QCA4019_SRAM_ADDR + QCA4019_SRAM_LEN)) {
+		/* SRAM contents for QCA4019 can be directly accessed and
+		 * no conversions are required
+		 */
+		val |= region;
+	} else {
+		val |= 0x100000 | region;
+	}
+
+	return val;
+}
+
 static const struct ath10k_hif_ops ath10k_ahb_hif_ops = {
 	.tx_sg                  = ath10k_pci_hif_tx_sg,
 	.diag_read              = ath10k_pci_hif_diag_read,
@@ -766,6 +788,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev)
 	ar_pci->mem_len = ar_ahb->mem_len;
 	ar_pci->ar = ar;
 	ar_pci->bus_ops = &ath10k_ahb_bus_ops;
+	ar_pci->targ_cpu_to_ce_addr = ath10k_ahb_qca4019_targ_cpu_to_ce_addr;
 
 	ret = ath10k_pci_setup_resource(ar);
 	if (ret) {
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 410bcdaa9e87..25b8d501d437 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -840,31 +840,35 @@ void ath10k_pci_rx_replenish_retry(unsigned long ptr)
 	ath10k_pci_rx_post(ar);
 }
 
-static u32 ath10k_pci_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
+static u32 ath10k_pci_qca988x_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
 {
-	u32 val = 0;
+	u32 val = 0, region = addr & 0xfffff;
 
-	switch (ar->hw_rev) {
-	case ATH10K_HW_QCA988X:
-	case ATH10K_HW_QCA9887:
-	case ATH10K_HW_QCA6174:
-	case ATH10K_HW_QCA9377:
-		val = (ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
-					  CORE_CTRL_ADDRESS) &
-		       0x7ff) << 21;
-		break;
-	case ATH10K_HW_QCA9888:
-	case ATH10K_HW_QCA99X0:
-	case ATH10K_HW_QCA9984:
-	case ATH10K_HW_QCA4019:
-		val = ath10k_pci_read32(ar, PCIE_BAR_REG_ADDRESS);
-		break;
-	}
+	val = (ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + CORE_CTRL_ADDRESS)
+				 & 0x7ff) << 21;
+	val |= 0x100000 | region;
+	return val;
+}
+
+static u32 ath10k_pci_qca99x0_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
+{
+	u32 val = 0, region = addr & 0xfffff;
 
-	val |= 0x100000 | (addr & 0xfffff);
+	val = ath10k_pci_read32(ar, PCIE_BAR_REG_ADDRESS);
+	val |= 0x100000 | region;
 	return val;
 }
 
+static u32 ath10k_pci_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
+{
+	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
+
+	if (WARN_ON_ONCE(!ar_pci->targ_cpu_to_ce_addr))
+		return -ENOTSUPP;
+
+	return ar_pci->targ_cpu_to_ce_addr(ar, addr);
+}
+
 /*
  * Diagnostic read/write access is provided for startup/config/debug usage.
  * Caller must guarantee proper alignment, when applicable, and single user
@@ -3171,6 +3175,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 	bool pci_ps;
 	int (*pci_soft_reset)(struct ath10k *ar);
 	int (*pci_hard_reset)(struct ath10k *ar);
+	u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr);
 
 	switch (pci_dev->device) {
 	case QCA988X_2_0_DEVICE_ID:
@@ -3178,12 +3183,14 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		pci_ps = false;
 		pci_soft_reset = ath10k_pci_warm_reset;
 		pci_hard_reset = ath10k_pci_qca988x_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca988x_targ_cpu_to_ce_addr;
 		break;
 	case QCA9887_1_0_DEVICE_ID:
 		hw_rev = ATH10K_HW_QCA9887;
 		pci_ps = false;
 		pci_soft_reset = ath10k_pci_warm_reset;
 		pci_hard_reset = ath10k_pci_qca988x_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca988x_targ_cpu_to_ce_addr;
 		break;
 	case QCA6164_2_1_DEVICE_ID:
 	case QCA6174_2_1_DEVICE_ID:
@@ -3191,30 +3198,35 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		pci_ps = true;
 		pci_soft_reset = ath10k_pci_warm_reset;
 		pci_hard_reset = ath10k_pci_qca6174_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca988x_targ_cpu_to_ce_addr;
 		break;
 	case QCA99X0_2_0_DEVICE_ID:
 		hw_rev = ATH10K_HW_QCA99X0;
 		pci_ps = false;
 		pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
 		pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca99x0_targ_cpu_to_ce_addr;
 		break;
 	case QCA9984_1_0_DEVICE_ID:
 		hw_rev = ATH10K_HW_QCA9984;
 		pci_ps = false;
 		pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
 		pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca99x0_targ_cpu_to_ce_addr;
 		break;
 	case QCA9888_2_0_DEVICE_ID:
 		hw_rev = ATH10K_HW_QCA9888;
 		pci_ps = false;
 		pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
 		pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca99x0_targ_cpu_to_ce_addr;
 		break;
 	case QCA9377_1_0_DEVICE_ID:
 		hw_rev = ATH10K_HW_QCA9377;
 		pci_ps = true;
 		pci_soft_reset = NULL;
 		pci_hard_reset = ath10k_pci_qca6174_chip_reset;
+		targ_cpu_to_ce_addr = ath10k_pci_qca988x_targ_cpu_to_ce_addr;
 		break;
 	default:
 		WARN_ON(1);
@@ -3241,6 +3253,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 	ar_pci->bus_ops = &ath10k_pci_bus_ops;
 	ar_pci->pci_soft_reset = pci_soft_reset;
 	ar_pci->pci_hard_reset = pci_hard_reset;
+	ar_pci->targ_cpu_to_ce_addr = targ_cpu_to_ce_addr;
 
 	ar->id.vendor = pdev->vendor;
 	ar->id.device = pdev->device;
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 9854ad56b2de..577bb87ab2f6 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -238,6 +238,11 @@ struct ath10k_pci {
 	/* Chip specific pci full reset function */
 	int (*pci_hard_reset)(struct ath10k *ar);
 
+	/* chip specific methods for converting target CPU virtual address
+	 * space to CE address space
+	 */
+	u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr);
+
 	/* Keep this entry in the last, memory for struct ath10k_ahb is
 	 * allocated (ahb support enabled case) in the continuation of
 	 * this struct.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 27/50] drm/msm/dsi: Set msm_dsi->encoders before initializing bridge
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (25 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 24/50] [media] cx231xx: Fix I2C on Internal Master 3 Bus Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf() Levin, Alexander (Sasha Levin)
                   ` (18 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Archit Taneja, Laurent Pinchart, Rob Clark, Levin,
	Alexander (Sasha Levin)

From: Archit Taneja <architt@codeaurora.org>

[ Upstream commit 0bb70b82c2f91e4667f3c617505235efd6d77e46 ]

The commit "drm: bridge: Link encoder and bridge in core code" updated
the drm_bridge_attach() API to also include the drm_encoder pointer
the bridge attaches to.

The func msm_dsi_manager_bridge_init() now relies on the drm_encoder
pointer stored in msm_dsi->encoders to pass the encoder to the bridge
API.

msm_dsi->encoders is unfortunately set after this function is called,
resulting in us passing a NULL pointer to drm_brigde_attach. This
results in an error and the DSI driver probe fails.

Move the initialization of msm_dsi->encoders[] a bit up. Also, don't
try to set the encoder's bridge. That's now managed by the bridge
API.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/msm/dsi/dsi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index ec572f8389ed..9593238ccc1b 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -205,6 +205,9 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
 		goto fail;
 	}
 
+	for (i = 0; i < MSM_DSI_ENCODER_NUM; i++)
+		msm_dsi->encoders[i] = encoders[i];
+
 	msm_dsi->bridge = msm_dsi_manager_bridge_init(msm_dsi->id);
 	if (IS_ERR(msm_dsi->bridge)) {
 		ret = PTR_ERR(msm_dsi->bridge);
@@ -213,11 +216,6 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
 		goto fail;
 	}
 
-	for (i = 0; i < MSM_DSI_ENCODER_NUM; i++) {
-		encoders[i]->bridge = msm_dsi->bridge;
-		msm_dsi->encoders[i] = encoders[i];
-	}
-
 	/*
 	 * check if the dsi encoder output is connected to a panel or an
 	 * external bridge. We create a connector only if we're connected to a
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 28/50] mtd: nand: sunxi: Fix the non-polling case in sunxi_nfc_wait_events()
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (21 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 21/50] drm/fsl-dcu: check for clk_prepare_enable() error Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 25/50] ath10k: fix reading sram contents for QCA4019 Levin, Alexander (Sasha Levin)
                   ` (22 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Boris Brezillon, Levin, Alexander (Sasha Levin)

From: Boris Brezillon <boris.brezillon@free-electrons.com>

[ Upstream commit 19649e2c16fbc94b664f7074ec4fa9f15292fdce ]

wait_for_completion_timeout() returns 0 if a timeout occurred, 1
otherwise. Fix the sunxi_nfc_wait_events() accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/mtd/nand/sunxi_nand.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index 8b8470c4e6d0..f9b2a771096b 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -320,6 +320,10 @@ static int sunxi_nfc_wait_events(struct sunxi_nfc *nfc, u32 events,
 
 		ret = wait_for_completion_timeout(&nfc->complete,
 						msecs_to_jiffies(timeout_ms));
+		if (!ret)
+			ret = -ETIMEDOUT;
+		else
+			ret = 0;
 
 		writel(0, nfc->regs + NFC_REG_INT);
 	} else {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 29/50] dmaengine: sun6i: allow build on ARM64 platforms (sun50i)
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (27 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf() Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 32/50] scsi: aacraid: Process Error for response I/O Levin, Alexander (Sasha Levin)
                   ` (16 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Icenowy Zheng, Vinod Koul, Levin, Alexander (Sasha Levin)

From: Icenowy Zheng <icenowy@aosc.xyz>

[ Upstream commit c429ceb1e18252122ba96b52e689dcf87103c186 ]

As 64-bit Allwinner H5 SoC has the same DMA engine with H3, the DMA
driver should be allowed to be built for ARM64, in order to make it work on H5.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/dma/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 141aefbe37ec..4e4294f2f2ac 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -157,7 +157,7 @@ config DMA_SUN4I
 
 config DMA_SUN6I
 	tristate "Allwinner A31 SoCs DMA support"
-	depends on MACH_SUN6I || MACH_SUN8I || COMPILE_TEST
+	depends on MACH_SUN6I || MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
 	depends on RESET_CONTROLLER
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf()
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (26 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 27/50] drm/msm/dsi: Set msm_dsi->encoders before initializing bridge Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-10 12:49   ` Boris Ostrovsky
  2017-10-07 22:36 ` [PATCH review for 4.9 29/50] dmaengine: sun6i: allow build on ARM64 platforms (sun50i) Levin, Alexander (Sasha Levin)
                   ` (17 subsequent siblings)
  45 siblings, 1 reply; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jan Beulich, Jan Beulich, Boris Ostrovsky, Levin,
	Alexander (Sasha Levin)

From: Jan Beulich <JBeulich@suse.com>

[ Upstream commit 4fed1b125eb6252bde478665fc05d4819f774fa8 ]

A negative return value indicates an error; in fact the function at
present won't ever return zero.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/xen/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 26e5e8507f03..357a8db859c9 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -277,7 +277,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
 	err = xenbus_transaction_start(&xbt);
 	if (err)
 		return;
-	if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) {
+	if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) {
 		pr_err("Unable to read sysrq code in control/sysrq\n");
 		xenbus_transaction_end(xbt, 1);
 		return;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 32/50] scsi: aacraid: Process Error for response I/O
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (28 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 29/50] dmaengine: sun6i: allow build on ARM64 platforms (sun50i) Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 30/50] gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build error Levin, Alexander (Sasha Levin)
                   ` (15 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Raghava Aditya Renukunta, Dave Carroll, Martin K . Petersen,
	Levin, Alexander (Sasha Levin)

From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>

[ Upstream commit 4ec57fb4edaec523f0f78a0449a3b063749ac58b ]

Make sure that the driver processes error conditions even in the fast
response path for response from the adapter.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Dave Carroll <David.Carroll@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/scsi/aacraid/aachba.c | 289 ++++++++++++++++++++++--------------------
 1 file changed, 151 insertions(+), 138 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 6678d1fd897b..065f11a1964d 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -2954,16 +2954,11 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
 		return;
 
 	BUG_ON(fibptr == NULL);
-	dev = fibptr->dev;
-
-	scsi_dma_unmap(scsicmd);
 
-	/* expose physical device if expose_physicald flag is on */
-	if (scsicmd->cmnd[0] == INQUIRY && !(scsicmd->cmnd[1] & 0x01)
-	  && expose_physicals > 0)
-		aac_expose_phy_device(scsicmd);
+	dev = fibptr->dev;
 
 	srbreply = (struct aac_srb_reply *) fib_data(fibptr);
+
 	scsicmd->sense_buffer[0] = '\0';  /* Initialize sense valid flag to false */
 
 	if (fibptr->flags & FIB_CONTEXT_FLAG_FASTRESP) {
@@ -2976,158 +2971,176 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
 		 */
 		scsi_set_resid(scsicmd, scsi_bufflen(scsicmd)
 				   - le32_to_cpu(srbreply->data_xfer_length));
-		/*
-		 * First check the fib status
-		 */
+	}
 
-		if (le32_to_cpu(srbreply->status) != ST_OK) {
-			int len;
 
-			printk(KERN_WARNING "aac_srb_callback: srb failed, status = %d\n", le32_to_cpu(srbreply->status));
-			len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
-				    SCSI_SENSE_BUFFERSIZE);
-			scsicmd->result = DID_ERROR << 16
-						| COMMAND_COMPLETE << 8
-						| SAM_STAT_CHECK_CONDITION;
-			memcpy(scsicmd->sense_buffer,
-					srbreply->sense_data, len);
-		}
+	scsi_dma_unmap(scsicmd);
 
-		/*
-		 * Next check the srb status
-		 */
-		switch ((le32_to_cpu(srbreply->srb_status))&0x3f) {
-		case SRB_STATUS_ERROR_RECOVERY:
-		case SRB_STATUS_PENDING:
-		case SRB_STATUS_SUCCESS:
-			scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-			break;
-		case SRB_STATUS_DATA_OVERRUN:
-			switch (scsicmd->cmnd[0]) {
-			case  READ_6:
-			case  WRITE_6:
-			case  READ_10:
-			case  WRITE_10:
-			case  READ_12:
-			case  WRITE_12:
-			case  READ_16:
-			case  WRITE_16:
-				if (le32_to_cpu(srbreply->data_xfer_length)
-							< scsicmd->underflow)
-					printk(KERN_WARNING"aacraid: SCSI CMD underflow\n");
-				else
-					printk(KERN_WARNING"aacraid: SCSI CMD Data Overrun\n");
-				scsicmd->result = DID_ERROR << 16
-							| COMMAND_COMPLETE << 8;
-				break;
-			case INQUIRY: {
-				scsicmd->result = DID_OK << 16
-							| COMMAND_COMPLETE << 8;
-				break;
-			}
-			default:
-				scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-				break;
-			}
-			break;
-		case SRB_STATUS_ABORTED:
-			scsicmd->result = DID_ABORT << 16 | ABORT << 8;
-			break;
-		case SRB_STATUS_ABORT_FAILED:
-			/*
-			 * Not sure about this one - but assuming the
-			 * hba was trying to abort for some reason
-			 */
-			scsicmd->result = DID_ERROR << 16 | ABORT << 8;
-			break;
-		case SRB_STATUS_PARITY_ERROR:
-			scsicmd->result = DID_PARITY << 16
-						| MSG_PARITY_ERROR << 8;
-			break;
-		case SRB_STATUS_NO_DEVICE:
-		case SRB_STATUS_INVALID_PATH_ID:
-		case SRB_STATUS_INVALID_TARGET_ID:
-		case SRB_STATUS_INVALID_LUN:
-		case SRB_STATUS_SELECTION_TIMEOUT:
-			scsicmd->result = DID_NO_CONNECT << 16
-						| COMMAND_COMPLETE << 8;
-			break;
+	/* expose physical device if expose_physicald flag is on */
+	if (scsicmd->cmnd[0] == INQUIRY && !(scsicmd->cmnd[1] & 0x01)
+	  && expose_physicals > 0)
+		aac_expose_phy_device(scsicmd);
 
-		case SRB_STATUS_COMMAND_TIMEOUT:
-		case SRB_STATUS_TIMEOUT:
-			scsicmd->result = DID_TIME_OUT << 16
-						| COMMAND_COMPLETE << 8;
-			break;
+	/*
+	 * First check the fib status
+	 */
 
-		case SRB_STATUS_BUSY:
-			scsicmd->result = DID_BUS_BUSY << 16
-						| COMMAND_COMPLETE << 8;
-			break;
+	if (le32_to_cpu(srbreply->status) != ST_OK) {
+		int len;
 
-		case SRB_STATUS_BUS_RESET:
-			scsicmd->result = DID_RESET << 16
-						| COMMAND_COMPLETE << 8;
-			break;
+		pr_warn("aac_srb_callback: srb failed, status = %d\n",
+				le32_to_cpu(srbreply->status));
+		len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
+			    SCSI_SENSE_BUFFERSIZE);
+		scsicmd->result = DID_ERROR << 16
+				| COMMAND_COMPLETE << 8
+				| SAM_STAT_CHECK_CONDITION;
+		memcpy(scsicmd->sense_buffer,
+				srbreply->sense_data, len);
+	}
 
-		case SRB_STATUS_MESSAGE_REJECTED:
+	/*
+	 * Next check the srb status
+	 */
+	switch ((le32_to_cpu(srbreply->srb_status))&0x3f) {
+	case SRB_STATUS_ERROR_RECOVERY:
+	case SRB_STATUS_PENDING:
+	case SRB_STATUS_SUCCESS:
+		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
+		break;
+	case SRB_STATUS_DATA_OVERRUN:
+		switch (scsicmd->cmnd[0]) {
+		case  READ_6:
+		case  WRITE_6:
+		case  READ_10:
+		case  WRITE_10:
+		case  READ_12:
+		case  WRITE_12:
+		case  READ_16:
+		case  WRITE_16:
+			if (le32_to_cpu(srbreply->data_xfer_length)
+						< scsicmd->underflow)
+				pr_warn("aacraid: SCSI CMD underflow\n");
+			else
+				pr_warn("aacraid: SCSI CMD Data Overrun\n");
 			scsicmd->result = DID_ERROR << 16
-						| MESSAGE_REJECT << 8;
+					| COMMAND_COMPLETE << 8;
+			break;
+		case INQUIRY:
+			scsicmd->result = DID_OK << 16
+					| COMMAND_COMPLETE << 8;
 			break;
-		case SRB_STATUS_REQUEST_FLUSHED:
-		case SRB_STATUS_ERROR:
-		case SRB_STATUS_INVALID_REQUEST:
-		case SRB_STATUS_REQUEST_SENSE_FAILED:
-		case SRB_STATUS_NO_HBA:
-		case SRB_STATUS_UNEXPECTED_BUS_FREE:
-		case SRB_STATUS_PHASE_SEQUENCE_FAILURE:
-		case SRB_STATUS_BAD_SRB_BLOCK_LENGTH:
-		case SRB_STATUS_DELAYED_RETRY:
-		case SRB_STATUS_BAD_FUNCTION:
-		case SRB_STATUS_NOT_STARTED:
-		case SRB_STATUS_NOT_IN_USE:
-		case SRB_STATUS_FORCE_ABORT:
-		case SRB_STATUS_DOMAIN_VALIDATION_FAIL:
 		default:
+			scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
+			break;
+		}
+		break;
+	case SRB_STATUS_ABORTED:
+		scsicmd->result = DID_ABORT << 16 | ABORT << 8;
+		break;
+	case SRB_STATUS_ABORT_FAILED:
+		/*
+		 * Not sure about this one - but assuming the
+		 * hba was trying to abort for some reason
+		 */
+		scsicmd->result = DID_ERROR << 16 | ABORT << 8;
+		break;
+	case SRB_STATUS_PARITY_ERROR:
+		scsicmd->result = DID_PARITY << 16
+				| MSG_PARITY_ERROR << 8;
+		break;
+	case SRB_STATUS_NO_DEVICE:
+	case SRB_STATUS_INVALID_PATH_ID:
+	case SRB_STATUS_INVALID_TARGET_ID:
+	case SRB_STATUS_INVALID_LUN:
+	case SRB_STATUS_SELECTION_TIMEOUT:
+		scsicmd->result = DID_NO_CONNECT << 16
+				| COMMAND_COMPLETE << 8;
+		break;
+
+	case SRB_STATUS_COMMAND_TIMEOUT:
+	case SRB_STATUS_TIMEOUT:
+		scsicmd->result = DID_TIME_OUT << 16
+				| COMMAND_COMPLETE << 8;
+		break;
+
+	case SRB_STATUS_BUSY:
+		scsicmd->result = DID_BUS_BUSY << 16
+				| COMMAND_COMPLETE << 8;
+		break;
+
+	case SRB_STATUS_BUS_RESET:
+		scsicmd->result = DID_RESET << 16
+				| COMMAND_COMPLETE << 8;
+		break;
+
+	case SRB_STATUS_MESSAGE_REJECTED:
+		scsicmd->result = DID_ERROR << 16
+				| MESSAGE_REJECT << 8;
+		break;
+	case SRB_STATUS_REQUEST_FLUSHED:
+	case SRB_STATUS_ERROR:
+	case SRB_STATUS_INVALID_REQUEST:
+	case SRB_STATUS_REQUEST_SENSE_FAILED:
+	case SRB_STATUS_NO_HBA:
+	case SRB_STATUS_UNEXPECTED_BUS_FREE:
+	case SRB_STATUS_PHASE_SEQUENCE_FAILURE:
+	case SRB_STATUS_BAD_SRB_BLOCK_LENGTH:
+	case SRB_STATUS_DELAYED_RETRY:
+	case SRB_STATUS_BAD_FUNCTION:
+	case SRB_STATUS_NOT_STARTED:
+	case SRB_STATUS_NOT_IN_USE:
+	case SRB_STATUS_FORCE_ABORT:
+	case SRB_STATUS_DOMAIN_VALIDATION_FAIL:
+	default:
 #ifdef AAC_DETAILED_STATUS_INFO
-			printk(KERN_INFO "aacraid: SRB ERROR(%u) %s scsi cmd 0x%x - scsi status 0x%x\n",
-				le32_to_cpu(srbreply->srb_status) & 0x3F,
-				aac_get_status_string(
-					le32_to_cpu(srbreply->srb_status) & 0x3F),
-				scsicmd->cmnd[0],
-				le32_to_cpu(srbreply->scsi_status));
+		pr_info("aacraid: SRB ERROR(%u) %s scsi cmd 0x%x -scsi status 0x%x\n",
+			le32_to_cpu(srbreply->srb_status) & 0x3F,
+			aac_get_status_string(
+				le32_to_cpu(srbreply->srb_status) & 0x3F),
+			scsicmd->cmnd[0],
+			le32_to_cpu(srbreply->scsi_status));
 #endif
-			if ((scsicmd->cmnd[0] == ATA_12)
-				|| (scsicmd->cmnd[0] == ATA_16)) {
-					if (scsicmd->cmnd[2] & (0x01 << 5)) {
-						scsicmd->result = DID_OK << 16
-							| COMMAND_COMPLETE << 8;
-				break;
-				} else {
-					scsicmd->result = DID_ERROR << 16
-						| COMMAND_COMPLETE << 8;
-					break;
-				}
+		/*
+		 * When the CC bit is SET by the host in ATA pass thru CDB,
+		 *  driver is supposed to return DID_OK
+		 *
+		 * When the CC bit is RESET by the host, driver should
+		 *  return DID_ERROR
+		 */
+		if ((scsicmd->cmnd[0] == ATA_12)
+			|| (scsicmd->cmnd[0] == ATA_16)) {
+
+			if (scsicmd->cmnd[2] & (0x01 << 5)) {
+				scsicmd->result = DID_OK << 16
+					| COMMAND_COMPLETE << 8;
+			break;
 			} else {
 				scsicmd->result = DID_ERROR << 16
 					| COMMAND_COMPLETE << 8;
-				break;
+			break;
 			}
+		} else {
+			scsicmd->result = DID_ERROR << 16
+				| COMMAND_COMPLETE << 8;
+			break;
 		}
-		if (le32_to_cpu(srbreply->scsi_status)
-				== SAM_STAT_CHECK_CONDITION) {
-			int len;
+	}
+	if (le32_to_cpu(srbreply->scsi_status)
+			== SAM_STAT_CHECK_CONDITION) {
+		int len;
 
-			scsicmd->result |= SAM_STAT_CHECK_CONDITION;
-			len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
-				    SCSI_SENSE_BUFFERSIZE);
+		scsicmd->result |= SAM_STAT_CHECK_CONDITION;
+		len = min_t(u32, le32_to_cpu(srbreply->sense_data_size),
+			    SCSI_SENSE_BUFFERSIZE);
 #ifdef AAC_DETAILED_STATUS_INFO
-			printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n",
-						le32_to_cpu(srbreply->status), len);
+		pr_warn("aac_srb_callback: check condition, status = %d len=%d\n",
+					le32_to_cpu(srbreply->status), len);
 #endif
-			memcpy(scsicmd->sense_buffer,
-					srbreply->sense_data, len);
-		}
+		memcpy(scsicmd->sense_buffer,
+				srbreply->sense_data, len);
 	}
+
 	/*
 	 * OR in the scsi status (already shifted up a bit)
 	 */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 30/50] gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build error
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (29 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 32/50] scsi: aacraid: Process Error for response I/O Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 34/50] staging: lustre: llite: don't invoke direct_IO for the EOF case Levin, Alexander (Sasha Levin)
                   ` (14 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Axel Lin, Linus Walleij, Levin, Alexander (Sasha Levin)

From: Axel Lin <axel.lin@ingics.com>

[ Upstream commit e8e1a5b5679b1ae1ff03a3883b011b84e7226171 ]

This driver now using devm_regmap_init/devm_regmap_init_i2c, so it needs
to select REGMAP/REGMAP_I2C accordingly.

Fixes: ("3d84fdb3f0b5 gpio: mcp23s08: use regmap")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpio/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index ed37e5908b91..12d417a4d4a8 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1187,6 +1187,8 @@ config GPIO_MCP23S08
 	tristate "Microchip MCP23xxx I/O expander"
 	depends on OF_GPIO
 	select GPIOLIB_IRQCHIP
+	select REGMAP_I2C if I2C
+	select REGMAP if SPI_MASTER
 	help
 	  SPI/I2C driver for Microchip MCP23S08/MCP23S17/MCP23008/MCP23017
 	  I/O expanders.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 33/50] platform/x86: intel_mid_thermal: Fix module autoload
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (33 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 36/50] staging: lustre: ptlrpc: skip lock if export failed Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 37/50] staging: lustre: lmv: Error not handled for lmv_find_target Levin, Alexander (Sasha Levin)
                   ` (10 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Javier Martinez Canillas, Andy Shevchenko, Levin,
	Alexander (Sasha Levin)

From: Javier Martinez Canillas <javier@osg.samsung.com>

[ Upstream commit a93151a72061e944a4915458b1b1d6d505c03bbf ]

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/platform/x86/intel_mid_thermal.ko | grep alias
$

After this patch:

$ modinfo drivers/platform/x86/intel_mid_thermal.ko | grep alias
alias:          platform:msic_thermal

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/platform/x86/intel_mid_thermal.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c
index 9f713b832ba3..5c768c4627d3 100644
--- a/drivers/platform/x86/intel_mid_thermal.c
+++ b/drivers/platform/x86/intel_mid_thermal.c
@@ -550,6 +550,7 @@ static const struct platform_device_id therm_id_table[] = {
 	{ "msic_thermal", 1 },
 	{ }
 };
+MODULE_DEVICE_TABLE(platform, therm_id_table);
 
 static struct platform_driver mid_thermal_driver = {
 	.driver = {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 34/50] staging: lustre: llite: don't invoke direct_IO for the EOF case
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (30 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 30/50] gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build error Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 35/50] staging: lustre: hsm: stack overrun in hai_dump_data_field Levin, Alexander (Sasha Levin)
                   ` (13 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Yang Sheng, James Simmons, Greg Kroah-Hartman, Levin,
	Alexander (Sasha Levin)

From: Yang Sheng <yang.sheng@intel.com>

[ Upstream commit 77759771fb95420d23876cb104ab65c022613325 ]

The function generic_file_read_iter() does not check EOF
before invoke direct_IO callback. So we have to check it
ourselves.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8969
Reviewed-on: https://review.whamcloud.com/24552
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/staging/lustre/lustre/llite/rw26.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c
index 26f3a37873a7..0cb70c3a1a0b 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -354,6 +354,10 @@ static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter)
 	if (!lli->lli_has_smd)
 		return -EBADF;
 
+	/* Check EOF by ourselves */
+	if (iov_iter_rw(iter) == READ && file_offset >= i_size_read(inode))
+		return 0;
+
 	/* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */
 	if ((file_offset & ~PAGE_MASK) || (count & ~PAGE_MASK))
 		return -EINVAL;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 35/50] staging: lustre: hsm: stack overrun in hai_dump_data_field
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (31 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 34/50] staging: lustre: llite: don't invoke direct_IO for the EOF case Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 36/50] staging: lustre: ptlrpc: skip lock if export failed Levin, Alexander (Sasha Levin)
                   ` (12 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: frank zago, James Simmons, Greg Kroah-Hartman, Levin,
	Alexander (Sasha Levin)

From: frank zago <fzago@cray.com>

[ Upstream commit 22aadb91c0a0055935109c175f5446abfb130702 ]

The function hai_dump_data_field will do a stack buffer
overrun when cat'ing /sys/fs/lustre/.../hsm/actions if an action has
some data in it.

hai_dump_data_field uses snprintf. But there is no check for
truncation, and the value returned by snprintf is used as-is.  The
coordinator code calls hai_dump_data_field with 12 bytes in the
buffer. The 6th byte of data is printed incompletely to make room for
the terminating NUL. However snprintf still returns 2, so when
hai_dump_data_field writes the final NUL, it does it outside the
reserved buffer, in the 13th byte of the buffer. This stack buffer
overrun hangs my VM.

Fix by checking that there is enough room for the next 2 characters
plus the NUL terminator. Don't print half bytes. Change the format to
02X instead of .2X, which makes more sense.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8171
Reviewed-on: http://review.whamcloud.com/20338
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jean-Baptiste Riaux <riaux.jb@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 .../staging/lustre/lustre/include/lustre/lustre_user.h | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 6fc985571cba..e533088c017c 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -1213,23 +1213,21 @@ struct hsm_action_item {
  * \retval buffer
  */
 static inline char *hai_dump_data_field(struct hsm_action_item *hai,
-					char *buffer, int len)
+					char *buffer, size_t len)
 {
-	int i, sz, data_len;
+	int i, data_len;
 	char *ptr;
 
 	ptr = buffer;
-	sz = len;
 	data_len = hai->hai_len - sizeof(*hai);
-	for (i = 0 ; (i < data_len) && (sz > 0) ; i++) {
-		int cnt;
-
-		cnt = snprintf(ptr, sz, "%.2X",
-			       (unsigned char)hai->hai_data[i]);
-		ptr += cnt;
-		sz -= cnt;
+	for (i = 0; (i < data_len) && (len > 2); i++) {
+		snprintf(ptr, 3, "%02X", (unsigned char)hai->hai_data[i]);
+		ptr += 2;
+		len -= 2;
 	}
+
 	*ptr = '\0';
+
 	return buffer;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 36/50] staging: lustre: ptlrpc: skip lock if export failed
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (32 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 35/50] staging: lustre: hsm: stack overrun in hai_dump_data_field Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 33/50] platform/x86: intel_mid_thermal: Fix module autoload Levin, Alexander (Sasha Levin)
                   ` (11 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alexander Boyko, James Simmons, Greg Kroah-Hartman, Levin,
	Alexander (Sasha Levin)

From: Alexander Boyko <alexander.boyko@seagate.com>

[ Upstream commit 4c43c27ddc461d8473cedd70f2549614641dfbc7 ]

This patch resolves IO vs eviction race.
After eviction failed export stayed at stale list,
a client had IO processing and reconnected during it.
A client sent brw rpc with last lock cookie and new connection.
The lock with failed export was found and assert was happened.
 (ost_handler.c:1812:ost_prolong_lock_one())
  ASSERTION( lock->l_export == opd->opd_exp ) failed:

 1. Skip the lock at ldlm_handle2lock if lock export failed.
 2. Validation of lock for IO was added at hpreq_check(). The lock
    searching is based on granted interval tree. If server doesn`t
    have a valid lock, it reply to client with ESTALE.

Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7702
Seagate-bug-id: MRP-2787
Reviewed-on: http://review.whamcloud.com/18120
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |  7 +++++++
 drivers/staging/lustre/lustre/ptlrpc/service.c | 21 ++++++++-------------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 3c48b4fb96f1..d18ab3f28c70 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -546,6 +546,13 @@ struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *handle,
 	if (!lock)
 		return NULL;
 
+	if (lock->l_export && lock->l_export->exp_failed) {
+		CDEBUG(D_INFO, "lock export failed: lock %p, exp %p\n",
+		       lock, lock->l_export);
+		LDLM_LOCK_PUT(lock);
+		return NULL;
+	}
+
 	/* It's unlikely but possible that someone marked the lock as
 	 * destroyed after we did handle2object on it
 	 */
diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c
index 72f39308eebb..9d34848d5458 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -1264,20 +1264,15 @@ static int ptlrpc_server_hpreq_init(struct ptlrpc_service_part *svcpt,
 		 */
 		if (req->rq_ops->hpreq_check) {
 			rc = req->rq_ops->hpreq_check(req);
-			/**
-			 * XXX: Out of all current
-			 * ptlrpc_hpreq_ops::hpreq_check(), only
-			 * ldlm_cancel_hpreq_check() can return an error code;
-			 * other functions assert in similar places, which seems
-			 * odd. What also does not seem right is that handlers
-			 * for those RPCs do not assert on the same checks, but
-			 * rather handle the error cases. e.g. see
-			 * ost_rw_hpreq_check(), and ost_brw_read(),
-			 * ost_brw_write().
+			if (rc == -ESTALE) {
+				req->rq_status = rc;
+				ptlrpc_error(req);
+			}
+			/** can only return error,
+			 * 0 for normal request,
+			 *  or 1 for high priority request
 			 */
-			if (rc < 0)
-				return rc;
-			LASSERT(rc == 0 || rc == 1);
+			LASSERT(rc <= 1);
 		}
 
 		spin_lock_bh(&req->rq_export->exp_rpc_lock);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (36 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 40/50] vfs: open() with O_CREAT should not create inodes with unknown ids Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-09  8:36   ` Mark Brown
  2017-10-07 22:36 ` [PATCH review for 4.9 38/50] brcmfmac: check brcmf_bus_get_memdump result for error Levin, Alexander (Sasha Levin)
                   ` (7 subsequent siblings)
  45 siblings, 1 reply; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Matt Ranostay, Liam Breck, Mark Brown, Levin, Alexander (Sasha Levin)

From: Matt Ranostay <matt@ranostay.consulting>

[ Upstream commit 9834ffd1ecc3a401d0ce64c2d4235a726da6d4f9 ]

We can get audio errors if hitting deeper idle states on omaps:

[alsa.c:230] error: Fatal problem with alsa output, error -5.
[audio.c:614] error: Error in writing audio (Input/output error?)!

This seems to happen with off mode idle enabled as power for the
whole SoC may get cut off between filling the McBSP fifo using DMA.
While active DMA blocks deeper idle states in hardware, McBSP
activity does not seem to do so.

Basing the QoS latency calculation on the FIFO size, threshold,
sample rate, and channels.

Based on the original patch by Tony Lindgren
Link: https://patchwork.kernel.org/patch/9305867/

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 sound/soc/omap/mcbsp.h      |  3 +++
 sound/soc/omap/omap-mcbsp.c | 48 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h
index 61e93b1c185d..46ae1269a698 100644
--- a/sound/soc/omap/mcbsp.h
+++ b/sound/soc/omap/mcbsp.h
@@ -323,8 +323,11 @@ struct omap_mcbsp {
 
 	unsigned int fmt;
 	unsigned int in_freq;
+	unsigned int latency[2];
 	int clk_div;
 	int wlen;
+
+	struct pm_qos_request pm_qos_req;
 };
 
 void omap_mcbsp_config(struct omap_mcbsp *mcbsp,
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index d018e966e533..6b40bdbef336 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -157,6 +157,17 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream,
 				    struct snd_soc_dai *cpu_dai)
 {
 	struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
+	int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
+	int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
+	int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
+
+	if (mcbsp->latency[stream2])
+		pm_qos_update_request(&mcbsp->pm_qos_req,
+				      mcbsp->latency[stream2]);
+	else if (mcbsp->latency[stream1])
+		pm_qos_remove_request(&mcbsp->pm_qos_req);
+
+	mcbsp->latency[stream1] = 0;
 
 	if (!cpu_dai->active) {
 		omap_mcbsp_free(mcbsp);
@@ -164,6 +175,28 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream,
 	}
 }
 
+static int omap_mcbsp_dai_prepare(struct snd_pcm_substream *substream,
+				  struct snd_soc_dai *cpu_dai)
+{
+	struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai);
+	struct pm_qos_request *pm_qos_req = &mcbsp->pm_qos_req;
+	int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
+	int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
+	int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
+	int latency = mcbsp->latency[stream2];
+
+	/* Prevent omap hardware from hitting off between FIFO fills */
+	if (!latency || mcbsp->latency[stream1] < latency)
+		latency = mcbsp->latency[stream1];
+
+	if (pm_qos_request_active(pm_qos_req))
+		pm_qos_update_request(pm_qos_req, latency);
+	else if (latency)
+		pm_qos_add_request(pm_qos_req, PM_QOS_CPU_DMA_LATENCY, latency);
+
+	return 0;
+}
+
 static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
 				  struct snd_soc_dai *cpu_dai)
 {
@@ -226,6 +259,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 	int wlen, channels, wpf;
 	int pkt_size = 0;
 	unsigned int format, div, framesize, master;
+	unsigned int buffer_size = mcbsp->pdata->buffer_size;
 
 	dma_data = snd_soc_dai_get_dma_data(cpu_dai, substream);
 	channels = params_channels(params);
@@ -240,7 +274,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 	default:
 		return -EINVAL;
 	}
-	if (mcbsp->pdata->buffer_size) {
+	if (buffer_size) {
+		int latency;
+
 		if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) {
 			int period_words, max_thrsh;
 			int divider = 0;
@@ -271,6 +307,12 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 			/* Use packet mode for non mono streams */
 			pkt_size = channels;
 		}
+
+		latency = ((((buffer_size - pkt_size) / channels) * 1000)
+				 / (params->rate_num / params->rate_den));
+
+		mcbsp->latency[substream->stream] = latency;
+
 		omap_mcbsp_set_threshold(substream, pkt_size);
 	}
 
@@ -554,6 +596,7 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 static const struct snd_soc_dai_ops mcbsp_dai_ops = {
 	.startup	= omap_mcbsp_dai_startup,
 	.shutdown	= omap_mcbsp_dai_shutdown,
+	.prepare	= omap_mcbsp_dai_prepare,
 	.trigger	= omap_mcbsp_dai_trigger,
 	.delay		= omap_mcbsp_dai_delay,
 	.hw_params	= omap_mcbsp_dai_hw_params,
@@ -835,6 +878,9 @@ static int asoc_mcbsp_remove(struct platform_device *pdev)
 	if (mcbsp->pdata->ops && mcbsp->pdata->ops->free)
 		mcbsp->pdata->ops->free(mcbsp->id);
 
+	if (pm_qos_request_active(&mcbsp->pm_qos_req))
+		pm_qos_remove_request(&mcbsp->pm_qos_req);
+
 	omap_mcbsp_cleanup(mcbsp);
 
 	clk_put(mcbsp->fclk);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 40/50] vfs: open() with O_CREAT should not create inodes with unknown ids
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (35 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 37/50] staging: lustre: lmv: Error not handled for lmv_find_target Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches Levin, Alexander (Sasha Levin)
                   ` (8 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Seth Forshee, Eric W. Biederman, Levin, Alexander (Sasha Levin)

From: Seth Forshee <seth.forshee@canonical.com>

[ Upstream commit 1328c727004d432bbdfba0ffa02a166df04c7305 ]

may_create() rejects creation of inodes with ids which lack a
mapping into s_user_ns. However for O_CREAT may_o_create() is
is used instead. Add a similar check there.

Fixes: 036d523641c6 ("vfs: Don't create inodes with a uid or gid unknown to the vfs")
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 fs/namei.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/namei.c b/fs/namei.c
index 66209f720146..e7d125c23aa6 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2971,10 +2971,16 @@ static inline int open_to_namei_flags(int flag)
 
 static int may_o_create(const struct path *dir, struct dentry *dentry, umode_t mode)
 {
+	struct user_namespace *s_user_ns;
 	int error = security_path_mknod(dir, dentry, mode, 0);
 	if (error)
 		return error;
 
+	s_user_ns = dir->dentry->d_sb->s_user_ns;
+	if (!kuid_has_mapping(s_user_ns, current_fsuid()) ||
+	    !kgid_has_mapping(s_user_ns, current_fsgid()))
+		return -EOVERFLOW;
+
 	error = inode_permission(dir->dentry->d_inode, MAY_WRITE | MAY_EXEC);
 	if (error)
 		return error;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 37/50] staging: lustre: lmv: Error not handled for lmv_find_target
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (34 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 33/50] platform/x86: intel_mid_thermal: Fix module autoload Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 40/50] vfs: open() with O_CREAT should not create inodes with unknown ids Levin, Alexander (Sasha Levin)
                   ` (9 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ulka Vaze, Aditya Pandit, James Simmons, Greg Kroah-Hartman,
	Levin, Alexander (Sasha Levin)

From: Ulka Vaze <ulka.vaze@yahoo.in>

[ Upstream commit 30af99db7ab3483f5ce83ccb890533c9378c2ced ]

This issue is found by smatch; has been reported as-
Unchecked usage of potential ERR_PTR result in lmv_hsm_req_count
and lmv_hsm_req_build. Added ERR_PTR in both functions and also
return value check added.

Signed-off-by: Ulka Vaze <ulka.vaze@yahoo.in>
Signed-off-by: Aditya Pandit <panditadityashreesh@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6523
Reviewed-on: http://review.whamcloud.com/14918
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 7dbb2b946acf..cd19ce811e62 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -744,16 +744,18 @@ static int lmv_hsm_req_count(struct lmv_obd *lmv,
 	/* count how many requests must be sent to the given target */
 	for (i = 0; i < hur->hur_request.hr_itemcount; i++) {
 		curr_tgt = lmv_find_target(lmv, &hur->hur_user_item[i].hui_fid);
+		if (IS_ERR(curr_tgt))
+			return PTR_ERR(curr_tgt);
 		if (obd_uuid_equals(&curr_tgt->ltd_uuid, &tgt_mds->ltd_uuid))
 			nr++;
 	}
 	return nr;
 }
 
-static void lmv_hsm_req_build(struct lmv_obd *lmv,
-			      struct hsm_user_request *hur_in,
-			      const struct lmv_tgt_desc *tgt_mds,
-			      struct hsm_user_request *hur_out)
+static int lmv_hsm_req_build(struct lmv_obd *lmv,
+			     struct hsm_user_request *hur_in,
+			     const struct lmv_tgt_desc *tgt_mds,
+			     struct hsm_user_request *hur_out)
 {
 	int			i, nr_out;
 	struct lmv_tgt_desc    *curr_tgt;
@@ -764,6 +766,8 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv,
 	for (i = 0; i < hur_in->hur_request.hr_itemcount; i++) {
 		curr_tgt = lmv_find_target(lmv,
 					   &hur_in->hur_user_item[i].hui_fid);
+		if (IS_ERR(curr_tgt))
+			return PTR_ERR(curr_tgt);
 		if (obd_uuid_equals(&curr_tgt->ltd_uuid, &tgt_mds->ltd_uuid)) {
 			hur_out->hur_user_item[nr_out] =
 				hur_in->hur_user_item[i];
@@ -773,6 +777,8 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv,
 	hur_out->hur_request.hr_itemcount = nr_out;
 	memcpy(hur_data(hur_out), hur_data(hur_in),
 	       hur_in->hur_request.hr_data_len);
+
+	return 0;
 }
 
 static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len,
@@ -1052,15 +1058,17 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 		} else {
 			/* split fid list to their respective MDS */
 			for (i = 0; i < count; i++) {
-				unsigned int		nr, reqlen;
-				int			rc1;
 				struct hsm_user_request *req;
+				size_t reqlen;
+				int nr, rc1;
 
 				tgt = lmv->tgts[i];
 				if (!tgt || !tgt->ltd_exp)
 					continue;
 
 				nr = lmv_hsm_req_count(lmv, hur, tgt);
+				if (nr < 0)
+					return nr;
 				if (nr == 0) /* nothing for this MDS */
 					continue;
 
@@ -1072,10 +1080,13 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 				if (!req)
 					return -ENOMEM;
 
-				lmv_hsm_req_build(lmv, hur, tgt, req);
+				rc1 = lmv_hsm_req_build(lmv, hur, tgt, req);
+				if (rc1 < 0)
+					goto hsm_req_err;
 
 				rc1 = obd_iocontrol(cmd, tgt->ltd_exp, reqlen,
 						    req, uarg);
+hsm_req_err:
 				if (rc1 != 0 && rc == 0)
 					rc = rc1;
 				kvfree(req);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 38/50] brcmfmac: check brcmf_bus_get_memdump result for error
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (37 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 42/50] [media] exynos4-is: fimc-is: Unmap region obtained by of_iomap() Levin, Alexander (Sasha Levin)
                   ` (6 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rafał Miłecki, Kalle Valo, Levin, Alexander (Sasha Levin)

From: Rafał Miłecki <rafal@milecki.pl>

[ Upstream commit f4737a62033d7f3e0db740c449fc62119da7ab8a ]

This method may be unsupported (see: USB bus) or may just fail (see:
SDIO bus).
While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid
too many conditional code nesting levels.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 .../wireless/broadcom/brcm80211/brcmfmac/debug.c   | 23 +++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
index e64557c35553..6f8a4b074c31 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
@@ -32,16 +32,25 @@ static int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
 {
 	void *dump;
 	size_t ramsize;
+	int err;
 
 	ramsize = brcmf_bus_get_ramsize(bus);
-	if (ramsize) {
-		dump = vzalloc(len + ramsize);
-		if (!dump)
-			return -ENOMEM;
-		memcpy(dump, data, len);
-		brcmf_bus_get_memdump(bus, dump + len, ramsize);
-		dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL);
+	if (!ramsize)
+		return -ENOTSUPP;
+
+	dump = vzalloc(len + ramsize);
+	if (!dump)
+		return -ENOMEM;
+
+	memcpy(dump, data, len);
+	err = brcmf_bus_get_memdump(bus, dump + len, ramsize);
+	if (err) {
+		vfree(dump);
+		return err;
 	}
+
+	dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL);
+
 	return 0;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 41/50] ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (39 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 42/50] [media] exynos4-is: fimc-is: Unmap region obtained by of_iomap() Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 43/50] mei: return error on notification request to a disconnected client Levin, Alexander (Sasha Levin)
                   ` (4 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pierre-Louis Bossart, Mark Brown, Levin, Alexander (Sasha Levin)

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit 3639ac1cd5177685a5c8abb7230096b680e1d497 ]

This patch corrects an omission in bytcr_rt5640 and bytcr_rt5651.
All existing machine drivers shall not use .pm_ops to avoid a double
suspend, as initially implemented by 3f2dcbeaeb2b
("ASoC: Intel: Remove soc pm handling to allow platform driver handle it").

Reported-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 sound/soc/intel/boards/bytcr_rt5640.c | 1 -
 sound/soc/intel/boards/bytcr_rt5651.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index bd19fad2d91b..c17f262f0834 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -807,7 +807,6 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
 static struct platform_driver snd_byt_rt5640_mc_driver = {
 	.driver = {
 		.name = "bytcr_rt5640",
-		.pm = &snd_soc_pm_ops,
 	},
 	.probe = snd_byt_rt5640_mc_probe,
 };
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
index eabff3a857d0..ae49f8199e45 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -317,7 +317,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
 static struct platform_driver snd_byt_rt5651_mc_driver = {
 	.driver = {
 		.name = "bytcr_rt5651",
-		.pm = &snd_soc_pm_ops,
 	},
 	.probe = snd_byt_rt5651_mc_probe,
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 43/50] mei: return error on notification request to a disconnected client
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (40 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 41/50] ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 44/50] s390/dasd: check for device error pointer within state change interrupts Levin, Alexander (Sasha Levin)
                   ` (3 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alexander Usyskin, Tomas Winkler, Greg Kroah-Hartman, Levin,
	Alexander (Sasha Levin)

From: Alexander Usyskin <alexander.usyskin@intel.com>

[ Upstream commit 7c47d2ca0feca767479329da23523ed798acb854 ]

Request for a notification from a disconnected client will be ignored
silently by the FW but the caller should know that the operation hasn't
succeeded.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/misc/mei/client.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index e2af61f7e3b6..451d417eb451 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -1320,6 +1320,9 @@ int mei_cl_notify_request(struct mei_cl *cl,
 		return -EOPNOTSUPP;
 	}
 
+	if (!mei_cl_is_connected(cl))
+		return -ENODEV;
+
 	rets = pm_runtime_get(dev->dev);
 	if (rets < 0 && rets != -EINPROGRESS) {
 		pm_runtime_put_noidle(dev->dev);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 42/50] [media] exynos4-is: fimc-is: Unmap region obtained by of_iomap()
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (38 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 38/50] brcmfmac: check brcmf_bus_get_memdump result for error Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 41/50] ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers Levin, Alexander (Sasha Levin)
                   ` (5 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Arvind Yadav, Sylwester Nawrocki, Mauro Carvalho Chehab, Levin,
	Alexander (Sasha Levin)

From: Arvind Yadav <arvind.yadav.cs@gmail.com>

[ Upstream commit 4742575cde1f3cee0ea6b41af42781672315b04b ]

Free memory mapping, if fimc_is_probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/media/platform/exynos4-is/fimc-is.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c
index 518ad34f80d7..7f92144a1de3 100644
--- a/drivers/media/platform/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/exynos4-is/fimc-is.c
@@ -825,12 +825,13 @@ static int fimc_is_probe(struct platform_device *pdev)
 	is->irq = irq_of_parse_and_map(dev->of_node, 0);
 	if (!is->irq) {
 		dev_err(dev, "no irq found\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_iounmap;
 	}
 
 	ret = fimc_is_get_clocks(is);
 	if (ret < 0)
-		return ret;
+		goto err_iounmap;
 
 	platform_set_drvdata(pdev, is);
 
@@ -891,6 +892,8 @@ static int fimc_is_probe(struct platform_device *pdev)
 	free_irq(is->irq, is);
 err_clk:
 	fimc_is_put_clocks(is);
+err_iounmap:
+	iounmap(is->pmu_regs);
 	return ret;
 }
 
@@ -947,6 +950,7 @@ static int fimc_is_remove(struct platform_device *pdev)
 	fimc_is_unregister_subdevs(is);
 	vb2_dma_contig_clear_max_seg_size(dev);
 	fimc_is_put_clocks(is);
+	iounmap(is->pmu_regs);
 	fimc_is_debugfs_remove(is);
 	release_firmware(is->fw.f_w);
 	fimc_is_free_cpu_memory(is);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 44/50] s390/dasd: check for device error pointer within state change interrupts
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (41 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 43/50] mei: return error on notification request to a disconnected client Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 45/50] s390/prng: Adjust generation of entropy to produce real 256 bits Levin, Alexander (Sasha Levin)
                   ` (2 subsequent siblings)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Stefan Haberland, Martin Schwidefsky, Levin, Alexander (Sasha Levin)

From: Stefan Haberland <sth@linux.vnet.ibm.com>

[ Upstream commit 2202134e48a3b50320aeb9e3dd1186833e9d7e66 ]

Check if the device pointer is valid. Just a sanity check since we already
are in the int handler of the device.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/s390/block/dasd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 1de089019268..5ecd40884f01 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1704,8 +1704,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 	/* check for for attention message */
 	if (scsw_dstat(&irb->scsw) & DEV_STAT_ATTENTION) {
 		device = dasd_device_from_cdev_locked(cdev);
-		device->discipline->check_attention(device, irb->esw.esw1.lpum);
-		dasd_put_device(device);
+		if (!IS_ERR(device)) {
+			device->discipline->check_attention(device,
+							    irb->esw.esw1.lpum);
+			dasd_put_device(device);
+		}
 	}
 
 	if (!cqr)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 47/50] [media] bt8xx: fix memory leak
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (43 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 45/50] s390/prng: Adjust generation of entropy to produce real 256 bits Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 46/50] s390/crypto: Extend key length check for AES-XTS in fips mode Levin, Alexander (Sasha Levin)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Sudip Mukherjee, Sudip Mukherjee, Hans Verkuil,
	Mauro Carvalho Chehab, Levin, Alexander (Sasha Levin)

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

[ Upstream commit 6792eb0cf9310ec240b7e7c9bfa86dff4c758c68 ]

If dvb_attach() fails then we were just printing an error message and
exiting but the memory allocated to state was not released.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/media/pci/bt8xx/dvb-bt8xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c
index e69d338ab9be..ae550a180364 100644
--- a/drivers/media/pci/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c
@@ -680,6 +680,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
 		/*	DST is not a frontend, attaching the ASIC	*/
 		if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) {
 			pr_err("%s: Could not find a Twinhan DST\n", __func__);
+			kfree(state);
 			break;
 		}
 		/*	Attach other DST peripherals if any		*/
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 45/50] s390/prng: Adjust generation of entropy to produce real 256 bits.
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (42 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 44/50] s390/dasd: check for device error pointer within state change interrupts Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 47/50] [media] bt8xx: fix memory leak Levin, Alexander (Sasha Levin)
  2017-10-07 22:36 ` [PATCH review for 4.9 46/50] s390/crypto: Extend key length check for AES-XTS in fips mode Levin, Alexander (Sasha Levin)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Harald Freudenberger, Martin Schwidefsky, Levin, Alexander (Sasha Levin)

From: Harald Freudenberger <freude@linux.vnet.ibm.com>

[ Upstream commit d34b1acb78af41b8b8d5c60972b6555ea19f7564 ]

The generate_entropy function used a sha256 for compacting
together 256 bits of entropy into 32 bytes hash. However, it
is questionable if a sha256 can really be used here, as
potential collisions may reduce the max entropy fitting into
a 32 byte hash value. So this batch introduces the use of
sha512 instead and the required buffer adjustments for the
calling functions.

Further more the working buffer for the generate_entropy
function has been widened from one page to two pages. So now
1024 stckf invocations are used to gather 256 bits of
entropy. This has been done to be on the save side if the
jitters of stckf values isn't as good as supposed.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/s390/crypto/prng.c | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index 1113389d0a39..fe7368a41aa8 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -110,22 +110,30 @@ static const u8 initial_parm_block[32] __initconst = {
 
 /*** helper functions ***/
 
+/*
+ * generate_entropy:
+ * This algorithm produces 64 bytes of entropy data based on 1024
+ * individual stckf() invocations assuming that each stckf() value
+ * contributes 0.25 bits of entropy. So the caller gets 256 bit
+ * entropy per 64 byte or 4 bits entropy per byte.
+ */
 static int generate_entropy(u8 *ebuf, size_t nbytes)
 {
 	int n, ret = 0;
-	u8 *pg, *h, hash[32];
+	u8 *pg, *h, hash[64];
 
-	pg = (u8 *) __get_free_page(GFP_KERNEL);
+	/* allocate 2 pages */
+	pg = (u8 *) __get_free_pages(GFP_KERNEL, 1);
 	if (!pg) {
 		prng_errorflag = PRNG_GEN_ENTROPY_FAILED;
 		return -ENOMEM;
 	}
 
 	while (nbytes) {
-		/* fill page with urandom bytes */
-		get_random_bytes(pg, PAGE_SIZE);
-		/* exor page with stckf values */
-		for (n = 0; n < PAGE_SIZE / sizeof(u64); n++) {
+		/* fill pages with urandom bytes */
+		get_random_bytes(pg, 2*PAGE_SIZE);
+		/* exor pages with 1024 stckf values */
+		for (n = 0; n < 2 * PAGE_SIZE / sizeof(u64); n++) {
 			u64 *p = ((u64 *)pg) + n;
 			*p ^= get_tod_clock_fast();
 		}
@@ -134,8 +142,8 @@ static int generate_entropy(u8 *ebuf, size_t nbytes)
 			h = hash;
 		else
 			h = ebuf;
-		/* generate sha256 from this page */
-		cpacf_kimd(CPACF_KIMD_SHA_256, h, pg, PAGE_SIZE);
+		/* hash over the filled pages */
+		cpacf_kimd(CPACF_KIMD_SHA_512, h, pg, 2*PAGE_SIZE);
 		if (n < sizeof(hash))
 			memcpy(ebuf, hash, n);
 		ret += n;
@@ -143,7 +151,7 @@ static int generate_entropy(u8 *ebuf, size_t nbytes)
 		nbytes -= n;
 	}
 
-	free_page((unsigned long)pg);
+	free_pages((unsigned long)pg, 1);
 	return ret;
 }
 
@@ -334,7 +342,7 @@ static int __init prng_sha512_selftest(void)
 static int __init prng_sha512_instantiate(void)
 {
 	int ret, datalen;
-	u8 seed[64];
+	u8 seed[64 + 32 + 16];
 
 	pr_debug("prng runs in SHA-512 mode "
 		 "with chunksize=%d and reseed_limit=%u\n",
@@ -357,12 +365,12 @@ static int __init prng_sha512_instantiate(void)
 	if (ret)
 		goto outfree;
 
-	/* generate initial seed bytestring, first 48 bytes of entropy */
-	ret = generate_entropy(seed, 48);
-	if (ret != 48)
+	/* generate initial seed bytestring, with 256 + 128 bits entropy */
+	ret = generate_entropy(seed, 64 + 32);
+	if (ret != 64 + 32)
 		goto outfree;
 	/* followed by 16 bytes of unique nonce */
-	get_tod_clock_ext(seed + 48);
+	get_tod_clock_ext(seed + 64 + 32);
 
 	/* initial seed of the ppno drng */
 	cpacf_ppno(CPACF_PPNO_SHA512_DRNG_SEED,
@@ -395,9 +403,9 @@ static void prng_sha512_deinstantiate(void)
 static int prng_sha512_reseed(void)
 {
 	int ret;
-	u8 seed[32];
+	u8 seed[64];
 
-	/* generate 32 bytes of fresh entropy */
+	/* fetch 256 bits of fresh entropy */
 	ret = generate_entropy(seed, sizeof(seed));
 	if (ret != sizeof(seed))
 		return ret;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* [PATCH review for 4.9 46/50] s390/crypto: Extend key length check for AES-XTS in fips mode.
  2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
                   ` (44 preceding siblings ...)
  2017-10-07 22:36 ` [PATCH review for 4.9 47/50] [media] bt8xx: fix memory leak Levin, Alexander (Sasha Levin)
@ 2017-10-07 22:36 ` Levin, Alexander (Sasha Levin)
  45 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-07 22:36 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Harald Freudenberger, Martin Schwidefsky, Levin, Alexander (Sasha Levin)

From: Harald Freudenberger <freude@linux.vnet.ibm.com>

[ Upstream commit a4f2779ecf2f42b0997fedef6fd20a931c40a3e3 ]

In fips mode only xts keys with 128 bit or 125 bit are allowed.
This fix extends the xts_aes_set_key function to check for these
valid key lengths in fips mode.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 arch/s390/crypto/aes_s390.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 303d28eb03a2..591cbdf615af 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -28,6 +28,7 @@
 #include <linux/cpufeature.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
+#include <linux/fips.h>
 #include <crypto/xts.h>
 #include <asm/cpacf.h>
 
@@ -501,6 +502,12 @@ static int xts_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
 	if (err)
 		return err;
 
+	/* In fips mode only 128 bit or 256 bit keys are valid */
+	if (fips_enabled && key_len != 32 && key_len != 64) {
+		tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
+		return -EINVAL;
+	}
+
 	/* Pick the correct function code based on the key length */
 	fc = (key_len == 32) ? CPACF_KM_XTS_128 :
 	     (key_len == 64) ? CPACF_KM_XTS_256 : 0;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 51+ messages in thread

* Re: [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches
  2017-10-07 22:36 ` [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches Levin, Alexander (Sasha Levin)
@ 2017-10-09  8:36   ` Mark Brown
  2017-10-24  2:12     ` Levin, Alexander (Sasha Levin)
  0 siblings, 1 reply; 51+ messages in thread
From: Mark Brown @ 2017-10-09  8:36 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin)
  Cc: linux-kernel, stable, Matt Ranostay, Liam Breck

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

On Sat, Oct 07, 2017 at 10:36:55PM +0000, Levin, Alexander (Sasha Levin) wrote:
> From: Matt Ranostay <matt@ranostay.consulting>
> 
> [ Upstream commit 9834ffd1ecc3a401d0ce64c2d4235a726da6d4f9 ]
> 
> We can get audio errors if hitting deeper idle states on omaps:
> 
> [alsa.c:230] error: Fatal problem with alsa output, error -5.
> [audio.c:614] error: Error in writing audio (Input/output error?)!
> 
> This seems to happen with off mode idle enabled as power for the
> whole SoC may get cut off between filling the McBSP fifo using DMA.
> While active DMA blocks deeper idle states in hardware, McBSP
> activity does not seem to do so.

This seems rather invasive and fancy for stable material - people might
want it in production but they may also not have enough power management
enabled to be seeing the problems it fixes.

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

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf()
  2017-10-07 22:36 ` [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf() Levin, Alexander (Sasha Levin)
@ 2017-10-10 12:49   ` Boris Ostrovsky
  2017-10-24  1:39     ` Levin, Alexander (Sasha Levin)
  0 siblings, 1 reply; 51+ messages in thread
From: Boris Ostrovsky @ 2017-10-10 12:49 UTC (permalink / raw)
  To: Levin, Alexander (Sasha Levin), linux-kernel, stable; +Cc: Jan Beulich

On 10/07/2017 06:36 PM, Levin, Alexander (Sasha Levin) wrote:
> From: Jan Beulich <JBeulich@suse.com>
>
> [ Upstream commit 4fed1b125eb6252bde478665fc05d4819f774fa8 ]
>
> A negative return value indicates an error; in fact the function at
> present won't ever return zero.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Juergen Gross <jgross@suse.com>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>

This patch will cause a warning to be printed. Please pull commit
4e93b64 ("xen: don't print error message in case of missing Xenstore
entry") as well.

Thanks.
-boris

> ---
>  drivers/xen/manage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> index 26e5e8507f03..357a8db859c9 100644
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -277,7 +277,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
>  	err = xenbus_transaction_start(&xbt);
>  	if (err)
>  		return;
> -	if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) {
> +	if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) {
>  		pr_err("Unable to read sysrq code in control/sysrq\n");
>  		xenbus_transaction_end(xbt, 1);
>  		return;

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf()
  2017-10-10 12:49   ` Boris Ostrovsky
@ 2017-10-24  1:39     ` Levin, Alexander (Sasha Levin)
  0 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-24  1:39 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: linux-kernel, stable, Jan Beulich

On Tue, Oct 10, 2017 at 08:49:13AM -0400, Boris Ostrovsky wrote:
>On 10/07/2017 06:36 PM, Levin, Alexander (Sasha Levin) wrote:
>> From: Jan Beulich <JBeulich@suse.com>
>>
>> [ Upstream commit 4fed1b125eb6252bde478665fc05d4819f774fa8 ]
>>
>> A negative return value indicates an error; in fact the function at
>> present won't ever return zero.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> Reviewed-by: Juergen Gross <jgross@suse.com>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
>
>This patch will cause a warning to be printed. Please pull commit
>4e93b64 ("xen: don't print error message in case of missing Xenstore
>entry") as well.

Added, thanks Boris.

-- 

Thanks,
Sasha

^ permalink raw reply	[flat|nested] 51+ messages in thread

* Re: [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches
  2017-10-09  8:36   ` Mark Brown
@ 2017-10-24  2:12     ` Levin, Alexander (Sasha Levin)
  0 siblings, 0 replies; 51+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-10-24  2:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, stable, Matt Ranostay, Liam Breck

On Mon, Oct 09, 2017 at 09:36:56AM +0100, Mark Brown wrote:
>On Sat, Oct 07, 2017 at 10:36:55PM +0000, Levin, Alexander (Sasha Levin) wrote:
>> From: Matt Ranostay <matt@ranostay.consulting>
>>
>> [ Upstream commit 9834ffd1ecc3a401d0ce64c2d4235a726da6d4f9 ]
>>
>> We can get audio errors if hitting deeper idle states on omaps:
>>
>> [alsa.c:230] error: Fatal problem with alsa output, error -5.
>> [audio.c:614] error: Error in writing audio (Input/output error?)!
>>
>> This seems to happen with off mode idle enabled as power for the
>> whole SoC may get cut off between filling the McBSP fifo using DMA.
>> While active DMA blocks deeper idle states in hardware, McBSP
>> activity does not seem to do so.
>
>This seems rather invasive and fancy for stable material - people might
>want it in production but they may also not have enough power management
>enabled to be seeing the problems it fixes.

Fair enough, dropped.

This patch has been around for a while now, and had no fixes which is
why I preferred to originally take it anyway.

-- 

Thanks,
Sasha

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2017-10-24  2:13 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-07 22:36 [PATCH review for 4.9 01/50] cpufreq: Do not clear real_cpus mask on policy init Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 02/50] crypto: ccp - Set the AES size field for all modes Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 03/50] staging: fsl-mc: Add missing header Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 05/50] PM / wakeirq: report a wakeup_event on dedicated wekup irq Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 07/50] mmc: s3cmci: include linux/interrupt.h for tasklet_struct Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 06/50] scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 04/50] IB/mlx5: Assign DSCP for R-RoCE QPs Address Path Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 10/50] bnxt_en: Added PCI IDs for BCM57452 and BCM57454 ASICs Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 11/50] staging: rtl8712u: Fix endian settings for structs describing network packets Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 09/50] mfd: axp20x: Fix axp288 PEK_DBR and PEK_DBF irqs being swapped Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 08/50] mfd: ab8500-sysctrl: Handle probe deferral Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 15/50] ext4: do not use stripe_width if it is not set Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 13/50] net: mvneta: fix build errors when linux/phy*.h is removed from net/dsa.h Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 12/50] PCI/MSI: Return failure when msix_setup_entries() fails Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 14/50] ext4: fix stripe-unaligned allocations Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 16/50] net/ena: change driver's default timeouts Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 18/50] drm/amdgpu: when dpm disabled, also need to stop/start vce Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 19/50] perf tools: Only increase index if perf_evsel__new_idx() succeeds Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 17/50] i2c: riic: correctly finish transfers Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 23/50] net: phy: dp83867: Recover from "port mirroring" N/A MODE4 Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 22/50] clocksource/drivers/arm_arch_timer: Add dt binding for hisilicon-161010101 erratum Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 20/50] iwlwifi: mvm: use the PROBE_RESP_QUEUE to send deauth to unknown station Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 21/50] drm/fsl-dcu: check for clk_prepare_enable() error Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 28/50] mtd: nand: sunxi: Fix the non-polling case in sunxi_nfc_wait_events() Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 25/50] ath10k: fix reading sram contents for QCA4019 Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 26/50] clk: sunxi-ng: Check kzalloc() for errors and cleanup error path Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 24/50] [media] cx231xx: Fix I2C on Internal Master 3 Bus Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 27/50] drm/msm/dsi: Set msm_dsi->encoders before initializing bridge Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 31/50] xen/manage: correct return value check on xenbus_scanf() Levin, Alexander (Sasha Levin)
2017-10-10 12:49   ` Boris Ostrovsky
2017-10-24  1:39     ` Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 29/50] dmaengine: sun6i: allow build on ARM64 platforms (sun50i) Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 32/50] scsi: aacraid: Process Error for response I/O Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 30/50] gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build error Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 34/50] staging: lustre: llite: don't invoke direct_IO for the EOF case Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 35/50] staging: lustre: hsm: stack overrun in hai_dump_data_field Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 36/50] staging: lustre: ptlrpc: skip lock if export failed Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 33/50] platform/x86: intel_mid_thermal: Fix module autoload Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 37/50] staging: lustre: lmv: Error not handled for lmv_find_target Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 40/50] vfs: open() with O_CREAT should not create inodes with unknown ids Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 39/50] ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches Levin, Alexander (Sasha Levin)
2017-10-09  8:36   ` Mark Brown
2017-10-24  2:12     ` Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 38/50] brcmfmac: check brcmf_bus_get_memdump result for error Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 42/50] [media] exynos4-is: fimc-is: Unmap region obtained by of_iomap() Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 41/50] ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 43/50] mei: return error on notification request to a disconnected client Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 44/50] s390/dasd: check for device error pointer within state change interrupts Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 45/50] s390/prng: Adjust generation of entropy to produce real 256 bits Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 47/50] [media] bt8xx: fix memory leak Levin, Alexander (Sasha Levin)
2017-10-07 22:36 ` [PATCH review for 4.9 46/50] s390/crypto: Extend key length check for AES-XTS in fips mode Levin, Alexander (Sasha Levin)

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).