--- /dev/null
+From b9cf625d6ecde0d372e23ae022feead72b4228a6 Mon Sep 17 00:00:00 2001
+From: Eric Biggers <ebiggers@google.com>
+Date: Wed, 15 Mar 2017 14:52:02 -0400
+Subject: ext4: mark inode dirty after converting inline directory
+
+From: Eric Biggers <ebiggers@google.com>
+
+commit b9cf625d6ecde0d372e23ae022feead72b4228a6 upstream.
+
+If ext4_convert_inline_data() was called on a directory with inline
+data, the filesystem was left in an inconsistent state (as considered by
+e2fsck) because the file size was not increased to cover the new block.
+This happened because the inode was not marked dirty after i_disksize
+was updated. Fix this by marking the inode dirty at the end of
+ext4_finish_convert_inline_dir().
+
+This bug was probably not noticed before because most users mark the
+inode dirty afterwards for other reasons. But if userspace executed
+FS_IOC_SET_ENCRYPTION_POLICY with invalid parameters, as exercised by
+'kvm-xfstests -c adv generic/396', then the inode was never marked dirty
+after updating i_disksize.
+
+Fixes: 3c47d54170b6a678875566b1b8d6dcf57904e49b
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/inline.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/fs/ext4/inline.c
++++ b/fs/ext4/inline.c
+@@ -1158,10 +1158,9 @@ static int ext4_finish_convert_inline_di
+ set_buffer_uptodate(dir_block);
+ err = ext4_handle_dirty_dirent_node(handle, inode, dir_block);
+ if (err)
+- goto out;
++ return err;
+ set_buffer_verified(dir_block);
+-out:
+- return err;
++ return ext4_mark_inode_dirty(handle, inode);
+ }
+
+ static int ext4_convert_inline_data_nolock(handle_t *handle,
--- /dev/null
+From e83bb3e6f3efa21f4a9d883a25d0ecd9dfb431e1 Mon Sep 17 00:00:00 2001
+From: Michael Engl <michael.engl@wjw-solutions.com>
+Date: Tue, 3 Oct 2017 13:57:00 +0100
+Subject: iio: adc: ti_am335x_adc: fix fifo overrun recovery
+
+From: Michael Engl <michael.engl@wjw-solutions.com>
+
+commit e83bb3e6f3efa21f4a9d883a25d0ecd9dfb431e1 upstream.
+
+The tiadc_irq_h(int irq, void *private) function is handling FIFO
+overruns by clearing flags, disabling and enabling the ADC to
+recover.
+
+If the ADC is running in continuous mode a FIFO overrun happens
+regularly. If the disabling of the ADC happens concurrently with
+a new conversion. It might happen that the enabling of the ADC
+is ignored by the hardware. This stops the ADC permanently. No
+more interrupts are triggered.
+
+According to the AM335x Reference Manual (SPRUH73H October 2011 -
+Revised April 2013 - Chapter 12.4 and 12.5) it is necessary to
+check the ADC FSM bits in REG_ADCFSM before enabling the ADC
+again. Because the disabling of the ADC is done right after the
+current conversion has been finished.
+
+To trigger this bug it is necessary to run the ADC in continuous
+mode. The ADC values of all channels need to be read in an endless
+loop. The bug appears within the first 6 hours (~5.4 million
+handled FIFO overruns). The user space application will hang on
+reading new values from the character device.
+
+Fixes: ca9a563805f7a ("iio: ti_am335x_adc: Add continuous sampling support")
+Signed-off-by: Michael Engl <michael.engl@wjw-solutions.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/adc/ti_am335x_adc.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/ti_am335x_adc.c
++++ b/drivers/iio/adc/ti_am335x_adc.c
+@@ -151,7 +151,9 @@ static irqreturn_t tiadc_irq_h(int irq,
+ {
+ struct iio_dev *indio_dev = private;
+ struct tiadc_device *adc_dev = iio_priv(indio_dev);
+- unsigned int status, config;
++ unsigned int status, config, adc_fsm;
++ unsigned short count = 0;
++
+ status = tiadc_readl(adc_dev, REG_IRQSTATUS);
+
+ /*
+@@ -165,6 +167,15 @@ static irqreturn_t tiadc_irq_h(int irq,
+ tiadc_writel(adc_dev, REG_CTRL, config);
+ tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN
+ | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES);
++
++ /* wait for idle state.
++ * ADC needs to finish the current conversion
++ * before disabling the module
++ */
++ do {
++ adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM);
++ } while (adc_fsm != 0x10 && count++ < 100);
++
+ tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB));
+ return IRQ_HANDLED;
+ } else if (status & IRQENB_FIFO1THRES) {
--- /dev/null
+From 3bec247474469f769af41e8c80d3a100dd97dd76 Mon Sep 17 00:00:00 2001
+From: Song Hongyan <hongyan.song@intel.com>
+Date: Wed, 22 Feb 2017 17:17:38 +0800
+Subject: iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
+
+From: Song Hongyan <hongyan.song@intel.com>
+
+commit 3bec247474469f769af41e8c80d3a100dd97dd76 upstream.
+
+In function _hid_sensor_power_state(), when hid_sensor_read_poll_value()
+is called, sensor's all properties will be updated by the value from
+sensor hardware/firmware.
+In some implementation, sensor hardware/firmware will do a power cycle
+during S3. In this case, after resume, once hid_sensor_read_poll_value()
+is called, sensor's all properties which are kept by driver during S3
+will be changed to default value.
+But instead, if a set feature function is called first, sensor
+hardware/firmware will be recovered to the last status. So change the
+sensor_hub_set_feature() calling order to behind of set feature function
+to avoid sensor properties lose.
+
+Signed-off-by: Song Hongyan <hongyan.song@intel.com>
+Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
++++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+@@ -51,8 +51,6 @@ static int _hid_sensor_power_state(struc
+ st->report_state.report_id,
+ st->report_state.index,
+ HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM);
+-
+- poll_value = hid_sensor_read_poll_value(st);
+ } else {
+ int val;
+
+@@ -89,7 +87,9 @@ static int _hid_sensor_power_state(struc
+ sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
+ st->power_state.index,
+ sizeof(state_val), &state_val);
+- if (state && poll_value)
++ if (state)
++ poll_value = hid_sensor_read_poll_value(st);
++ if (poll_value > 0)
+ msleep_interruptible(poll_value * 2);
+
+ return 0;
--- /dev/null
+From 03270c6ac6207fc55bbf9d20d195029dca210c79 Mon Sep 17 00:00:00 2001
+From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Date: Mon, 6 Mar 2017 23:23:42 +0000
+Subject: parport: fix attempt to write duplicate procfiles
+
+From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+
+commit 03270c6ac6207fc55bbf9d20d195029dca210c79 upstream.
+
+Usually every parallel port will have a single pardev registered with
+it. But ppdev driver is an exception. This userspace parallel port
+driver allows to create multiple parrallel port devices for a single
+parallel port. And as a result we were having a nice warning like:
+"sysctl table check failed:
+/dev/parport/parport0/devices/ppdev0/timeslice Sysctl already exists"
+
+Use the same logic as used in parport_register_device() and register
+the proc files only once for each parallel port.
+
+Fixes: 6fa45a226897 ("parport: add device-model to parport subsystem")
+Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1414656
+Bugzilla: https://bugs.archlinux.org/task/52322
+Tested-by: James Feeney <james@nurealm.net>
+Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/parport/share.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/parport/share.c
++++ b/drivers/parport/share.c
+@@ -936,8 +936,10 @@ parport_register_dev_model(struct parpor
+ * pardevice fields. -arca
+ */
+ port->ops->init_state(par_dev, par_dev->state);
+- port->proc_device = par_dev;
+- parport_device_proc_register(par_dev);
++ if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) {
++ port->proc_device = par_dev;
++ parport_device_proc_register(par_dev);
++ }
+
+ return par_dev;
+
uwb-i1480-dfu-fix-null-deref-at-probe.patch
uwb-hwa-rc-fix-null-deref-at-probe.patch
mmc-ushc-fix-null-deref-at-probe.patch
+iio-adc-ti_am335x_adc-fix-fifo-overrun-recovery.patch
+iio-hid-sensor-trigger-change-get-poll-value-function-order-to-avoid-sensor-properties-losing-after-resume-from-s3.patch
+parport-fix-attempt-to-write-duplicate-procfiles.patch
+ext4-mark-inode-dirty-after-converting-inline-directory.patch