Allow PCI core to do runtime PM to devices without needing to use dummy
runtime PM callback functions if there is no need to do anything device
specific beyond PCI device power state management.
Implement this by letting core to change device power state during
runtime PM transitions even if no callback functions are defined.
Fixes: a9c8088c7988 ("i2c: i801: Don't restore config registers on runtime PM")
Reported-by: Mika Westerberg <mika.westerberg(a)linux.intel.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Jarkko Nikula <jarkko.nikula(a)linux.intel.com>
---
This is related to my i2c-i801.c fix thread back in June which I completely
forgot till now: https://lkml.org/lkml/2018/6/27/642
Discussion back then was that it should be handled in the PCI PM instead
of having dummy functions in the drivers. I wanted to respin with a
patch.
---
drivers/pci/pci-driver.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index bef17c3fca67..6185b878ede1 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1239,7 +1239,7 @@ static int pci_pm_runtime_suspend(struct device *dev)
struct pci_dev *pci_dev = to_pci_dev(dev);
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
pci_power_t prev = pci_dev->current_state;
- int error;
+ int error = 0;
/*
* If pci_dev->driver is not set (unbound), we leave the device in D0,
@@ -1251,11 +1251,9 @@ static int pci_pm_runtime_suspend(struct device *dev)
return 0;
}
- if (!pm || !pm->runtime_suspend)
- return -ENOSYS;
-
pci_dev->state_saved = false;
- error = pm->runtime_suspend(dev);
+ if (pm && pm->runtime_suspend)
+ error = pm->runtime_suspend(dev);
if (error) {
/*
* -EBUSY and -EAGAIN is used to request the runtime PM core
@@ -1292,7 +1290,7 @@ static int pci_pm_runtime_suspend(struct device *dev)
static int pci_pm_runtime_resume(struct device *dev)
{
- int rc;
+ int rc = 0;
struct pci_dev *pci_dev = to_pci_dev(dev);
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
@@ -1306,14 +1304,12 @@ static int pci_pm_runtime_resume(struct device *dev)
if (!pci_dev->driver)
return 0;
- if (!pm || !pm->runtime_resume)
- return -ENOSYS;
-
pci_fixup_device(pci_fixup_resume_early, pci_dev);
pci_enable_wake(pci_dev, PCI_D0, false);
pci_fixup_device(pci_fixup_resume, pci_dev);
- rc = pm->runtime_resume(dev);
+ if (pm && pm->runtime_resume)
+ rc = pm->runtime_resume(dev);
pci_dev->runtime_d3cold = false;
--
2.19.1
Fix the synthetic event test case to remove event correctly.
If redirecting command to synthetic_event file without append
mode, it cleans up all existing events and execute (parse) the
command. This means "delete event" always fails to find the
target event.
Since previous synthetic event has a bug which doesn't return
-ENOENT even if it fails to find the deleting event, this test
passed. But fixing that bug, this test fails because this test
itself has a bug.
This fixes that bug by trying to delete event right after
adding an event, and use append mode redirection ('>>') instead
of normal redirection ('>').
Fixes: f06eec4d0f2c ('selftests: ftrace: Add inter-event hist triggers testcases')
Signed-off-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Cc: stable(a)vger.kernel.org
Cc: Rajvi Jingar <rajvi.jingar(a)intel.com>
Cc: Tom Zanussi <tom.zanussi(a)linux.intel.com>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
---
.../trigger-synthetic-event-createremove.tc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc
index cef11377dcbd..c604438df13b 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-createremove.tc
@@ -35,18 +35,18 @@ fi
reset_trigger
-echo "Test create synthetic event with an error"
-echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null
+echo "Test remove synthetic event"
+echo '!wakeup_latency u64 lat pid_t pid char comm[16]' >> synthetic_events
if [ -d events/synthetic/wakeup_latency ]; then
- fail "Created wakeup_latency synthetic event with an invalid format"
+ fail "Failed to delete wakeup_latency synthetic event"
fi
reset_trigger
-echo "Test remove synthetic event"
-echo '!wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events
+echo "Test create synthetic event with an error"
+echo 'wakeup_latency u64 lat pid_t pid char' > synthetic_events > /dev/null
if [ -d events/synthetic/wakeup_latency ]; then
- fail "Failed to delete wakeup_latency synthetic event"
+ fail "Created wakeup_latency synthetic event with an invalid format"
fi
do_reset
Hello,
on both my ppc32 systems I've tested (G4 PowerMac and G4 Mac-mini), I
see a regression after upgrading from 4.14.74 to 4.14.76: Very soon
after starting the kernel from yaboot, they drop me into a OF prompt,
message is "invalid memory access at" on the mini, and another one I
forgot on the PowerMac. FWIW, the ppc64 G5 PowerMac does fine.
Before I start bisecting - might take a few days -, is this already on
radar?
Christoph
On Sun, Oct 21, 2018 at 10:26 AM Monthero <rhmcruiser(a)gmail.com> wrote:
>
> Hi Amir thanks for the pointer.
> I will get in touch with maintainer of 3.16
> Yes it covers Neil's commit and apart from that it would need this replacement for dentry check in 3.16
>
> > - if (S_ISDIR(result->d_inode->i_mode)) {
> > + if (d_is_dir(result)) {
>
Fine, but Why?
How is dereferencing dentry->d_flags any better than dereferencing->d_inode
when dentry has an invalid value?
Thanks,
Amir.
From: Dexuan Cui <decui(a)microsoft.com>
In kvp_send_key(), we do need call process_ib_ipinfo() if
message->kvp_hdr.operation is KVP_OP_GET_IP_INFO, because it turns out
the userland hv_kvp_daemon needs the info of operation, adapter_id and
addr_family. With the incorrect fc62c3b1977d, the host can't get the
VM's IP via KVP.
And, fc62c3b1977d added a "break;", but actually forgot to initialize
the key_size/value in the case of KVP_OP_SET, so the default key_size of
0 is passed to the kvp daemon, and the pool files
/var/lib/hyperv/.kvp_pool_* can't be updated.
This patch effectively rolls back the previous fc62c3b1977d, and
correctly fixes the "this statement may fall through" warnings.
This patch is tested on WS 2012 R2 and 2016.
Fixes: fc62c3b1977d ("Drivers: hv: kvp: Fix two "this statement may fall through" warnings")
Signed-off-by: Dexuan Cui <decui(a)microsoft.com>
Cc: K. Y. Srinivasan <kys(a)microsoft.com>
Cc: Haiyang Zhang <haiyangz(a)microsoft.com>
Cc: Stephen Hemminger <sthemmin(a)microsoft.com>
Cc: <Stable(a)vger.kernel.org>
Signed-off-by: K. Y. Srinivasan <kys(a)microsoft.com>
---
drivers/hv/hv_kvp.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
index a7513a8a8e37..9fbb15c62c6c 100644
--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -353,6 +353,9 @@ static void process_ib_ipinfo(void *in_msg, void *out_msg, int op)
out->body.kvp_ip_val.dhcp_enabled = in->kvp_ip_val.dhcp_enabled;
+ __attribute__ ((fallthrough));
+
+ case KVP_OP_GET_IP_INFO:
utf16s_to_utf8s((wchar_t *)in->kvp_ip_val.adapter_id,
MAX_ADAPTER_ID_SIZE,
UTF16_LITTLE_ENDIAN,
@@ -405,7 +408,11 @@ kvp_send_key(struct work_struct *dummy)
process_ib_ipinfo(in_msg, message, KVP_OP_SET_IP_INFO);
break;
case KVP_OP_GET_IP_INFO:
- /* We only need to pass on message->kvp_hdr.operation. */
+ /*
+ * We only need to pass on the info of operation, adapter_id
+ * and addr_family to the userland kvp daemon.
+ */
+ process_ib_ipinfo(in_msg, message, KVP_OP_GET_IP_INFO);
break;
case KVP_OP_SET:
switch (in_msg->body.kvp_set.data.value_type) {
@@ -446,9 +453,9 @@ kvp_send_key(struct work_struct *dummy)
}
- break;
-
- case KVP_OP_GET:
+ /*
+ * The key is always a string - utf16 encoding.
+ */
message->body.kvp_set.data.key_size =
utf16s_to_utf8s(
(wchar_t *)in_msg->body.kvp_set.data.key,
@@ -456,6 +463,17 @@ kvp_send_key(struct work_struct *dummy)
UTF16_LITTLE_ENDIAN,
message->body.kvp_set.data.key,
HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1) + 1;
+
+ break;
+
+ case KVP_OP_GET:
+ message->body.kvp_get.data.key_size =
+ utf16s_to_utf8s(
+ (wchar_t *)in_msg->body.kvp_get.data.key,
+ in_msg->body.kvp_get.data.key_size,
+ UTF16_LITTLE_ENDIAN,
+ message->body.kvp_get.data.key,
+ HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1) + 1;
break;
case KVP_OP_DELETE:
--
2.18.0
From: Andi Kleen <ak(a)linux.intel.com>
The Intel microcode revision space is unsigned. Inside Intel there are special
microcodes that have the highest bit set, and they are considered to have
a higher revision than any microcodes that don't have this bit set.
The function comparing the microcode revision in the Linux driver compares
u32 with int, which ends up being signed extended to long on 64bit
systems. This results in these highest bit set microcode revision not loading
because their revision appears negative and smaller than the
existing microcode.
Change the comparison to unsigned. With that the loading works
as expected.
Cc: stable(a)vger.kernel.org # Any supported stable
Signed-off-by: Andi Kleen <ak(a)linux.intel.com>
--
v2: White space changes.
---
arch/x86/kernel/cpu/microcode/intel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 16936a24795c..e54d402500d3 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -93,7 +93,8 @@ static int find_matching_signature(void *mc, unsigned int csig, int cpf)
/*
* Returns 1 if update has been found, 0 otherwise.
*/
-static int has_newer_microcode(void *mc, unsigned int csig, int cpf, int new_rev)
+static int has_newer_microcode(void *mc, unsigned int csig, int cpf,
+ unsigned new_rev)
{
struct microcode_header_intel *mc_hdr = mc;
--
2.17.1
We are one image studio who is able to process 300+ photos a day.
If you need any image editing, please let us know. We can do it for you
such as:
Image cut out for photos and clipping path, masking for your photos,
They are mostly used for ecommerce photos, jewelry photos retouching,
beauty and skin images
and wedding photos.
We do also different kind of beauty retouching, portraits retouching.
We can send editing for your photos if you send us one or two photos.
Thanks,
Linda
This is the start of the stable review cycle for the 4.18.16 release.
There are 53 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 Sat Oct 20 17:53:52 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.18.16-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.18.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.18.16-rc1
Alexey Brodkin <abrodkin(a)synopsys.com>
ARC: build: Don't set CROSS_COMPILE in arch's Makefile
Alexey Brodkin <abrodkin(a)synopsys.com>
ARC: build: Get rid of toolchain check
Linus Torvalds <torvalds(a)linux-foundation.org>
mremap: properly flush TLB before releasing the page
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "vfs: fix freeze protection in mnt_want_write_file() for overlayfs"
Kairui Song <kasong(a)redhat.com>
x86/boot: Fix kexec booting failure in the SEV bit detection code
Arindam Nath <arindam.nath(a)amd.com>
iommu/amd: Return devid as alias for ACPI HID devices
Srikar Dronamraju <srikar(a)linux.vnet.ibm.com>
powerpc/numa: Use associativity if VPHN hcall is successful
Michael Neuling <mikey(a)neuling.org>
powerpc/tm: Avoid possible userspace r1 corruption on reclaim
Michael Neuling <mikey(a)neuling.org>
powerpc/tm: Fix userspace r13 corruption
Daniel Kurtz <djkurtz(a)chromium.org>
pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type
Heiko Stuebner <heiko(a)sntech.de>
iommu/rockchip: Free irqs in shutdown handler
James Cowgill <jcowgill(a)debian.org>
RISC-V: include linux/ftrace.h in asm-prototypes.h
Selvin Xavier <selvin.xavier(a)broadcom.com>
RDMA/bnxt_re: Fix system crash during RDMA resource initialization
Tao Ren <taoren(a)fb.com>
clocksource/drivers/fttmr010: Fix set_next_event handler
Nathan Chancellor <natechancellor(a)gmail.com>
net/mlx4: Use cpumask_available for eq->affinity_mask
John Fastabend <john.fastabend(a)gmail.com>
bpf: test_maps, only support ESTABLISHED socks
John Fastabend <john.fastabend(a)gmail.com>
bpf: sockmap, fix transition through disconnect without close
John Fastabend <john.fastabend(a)gmail.com>
bpf: sockmap only allow ESTABLISHED sock state
Johannes Thumshirn <jthumshirn(a)suse.de>
scsi: sd: don't crash the host on invalid commands
Wen Xiong <wenxiong(a)linux.vnet.ibm.com>
scsi: ipr: System hung while dlpar adding primary ipr adapter back
Alexandru Gheorghe <alexandru-cosmin.gheorghe(a)arm.com>
drm: mali-dp: Call drm_crtc_vblank_reset on device init
James Smart <jsmart2021(a)gmail.com>
scsi: lpfc: Synchronize access to remoteport via rport
Majd Dibbiny <majd(a)mellanox.com>
RDMA/uverbs: Fix validity check for modify QP
Jisheng Zhang <Jisheng.Zhang(a)synaptics.com>
PCI: dwc: Fix scheduling while atomic issues
Sudarsana Reddy Kalluru <sudarsana.kalluru(a)cavium.com>
qed: Do not add VLAN 0 tag to untagged frames in multi-function mode.
Sudarsana Reddy Kalluru <sudarsana.kalluru(a)cavium.com>
qed: Fix populating the invalid stag value in multi function mode.
YueHaibing <yuehaibing(a)huawei.com>
net/smc: fix sizeof to int comparison
Ursula Braun <ubraun(a)linux.ibm.com>
net/smc: fix non-blocking connect problem
Kazuya Mizuguchi <kazuya.mizuguchi.ks(a)renesas.com>
ravb: do not write 1 to reserved bits
Christian Lamparter <chunkeey(a)gmail.com>
net: emac: fix fixed-link setup for the RTL8363SB switch
Sabrina Dubroca <sd(a)queasysnail.net>
selftests: pmtu: properly redirect stderr to /dev/null
Michael Schmitz <schmitzmic(a)gmail.com>
Input: atakbd - fix Atari CapsLock behaviour
Andreas Schwab <schwab(a)linux-m68k.org>
Input: atakbd - fix Atari keymap
Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
intel_th: pci: Add Ice Lake PCH support
Laura Abbott <labbott(a)redhat.com>
scsi: ibmvscsis: Ensure partition name is properly NUL terminated
Laura Abbott <labbott(a)redhat.com>
scsi: ibmvscsis: Fix a stringop-overflow warning
Keerthy <j-keerthy(a)ti.com>
clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
Steve Wise <swise(a)opengridcomputing.com>
cxgb4: fix abort_req_rss6 struct
Marek Lindner <mareklindner(a)neomailbox.ch>
batman-adv: fix hardif_neigh refcount on queue_work() failure
Marek Lindner <mareklindner(a)neomailbox.ch>
batman-adv: fix backbone_gw refcount on queue_work() failure
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Prevent duplicated tvlv handler
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Prevent duplicated global TT entry
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Prevent duplicated softif_vlan entry
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Prevent duplicated nc_node entry
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Prevent duplicated gateway_node entry
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Fix segfault when writing to sysfs elp_interval
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Fix segfault when writing to throughput_override
Sven Eckelmann <sven(a)narfation.org>
batman-adv: Avoid probe ELP information leak
Linus Walleij <linus.walleij(a)linaro.org>
spi: gpio: Fix copy-and-paste error
Jozef Balga <jozef.balga(a)gmail.com>
media: af9035: prevent buffer overflow on write
Sanyog Kale <sanyog.r.kale(a)intel.com>
soundwire: Fix acquiring bus lock twice during master release
Shreyas NC <shreyas.nc(a)intel.com>
soundwire: Fix incorrect exit after configuring stream
Shreyas NC <shreyas.nc(a)intel.com>
soundwire: Fix duplicate stream state assignment
-------------
Diffstat:
Makefile | 4 +-
arch/arc/Makefile | 24 +-----
arch/powerpc/kernel/tm.S | 20 ++++-
arch/powerpc/mm/numa.c | 4 +-
arch/riscv/include/asm/asm-prototypes.h | 7 ++
arch/x86/boot/compressed/mem_encrypt.S | 19 -----
drivers/clocksource/timer-fttmr010.c | 18 +++--
drivers/clocksource/timer-ti-32k.c | 3 +
drivers/gpu/drm/arm/malidp_drv.c | 1 +
drivers/hwtracing/intel_th/pci.c | 5 ++
drivers/infiniband/core/uverbs_cmd.c | 68 +++++++++++------
drivers/infiniband/hw/bnxt_re/main.c | 93 ++++++++++-------------
drivers/input/keyboard/atakbd.c | 74 +++++++------------
drivers/iommu/amd_iommu.c | 6 ++
drivers/iommu/rockchip-iommu.c | 6 ++
drivers/media/usb/dvb-usb-v2/af9035.c | 6 +-
drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | 1 -
drivers/net/ethernet/ibm/emac/core.c | 15 ++--
drivers/net/ethernet/mellanox/mlx4/eq.c | 3 +-
drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 9 ++-
drivers/net/ethernet/qlogic/qed/qed_dcbx.h | 1 +
drivers/net/ethernet/qlogic/qed/qed_dev.c | 15 +++-
drivers/net/ethernet/qlogic/qed/qed_hsi.h | 4 +
drivers/net/ethernet/renesas/ravb.h | 5 ++
drivers/net/ethernet/renesas/ravb_main.c | 11 +--
drivers/net/ethernet/renesas/ravb_ptp.c | 2 +-
drivers/pci/controller/dwc/pcie-designware.c | 8 +-
drivers/pci/controller/dwc/pcie-designware.h | 3 +-
drivers/pinctrl/pinctrl-amd.c | 33 ++++++---
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 5 +-
drivers/scsi/ipr.c | 106 +++++++++++++++------------
drivers/scsi/ipr.h | 1 +
drivers/scsi/lpfc/lpfc_attr.c | 15 ++--
drivers/scsi/lpfc/lpfc_debugfs.c | 10 +--
drivers/scsi/lpfc/lpfc_nvme.c | 11 ++-
drivers/scsi/sd.c | 3 +-
drivers/soundwire/stream.c | 23 ++++--
drivers/spi/spi-gpio.c | 4 +-
fs/namespace.c | 7 +-
include/linux/huge_mm.h | 2 +-
kernel/bpf/sockmap.c | 91 ++++++++++++++++++-----
mm/huge_memory.c | 10 +--
mm/mremap.c | 30 ++++----
net/batman-adv/bat_v_elp.c | 10 ++-
net/batman-adv/bridge_loop_avoidance.c | 10 ++-
net/batman-adv/gateway_client.c | 11 ++-
net/batman-adv/network-coding.c | 27 ++++---
net/batman-adv/soft-interface.c | 25 +++++--
net/batman-adv/sysfs.c | 30 +++++---
net/batman-adv/translation-table.c | 6 +-
net/batman-adv/tvlv.c | 8 +-
net/smc/af_smc.c | 7 +-
net/smc/smc_clc.c | 14 ++--
tools/testing/selftests/bpf/test_maps.c | 10 ++-
tools/testing/selftests/net/pmtu.sh | 4 +-
55 files changed, 563 insertions(+), 385 deletions(-)
From: Masami Hiramatsu <mhiramat(a)kernel.org>
Fix synthetic event to allow independent semicolon at end.
The synthetic_events interface accepts a semicolon after the
last word if there is no space.
# echo "myevent u64 var;" >> synthetic_events
But if there is a space, it returns an error.
# echo "myevent u64 var ;" > synthetic_events
sh: write error: Invalid argument
This behavior is difficult for users to understand. Let's
allow the last independent semicolon too.
Link: http://lkml.kernel.org/r/153986835420.18251.2191216690677025744.stgit@devbox
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Tom Zanussi <tom.zanussi(a)linux.intel.com>
Cc: stable(a)vger.kernel.org
Fixes: commit 4b147936fa50 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 6ff83941065a..d239004aaf29 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1088,7 +1088,7 @@ static int create_synth_event(int argc, char **argv)
i += consumed - 1;
}
- if (i < argc) {
+ if (i < argc && strcmp(argv[i], ";") != 0) {
ret = -EINVAL;
goto err;
}
--
2.19.0