From: Greg Kroah-Hartman Date: Mon, 27 Mar 2017 17:02:39 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.4.58~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70544a40db1856a0e2e1c99801e8a87eae3b1ca8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: ext4-mark-inode-dirty-after-converting-inline-directory.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 --- diff --git a/queue-4.4/ext4-mark-inode-dirty-after-converting-inline-directory.patch b/queue-4.4/ext4-mark-inode-dirty-after-converting-inline-directory.patch new file mode 100644 index 00000000000..4617e55739b --- /dev/null +++ b/queue-4.4/ext4-mark-inode-dirty-after-converting-inline-directory.patch @@ -0,0 +1,46 @@ +From b9cf625d6ecde0d372e23ae022feead72b4228a6 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Wed, 15 Mar 2017 14:52:02 -0400 +Subject: ext4: mark inode dirty after converting inline directory + +From: Eric Biggers + +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 +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman + +--- + 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, diff --git a/queue-4.4/iio-adc-ti_am335x_adc-fix-fifo-overrun-recovery.patch b/queue-4.4/iio-adc-ti_am335x_adc-fix-fifo-overrun-recovery.patch new file mode 100644 index 00000000000..88df4a1f5cc --- /dev/null +++ b/queue-4.4/iio-adc-ti_am335x_adc-fix-fifo-overrun-recovery.patch @@ -0,0 +1,69 @@ +From e83bb3e6f3efa21f4a9d883a25d0ecd9dfb431e1 Mon Sep 17 00:00:00 2001 +From: Michael Engl +Date: Tue, 3 Oct 2017 13:57:00 +0100 +Subject: iio: adc: ti_am335x_adc: fix fifo overrun recovery + +From: Michael Engl + +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 +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + 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) { diff --git a/queue-4.4/iio-hid-sensor-trigger-change-get-poll-value-function-order-to-avoid-sensor-properties-losing-after-resume-from-s3.patch b/queue-4.4/iio-hid-sensor-trigger-change-get-poll-value-function-order-to-avoid-sensor-properties-losing-after-resume-from-s3.patch new file mode 100644 index 00000000000..d2aee784689 --- /dev/null +++ b/queue-4.4/iio-hid-sensor-trigger-change-get-poll-value-function-order-to-avoid-sensor-properties-losing-after-resume-from-s3.patch @@ -0,0 +1,52 @@ +From 3bec247474469f769af41e8c80d3a100dd97dd76 Mon Sep 17 00:00:00 2001 +From: Song Hongyan +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 + +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 +Acked-by: Srinivas Pandruvada +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-4.4/parport-fix-attempt-to-write-duplicate-procfiles.patch b/queue-4.4/parport-fix-attempt-to-write-duplicate-procfiles.patch new file mode 100644 index 00000000000..7f3c3ec1169 --- /dev/null +++ b/queue-4.4/parport-fix-attempt-to-write-duplicate-procfiles.patch @@ -0,0 +1,45 @@ +From 03270c6ac6207fc55bbf9d20d195029dca210c79 Mon Sep 17 00:00:00 2001 +From: Sudip Mukherjee +Date: Mon, 6 Mar 2017 23:23:42 +0000 +Subject: parport: fix attempt to write duplicate procfiles + +From: Sudip Mukherjee + +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 +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + diff --git a/queue-4.4/series b/queue-4.4/series index 1f6527983d9..23713b7cf78 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -35,3 +35,7 @@ usb-hub-fix-crash-after-failure-to-read-bos-descriptor.patch 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