]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 08:36:19 +0000 (09:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 08:36:19 +0000 (09:36 +0100)
added patches:
alsa-hda-apply-asus-mode8-fixup-to-asus-x71sl.patch
alsa-hda-fix-up-gpio-for-asus-rog-ranger.patch
alsa-usb-audio-fix-irq-process-data-synchronization.patch
arm-davinci-da850-don-t-add-emac-clock-to-lookup-table-twice.patch
fscrypt-fix-renaming-and-linking-special-files.patch
hid-sensor-hub-move-the-memset-to-sensor_hub_get_feature.patch
iio-bmi160-fix-time-needed-to-sleep-after-command-execution.patch
iio-common-st_sensors-fix-channel-data-parsing.patch
iio-max44000-correct-value-in-illuminance_integration_time_available.patch
parisc-add-line-break-when-printing-segfault-info.patch
parisc-mark-cr16-clocksource-unstable-on-smp-systems.patch
staging-octeon-call-set_netdev_dev.patch

12 files changed:
queue-4.9/alsa-hda-apply-asus-mode8-fixup-to-asus-x71sl.patch [new file with mode: 0644]
queue-4.9/alsa-hda-fix-up-gpio-for-asus-rog-ranger.patch [new file with mode: 0644]
queue-4.9/alsa-usb-audio-fix-irq-process-data-synchronization.patch [new file with mode: 0644]
queue-4.9/arm-davinci-da850-don-t-add-emac-clock-to-lookup-table-twice.patch [new file with mode: 0644]
queue-4.9/fscrypt-fix-renaming-and-linking-special-files.patch [new file with mode: 0644]
queue-4.9/hid-sensor-hub-move-the-memset-to-sensor_hub_get_feature.patch [new file with mode: 0644]
queue-4.9/iio-bmi160-fix-time-needed-to-sleep-after-command-execution.patch [new file with mode: 0644]
queue-4.9/iio-common-st_sensors-fix-channel-data-parsing.patch [new file with mode: 0644]
queue-4.9/iio-max44000-correct-value-in-illuminance_integration_time_available.patch [new file with mode: 0644]
queue-4.9/parisc-add-line-break-when-printing-segfault-info.patch [new file with mode: 0644]
queue-4.9/parisc-mark-cr16-clocksource-unstable-on-smp-systems.patch [new file with mode: 0644]
queue-4.9/staging-octeon-call-set_netdev_dev.patch [new file with mode: 0644]

diff --git a/queue-4.9/alsa-hda-apply-asus-mode8-fixup-to-asus-x71sl.patch b/queue-4.9/alsa-hda-apply-asus-mode8-fixup-to-asus-x71sl.patch
new file mode 100644 (file)
index 0000000..67c1966
--- /dev/null
@@ -0,0 +1,31 @@
+From c7efff9284dfde95a11aaa811c9d8ec8167f0f6e Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 4 Jan 2017 21:38:16 +0100
+Subject: ALSA: hda - Apply asus-mode8 fixup to ASUS X71SL
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit c7efff9284dfde95a11aaa811c9d8ec8167f0f6e upstream.
+
+Although the old quirk table showed ASUS X71SL with ALC663 codec being
+compatible with asus-mode3 fixup, the bugzilla reporter explained that
+asus-model8 fits better for the dual headphone controls.  So be it.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=191781
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -6944,6 +6944,7 @@ static const struct snd_pci_quirk alc662
+       SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
+       SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
+       SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
++      SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
+       SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
+       SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
+       SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
diff --git a/queue-4.9/alsa-hda-fix-up-gpio-for-asus-rog-ranger.patch b/queue-4.9/alsa-hda-fix-up-gpio-for-asus-rog-ranger.patch
new file mode 100644 (file)
index 0000000..d063d89
--- /dev/null
@@ -0,0 +1,31 @@
+From 85bcf96caba8b4a7c0805555638629ba3c67ea0c Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 6 Dec 2016 16:20:36 +0100
+Subject: ALSA: hda - Fix up GPIO for ASUS ROG Ranger
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 85bcf96caba8b4a7c0805555638629ba3c67ea0c upstream.
+
+ASUS ROG Ranger VIII with ALC1150 codec requires the extra GPIO pin to
+up for the front panel.  Just use the existing fixup for setting up
+the GPIO pins.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189411
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -2230,6 +2230,7 @@ static const struct snd_pci_quirk alc882
+       SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
+       SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
+       SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
++      SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
+       SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
+       SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
+       SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
diff --git a/queue-4.9/alsa-usb-audio-fix-irq-process-data-synchronization.patch b/queue-4.9/alsa-usb-audio-fix-irq-process-data-synchronization.patch
new file mode 100644 (file)
index 0000000..8b0eb83
--- /dev/null
@@ -0,0 +1,158 @@
+From 1d0f953086f090a022f2c0e1448300c15372db46 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <adi@adirat.com>
+Date: Thu, 5 Jan 2017 00:37:46 +0200
+Subject: ALSA: usb-audio: Fix irq/process data synchronization
+
+From: Ioan-Adrian Ratiu <adi@adirat.com>
+
+commit 1d0f953086f090a022f2c0e1448300c15372db46 upstream.
+
+Commit 16200948d83 ("ALSA: usb-audio: Fix race at stopping the stream") was
+incomplete causing another more severe kernel panic, so it got reverted.
+This fixes both the original problem and its fallout kernel race/crash.
+
+The original fix is to move the endpoint member NULL clearing logic inside
+wait_clear_urbs() so the irq triggering the urb completion doesn't call
+retire_capture/playback_urb() after the NULL clearing and generate a panic.
+
+However this creates a new race between snd_usb_endpoint_start()'s call
+to wait_clear_urbs() and the irq urb completion handler which again calls
+retire_capture/playback_urb() leading to a new NULL dereference.
+
+We keep the EP deactivation code in snd_usb_endpoint_start() because
+removing it will break the EP reference counting (see [1] [2] for info),
+however we don't need the "can_sleep" mechanism anymore because a new
+function was introduced (snd_usb_endpoint_sync_pending_stop()) which
+synchronizes pending stops and gets called inside the pcm prepare callback.
+
+It also makes sense to remove can_sleep because it was also removed from
+deactivate_urbs() signature in [3] so we benefit from more simplification.
+
+[1] commit 015618b90 ("ALSA: snd-usb: Fix URB cancellation at stream start")
+[2] commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream")
+[3] commit ccc1696d5 ("ALSA: usb-audio: simplify endpoint deactivation code")
+
+Fixes: f8114f8583bb ("Revert "ALSA: usb-audio: Fix race at stopping the stream"")
+
+Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/endpoint.c |   17 +++++++----------
+ sound/usb/endpoint.h |    2 +-
+ sound/usb/pcm.c      |   10 +++++-----
+ 3 files changed, 13 insertions(+), 16 deletions(-)
+
+--- a/sound/usb/endpoint.c
++++ b/sound/usb/endpoint.c
+@@ -534,6 +534,11 @@ static int wait_clear_urbs(struct snd_us
+                       alive, ep->ep_num);
+       clear_bit(EP_FLAG_STOPPING, &ep->flags);
++      ep->data_subs = NULL;
++      ep->sync_slave = NULL;
++      ep->retire_data_urb = NULL;
++      ep->prepare_data_urb = NULL;
++
+       return 0;
+ }
+@@ -898,9 +903,7 @@ int snd_usb_endpoint_set_params(struct s
+ /**
+  * snd_usb_endpoint_start: start an snd_usb_endpoint
+  *
+- * @ep:               the endpoint to start
+- * @can_sleep:        flag indicating whether the operation is executed in
+- *            non-atomic context
++ * @ep: the endpoint to start
+  *
+  * A call to this function will increment the use count of the endpoint.
+  * In case it is not already running, the URBs for this endpoint will be
+@@ -910,7 +913,7 @@ int snd_usb_endpoint_set_params(struct s
+  *
+  * Returns an error if the URB submission failed, 0 in all other cases.
+  */
+-int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep)
++int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
+ {
+       int err;
+       unsigned int i;
+@@ -924,8 +927,6 @@ int snd_usb_endpoint_start(struct snd_us
+       /* just to be sure */
+       deactivate_urbs(ep, false);
+-      if (can_sleep)
+-              wait_clear_urbs(ep);
+       ep->active_mask = 0;
+       ep->unlink_mask = 0;
+@@ -1006,10 +1007,6 @@ void snd_usb_endpoint_stop(struct snd_us
+       if (--ep->use_count == 0) {
+               deactivate_urbs(ep, false);
+-              ep->data_subs = NULL;
+-              ep->sync_slave = NULL;
+-              ep->retire_data_urb = NULL;
+-              ep->prepare_data_urb = NULL;
+               set_bit(EP_FLAG_STOPPING, &ep->flags);
+       }
+ }
+--- a/sound/usb/endpoint.h
++++ b/sound/usb/endpoint.h
+@@ -18,7 +18,7 @@ int snd_usb_endpoint_set_params(struct s
+                               struct audioformat *fmt,
+                               struct snd_usb_endpoint *sync_ep);
+-int  snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep);
++int  snd_usb_endpoint_start(struct snd_usb_endpoint *ep);
+ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
+ void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
+ int  snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
+--- a/sound/usb/pcm.c
++++ b/sound/usb/pcm.c
+@@ -218,7 +218,7 @@ int snd_usb_init_pitch(struct snd_usb_au
+       }
+ }
+-static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep)
++static int start_endpoints(struct snd_usb_substream *subs)
+ {
+       int err;
+@@ -231,7 +231,7 @@ static int start_endpoints(struct snd_us
+               dev_dbg(&subs->dev->dev, "Starting data EP @%p\n", ep);
+               ep->data_subs = subs;
+-              err = snd_usb_endpoint_start(ep, can_sleep);
++              err = snd_usb_endpoint_start(ep);
+               if (err < 0) {
+                       clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags);
+                       return err;
+@@ -260,7 +260,7 @@ static int start_endpoints(struct snd_us
+               dev_dbg(&subs->dev->dev, "Starting sync EP @%p\n", ep);
+               ep->sync_slave = subs->data_endpoint;
+-              err = snd_usb_endpoint_start(ep, can_sleep);
++              err = snd_usb_endpoint_start(ep);
+               if (err < 0) {
+                       clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags);
+                       return err;
+@@ -839,7 +839,7 @@ static int snd_usb_pcm_prepare(struct sn
+       /* for playback, submit the URBs now; otherwise, the first hwptr_done
+        * updates for all URBs would happen at the same time when starting */
+       if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK)
+-              ret = start_endpoints(subs, true);
++              ret = start_endpoints(subs);
+  unlock:
+       snd_usb_unlock_shutdown(subs->stream->chip);
+@@ -1655,7 +1655,7 @@ static int snd_usb_substream_capture_tri
+       switch (cmd) {
+       case SNDRV_PCM_TRIGGER_START:
+-              err = start_endpoints(subs, false);
++              err = start_endpoints(subs);
+               if (err < 0)
+                       return err;
diff --git a/queue-4.9/arm-davinci-da850-don-t-add-emac-clock-to-lookup-table-twice.patch b/queue-4.9/arm-davinci-da850-don-t-add-emac-clock-to-lookup-table-twice.patch
new file mode 100644 (file)
index 0000000..5f9a699
--- /dev/null
@@ -0,0 +1,51 @@
+From ef37427ac5677331145ab27a17e6f5f1b43f0c11 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+Date: Wed, 7 Dec 2016 16:22:16 +0100
+Subject: ARM: davinci: da850: don't add emac clock to lookup table twice
+
+From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+
+commit ef37427ac5677331145ab27a17e6f5f1b43f0c11 upstream.
+
+Similarly to the aemif clock - this screws up the linked list of clock
+children. Create a separate clock for mdio inheriting the rate from
+emac_clk.
+
+Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
+[nsekhar@ti.com: add a comment over mdio_clk to explaing its existence +
+                commit headline updates]
+Signed-off-by: Sekhar Nori <nsekhar@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-davinci/da850.c |   12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/mach-davinci/da850.c
++++ b/arch/arm/mach-davinci/da850.c
+@@ -319,6 +319,16 @@ static struct clk emac_clk = {
+       .gpsc           = 1,
+ };
++/*
++ * In order to avoid adding the emac_clk to the clock lookup table twice (and
++ * screwing up the linked list in the process) create a separate clock for
++ * mdio inheriting the rate from emac_clk.
++ */
++static struct clk mdio_clk = {
++      .name           = "mdio",
++      .parent         = &emac_clk,
++};
++
+ static struct clk mcasp_clk = {
+       .name           = "mcasp",
+       .parent         = &async3_clk,
+@@ -494,7 +504,7 @@ static struct clk_lookup da850_clks[] =
+       CLK(NULL,               "arm",          &arm_clk),
+       CLK(NULL,               "rmii",         &rmii_clk),
+       CLK("davinci_emac.1",   NULL,           &emac_clk),
+-      CLK("davinci_mdio.0",   "fck",          &emac_clk),
++      CLK("davinci_mdio.0",   "fck",          &mdio_clk),
+       CLK("davinci-mcasp.0",  NULL,           &mcasp_clk),
+       CLK("davinci-mcbsp.0",  NULL,           &mcbsp0_clk),
+       CLK("davinci-mcbsp.1",  NULL,           &mcbsp1_clk),
diff --git a/queue-4.9/fscrypt-fix-renaming-and-linking-special-files.patch b/queue-4.9/fscrypt-fix-renaming-and-linking-special-files.patch
new file mode 100644 (file)
index 0000000..57e10f4
--- /dev/null
@@ -0,0 +1,45 @@
+From 42d97eb0ade31e1bc537d086842f5d6e766d9d51 Mon Sep 17 00:00:00 2001
+From: Eric Biggers <ebiggers@google.com>
+Date: Mon, 19 Dec 2016 14:20:13 -0800
+Subject: fscrypt: fix renaming and linking special files
+
+From: Eric Biggers <ebiggers@google.com>
+
+commit 42d97eb0ade31e1bc537d086842f5d6e766d9d51 upstream.
+
+Attempting to link a device node, named pipe, or socket file into an
+encrypted directory through rename(2) or link(2) always failed with
+EPERM.  This happened because fscrypt_has_permitted_context() saw that
+the file was unencrypted and forbid creating the link.  This behavior
+was unexpected because such files are never encrypted; only regular
+files, directories, and symlinks can be encrypted.
+
+To fix this, make fscrypt_has_permitted_context() always return true on
+special files.
+
+This will be covered by a test in my encryption xfstests patchset.
+
+Fixes: 9bd8212f981e ("ext4 crypto: add encryption policy and password salt support")
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Reviewed-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/crypto/policy.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/fs/crypto/policy.c
++++ b/fs/crypto/policy.c
+@@ -171,6 +171,11 @@ int fscrypt_has_permitted_context(struct
+               BUG_ON(1);
+       }
++      /* No restrictions on file types which are never encrypted */
++      if (!S_ISREG(child->i_mode) && !S_ISDIR(child->i_mode) &&
++          !S_ISLNK(child->i_mode))
++              return 1;
++
+       /* no restrictions if the parent directory is not encrypted */
+       if (!parent->i_sb->s_cop->is_encrypted(parent))
+               return 1;
diff --git a/queue-4.9/hid-sensor-hub-move-the-memset-to-sensor_hub_get_feature.patch b/queue-4.9/hid-sensor-hub-move-the-memset-to-sensor_hub_get_feature.patch
new file mode 100644 (file)
index 0000000..6906489
--- /dev/null
@@ -0,0 +1,45 @@
+From 143fca77cce906d35f7a60ccef648e888df589f2 Mon Sep 17 00:00:00 2001
+From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Date: Tue, 27 Dec 2016 08:57:59 -0800
+Subject: HID: sensor-hub: Move the memset to sensor_hub_get_feature()
+
+From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+
+commit 143fca77cce906d35f7a60ccef648e888df589f2 upstream.
+
+While applying patch d443a0aa3a29: "HID: hid-sensor-hub: clear memory to
+avoid random data", there was some issues in applying correct version of
+the patch. This resulted in the breakage of sensor functions as all
+request like power-up will be reset by the memset() in the function
+sensor_hub_set_feature().
+The reset of caller buffer should be in the function
+sensor_hub_get_feature(), not in the sensor_hub_set_feature().
+
+Fixes: d443a0aa3a29 ("HID: hid-sensor-hub: clear memory to avoid random data")
+Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hid/hid-sensor-hub.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/hid/hid-sensor-hub.c
++++ b/drivers/hid/hid-sensor-hub.c
+@@ -212,7 +212,6 @@ int sensor_hub_set_feature(struct hid_se
+       __s32 value;
+       int ret = 0;
+-      memset(buffer, 0, buffer_size);
+       mutex_lock(&data->mutex);
+       report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
+       if (!report || (field_index >= report->maxfield)) {
+@@ -256,6 +255,8 @@ int sensor_hub_get_feature(struct hid_se
+       int buffer_index = 0;
+       int i;
++      memset(buffer, 0, buffer_size);
++
+       mutex_lock(&data->mutex);
+       report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
+       if (!report || (field_index >= report->maxfield) ||
diff --git a/queue-4.9/iio-bmi160-fix-time-needed-to-sleep-after-command-execution.patch b/queue-4.9/iio-bmi160-fix-time-needed-to-sleep-after-command-execution.patch
new file mode 100644 (file)
index 0000000..574192d
--- /dev/null
@@ -0,0 +1,73 @@
+From 01d1f7a99e457952aa51849ed7c1cc4ced7bca4b Mon Sep 17 00:00:00 2001
+From: Marcin Niestroj <m.niestroj@grinn-global.com>
+Date: Thu, 8 Dec 2016 15:22:58 +0100
+Subject: iio: bmi160: Fix time needed to sleep after command execution
+
+From: Marcin Niestroj <m.niestroj@grinn-global.com>
+
+commit 01d1f7a99e457952aa51849ed7c1cc4ced7bca4b upstream.
+
+Datasheet specifies typical and maximum execution times for which CMD
+register is occupied after previous command execution. We took these
+values as minimum and maximum time for usleep_range() call before making
+a new command execution.
+
+To be sure, that the CMD register is no longer occupied we need to wait
+*at least* the maximum time specified by datasheet.
+
+Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/imu/bmi160/bmi160_core.c |   25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
+
+--- a/drivers/iio/imu/bmi160/bmi160_core.c
++++ b/drivers/iio/imu/bmi160/bmi160_core.c
+@@ -66,10 +66,8 @@
+ #define BMI160_REG_DUMMY              0x7F
+-#define BMI160_ACCEL_PMU_MIN_USLEEP   3200
+-#define BMI160_ACCEL_PMU_MAX_USLEEP   3800
+-#define BMI160_GYRO_PMU_MIN_USLEEP    55000
+-#define BMI160_GYRO_PMU_MAX_USLEEP    80000
++#define BMI160_ACCEL_PMU_MIN_USLEEP   3800
++#define BMI160_GYRO_PMU_MIN_USLEEP    80000
+ #define BMI160_SOFTRESET_USLEEP               1000
+ #define BMI160_CHANNEL(_type, _axis, _index) {                        \
+@@ -151,20 +149,9 @@ static struct bmi160_regs bmi160_regs[]
+       },
+ };
+-struct bmi160_pmu_time {
+-      unsigned long min;
+-      unsigned long max;
+-};
+-
+-static struct bmi160_pmu_time bmi160_pmu_time[] = {
+-      [BMI160_ACCEL] = {
+-              .min = BMI160_ACCEL_PMU_MIN_USLEEP,
+-              .max = BMI160_ACCEL_PMU_MAX_USLEEP
+-      },
+-      [BMI160_GYRO] = {
+-              .min = BMI160_GYRO_PMU_MIN_USLEEP,
+-              .max = BMI160_GYRO_PMU_MIN_USLEEP,
+-      },
++static unsigned long bmi160_pmu_time[] = {
++      [BMI160_ACCEL] = BMI160_ACCEL_PMU_MIN_USLEEP,
++      [BMI160_GYRO] = BMI160_GYRO_PMU_MIN_USLEEP,
+ };
+ struct bmi160_scale {
+@@ -289,7 +276,7 @@ int bmi160_set_mode(struct bmi160_data *
+       if (ret < 0)
+               return ret;
+-      usleep_range(bmi160_pmu_time[t].min, bmi160_pmu_time[t].max);
++      usleep_range(bmi160_pmu_time[t], bmi160_pmu_time[t] + 1000);
+       return 0;
+ }
diff --git a/queue-4.9/iio-common-st_sensors-fix-channel-data-parsing.patch b/queue-4.9/iio-common-st_sensors-fix-channel-data-parsing.patch
new file mode 100644 (file)
index 0000000..b304d91
--- /dev/null
@@ -0,0 +1,56 @@
+From 65c8aea07de11b6507efa175edb44bd8b4488218 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+Date: Wed, 16 Nov 2016 22:15:28 +0100
+Subject: iio: common: st_sensors: fix channel data parsing
+
+From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+
+commit 65c8aea07de11b6507efa175edb44bd8b4488218 upstream.
+
+Using realbits as i2c/spi read len, when that value is not byte aligned
+(e.g 12 bits), lead to skip msb part of out data registers.
+Fix this taking into account scan_type.shift in addition to
+scan_type.realbits as read length:
+
+read_len = DIV_ROUND_UP(realbits + shift, 8)
+
+This fix has been tested on 8, 12, 16, 24 bit sensors
+
+Fixes: e7385de5291e ("iio:st_sensors: align on storagebits boundaries")
+Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
+Tested-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/common/st_sensors/st_sensors_buffer.c |    4 +++-
+ drivers/iio/common/st_sensors/st_sensors_core.c   |    4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/iio/common/st_sensors/st_sensors_buffer.c
++++ b/drivers/iio/common/st_sensors/st_sensors_buffer.c
+@@ -30,7 +30,9 @@ static int st_sensors_get_buffer_element
+       for_each_set_bit(i, indio_dev->active_scan_mask, num_data_channels) {
+               const struct iio_chan_spec *channel = &indio_dev->channels[i];
+-              unsigned int bytes_to_read = channel->scan_type.realbits >> 3;
++              unsigned int bytes_to_read =
++                      DIV_ROUND_UP(channel->scan_type.realbits +
++                                   channel->scan_type.shift, 8);
+               unsigned int storage_bytes =
+                       channel->scan_type.storagebits >> 3;
+--- a/drivers/iio/common/st_sensors/st_sensors_core.c
++++ b/drivers/iio/common/st_sensors/st_sensors_core.c
+@@ -483,8 +483,10 @@ static int st_sensors_read_axis_data(str
+       int err;
+       u8 *outdata;
+       struct st_sensor_data *sdata = iio_priv(indio_dev);
+-      unsigned int byte_for_channel = ch->scan_type.realbits >> 3;
++      unsigned int byte_for_channel;
++      byte_for_channel = DIV_ROUND_UP(ch->scan_type.realbits +
++                                      ch->scan_type.shift, 8);
+       outdata = kmalloc(byte_for_channel, GFP_KERNEL);
+       if (!outdata)
+               return -ENOMEM;
diff --git a/queue-4.9/iio-max44000-correct-value-in-illuminance_integration_time_available.patch b/queue-4.9/iio-max44000-correct-value-in-illuminance_integration_time_available.patch
new file mode 100644 (file)
index 0000000..6aef478
--- /dev/null
@@ -0,0 +1,38 @@
+From b4e8a0eb718749455601fa7b283febc42cca8957 Mon Sep 17 00:00:00 2001
+From: Akinobu Mita <akinobu.mita@gmail.com>
+Date: Thu, 29 Dec 2016 02:16:36 +0900
+Subject: iio: max44000: correct value in illuminance_integration_time_available
+
+From: Akinobu Mita <akinobu.mita@gmail.com>
+
+commit b4e8a0eb718749455601fa7b283febc42cca8957 upstream.
+
+According to the datasheet, the shortest available integration time for
+ALS ADC conversion is 1.5625ms but illuminance_integration_time_available
+sysfs file shows wrong value.
+
+Cc: Crestez Dan Leonard <leonard.crestez@intel.com>
+Cc: Jonathan Cameron <jic23@kernel.org>
+Cc: Hartmut Knaack <knaack.h@gmx.de>
+Cc: Lars-Peter Clausen <lars@metafoo.de>
+Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
+Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
+Fixes: d5d8f49b6 ("max44000: Expose ambient sensor scaling")
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/light/max44000.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/light/max44000.c
++++ b/drivers/iio/light/max44000.c
+@@ -113,7 +113,7 @@ static const char max44000_int_time_avai
+       "0.100 "
+       "0.025 "
+       "0.00625 "
+-      "0.001625";
++      "0.0015625";
+ /* Available scales (internal to ulux) with pretty manual alignment: */
+ static const int max44000_scale_avail_ulux_array[] = {
diff --git a/queue-4.9/parisc-add-line-break-when-printing-segfault-info.patch b/queue-4.9/parisc-add-line-break-when-printing-segfault-info.patch
new file mode 100644 (file)
index 0000000..9be925e
--- /dev/null
@@ -0,0 +1,29 @@
+From b4a9eb4cd5966c8aad3d007d206a2cbda97d6928 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 2 Jan 2017 17:43:15 +0100
+Subject: parisc: Add line-break when printing segfault info
+
+From: Helge Deller <deller@gmx.de>
+
+commit b4a9eb4cd5966c8aad3d007d206a2cbda97d6928 upstream.
+
+Add a leading line break else printed line gets too long.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/parisc/mm/fault.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/parisc/mm/fault.c
++++ b/arch/parisc/mm/fault.c
+@@ -234,7 +234,7 @@ show_signal_msg(struct pt_regs *regs, un
+           tsk->comm, code, address);
+       print_vma_addr(KERN_CONT " in ", regs->iaoq[0]);
+-      pr_cont(" trap #%lu: %s%c", code, trap_name(code),
++      pr_cont("\ntrap #%lu: %s%c", code, trap_name(code),
+               vma ? ',':'\n');
+       if (vma)
diff --git a/queue-4.9/parisc-mark-cr16-clocksource-unstable-on-smp-systems.patch b/queue-4.9/parisc-mark-cr16-clocksource-unstable-on-smp-systems.patch
new file mode 100644 (file)
index 0000000..c94f5fd
--- /dev/null
@@ -0,0 +1,57 @@
+From 41744213602a206f24adcb4a2b7551db3c700e72 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Mon, 26 Dec 2016 12:46:01 +0100
+Subject: parisc: Mark cr16 clocksource unstable on SMP systems
+
+From: Helge Deller <deller@gmx.de>
+
+commit 41744213602a206f24adcb4a2b7551db3c700e72 upstream.
+
+The cr16 interval timer of each CPU is not syncronized to other cr16
+timers in other CPUs in a SMP system. So, delay the registration of the
+cr16 clocksource until all CPUs have been detected and then - if we are
+on a SMP machine - mark the cr16 clocksource as unstable and lower it's
+rating before registering it at the clocksource framework.
+
+This patch fixes the stalled CPU warnings which we have seen since
+introduction of the cr16 clocksource.
+
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/parisc/kernel/time.c |   23 ++++++++++++++++++++---
+ 1 file changed, 20 insertions(+), 3 deletions(-)
+
+--- a/arch/parisc/kernel/time.c
++++ b/arch/parisc/kernel/time.c
+@@ -289,9 +289,26 @@ void __init time_init(void)
+       cr16_hz = 100 * PAGE0->mem_10msec;  /* Hz */
+-      /* register at clocksource framework */
+-      clocksource_register_hz(&clocksource_cr16, cr16_hz);
+-
+       /* register as sched_clock source */
+       sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz);
+ }
++
++static int __init init_cr16_clocksource(void)
++{
++      /*
++       * The cr16 interval timers are not syncronized across CPUs, so mark
++       * them unstable and lower rating on SMP systems.
++       */
++      if (num_online_cpus() > 1) {
++              clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
++              clocksource_cr16.rating = 0;
++      }
++
++      /* register at clocksource framework */
++      clocksource_register_hz(&clocksource_cr16,
++              100 * PAGE0->mem_10msec);
++
++      return 0;
++}
++
++device_initcall(init_cr16_clocksource);
diff --git a/queue-4.9/staging-octeon-call-set_netdev_dev.patch b/queue-4.9/staging-octeon-call-set_netdev_dev.patch
new file mode 100644 (file)
index 0000000..5f46a9a
--- /dev/null
@@ -0,0 +1,40 @@
+From e7c9a3d9e432200fd4c17855c2c23ac784d6e833 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Wed, 14 Dec 2016 17:13:24 -0800
+Subject: staging: octeon: Call SET_NETDEV_DEV()
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+commit e7c9a3d9e432200fd4c17855c2c23ac784d6e833 upstream.
+
+The Octeon driver calls into PHYLIB which now checks for
+net_device->dev.parent, so make sure we do set it before calling into
+any MDIO/PHYLIB related function.
+
+Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
+Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/octeon/ethernet.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/staging/octeon/ethernet.c
++++ b/drivers/staging/octeon/ethernet.c
+@@ -776,6 +776,7 @@ static int cvm_oct_probe(struct platform
+                       /* Initialize the device private structure. */
+                       struct octeon_ethernet *priv = netdev_priv(dev);
++                      SET_NETDEV_DEV(dev, &pdev->dev);
+                       dev->netdev_ops = &cvm_oct_pow_netdev_ops;
+                       priv->imode = CVMX_HELPER_INTERFACE_MODE_DISABLED;
+                       priv->port = CVMX_PIP_NUM_INPUT_PORTS;
+@@ -820,6 +821,7 @@ static int cvm_oct_probe(struct platform
+                       }
+                       /* Initialize the device private structure. */
++                      SET_NETDEV_DEV(dev, &pdev->dev);
+                       priv = netdev_priv(dev);
+                       priv->netdev = dev;
+                       priv->of_node = cvm_oct_node_for_port(pip, interface,