From: Markus Hofstaetter <markus.hofstaetter(a)ait.ac.at>
commit f16703360da7731a057df2ffa902306819c22398 upstream.
Some PWMs are disabled by default or the default pin setting
does not match the LED_OFF state (e.g., active-low leds).
Hence, the driver may end up reporting 0 brightness, but
the leds are actually on using full brightness, because
it never enforces its default configuration.
So enforce it by calling led_pwm_set() after successfully
registering the device.
Tested on a Phytec phyFLEX i.MX6Q board based on kernel
v3.19.5.
Signed-off-by: Markus Hofstaetter <markus.hofstaetter(a)ait.ac.at>
Tested-by: Markus Hofstaetter <markus.hofstaetter(a)ait.ac.at>
Signed-off-by: Jacek Anaszewski <j.anaszewski(a)samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk(a)kernel.org>
---
drivers/leds/leds-pwm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 1d07e3e83d29..3149dbece146 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -132,6 +132,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
ret = led_classdev_register(dev, &led_data->cdev);
if (ret == 0) {
priv->num_leds++;
+ led_pwm_set(&led_data->cdev, led_data->cdev.brightness);
} else {
dev_err(dev, "failed to register PWM led for %s: %d\n",
led->name, ret);
--
2.7.4
The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From db7a691a1551a748cb92d9c89c6b190ea87e28d5 Mon Sep 17 00:00:00 2001
From: Michael Guralnik <michaelgur(a)mellanox.com>
Date: Wed, 21 Nov 2018 15:03:54 +0200
Subject: [PATCH] IB/mlx5: Avoid load failure due to unknown link width
If the firmware reports a connection width that is not 1x, 4x, 8x or 12x
it causes the driver to fail during initialization.
To prevent this failure every time a new width is introduced to the RDMA
stack, we will set a default 4x width for these widths which ar unknown to
the driver.
This is needed to allow to run old kernels with new firmware.
Cc: <stable(a)vger.kernel.org> # 4.1
Fixes: 1b5daf11b015 ("IB/mlx5: Avoid using the MAD_IFC command under ISSI > 0 mode")
Signed-off-by: Michael Guralnik <michaelgur(a)mellanox.com>
Reviewed-by: Majd Dibbiny <majd(a)mellanox.com>
Signed-off-by: Leon Romanovsky <leonro(a)mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg(a)mellanox.com>
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index e9c428071df3..3569fda07e07 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1094,31 +1094,26 @@ enum mlx5_ib_width {
MLX5_IB_WIDTH_12X = 1 << 4
};
-static int translate_active_width(struct ib_device *ibdev, u8 active_width,
+static void translate_active_width(struct ib_device *ibdev, u8 active_width,
u8 *ib_width)
{
struct mlx5_ib_dev *dev = to_mdev(ibdev);
- int err = 0;
- if (active_width & MLX5_IB_WIDTH_1X) {
+ if (active_width & MLX5_IB_WIDTH_1X)
*ib_width = IB_WIDTH_1X;
- } else if (active_width & MLX5_IB_WIDTH_2X) {
- mlx5_ib_dbg(dev, "active_width %d is not supported by IB spec\n",
- (int)active_width);
- err = -EINVAL;
- } else if (active_width & MLX5_IB_WIDTH_4X) {
+ else if (active_width & MLX5_IB_WIDTH_4X)
*ib_width = IB_WIDTH_4X;
- } else if (active_width & MLX5_IB_WIDTH_8X) {
+ else if (active_width & MLX5_IB_WIDTH_8X)
*ib_width = IB_WIDTH_8X;
- } else if (active_width & MLX5_IB_WIDTH_12X) {
+ else if (active_width & MLX5_IB_WIDTH_12X)
*ib_width = IB_WIDTH_12X;
- } else {
- mlx5_ib_dbg(dev, "Invalid active_width %d\n",
+ else {
+ mlx5_ib_dbg(dev, "Invalid active_width %d, setting width to default value: 4x\n",
(int)active_width);
- err = -EINVAL;
+ *ib_width = IB_WIDTH_4X;
}
- return err;
+ return;
}
static int mlx5_mtu_to_ib_mtu(int mtu)
@@ -1225,10 +1220,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port,
if (err)
goto out;
- err = translate_active_width(ibdev, ib_link_width_oper,
- &props->active_width);
- if (err)
- goto out;
+ translate_active_width(ibdev, ib_link_width_oper, &props->active_width);
+
err = mlx5_query_port_ib_proto_oper(mdev, &props->active_speed, port);
if (err)
goto out;
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 3054426dc68e5d63aa6a6e9b91ac4ec78e3f3805 Mon Sep 17 00:00:00 2001
From: Pavankumar Kondeti <pkondeti(a)codeaurora.org>
Date: Tue, 30 Oct 2018 12:24:33 +0530
Subject: [PATCH] sched, trace: Fix prev_state output in sched_switch
tracepoint
commit 3f5fe9fef5b2 ("sched/debug: Fix task state recording/printout")
tried to fix the problem introduced by a previous commit efb40f588b43
("sched/tracing: Fix trace_sched_switch task-state printing"). However
the prev_state output in sched_switch is still broken.
task_state_index() uses fls() which considers the LSB as 1. Left
shifting 1 by this value gives an incorrect mapping to the task state.
Fix this by decrementing the value returned by __get_task_state()
before shifting.
Link: http://lkml.kernel.org/r/1540882473-1103-1-git-send-email-pkondeti@codeauro…
Cc: stable(a)vger.kernel.org
Fixes: 3f5fe9fef5b2 ("sched/debug: Fix task state recording/printout")
Signed-off-by: Pavankumar Kondeti <pkondeti(a)codeaurora.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index f07b270d4fc4..9a4bdfadab07 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -107,6 +107,8 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
#ifdef CREATE_TRACE_POINTS
static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p)
{
+ unsigned int state;
+
#ifdef CONFIG_SCHED_DEBUG
BUG_ON(p != current);
#endif /* CONFIG_SCHED_DEBUG */
@@ -118,7 +120,15 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *
if (preempt)
return TASK_REPORT_MAX;
- return 1 << task_state_index(p);
+ /*
+ * task_state_index() uses fls() and returns a value from 0-8 range.
+ * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using
+ * it for left shift operation to get the correct task->state
+ * mapping.
+ */
+ state = task_state_index(p);
+
+ return state ? (1 << (state - 1)) : state;
}
#endif /* CREATE_TRACE_POINTS */
On Sun, Dec 2, 2018 at 4:51 PM Sasha Levin <sashal(a)kernel.org> wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> libceph: implement CEPHX_V2 calculation mode
>
> to the 4.14-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
>
> The filename of the patch is:
> libceph-implement-cephx_v2-calculation-mode.patch
> and it can be found in the queue-4.14 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable(a)vger.kernel.org> know about it.
>
>
>
> commit 14735e0afb6ed378becd0dedf37d1e5ddfa12084
> Author: Ilya Dryomov <idryomov(a)gmail.com>
> Date: Fri Jul 27 19:25:32 2018 +0200
>
> libceph: implement CEPHX_V2 calculation mode
>
> commit cc255c76c70f7a87d97939621eae04b600d9f4a1 upstream.
>
> Derive the signature from the entire buffer (both AES cipher blocks)
> instead of using just the first half of the first block, leaving out
> data_crc entirely.
>
> This addresses CVE-2018-1129.
>
> Link: http://tracker.ceph.com/issues/24837
> Signed-off-by: Ilya Dryomov <idryomov(a)gmail.com>
> Reviewed-by: Sage Weil <sage(a)redhat.com>
> Signed-off-by: Ben Hutchings <ben.hutchings(a)codethink.co.uk>
> Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Hi Sasha,
The CVEs mentioned in this series are server side and CEPHX_V2 is
probably more of a new feature than a security fix. That said, I don't
object to including it in 4.14.z. If you do, please pick up the
remaining two patches for interoperability:
f1d10e046379 libceph: weaken sizeof check in ceph_x_verify_authorizer_reply()
130f52f2b203 libceph: check authorizer reply/challenge length before reading
Thanks,
Ilya
Intel Merrifield has a reduced size of FIFO used in iDMA 32-bit controller,
i.e. 512 bytes instead of 1024.
Fix this by partitioning it as 64 bytes per channel.
Note, in the future we might switch to 'fifo-size' property instead of
hard coded value.
Fixes: 199244d69458 ("dmaengine: dw: add support of iDMA 32-bit hardware")
Signed-off-by: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
Cc: stable(a)vger.kernel.org
---
drivers/dma/dw/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 2c5ca1961256..dc053e62f894 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1061,12 +1061,12 @@ static void dwc_issue_pending(struct dma_chan *chan)
/*
* Program FIFO size of channels.
*
- * By default full FIFO (1024 bytes) is assigned to channel 0. Here we
+ * By default full FIFO (512 bytes) is assigned to channel 0. Here we
* slice FIFO on equal parts between channels.
*/
static void idma32_fifo_partition(struct dw_dma *dw)
{
- u64 value = IDMA32C_FP_PSIZE_CH0(128) | IDMA32C_FP_PSIZE_CH1(128) |
+ u64 value = IDMA32C_FP_PSIZE_CH0(64) | IDMA32C_FP_PSIZE_CH1(64) |
IDMA32C_FP_UPDATE;
u64 fifo_partition = 0;
@@ -1079,7 +1079,7 @@ static void idma32_fifo_partition(struct dw_dma *dw)
/* Fill FIFO_PARTITION high bits (Channels 2..3, 6..7) */
fifo_partition |= value << 32;
- /* Program FIFO Partition registers - 128 bytes for each channel */
+ /* Program FIFO Partition registers - 64 bytes per channel */
idma32_writeq(dw, FIFO_PARTITION1, fifo_partition);
idma32_writeq(dw, FIFO_PARTITION0, fifo_partition);
}
--
2.19.2
This is the start of the stable review cycle for the 4.9.143 release.
There are 50 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu Dec 6 10:36:59 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.143-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.143-rc1
Chris Fries <cfries(a)google.com>
kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
efi/libstub: Make file I/O chunking x86-specific
Arnd Bergmann <arnd(a)arndb.de>
workqueue: avoid clang warning
Stefan Agner <stefan(a)agner.ch>
ARM: trusted_foundations: do not use naked function
Stefan Agner <stefan(a)agner.ch>
bus: arm-cci: remove unnecessary unreachable()
Stefan Agner <stefan(a)agner.ch>
ARM: 8767/1: add support for building ARM kernel with clang
Stefan Agner <stefan(a)agner.ch>
ARM: 8766/1: drop no-thumb-interwork in EABI mode
Alistair Strachan <astrachan(a)google.com>
efi/libstub: arm: support building with clang
YueHaibing <yuehaibing(a)huawei.com>
misc: mic/scif: fix copy-paste error in scif_create_remote_lookup
Dexuan Cui <decui(a)microsoft.com>
Drivers: hv: vmbus: check the creation_status in vmbus_establish_gpadl()
Yu Zhao <yuzhao(a)google.com>
mm: use swp_offset as key in shmem_replace_page()
Martin Kelly <martin(a)martingkelly.com>
iio:st_magn: Fix enable device after trigger
Felipe Balbi <felipe.balbi(a)linux.intel.com>
Revert "usb: dwc3: gadget: skip Set/Clear Halt when invalid"
Michael Niewöhner <linux(a)mniewoehner.de>
usb: core: quirks: add RESET_RESUME quirk for Cherry G230 Stream series
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: usb-storage: Add new IDs to ums-realtek
Josef Bacik <josef(a)toxicpanda.com>
btrfs: release metadata before running delayed refs
Richard Genoud <richard.genoud(a)gmail.com>
dmaengine: at_hdmac: fix module unloading
Richard Genoud <richard.genoud(a)gmail.com>
dmaengine: at_hdmac: fix memory leak in at_dma_xlate()
Pan Bian <bianpan2016(a)163.com>
ext2: fix potential use after free
Takashi Iwai <tiwai(a)suse.de>
ALSA: sparc: Fix invalid snd_free_pages() at error path
Takashi Iwai <tiwai(a)suse.de>
ALSA: control: Fix race between adding and removing a user element
Takashi Iwai <tiwai(a)suse.de>
ALSA: ac97: Fix incorrect bit shift at AC97-SPSA control write
Takashi Iwai <tiwai(a)suse.de>
ALSA: wss: Fix invalid snd_free_pages() at error path
Maximilian Heyne <mheyne(a)amazon.de>
fs: fix lost error code in dio_complete
Jiri Olsa <jolsa(a)kernel.org>
perf/x86/intel: Add generic branch tracing check to intel_pmu_has_bts()
Jiri Olsa <jolsa(a)kernel.org>
perf/x86/intel: Move branch tracing setup to the Intel-specific source file
Filipe Manana <fdmanana(a)suse.com>
Btrfs: ensure path name is null terminated at btrfs_control_ioctl
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: fix coprocessor context offset definitions
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: enable coprocessors that are being flushed
Wanpeng Li <wanpengli(a)tencent.com>
KVM: X86: Fix scan ioapic use-before-initialization
Jim Mattson <jmattson(a)google.com>
kvm: svm: Ensure an IBPB on all affected CPUs when freeing a vmcb
Junaid Shahid <junaids(a)google.com>
kvm: mmu: Fix race in emulated page table writes
Bernd Eckstein <3erndeckstein(a)gmail.com>
usbnet: ipheth: fix potential recvmsg bug and recvmsg bug 2
Julian Wiedmann <jwi(a)linux.ibm.com>
s390/qeth: fix length check in SNMP processing
Pan Bian <bianpan2016(a)163.com>
rapidio/rionet: do not free skb before reading its length
Petr Machata <petrm(a)mellanox.com>
net: skb_scrub_packet(): Scrub offload_fwd_mark
Sasha Levin <sashal(a)kernel.org>
Revert "wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()"
Matthias Schwarzott <zzam(a)gentoo.org>
media: em28xx: Fix use-after-free when disconnecting
Hugh Dickins <hughd(a)google.com>
mm/khugepaged: collapse_shmem() do not crash on Compound
Hugh Dickins <hughd(a)google.com>
mm/khugepaged: collapse_shmem() without freezing new_page
Hugh Dickins <hughd(a)google.com>
mm/khugepaged: minor reorderings in collapse_shmem()
Hugh Dickins <hughd(a)google.com>
mm/khugepaged: collapse_shmem() remember to clear holes
Hugh Dickins <hughd(a)google.com>
mm/khugepaged: fix crashes due to misaccounted holes
Mike Rapoport <rppt(a)linux.vnet.ibm.com>
shmem: introduce shmem_inode_acct_block
Mike Rapoport <rppt(a)linux.vnet.ibm.com>
shmem: shmem_charge: verify max_block is not exceeded before inode update
Hugh Dickins <hughd(a)google.com>
mm/khugepaged: collapse_shmem() stop if punched or truncated
Hugh Dickins <hughd(a)google.com>
mm/huge_memory: fix lockdep complaint on 32-bit i_size_read()
Hugh Dickins <hughd(a)google.com>
mm/huge_memory: splitting set mapping+index before unfreeze
Konstantin Khlebnikov <khlebnikov(a)yandex-team.ru>
mm/huge_memory.c: reorder operations in __split_huge_page_tail()
Hugh Dickins <hughd(a)google.com>
mm/huge_memory: rename freeze_page() to unmap_page()
-------------
Diffstat:
Makefile | 69 ++++++-------
arch/arm/Makefile | 2 +-
arch/arm/boot/compressed/Makefile | 2 +-
arch/arm/firmware/trusted_foundations.c | 14 ++-
arch/x86/events/core.c | 20 ----
arch/x86/events/intel/core.c | 52 +++++++---
arch/x86/events/perf_event.h | 13 ++-
arch/x86/kvm/mmu.c | 27 ++----
arch/x86/kvm/svm.c | 20 +++-
arch/x86/kvm/x86.c | 3 +-
arch/xtensa/kernel/asm-offsets.c | 16 +--
arch/xtensa/kernel/process.c | 5 +-
drivers/bus/arm-cci.c | 2 -
drivers/dma/at_hdmac.c | 10 +-
drivers/firmware/efi/libstub/Makefile | 3 +-
drivers/firmware/efi/libstub/efi-stub-helper.c | 11 ++-
drivers/hv/channel.c | 8 ++
drivers/iio/magnetometer/st_magn_buffer.c | 12 +--
drivers/media/usb/em28xx/em28xx-dvb.c | 3 +-
drivers/misc/mic/scif/scif_rma.c | 2 +-
drivers/net/rionet.c | 2 +-
drivers/net/usb/ipheth.c | 10 +-
drivers/net/wireless/ti/wlcore/cmd.c | 6 --
drivers/s390/net/qeth_core_main.c | 27 +++---
drivers/usb/core/quirks.c | 3 +
drivers/usb/dwc3/gadget.c | 5 -
drivers/usb/storage/unusual_realtek.h | 10 ++
fs/btrfs/super.c | 1 +
fs/btrfs/transaction.c | 6 +-
fs/direct-io.c | 4 +-
fs/ext2/xattr.c | 2 +-
include/linux/workqueue.h | 4 +-
mm/huge_memory.c | 79 +++++++--------
mm/khugepaged.c | 129 ++++++++++++++-----------
mm/shmem.c | 97 ++++++++++---------
net/core/skbuff.c | 4 +
sound/core/control.c | 80 ++++++++-------
sound/isa/wss/wss_lib.c | 2 -
sound/pci/ac97/ac97_codec.c | 2 +-
sound/sparc/cs4231.c | 8 +-
40 files changed, 424 insertions(+), 351 deletions(-)