linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.19 00/40] 4.19.117-rc1 review
@ 2020-04-20 12:39 Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 01/40] amd-xgbe: Use __napi_schedule() in BH context Greg Kroah-Hartman
                   ` (44 more replies)
  0 siblings, 45 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah, patches,
	ben.hutchings, lkft-triage, stable

This is the start of the stable review cycle for the 4.19.117 release.
There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
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.19.117-rc1.gz
or in the git tree and branch at:
	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 4.19.117-rc1

Austin Kim <austindh.kim@gmail.com>
    mm/vmalloc.c: move 'area->pages' after if statement

Karthick Gopalasubramanian <kargop@codeaurora.org>
    wil6210: remove reset file from debugfs

Dedy Lansky <dlansky@codeaurora.org>
    wil6210: make sure Rx ring sizes are correlated

Alexei Avshalom Lazar <ailizaro@codeaurora.org>
    wil6210: add general initialization/size checks

Maya Erez <merez@codeaurora.org>
    wil6210: ignore HALP ICR if already handled

Dedy Lansky <dlansky@codeaurora.org>
    wil6210: check rx_buff_mgmt before accessing it

Reinette Chatre <reinette.chatre@intel.com>
    x86/resctrl: Fix invalid attempt at removing the default resource group

James Morse <james.morse@arm.com>
    x86/resctrl: Preserve CDP enable over CPU hotplug

John Allen <john.allen@amd.com>
    x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE

Maurizio Lombardi <mlombard@redhat.com>
    scsi: target: fix hang when multiple threads try to destroy the same iscsi session

Maurizio Lombardi <mlombard@redhat.com>
    scsi: target: remove boilerplate code

Jim Mattson <jmattson@google.com>
    kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD

Jan Kara <jack@suse.cz>
    ext4: do not zeroout extents beyond i_disksize

Sergei Lopatin <magist3r@gmail.com>
    drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Don't clear flags before transfer ended

Sasha Levin <sashal@kernel.org>
    usb: dwc3: gadget: don't enable interrupt when disabling endpoint

Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
    mac80211_hwsim: Use kstrndup() in place of kasprintf()

Josef Bacik <josef@toxicpanda.com>
    btrfs: check commit root generation in should_ignore_root

Xiao Yang <yangx.jy@cn.fujitsu.com>
    tracing: Fix the race between registering 'snapshot' event trigger and triggering 'snapshot' operation

Vasily Averin <vvs@virtuozzo.com>
    keys: Fix proc_keys_next to increase position index

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Check mapping at creating connector controls, too

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Don't create jack controls for PCM terminals

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Don't override ignore_ctl_error value from the map

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Filter error from connector kctl ops, too

Colin Ian King <colin.king@canonical.com>
    ASoC: Intel: mrfld: return error codes when an error occurs

Colin Ian King <colin.king@canonical.com>
    ASoC: Intel: mrfld: fix incorrect check on p->sink

Josh Triplett <josh@joshtriplett.org>
    ext4: fix incorrect inodes per group in error message

Josh Triplett <josh@joshtriplett.org>
    ext4: fix incorrect group count in ext4_fill_super error message

Sven Van Asbroeck <TheSven73@gmail.com>
    pwm: pca9685: Fix PWM/GPIO inter-operation

zhangyi (F) <yi.zhang@huawei.com>
    jbd2: improve comments about freeing data buffers whose page mapping is NULL

Can Guo <cang@codeaurora.org>
    scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic

Amir Goldstein <amir73il@gmail.com>
    ovl: fix value of i_ino for lower hardlink corner case

DENG Qingfang <dqfext@gmail.com>
    net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode

Florian Fainelli <f.fainelli@gmail.com>
    net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes

Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
    net: revert default NAPI poll timeout to 2 jiffies

Wang Wenhu <wenhu.wang@vivo.com>
    net: qrtr: send msgs from local of same id as broadcast

Tim Stallard <code@timstallard.me.uk>
    net: ipv6: do not consider routes via gateways for anycast address check

Taras Chornyi <taras.chornyi@plvision.eu>
    net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin

Taehee Yoo <ap420073@gmail.com>
    hsr: check protocol version in hsr_newlink()

Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    amd-xgbe: Use __napi_schedule() in BH context


-------------

Diffstat:

 Makefile                                          |  4 +-
 arch/x86/include/asm/microcode_amd.h              |  2 +-
 arch/x86/kernel/cpu/intel_rdt.c                   |  2 +
 arch/x86/kernel/cpu/intel_rdt.h                   |  1 +
 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c          | 16 ++++-
 arch/x86/kvm/cpuid.c                              |  3 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c  |  5 +-
 drivers/net/dsa/mt7530.c                          | 18 +++--
 drivers/net/dsa/mt7530.h                          |  7 ++
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c          |  2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c |  2 +
 drivers/net/wireless/ath/wil6210/debugfs.c        | 29 +-------
 drivers/net/wireless/ath/wil6210/interrupt.c      | 12 ++--
 drivers/net/wireless/ath/wil6210/main.c           |  5 +-
 drivers/net/wireless/ath/wil6210/txrx.c           |  4 +-
 drivers/net/wireless/ath/wil6210/txrx_edma.c      | 14 +++-
 drivers/net/wireless/ath/wil6210/wil6210.h        |  3 +-
 drivers/net/wireless/ath/wil6210/wmi.c            |  2 +-
 drivers/net/wireless/mac80211_hwsim.c             | 12 ++--
 drivers/pwm/pwm-pca9685.c                         | 85 +++++++++++++----------
 drivers/scsi/ufs/ufshcd.c                         |  5 ++
 drivers/target/iscsi/iscsi_target.c               | 79 ++++++---------------
 drivers/target/iscsi/iscsi_target.h               |  1 -
 drivers/target/iscsi/iscsi_target_configfs.c      |  5 +-
 drivers/target/iscsi/iscsi_target_login.c         |  5 +-
 drivers/usb/dwc3/gadget.c                         | 18 ++---
 fs/btrfs/relocation.c                             |  4 +-
 fs/ext4/extents.c                                 |  8 +--
 fs/ext4/super.c                                   |  6 +-
 fs/jbd2/commit.c                                  |  7 +-
 fs/overlayfs/inode.c                              |  4 +-
 include/net/ip6_route.h                           |  1 +
 include/target/iscsi/iscsi_target_core.h          |  2 +-
 kernel/trace/trace_events_trigger.c               | 10 +--
 mm/vmalloc.c                                      |  8 ++-
 net/core/dev.c                                    |  3 +-
 net/hsr/hsr_netlink.c                             | 10 ++-
 net/ipv4/devinet.c                                | 13 ++--
 net/qrtr/qrtr.c                                   |  7 +-
 security/keys/proc.c                              |  2 +
 sound/soc/intel/atom/sst-atom-controls.c          |  2 +-
 sound/soc/intel/atom/sst/sst_pci.c                |  2 +-
 sound/usb/mixer.c                                 | 31 +++++----
 sound/usb/mixer_maps.c                            |  4 +-
 44 files changed, 252 insertions(+), 213 deletions(-)



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 01/40] amd-xgbe: Use __napi_schedule() in BH context
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 02/40] hsr: check protocol version in hsr_newlink() Greg Kroah-Hartman
                   ` (43 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sebastian Andrzej Siewior,
	Tom Lendacky, David S. Miller

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

[ Upstream commit d518691cbd3be3dae218e05cca3f3fc9b2f1aa77 ]

The driver uses __napi_schedule_irqoff() which is fine as long as it is
invoked with disabled interrupts by everybody. Since the commit
mentioned below the driver may invoke xgbe_isr_task() in tasklet/softirq
context. This may lead to list corruption if another driver uses
__napi_schedule_irqoff() in IRQ context.

Use __napi_schedule() which safe to use from IRQ and softirq context.

Fixes: 85b85c853401d ("amd-xgbe: Re-issue interrupt if interrupt status not cleared")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -515,7 +515,7 @@ static void xgbe_isr_task(unsigned long
 				xgbe_disable_rx_tx_ints(pdata);
 
 				/* Turn on polling */
-				__napi_schedule_irqoff(&pdata->napi);
+				__napi_schedule(&pdata->napi);
 			}
 		} else {
 			/* Don't clear Rx/Tx status if doing per channel DMA



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 02/40] hsr: check protocol version in hsr_newlink()
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 01/40] amd-xgbe: Use __napi_schedule() in BH context Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 03/40] net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Taehee Yoo, David S. Miller

From: Taehee Yoo <ap420073@gmail.com>

[ Upstream commit 4faab8c446def7667adf1f722456c2f4c304069c ]

In the current hsr code, only 0 and 1 protocol versions are valid.
But current hsr code doesn't check the version, which is received by
userspace.

Test commands:
    ip link add dummy0 type dummy
    ip link add dummy1 type dummy
    ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 version 4

In the test commands, version 4 is invalid.
So, the command should be failed.

After this patch, following error will occur.
"Error: hsr: Only versions 0..1 are supported."

Fixes: ee1c27977284 ("net/hsr: Added support for HSR v1")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/hsr/hsr_netlink.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/net/hsr/hsr_netlink.c
+++ b/net/hsr/hsr_netlink.c
@@ -64,10 +64,16 @@ static int hsr_newlink(struct net *src_n
 	else
 		multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]);
 
-	if (!data[IFLA_HSR_VERSION])
+	if (!data[IFLA_HSR_VERSION]) {
 		hsr_version = 0;
-	else
+	} else {
 		hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]);
+		if (hsr_version > 1) {
+			NL_SET_ERR_MSG_MOD(extack,
+					   "Only versions 0..1 are supported");
+			return -EINVAL;
+		}
+	}
 
 	return hsr_dev_finalize(dev, link, multicast_spec, hsr_version);
 }



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 03/40] net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 01/40] amd-xgbe: Use __napi_schedule() in BH context Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 02/40] hsr: check protocol version in hsr_newlink() Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 04/40] net: ipv6: do not consider routes via gateways for anycast address check Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Taras Chornyi, Vadym Kochan, David S. Miller

From: Taras Chornyi <taras.chornyi@plvision.eu>

[ Upstream commit 690cc86321eb9bcee371710252742fb16fe96824 ]

When CONFIG_IP_MULTICAST is not set and multicast ip is added to the device
with autojoin flag or when multicast ip is deleted kernel will crash.

steps to reproduce:

ip addr add 224.0.0.0/32 dev eth0
ip addr del 224.0.0.0/32 dev eth0

or

ip addr add 224.0.0.0/32 dev eth0 autojoin

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000088
 pc : _raw_write_lock_irqsave+0x1e0/0x2ac
 lr : lock_sock_nested+0x1c/0x60
 Call trace:
  _raw_write_lock_irqsave+0x1e0/0x2ac
  lock_sock_nested+0x1c/0x60
  ip_mc_config.isra.28+0x50/0xe0
  inet_rtm_deladdr+0x1a8/0x1f0
  rtnetlink_rcv_msg+0x120/0x350
  netlink_rcv_skb+0x58/0x120
  rtnetlink_rcv+0x14/0x20
  netlink_unicast+0x1b8/0x270
  netlink_sendmsg+0x1a0/0x3b0
  ____sys_sendmsg+0x248/0x290
  ___sys_sendmsg+0x80/0xc0
  __sys_sendmsg+0x68/0xc0
  __arm64_sys_sendmsg+0x20/0x30
  el0_svc_common.constprop.2+0x88/0x150
  do_el0_svc+0x20/0x80
 el0_sync_handler+0x118/0x190
  el0_sync+0x140/0x180

Fixes: 93a714d6b53d ("multicast: Extend ip address command to enable multicast group join/leave on")
Signed-off-by: Taras Chornyi <taras.chornyi@plvision.eu>
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/devinet.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -587,12 +587,15 @@ struct in_ifaddr *inet_ifa_byprefix(stru
 	return NULL;
 }
 
-static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa)
+static int ip_mc_autojoin_config(struct net *net, bool join,
+				 const struct in_ifaddr *ifa)
 {
+#if defined(CONFIG_IP_MULTICAST)
 	struct ip_mreqn mreq = {
 		.imr_multiaddr.s_addr = ifa->ifa_address,
 		.imr_ifindex = ifa->ifa_dev->dev->ifindex,
 	};
+	struct sock *sk = net->ipv4.mc_autojoin_sk;
 	int ret;
 
 	ASSERT_RTNL();
@@ -605,6 +608,9 @@ static int ip_mc_config(struct sock *sk,
 	release_sock(sk);
 
 	return ret;
+#else
+	return -EOPNOTSUPP;
+#endif
 }
 
 static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh,
@@ -646,7 +652,7 @@ static int inet_rtm_deladdr(struct sk_bu
 			continue;
 
 		if (ipv4_is_multicast(ifa->ifa_address))
-			ip_mc_config(net->ipv4.mc_autojoin_sk, false, ifa);
+			ip_mc_autojoin_config(net, false, ifa);
 		__inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid);
 		return 0;
 	}
@@ -907,8 +913,7 @@ static int inet_rtm_newaddr(struct sk_bu
 		 */
 		set_ifa_lifetime(ifa, valid_lft, prefered_lft);
 		if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) {
-			int ret = ip_mc_config(net->ipv4.mc_autojoin_sk,
-					       true, ifa);
+			int ret = ip_mc_autojoin_config(net, true, ifa);
 
 			if (ret < 0) {
 				inet_free_ifa(ifa);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 04/40] net: ipv6: do not consider routes via gateways for anycast address check
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 03/40] net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 05/40] net: qrtr: send msgs from local of same id as broadcast Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Tim Stallard, David S. Miller

From: Tim Stallard <code@timstallard.me.uk>

[ Upstream commit 03e2a984b6165621f287fadf5f4b5cd8b58dcaba ]

The behaviour for what is considered an anycast address changed in
commit 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after
encountering pmtu exception"). This now considers the first
address in a subnet where there is a route via a gateway
to be an anycast address.

This breaks path MTU discovery and traceroutes when a host in a
remote network uses the address at the start of a prefix
(eg 2600:: advertised as 2600::/48 in the DFZ) as ICMP errors
will not be sent to anycast addresses.

This patch excludes any routes with a gateway, or via point to
point links, like the behaviour previously from
rt6_is_gw_or_nonexthop in net/ipv6/route.c.

This can be tested with:
ip link add v1 type veth peer name v2
ip netns add test
ip netns exec test ip link set lo up
ip link set v2 netns test
ip link set v1 up
ip netns exec test ip link set v2 up
ip addr add 2001:db8::1/64 dev v1 nodad
ip addr add 2001:db8:100:: dev lo nodad
ip netns exec test ip addr add 2001:db8::2/64 dev v2 nodad
ip netns exec test ip route add unreachable 2001:db8:1::1
ip netns exec test ip route add 2001:db8:100::/64 via 2001:db8::1
ip netns exec test sysctl net.ipv6.conf.all.forwarding=1
ip route add 2001:db8:1::1 via 2001:db8::2
ping -I 2001:db8::1 2001:db8:1::1 -c1
ping -I 2001:db8:100:: 2001:db8:1::1 -c1
ip addr delete 2001:db8:100:: dev lo
ip netns delete test

Currently the first ping will get back a destination unreachable ICMP
error, but the second will never get a response, with "icmp6_send:
acast source" logged. After this patch, both get destination
unreachable ICMP replies.

Fixes: 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after encountering pmtu exception")
Signed-off-by: Tim Stallard <code@timstallard.me.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/net/ip6_route.h |    1 +
 1 file changed, 1 insertion(+)

--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -234,6 +234,7 @@ static inline bool ipv6_anycast_destinat
 
 	return rt->rt6i_flags & RTF_ANYCAST ||
 		(rt->rt6i_dst.plen < 127 &&
+		 !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) &&
 		 ipv6_addr_equal(&rt->rt6i_dst.addr, daddr));
 }
 



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 05/40] net: qrtr: send msgs from local of same id as broadcast
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 04/40] net: ipv6: do not consider routes via gateways for anycast address check Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 06/40] net: revert default NAPI poll timeout to 2 jiffies Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Wang Wenhu, David S. Miller

From: Wang Wenhu <wenhu.wang@vivo.com>

[ Upstream commit 6dbf02acef69b0742c238574583b3068afbd227c ]

If the local node id(qrtr_local_nid) is not modified after its
initialization, it equals to the broadcast node id(QRTR_NODE_BCAST).
So the messages from local node should not be taken as broadcast
and keep the process going to send them out anyway.

The definitions are as follow:
static unsigned int qrtr_local_nid = NUMA_NO_NODE;

Fixes: fdf5fd397566 ("net: qrtr: Broadcast messages only from control port")
Signed-off-by: Wang Wenhu <wenhu.wang@vivo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/qrtr/qrtr.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -769,20 +769,21 @@ static int qrtr_sendmsg(struct socket *s
 
 	node = NULL;
 	if (addr->sq_node == QRTR_NODE_BCAST) {
-		enqueue_fn = qrtr_bcast_enqueue;
-		if (addr->sq_port != QRTR_PORT_CTRL) {
+		if (addr->sq_port != QRTR_PORT_CTRL &&
+		    qrtr_local_nid != QRTR_NODE_BCAST) {
 			release_sock(sk);
 			return -ENOTCONN;
 		}
+		enqueue_fn = qrtr_bcast_enqueue;
 	} else if (addr->sq_node == ipc->us.sq_node) {
 		enqueue_fn = qrtr_local_enqueue;
 	} else {
-		enqueue_fn = qrtr_node_enqueue;
 		node = qrtr_node_lookup(addr->sq_node);
 		if (!node) {
 			release_sock(sk);
 			return -ECONNRESET;
 		}
+		enqueue_fn = qrtr_node_enqueue;
 	}
 
 	plen = (len + 3) & ~3;



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 06/40] net: revert default NAPI poll timeout to 2 jiffies
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 05/40] net: qrtr: send msgs from local of same id as broadcast Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 07/40] net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dmitry Yakunin,
	Konstantin Khlebnikov, David S. Miller

From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>

[ Upstream commit a4837980fd9fa4c70a821d11831698901baef56b ]

For HZ < 1000 timeout 2000us rounds up to 1 jiffy but expires randomly
because next timer interrupt could come shortly after starting softirq.

For commonly used CONFIG_HZ=1000 nothing changes.

Fixes: 7acf8a1e8a28 ("Replace 2 jiffies with sysctl netdev_budget_usecs to enable softirq tuning")
Reported-by: Dmitry Yakunin <zeil@yandex-team.ru>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/dev.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3934,7 +3934,8 @@ EXPORT_SYMBOL(netdev_max_backlog);
 
 int netdev_tstamp_prequeue __read_mostly = 1;
 int netdev_budget __read_mostly = 300;
-unsigned int __read_mostly netdev_budget_usecs = 2000;
+/* Must be at least 2 jiffes to guarantee 1 jiffy timeout */
+unsigned int __read_mostly netdev_budget_usecs = 2 * USEC_PER_SEC / HZ;
 int weight_p __read_mostly = 64;           /* old backlog weight */
 int dev_weight_rx_bias __read_mostly = 1;  /* bias for backlog weight */
 int dev_weight_tx_bias __read_mostly = 1;  /* bias for output_queue quota */



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 07/40] net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 06/40] net: revert default NAPI poll timeout to 2 jiffies Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 08/40] net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Chen-Yu Tsai, Florian Fainelli,
	David S. Miller

From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit 806fd188ce2a4f8b587e83e73c478e6484fbfa55 ]

After commit bfcb813203e619a8960a819bf533ad2a108d8105 ("net: dsa:
configure the MTU for switch ports") my Lamobo R1 platform which uses
an allwinner,sun7i-a20-gmac compatible Ethernet MAC started to fail
by rejecting a MTU of 1536. The reason for that is that the DMA
capabilities are not readable on this version of the IP, and there
is also no 'tx-fifo-depth' property being provided in Device Tree. The
property is documented as optional, and is not provided.

Chen-Yu indicated that the FIFO sizes are 4KB for TX and 16KB for RX, so
provide these values through platform data as an immediate fix until
various Device Tree sources get updated accordingly.

Fixes: eaf4fac47807 ("net: stmmac: Do not accept invalid MTU values")
Suggested-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
@@ -155,6 +155,8 @@ static int sun7i_gmac_probe(struct platf
 	plat_dat->init = sun7i_gmac_init;
 	plat_dat->exit = sun7i_gmac_exit;
 	plat_dat->fix_mac_speed = sun7i_fix_speed;
+	plat_dat->tx_fifo_size = 4096;
+	plat_dat->rx_fifo_size = 16384;
 
 	ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);
 	if (ret)



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 08/40] net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 07/40] net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 09/40] ovl: fix value of i_ino for lower hardlink corner case Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, DENG Qingfang, Florian Fainelli,
	René van Dorst, David S. Miller

From: DENG Qingfang <dqfext@gmail.com>

[ Upstream commit e045124e93995fe01e42ed530003ddba5d55db4f ]

In VLAN-unaware mode, the Egress Tag (EG_TAG) field in Port VLAN
Control register must be set to Consistent to let tagged frames pass
through as is, otherwise their tags will be stripped.

Fixes: 83163f7dca56 ("net: dsa: mediatek: add VLAN support for MT7530")
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: René van Dorst <opensource@vdorst.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/dsa/mt7530.c |   18 ++++++++++++------
 drivers/net/dsa/mt7530.h |    7 +++++++
 2 files changed, 19 insertions(+), 6 deletions(-)

--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -824,8 +824,9 @@ mt7530_port_set_vlan_unaware(struct dsa_
 	 */
 	mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK,
 		   MT7530_PORT_MATRIX_MODE);
-	mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK,
-		   VLAN_ATTR(MT7530_VLAN_TRANSPARENT));
+	mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK,
+		   VLAN_ATTR(MT7530_VLAN_TRANSPARENT) |
+		   PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
 
 	priv->ports[port].vlan_filtering = false;
 
@@ -843,8 +844,8 @@ mt7530_port_set_vlan_unaware(struct dsa_
 	if (all_user_ports_removed) {
 		mt7530_write(priv, MT7530_PCR_P(MT7530_CPU_PORT),
 			     PCR_MATRIX(dsa_user_ports(priv->ds)));
-		mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT),
-			     PORT_SPEC_TAG);
+		mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT), PORT_SPEC_TAG
+			     | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
 	}
 }
 
@@ -870,8 +871,9 @@ mt7530_port_set_vlan_aware(struct dsa_sw
 	/* Set the port as a user port which is to be able to recognize VID
 	 * from incoming packets before fetching entry within the VLAN table.
 	 */
-	mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK,
-		   VLAN_ATTR(MT7530_VLAN_USER));
+	mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK,
+		   VLAN_ATTR(MT7530_VLAN_USER) |
+		   PVC_EG_TAG(MT7530_VLAN_EG_DISABLED));
 }
 
 static void
@@ -1297,6 +1299,10 @@ mt7530_setup(struct dsa_switch *ds)
 			mt7530_cpu_port_enable(priv, i);
 		else
 			mt7530_port_disable(ds, i, NULL);
+
+		/* Enable consistent egress tag */
+		mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
+			   PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
 	}
 
 	/* Flush the FDB table */
--- a/drivers/net/dsa/mt7530.h
+++ b/drivers/net/dsa/mt7530.h
@@ -167,9 +167,16 @@ enum mt7530_port_mode {
 /* Register for port vlan control */
 #define MT7530_PVC_P(x)			(0x2010 + ((x) * 0x100))
 #define  PORT_SPEC_TAG			BIT(5)
+#define  PVC_EG_TAG(x)			(((x) & 0x7) << 8)
+#define  PVC_EG_TAG_MASK		PVC_EG_TAG(7)
 #define  VLAN_ATTR(x)			(((x) & 0x3) << 6)
 #define  VLAN_ATTR_MASK			VLAN_ATTR(3)
 
+enum mt7530_vlan_port_eg_tag {
+	MT7530_VLAN_EG_DISABLED = 0,
+	MT7530_VLAN_EG_CONSISTENT = 1,
+};
+
 enum mt7530_vlan_port_attr {
 	MT7530_VLAN_USER = 0,
 	MT7530_VLAN_TRANSPARENT = 3,



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 09/40] ovl: fix value of i_ino for lower hardlink corner case
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 08/40] net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 10/40] scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Amir Goldstein, Miklos Szeredi

From: Amir Goldstein <amir73il@gmail.com>

commit 300b124fcf6ad2cd99a7b721e0f096785e0a3134 upstream.

Commit 6dde1e42f497 ("ovl: make i_ino consistent with st_ino in more
cases"), relaxed the condition nfs_export=on in order to set the value of
i_ino to xino map of real ino.

Specifically, it also relaxed the pre-condition that index=on for
consistent i_ino. This opened the corner case of lower hardlink in
ovl_get_inode(), which calls ovl_fill_inode() with ino=0 and then
ovl_init_inode() is called to set i_ino to lower real ino without the xino
mapping.

Pass the correct values of ino;fsid in this case to ovl_fill_inode(), so it
can initialize i_ino correctly.

Fixes: 6dde1e42f497 ("ovl: make i_ino consistent with st_ino in more ...")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/overlayfs/inode.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -884,7 +884,7 @@ struct inode *ovl_get_inode(struct super
 	struct dentry *lowerdentry = lowerpath ? lowerpath->dentry : NULL;
 	bool bylower = ovl_hash_bylower(sb, upperdentry, lowerdentry,
 					oip->index);
-	int fsid = bylower ? oip->lowerpath->layer->fsid : 0;
+	int fsid = bylower ? lowerpath->layer->fsid : 0;
 	bool is_dir, metacopy = false;
 	unsigned long ino = 0;
 	int err = oip->newinode ? -EEXIST : -ENOMEM;
@@ -934,6 +934,8 @@ struct inode *ovl_get_inode(struct super
 			err = -ENOMEM;
 			goto out_err;
 		}
+		ino = realinode->i_ino;
+		fsid = lowerpath->layer->fsid;
 	}
 	ovl_fill_inode(inode, realinode->i_mode, realinode->i_rdev, ino, fsid);
 	ovl_inode_init(inode, upperdentry, lowerdentry, oip->lowerdata);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 10/40] scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 09/40] ovl: fix value of i_ino for lower hardlink corner case Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 11/40] jbd2: improve comments about freeing data buffers whose page mapping is NULL Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Hongwu Su, Asutosh Das, Bean Huo,
	Stanley Chu, Can Guo, Martin K. Petersen

From: Can Guo <cang@codeaurora.org>

commit c63d6099a7959ecc919b2549dc6b71f53521f819 upstream.

The async version of ufshcd_hold(async == true), which is only called in
queuecommand path as for now, is expected to work in atomic context, thus
it should not sleep or schedule out. When it runs into the condition that
clocks are ON but link is still in hibern8 state, it should bail out
without flushing the clock ungate work.

Fixes: f2a785ac2312 ("scsi: ufshcd: Fix race between clk scaling and ungate work")
Link: https://lore.kernel.org/r/1581392451-28743-6-git-send-email-cang@codeaurora.org
Reviewed-by: Hongwu Su <hongwus@codeaurora.org>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/ufs/ufshcd.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1563,6 +1563,11 @@ start:
 		 */
 		if (ufshcd_can_hibern8_during_gating(hba) &&
 		    ufshcd_is_link_hibern8(hba)) {
+			if (async) {
+				rc = -EAGAIN;
+				hba->clk_gating.active_reqs--;
+				break;
+			}
 			spin_unlock_irqrestore(hba->host->host_lock, flags);
 			flush_work(&hba->clk_gating.ungate_work);
 			spin_lock_irqsave(hba->host->host_lock, flags);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 11/40] jbd2: improve comments about freeing data buffers whose page mapping is NULL
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 10/40] scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 12/40] pwm: pca9685: Fix PWM/GPIO inter-operation Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jan Kara, zhangyi (F), Theodore Tso

From: zhangyi (F) <yi.zhang@huawei.com>

commit 780f66e59231fcf882f36c63f287252ee47cc75a upstream.

Improve comments in jbd2_journal_commit_transaction() to describe why
we don't need to clear the buffer_mapped bit for freeing file mapping
buffers whose page mapping is NULL.

Link: https://lore.kernel.org/r/20200217112706.20085-1-yi.zhang@huawei.com
Fixes: c96dceeabf76 ("jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer")
Suggested-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/jbd2/commit.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -992,9 +992,10 @@ restart_loop:
 			 * journalled data) we need to unmap buffer and clear
 			 * more bits. We also need to be careful about the check
 			 * because the data page mapping can get cleared under
-			 * out hands, which alse need not to clear more bits
-			 * because the page and buffers will be freed and can
-			 * never be reused once we are done with them.
+			 * our hands. Note that if mapping == NULL, we don't
+			 * need to make buffer unmapped because the page is
+			 * already detached from the mapping and buffers cannot
+			 * get reused.
 			 */
 			mapping = READ_ONCE(bh->b_page->mapping);
 			if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) {



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 12/40] pwm: pca9685: Fix PWM/GPIO inter-operation
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 11/40] jbd2: improve comments about freeing data buffers whose page mapping is NULL Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 13/40] ext4: fix incorrect group count in ext4_fill_super error message Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, YueHaibing, Mika Westerberg,
	Uwe Kleine-König, Sven Van Asbroeck, Clemens Gruber,
	Thierry Reding

From: Sven Van Asbroeck <TheSven73@gmail.com>

commit 9cc5f232a4b6a0ef6e9b57876d61b88f61bdd7c2 upstream.

This driver allows pwms to be requested as gpios via gpiolib. Obviously,
it should not be allowed to request a GPIO when its corresponding PWM is
already requested (and vice versa). So it requires some exclusion code.

Given that the PWMm and GPIO cores are not synchronized with respect to
each other, this exclusion code will also require proper
synchronization.

Such a mechanism was in place, but was inadvertently removed by Uwe's
clean-up in commit e926b12c611c ("pwm: Clear chip_data in pwm_put()").

Upon revisiting the synchronization mechanism, we found that
theoretically, it could allow two threads to successfully request
conflicting PWMs/GPIOs.

Replace with a bitmap which tracks PWMs in-use, plus a mutex. As long as
PWM and GPIO's respective request/free functions modify the in-use
bitmap while holding the mutex, proper synchronization will be
guaranteed.

Reported-by: YueHaibing <yuehaibing@huawei.com>
Fixes: e926b12c611c ("pwm: Clear chip_data in pwm_put()")
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: YueHaibing <yuehaibing@huawei.com>
Link: https://lkml.org/lkml/2019/5/31/963
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
[cg: Tested on an i.MX6Q board with two NXP PCA9685 chips]
Tested-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com> # cg's rebase
Link: https://lore.kernel.org/lkml/20200330160238.GD2817345@ulmo/
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pwm/pwm-pca9685.c |   85 +++++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 37 deletions(-)

--- a/drivers/pwm/pwm-pca9685.c
+++ b/drivers/pwm/pwm-pca9685.c
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/pm_runtime.h>
+#include <linux/bitmap.h>
 
 /*
  * Because the PCA9685 has only one prescaler per chip, changing the period of
@@ -85,6 +86,7 @@ struct pca9685 {
 #if IS_ENABLED(CONFIG_GPIOLIB)
 	struct mutex lock;
 	struct gpio_chip gpio;
+	DECLARE_BITMAP(pwms_inuse, PCA9685_MAXCHAN + 1);
 #endif
 };
 
@@ -94,51 +96,51 @@ static inline struct pca9685 *to_pca(str
 }
 
 #if IS_ENABLED(CONFIG_GPIOLIB)
-static int pca9685_pwm_gpio_request(struct gpio_chip *gpio, unsigned int offset)
+static bool pca9685_pwm_test_and_set_inuse(struct pca9685 *pca, int pwm_idx)
 {
-	struct pca9685 *pca = gpiochip_get_data(gpio);
-	struct pwm_device *pwm;
+	bool is_inuse;
 
 	mutex_lock(&pca->lock);
-
-	pwm = &pca->chip.pwms[offset];
-
-	if (pwm->flags & (PWMF_REQUESTED | PWMF_EXPORTED)) {
-		mutex_unlock(&pca->lock);
-		return -EBUSY;
+	if (pwm_idx >= PCA9685_MAXCHAN) {
+		/*
+		 * "all LEDs" channel:
+		 * pretend already in use if any of the PWMs are requested
+		 */
+		if (!bitmap_empty(pca->pwms_inuse, PCA9685_MAXCHAN)) {
+			is_inuse = true;
+			goto out;
+		}
+	} else {
+		/*
+		 * regular channel:
+		 * pretend already in use if the "all LEDs" channel is requested
+		 */
+		if (test_bit(PCA9685_MAXCHAN, pca->pwms_inuse)) {
+			is_inuse = true;
+			goto out;
+		}
 	}
-
-	pwm_set_chip_data(pwm, (void *)1);
-
+	is_inuse = test_and_set_bit(pwm_idx, pca->pwms_inuse);
+out:
 	mutex_unlock(&pca->lock);
-	pm_runtime_get_sync(pca->chip.dev);
-	return 0;
+	return is_inuse;
 }
 
-static bool pca9685_pwm_is_gpio(struct pca9685 *pca, struct pwm_device *pwm)
+static void pca9685_pwm_clear_inuse(struct pca9685 *pca, int pwm_idx)
 {
-	bool is_gpio = false;
-
 	mutex_lock(&pca->lock);
+	clear_bit(pwm_idx, pca->pwms_inuse);
+	mutex_unlock(&pca->lock);
+}
 
-	if (pwm->hwpwm >= PCA9685_MAXCHAN) {
-		unsigned int i;
-
-		/*
-		 * Check if any of the GPIOs are requested and in that case
-		 * prevent using the "all LEDs" channel.
-		 */
-		for (i = 0; i < pca->gpio.ngpio; i++)
-			if (gpiochip_is_requested(&pca->gpio, i)) {
-				is_gpio = true;
-				break;
-			}
-	} else if (pwm_get_chip_data(pwm)) {
-		is_gpio = true;
-	}
+static int pca9685_pwm_gpio_request(struct gpio_chip *gpio, unsigned int offset)
+{
+	struct pca9685 *pca = gpiochip_get_data(gpio);
 
-	mutex_unlock(&pca->lock);
-	return is_gpio;
+	if (pca9685_pwm_test_and_set_inuse(pca, offset))
+		return -EBUSY;
+	pm_runtime_get_sync(pca->chip.dev);
+	return 0;
 }
 
 static int pca9685_pwm_gpio_get(struct gpio_chip *gpio, unsigned int offset)
@@ -173,6 +175,7 @@ static void pca9685_pwm_gpio_free(struct
 
 	pca9685_pwm_gpio_set(gpio, offset, 0);
 	pm_runtime_put(pca->chip.dev);
+	pca9685_pwm_clear_inuse(pca, offset);
 }
 
 static int pca9685_pwm_gpio_get_direction(struct gpio_chip *chip,
@@ -224,12 +227,17 @@ static int pca9685_pwm_gpio_probe(struct
 	return devm_gpiochip_add_data(dev, &pca->gpio, pca);
 }
 #else
-static inline bool pca9685_pwm_is_gpio(struct pca9685 *pca,
-				       struct pwm_device *pwm)
+static inline bool pca9685_pwm_test_and_set_inuse(struct pca9685 *pca,
+						  int pwm_idx)
 {
 	return false;
 }
 
+static inline void
+pca9685_pwm_clear_inuse(struct pca9685 *pca, int pwm_idx)
+{
+}
+
 static inline int pca9685_pwm_gpio_probe(struct pca9685 *pca)
 {
 	return 0;
@@ -413,7 +421,7 @@ static int pca9685_pwm_request(struct pw
 {
 	struct pca9685 *pca = to_pca(chip);
 
-	if (pca9685_pwm_is_gpio(pca, pwm))
+	if (pca9685_pwm_test_and_set_inuse(pca, pwm->hwpwm))
 		return -EBUSY;
 	pm_runtime_get_sync(chip->dev);
 
@@ -422,8 +430,11 @@ static int pca9685_pwm_request(struct pw
 
 static void pca9685_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
 {
+	struct pca9685 *pca = to_pca(chip);
+
 	pca9685_pwm_disable(chip, pwm);
 	pm_runtime_put(chip->dev);
+	pca9685_pwm_clear_inuse(pca, pwm->hwpwm);
 }
 
 static const struct pwm_ops pca9685_pwm_ops = {



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 13/40] ext4: fix incorrect group count in ext4_fill_super error message
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 12/40] pwm: pca9685: Fix PWM/GPIO inter-operation Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 14/40] ext4: fix incorrect inodes per group in " Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Josh Triplett, Theodore Tso

From: Josh Triplett <josh@joshtriplett.org>

commit df41460a21b06a76437af040d90ccee03888e8e5 upstream.

ext4_fill_super doublechecks the number of groups before mounting; if
that check fails, the resulting error message prints the group count
from the ext4_sb_info sbi, which hasn't been set yet. Print the freshly
computed group count instead (which at that point has just been computed
in "blocks_count").

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Fixes: 4ec1102813798 ("ext4: Add sanity checks for the superblock before mounting the filesystem")
Link: https://lore.kernel.org/r/8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/super.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4162,9 +4162,9 @@ static int ext4_fill_super(struct super_
 			EXT4_BLOCKS_PER_GROUP(sb) - 1);
 	do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb));
 	if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
-		ext4_msg(sb, KERN_WARNING, "groups count too large: %u "
+		ext4_msg(sb, KERN_WARNING, "groups count too large: %llu "
 		       "(block count %llu, first data block %u, "
-		       "blocks per group %lu)", sbi->s_groups_count,
+		       "blocks per group %lu)", blocks_count,
 		       ext4_blocks_count(es),
 		       le32_to_cpu(es->s_first_data_block),
 		       EXT4_BLOCKS_PER_GROUP(sb));



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 14/40] ext4: fix incorrect inodes per group in error message
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 13/40] ext4: fix incorrect group count in ext4_fill_super error message Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 15/40] ASoC: Intel: mrfld: fix incorrect check on p->sink Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andreas Dilger, Josh Triplett, Theodore Tso

From: Josh Triplett <josh@joshtriplett.org>

commit b9c538da4e52a7b79dfcf4cfa487c46125066dfb upstream.

If ext4_fill_super detects an invalid number of inodes per group, the
resulting error message printed the number of blocks per group, rather
than the number of inodes per group. Fix it to print the correct value.

Fixes: cd6bb35bf7f6d ("ext4: use more strict checks for inodes_per_block on mount")
Link: https://lore.kernel.org/r/8be03355983a08e5d4eed480944613454d7e2550.1585434649.git.josh@joshtriplett.org
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4031,7 +4031,7 @@ static int ext4_fill_super(struct super_
 	if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
 	    sbi->s_inodes_per_group > blocksize * 8) {
 		ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n",
-			 sbi->s_blocks_per_group);
+			 sbi->s_inodes_per_group);
 		goto failed_mount;
 	}
 	sbi->s_itb_per_group = sbi->s_inodes_per_group /



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 15/40] ASoC: Intel: mrfld: fix incorrect check on p->sink
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 14/40] ext4: fix incorrect inodes per group in " Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 16/40] ASoC: Intel: mrfld: return error codes when an error occurs Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Colin Ian King, Mark Brown

From: Colin Ian King <colin.king@canonical.com>

commit f5e056e1e46fcbb5f74ce560792aeb7d57ce79e6 upstream.

The check on p->sink looks bogus, I believe it should be p->source
since the following code blocks are related to p->source. Fix
this by replacing p->sink with p->source.

Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Copy-paste error")
Link: https://lore.kernel.org/r/20191119113640.166940-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/intel/atom/sst-atom-controls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/soc/intel/atom/sst-atom-controls.c
+++ b/sound/soc/intel/atom/sst-atom-controls.c
@@ -1341,7 +1341,7 @@ int sst_send_pipe_gains(struct snd_soc_d
 				dai->capture_widget->name);
 		w = dai->capture_widget;
 		snd_soc_dapm_widget_for_each_source_path(w, p) {
-			if (p->connected && !p->connected(w, p->sink))
+			if (p->connected && !p->connected(w, p->source))
 				continue;
 
 			if (p->connect &&  p->source->power &&



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 16/40] ASoC: Intel: mrfld: return error codes when an error occurs
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 15/40] ASoC: Intel: mrfld: fix incorrect check on p->sink Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 17/40] ALSA: usb-audio: Filter error from connector kctl ops, too Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Colin Ian King, Cezary Rojewski,
	Pierre-Louis Bossart, Mark Brown

From: Colin Ian King <colin.king@canonical.com>

commit 3025571edd9df653e1ad649f0638368a39d1bbb5 upstream.

Currently function sst_platform_get_resources always returns zero and
error return codes set by the function are never returned. Fix this
by returning the error return code in variable ret rather than the
hard coded zero.

Addresses-Coverity: ("Unused value")
Fixes: f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200208220720.36657-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/intel/atom/sst/sst_pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/soc/intel/atom/sst/sst_pci.c
+++ b/sound/soc/intel/atom/sst/sst_pci.c
@@ -107,7 +107,7 @@ static int sst_platform_get_resources(st
 	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
 do_release_regions:
 	pci_release_regions(pci);
-	return 0;
+	return ret;
 }
 
 /*



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 17/40] ALSA: usb-audio: Filter error from connector kctl ops, too
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 16/40] ASoC: Intel: mrfld: return error codes when an error occurs Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 18/40] ALSA: usb-audio: Dont override ignore_ctl_error value from the map Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

From: Takashi Iwai <tiwai@suse.de>

commit 48cc42973509afac24e83d6edc23901d102872d1 upstream.

The ignore_ctl_error option should filter the error at kctl accesses,
but there was an overlook: mixer_ctl_connector_get() returns an error
from the request.

This patch covers the forgotten code path and apply filter_error()
properly.  The locking error is still returned since this is a fatal
error that has to be reported even with ignore_ctl_error option.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206873
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200412081331.4742-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/mixer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1461,7 +1461,7 @@ error:
 		usb_audio_err(chip,
 			"cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",
 			UAC_GET_CUR, validx, idx, cval->val_type);
-		return ret;
+		return filter_error(cval, ret);
 	}
 
 	ucontrol->value.integer.value[0] = val;



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 18/40] ALSA: usb-audio: Dont override ignore_ctl_error value from the map
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 17/40] ALSA: usb-audio: Filter error from connector kctl ops, too Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 19/40] ALSA: usb-audio: Dont create jack controls for PCM terminals Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

From: Takashi Iwai <tiwai@suse.de>

commit 3507245b82b4362dc9721cbc328644905a3efa22 upstream.

The mapping table may contain also ignore_ctl_error flag for devices
that are known to behave wild.  Since this flag always writes the
card's own ignore_ctl_error flag, it overrides the value already set
by the module option, so it doesn't follow user's expectation.
Let's fix the code not to clear the flag that has been set by user.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206873
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200412081331.4742-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/mixer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -3104,7 +3104,7 @@ static int snd_usb_mixer_controls(struct
 		if (map->id == state.chip->usb_id) {
 			state.map = map->map;
 			state.selector_map = map->selector_map;
-			mixer->ignore_ctl_error = map->ignore_ctl_error;
+			mixer->ignore_ctl_error |= map->ignore_ctl_error;
 			break;
 		}
 	}



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 19/40] ALSA: usb-audio: Dont create jack controls for PCM terminals
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 18/40] ALSA: usb-audio: Dont override ignore_ctl_error value from the map Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 20/40] ALSA: usb-audio: Check mapping at creating connector controls, too Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

From: Takashi Iwai <tiwai@suse.de>

commit 7dc3c5a0172e6c0449502103356c3628d05bc0e0 upstream.

Some funky firmwares set the connector flag even on PCM terminals
although it doesn't make sense (and even actually the firmware doesn't
react properly!).  Let's skip creation of jack controls in such a
case.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206873
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200412081331.4742-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/mixer.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2107,7 +2107,8 @@ static int parse_audio_input_terminal(st
 	check_input_term(state, term_id, &iterm);
 
 	/* Check for jack detection. */
-	if (uac_v2v3_control_is_readable(bmctls, control))
+	if ((iterm.type & 0xff00) != 0x0100 &&
+	    uac_v2v3_control_is_readable(bmctls, control))
 		build_connector_control(state->mixer, &iterm, true);
 
 	return 0;
@@ -3147,7 +3148,8 @@ static int snd_usb_mixer_controls(struct
 			if (err < 0 && err != -EINVAL)
 				return err;
 
-			if (uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
+			if ((state.oterm.type & 0xff00) != 0x0100 &&
+			    uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
 							 UAC2_TE_CONNECTOR)) {
 				build_connector_control(state.mixer, &state.oterm,
 							false);
@@ -3172,7 +3174,8 @@ static int snd_usb_mixer_controls(struct
 			if (err < 0 && err != -EINVAL)
 				return err;
 
-			if (uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
+			if ((state.oterm.type & 0xff00) != 0x0100 &&
+			    uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
 							 UAC3_TE_INSERTION)) {
 				build_connector_control(state.mixer, &state.oterm,
 							false);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 20/40] ALSA: usb-audio: Check mapping at creating connector controls, too
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 19/40] ALSA: usb-audio: Dont create jack controls for PCM terminals Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 21/40] keys: Fix proc_keys_next to increase position index Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

From: Takashi Iwai <tiwai@suse.de>

commit 934b96594ed66b07dbc7e576d28814466df3a494 upstream.

Add the mapping check to build_connector_control() so that the device
specific quirk can provide the node to skip for the badly behaving
connector controls.  As an example, ALC1220-VB-based codec implements
the skip entry for the broken SPDIF connector detection.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206873
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200412081331.4742-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/mixer.c      |   18 +++++++++++-------
 sound/usb/mixer_maps.c |    4 +++-
 2 files changed, 14 insertions(+), 8 deletions(-)

--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1765,11 +1765,15 @@ static void get_connector_control_name(s
 
 /* Build a mixer control for a UAC connector control (jack-detect) */
 static void build_connector_control(struct usb_mixer_interface *mixer,
+				    const struct usbmix_name_map *imap,
 				    struct usb_audio_term *term, bool is_input)
 {
 	struct snd_kcontrol *kctl;
 	struct usb_mixer_elem_info *cval;
 
+	if (check_ignored_ctl(find_map(imap, term->id, 0)))
+		return;
+
 	cval = kzalloc(sizeof(*cval), GFP_KERNEL);
 	if (!cval)
 		return;
@@ -2109,7 +2113,7 @@ static int parse_audio_input_terminal(st
 	/* Check for jack detection. */
 	if ((iterm.type & 0xff00) != 0x0100 &&
 	    uac_v2v3_control_is_readable(bmctls, control))
-		build_connector_control(state->mixer, &iterm, true);
+		build_connector_control(state->mixer, state->map, &iterm, true);
 
 	return 0;
 }
@@ -3070,13 +3074,13 @@ static int snd_usb_mixer_controls_badd(s
 		memset(&iterm, 0, sizeof(iterm));
 		iterm.id = UAC3_BADD_IT_ID4;
 		iterm.type = UAC_BIDIR_TERMINAL_HEADSET;
-		build_connector_control(mixer, &iterm, true);
+		build_connector_control(mixer, map->map, &iterm, true);
 
 		/* Output Term - Insertion control */
 		memset(&oterm, 0, sizeof(oterm));
 		oterm.id = UAC3_BADD_OT_ID3;
 		oterm.type = UAC_BIDIR_TERMINAL_HEADSET;
-		build_connector_control(mixer, &oterm, false);
+		build_connector_control(mixer, map->map, &oterm, false);
 	}
 
 	return 0;
@@ -3151,8 +3155,8 @@ static int snd_usb_mixer_controls(struct
 			if ((state.oterm.type & 0xff00) != 0x0100 &&
 			    uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
 							 UAC2_TE_CONNECTOR)) {
-				build_connector_control(state.mixer, &state.oterm,
-							false);
+				build_connector_control(state.mixer, state.map,
+							&state.oterm, false);
 			}
 		} else {  /* UAC_VERSION_3 */
 			struct uac3_output_terminal_descriptor *desc = p;
@@ -3177,8 +3181,8 @@ static int snd_usb_mixer_controls(struct
 			if ((state.oterm.type & 0xff00) != 0x0100 &&
 			    uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
 							 UAC3_TE_INSERTION)) {
-				build_connector_control(state.mixer, &state.oterm,
-							false);
+				build_connector_control(state.mixer, state.map,
+							&state.oterm, false);
 			}
 		}
 	}
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -364,9 +364,11 @@ static const struct usbmix_name_map dell
 };
 
 /* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX
- * response for Input Gain Pad (id=19, control=12).  Skip it.
+ * response for Input Gain Pad (id=19, control=12) and the connector status
+ * for SPDIF terminal (id=18).  Skip them.
  */
 static const struct usbmix_name_map asus_rog_map[] = {
+	{ 18, NULL }, /* OT, connector control */
 	{ 19, NULL, 12 }, /* FU, Input Gain Pad */
 	{}
 };



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 21/40] keys: Fix proc_keys_next to increase position index
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 20/40] ALSA: usb-audio: Check mapping at creating connector controls, too Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 22/40] tracing: Fix the race between registering snapshot event trigger and triggering snapshot operation Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Vasily Averin, David Howells,
	Jarkko Sakkinen, Linus Torvalds

From: Vasily Averin <vvs@virtuozzo.com>

commit 86d32f9a7c54ad74f4514d7fef7c847883207291 upstream.

If seq_file .next function does not change position index,
read after some lseek can generate unexpected output:

    $ dd if=/proc/keys bs=1  # full usual output
    0f6bfdf5 I--Q---     2 perm 3f010000  1000  1000 user      4af2f79ab8848d0a: 740
    1fb91b32 I--Q---     3 perm 1f3f0000  1000 65534 keyring   _uid.1000: 2
    27589480 I--Q---     1 perm 0b0b0000     0     0 user      invocation_id: 16
    2f33ab67 I--Q---   152 perm 3f030000     0     0 keyring   _ses: 2
    33f1d8fa I--Q---     4 perm 3f030000  1000  1000 keyring   _ses: 1
    3d427fda I--Q---     2 perm 3f010000  1000  1000 user      69ec44aec7678e5a: 740
    3ead4096 I--Q---     1 perm 1f3f0000  1000 65534 keyring   _uid_ses.1000: 1
    521+0 records in
    521+0 records out
    521 bytes copied, 0,00123769 s, 421 kB/s

But a read after lseek in middle of last line results in the partial
last line and then a repeat of the final line:

    $ dd if=/proc/keys bs=500 skip=1
    dd: /proc/keys: cannot skip to specified offset
    g   _uid_ses.1000: 1
    3ead4096 I--Q---     1 perm 1f3f0000  1000 65534 keyring   _uid_ses.1000: 1
    0+1 records in
    0+1 records out
    97 bytes copied, 0,000135035 s, 718 kB/s

and a read after lseek beyond end of file results in the last line being
shown:

    $ dd if=/proc/keys bs=1000 skip=1   # read after lseek beyond end of file
    dd: /proc/keys: cannot skip to specified offset
    3ead4096 I--Q---     1 perm 1f3f0000  1000 65534 keyring   _uid_ses.1000: 1
    0+1 records in
    0+1 records out
    76 bytes copied, 0,000119981 s, 633 kB/s

See https://bugzilla.kernel.org/show_bug.cgi?id=206283

Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 security/keys/proc.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -144,6 +144,8 @@ static void *proc_keys_next(struct seq_f
 	n = key_serial_next(p, v);
 	if (n)
 		*_pos = key_node_serial(n);
+	else
+		(*_pos)++;
 	return n;
 }
 



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 22/40] tracing: Fix the race between registering snapshot event trigger and triggering snapshot operation
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 21/40] keys: Fix proc_keys_next to increase position index Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 23/40] btrfs: check commit root generation in should_ignore_root Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Xiao Yang, Steven Rostedt (VMware)

From: Xiao Yang <yangx.jy@cn.fujitsu.com>

commit 0bbe7f719985efd9adb3454679ecef0984cb6800 upstream.

Traced event can trigger 'snapshot' operation(i.e. calls snapshot_trigger()
or snapshot_count_trigger()) when register_snapshot_trigger() has completed
registration but doesn't allocate buffer for 'snapshot' event trigger.  In
the rare case, 'snapshot' operation always detects the lack of allocated
buffer so make register_snapshot_trigger() allocate buffer first.

trigger-snapshot.tc in kselftest reproduces the issue on slow vm:
-----------------------------------------------------------
cat trace
...
ftracetest-3028  [002] ....   236.784290: sched_process_fork: comm=ftracetest pid=3028 child_comm=ftracetest child_pid=3036
     <...>-2875  [003] ....   240.460335: tracing_snapshot_instance_cond: *** SNAPSHOT NOT ALLOCATED ***
     <...>-2875  [003] ....   240.460338: tracing_snapshot_instance_cond: *** stopping trace here!   ***
-----------------------------------------------------------

Link: http://lkml.kernel.org/r/20200414015145.66236-1-yangx.jy@cn.fujitsu.com

Cc: stable@vger.kernel.org
Fixes: 93e31ffbf417a ("tracing: Add 'snapshot' event trigger command")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/trace_events_trigger.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -1081,14 +1081,10 @@ register_snapshot_trigger(char *glob, st
 			  struct event_trigger_data *data,
 			  struct trace_event_file *file)
 {
-	int ret = register_trigger(glob, ops, data, file);
+	if (tracing_alloc_snapshot_instance(file->tr) != 0)
+		return 0;
 
-	if (ret > 0 && tracing_alloc_snapshot_instance(file->tr) != 0) {
-		unregister_trigger(glob, ops, data, file);
-		ret = 0;
-	}
-
-	return ret;
+	return register_trigger(glob, ops, data, file);
 }
 
 static int



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 23/40] btrfs: check commit root generation in should_ignore_root
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 22/40] tracing: Fix the race between registering snapshot event trigger and triggering snapshot operation Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 24/40] mac80211_hwsim: Use kstrndup() in place of kasprintf() Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Filipe Manana, Josef Bacik, David Sterba

From: Josef Bacik <josef@toxicpanda.com>

commit 4d4225fc228e46948486d8b8207955f0c031b92e upstream.

Previously we would set the reloc root's last snapshot to transid - 1.
However there was a problem with doing this, and we changed it to
setting the last snapshot to the generation of the commit node of the fs
root.

This however broke should_ignore_root().  The assumption is that if we
are in a generation newer than when the reloc root was created, then we
would find the reloc root through normal backref lookups, and thus can
ignore any fs roots we find with an old enough reloc root.

Now that the last snapshot could be considerably further in the past
than before, we'd end up incorrectly ignoring an fs root.  Thus we'd
find no nodes for the bytenr we were searching for, and we'd fail to
relocate anything.  We'd loop through the relocate code again and see
that there were still used space in that block group, attempt to
relocate those bytenr's again, fail in the same way, and just loop like
this forever.  This is tricky in that we have to not modify the fs root
at all during this time, so we need to have a block group that has data
in this fs root that is not shared by any other root, which is why this
has been difficult to reproduce.

Fixes: 054570a1dc94 ("Btrfs: fix relocation incorrectly dropping data references")
CC: stable@vger.kernel.org # 4.9+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/btrfs/relocation.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -525,8 +525,8 @@ static int should_ignore_root(struct btr
 	if (!reloc_root)
 		return 0;
 
-	if (btrfs_root_last_snapshot(&reloc_root->root_item) ==
-	    root->fs_info->running_transaction->transid - 1)
+	if (btrfs_header_generation(reloc_root->commit_root) ==
+	    root->fs_info->running_transaction->transid)
 		return 0;
 	/*
 	 * if there is reloc tree and it was created in previous



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 24/40] mac80211_hwsim: Use kstrndup() in place of kasprintf()
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 23/40] btrfs: check commit root generation in should_ignore_root Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 25/40] usb: dwc3: gadget: dont enable interrupt when disabling endpoint Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, syzbot+6693adf1698864d21734,
	syzbot+a4aee3f42d7584d76761, stable, Tuomas Tynkkynen,
	Johannes Berg

From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>

commit 7ea862048317aa76d0f22334202779a25530980c upstream.

syzbot reports a warning:

precision 33020 too large
WARNING: CPU: 0 PID: 9618 at lib/vsprintf.c:2471 set_precision+0x150/0x180 lib/vsprintf.c:2471
 vsnprintf+0xa7b/0x19a0 lib/vsprintf.c:2547
 kvasprintf+0xb2/0x170 lib/kasprintf.c:22
 kasprintf+0xbb/0xf0 lib/kasprintf.c:59
 hwsim_del_radio_nl+0x63a/0x7e0 drivers/net/wireless/mac80211_hwsim.c:3625
 genl_family_rcv_msg_doit net/netlink/genetlink.c:672 [inline]
 ...
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Thus it seems that kasprintf() with "%.*s" format can not be used for
duplicating a string with arbitrary length. Replace it with kstrndup().

Note that later this string is limited to NL80211_WIPHY_NAME_MAXLEN == 64,
but the code is simpler this way.

Reported-by: syzbot+6693adf1698864d21734@syzkaller.appspotmail.com
Reported-by: syzbot+a4aee3f42d7584d76761@syzkaller.appspotmail.com
Cc: stable@kernel.org
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Link: https://lore.kernel.org/r/20200410123257.14559-1-tuomas.tynkkynen@iki.fi
[johannes: add note about length limit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/mac80211_hwsim.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3327,9 +3327,9 @@ static int hwsim_new_radio_nl(struct sk_
 		param.no_vif = true;
 
 	if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
-		hwname = kasprintf(GFP_KERNEL, "%.*s",
-				   nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
-				   (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
+		hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
+				  nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
+				  GFP_KERNEL);
 		if (!hwname)
 			return -ENOMEM;
 		param.hwname = hwname;
@@ -3385,9 +3385,9 @@ static int hwsim_del_radio_nl(struct sk_
 	if (info->attrs[HWSIM_ATTR_RADIO_ID]) {
 		idx = nla_get_u32(info->attrs[HWSIM_ATTR_RADIO_ID]);
 	} else if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
-		hwname = kasprintf(GFP_KERNEL, "%.*s",
-				   nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
-				   (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
+		hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
+				  nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
+				  GFP_KERNEL);
 		if (!hwname)
 			return -ENOMEM;
 	} else



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 25/40] usb: dwc3: gadget: dont enable interrupt when disabling endpoint
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 24/40] mac80211_hwsim: Use kstrndup() in place of kasprintf() Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 26/40] usb: dwc3: gadget: Dont clear flags before transfer ended Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Sasha Levin

[ Upstream commit c5353b225df9b2d0cf881873eef6f680e43c9aa2 ]

Since we're disabling the endpoint anyway, we don't worry about
getting endpoint command completion interrupt.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/dwc3/gadget.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 7b8b463676ad6..019aee3a79568 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -688,12 +688,13 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action)
 	return 0;
 }
 
-static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force);
+static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
+		bool interrupt);
 static void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep)
 {
 	struct dwc3_request		*req;
 
-	dwc3_stop_active_transfer(dep, true);
+	dwc3_stop_active_transfer(dep, true, false);
 
 	/* - giveback all requests to gadget driver */
 	while (!list_empty(&dep->started_list)) {
@@ -1416,7 +1417,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
 		}
 		if (r == req) {
 			/* wait until it is processed */
-			dwc3_stop_active_transfer(dep, true);
+			dwc3_stop_active_transfer(dep, true, true);
 
 			if (!r->trb)
 				goto out0;
@@ -2366,7 +2367,7 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
 	dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
 
 	if (stop) {
-		dwc3_stop_active_transfer(dep, true);
+		dwc3_stop_active_transfer(dep, true, true);
 		dep->flags = DWC3_EP_ENABLED;
 	}
 
@@ -2488,7 +2489,8 @@ static void dwc3_reset_gadget(struct dwc3 *dwc)
 	}
 }
 
-static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force)
+static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force,
+	bool interrupt)
 {
 	struct dwc3 *dwc = dep->dwc;
 	struct dwc3_gadget_ep_cmd_params params;
@@ -2532,7 +2534,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force)
 
 	cmd = DWC3_DEPCMD_ENDTRANSFER;
 	cmd |= force ? DWC3_DEPCMD_HIPRI_FORCERM : 0;
-	cmd |= DWC3_DEPCMD_CMDIOC;
+	cmd |= interrupt ? DWC3_DEPCMD_CMDIOC : 0;
 	cmd |= DWC3_DEPCMD_PARAM(dep->resource_index);
 	memset(&params, 0, sizeof(params));
 	ret = dwc3_send_gadget_ep_cmd(dep, cmd, &params);
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH 4.19 26/40] usb: dwc3: gadget: Dont clear flags before transfer ended
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 25/40] usb: dwc3: gadget: dont enable interrupt when disabling endpoint Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 27/40] drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Thinh Nguyen, Felipe Balbi, Sasha Levin

From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

[ Upstream commit a114c4ca64bd522aec1790c7e5c60c882f699d8f ]

We track END_TRANSFER command completion. Don't clear transfer
started/ended flag prematurely. Otherwise, we'd run into the problem
with restarting transfer before END_TRANSFER command finishes.

Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/dwc3/gadget.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 019aee3a79568..8a4455d0af8b9 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2366,10 +2366,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
 
 	dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
 
-	if (stop) {
+	if (stop)
 		dwc3_stop_active_transfer(dep, true, true);
-		dep->flags = DWC3_EP_ENABLED;
-	}
 
 	/*
 	 * WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH 4.19 27/40] drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 26/40] usb: dwc3: gadget: Dont clear flags before transfer ended Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 28/40] ext4: do not zeroout extents beyond i_disksize Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Sergei Lopatin, Alex Deucher

From: Sergei Lopatin <magist3r@gmail.com>

commit 8c7f0a44b4b4ef16df8f44fbaee6d1f5d1593c83 upstream.

Should prevent flicker if PP_OVERDRIVE_MASK is set.

bug: https://bugs.freedesktop.org/show_bug.cgi?id=102646
bug: https://bugs.freedesktop.org/show_bug.cgi?id=108941
bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1088
bug: https://gitlab.freedesktop.org/drm/amd/-/issues/628

Signed-off-by: Sergei Lopatin <magist3r@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3788,9 +3788,12 @@ static int smu7_trim_single_dpm_states(s
 {
 	uint32_t i;
 
+	/* force the trim if mclk_switching is disabled to prevent flicker */
+	bool force_trim = (low_limit == high_limit);
 	for (i = 0; i < dpm_table->count; i++) {
 	/*skip the trim if od is enabled*/
-		if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit
+		if ((!hwmgr->od_enabled || force_trim)
+			&& (dpm_table->dpm_levels[i].value < low_limit
 			|| dpm_table->dpm_levels[i].value > high_limit))
 			dpm_table->dpm_levels[i].enabled = false;
 		else



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 28/40] ext4: do not zeroout extents beyond i_disksize
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 27/40] drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 29/40] kvm: x86: Host feature SSBD doesnt imply guest feature SPEC_CTRL_SSBD Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Lukas Czerner, Jan Kara, Theodore Tso

From: Jan Kara <jack@suse.cz>

commit 801674f34ecfed033b062a0f217506b93c8d5e8a upstream.

We do not want to create initialized extents beyond end of file because
for e2fsck it is impossible to distinguish them from a case of corrupted
file size / extent tree and so it complains like:

Inode 12, i_size is 147456, should be 163840.  Fix? no

Code in ext4_ext_convert_to_initialized() and
ext4_split_convert_extents() try to make sure it does not create
initialized extents beyond inode size however they check against
inode->i_size which is wrong. They should instead check against
EXT4_I(inode)->i_disksize which is the current inode size on disk.
That's what e2fsck is going to see in case of crash before all dirty
data is written. This bug manifests as generic/456 test failure (with
recent enough fstests where fsx got fixed to properly pass
FALLOC_KEEP_SIZE_FL flags to the kernel) when run with dioread_lock
mount option.

CC: stable@vger.kernel.org
Fixes: 21ca087a3891 ("ext4: Do not zero out uninitialized extents beyond i_size")
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20200331105016.8674-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/extents.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3438,8 +3438,8 @@ static int ext4_ext_convert_to_initializ
 		(unsigned long long)map->m_lblk, map_len);
 
 	sbi = EXT4_SB(inode->i_sb);
-	eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
-		inode->i_sb->s_blocksize_bits;
+	eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
+			>> inode->i_sb->s_blocksize_bits;
 	if (eof_block < map->m_lblk + map_len)
 		eof_block = map->m_lblk + map_len;
 
@@ -3694,8 +3694,8 @@ static int ext4_split_convert_extents(ha
 		  __func__, inode->i_ino,
 		  (unsigned long long)map->m_lblk, map->m_len);
 
-	eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
-		inode->i_sb->s_blocksize_bits;
+	eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
+			>> inode->i_sb->s_blocksize_bits;
 	if (eof_block < map->m_lblk + map->m_len)
 		eof_block = map->m_lblk + map->m_len;
 	/*



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 29/40] kvm: x86: Host feature SSBD doesnt imply guest feature SPEC_CTRL_SSBD
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 28/40] ext4: do not zeroout extents beyond i_disksize Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 30/40] scsi: target: remove boilerplate code Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jim Mattson, Jacob Xu, Peter Shier,
	Paolo Bonzini, Eric Biggers, Ben Hutchings, Sasha Levin

From: Jim Mattson <jmattson@google.com>

commit 396d2e878f92ec108e4293f1c77ea3bc90b414ff upstream.

The host reports support for the synthetic feature X86_FEATURE_SSBD
when any of the three following hardware features are set:
  CPUID.(EAX=7,ECX=0):EDX.SSBD[bit 31]
  CPUID.80000008H:EBX.AMD_SSBD[bit 24]
  CPUID.80000008H:EBX.VIRT_SSBD[bit 25]

Either of the first two hardware features implies the existence of the
IA32_SPEC_CTRL MSR, but CPUID.80000008H:EBX.VIRT_SSBD[bit 25] does
not. Therefore, CPUID.(EAX=7,ECX=0):EDX.SSBD[bit 31] should only be
set in the guest if CPUID.(EAX=7,ECX=0):EDX.SSBD[bit 31] or
CPUID.80000008H:EBX.AMD_SSBD[bit 24] is set on the host.

Fixes: 0c54914d0c52a ("KVM: x86: use Intel speculation bugs and features as derived in generic x86 code")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Jacob Xu <jacobhxu@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[bwh: Backported to 4.x: adjust indentation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/kvm/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 48c24d0e9e75c..1fe9ccabc082a 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -509,7 +509,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 				entry->edx |= F(SPEC_CTRL);
 			if (boot_cpu_has(X86_FEATURE_STIBP))
 				entry->edx |= F(INTEL_STIBP);
-			if (boot_cpu_has(X86_FEATURE_SSBD))
+			if (boot_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) ||
+			    boot_cpu_has(X86_FEATURE_AMD_SSBD))
 				entry->edx |= F(SPEC_CTRL_SSBD);
 			/*
 			 * We emulate ARCH_CAPABILITIES in software even
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH 4.19 30/40] scsi: target: remove boilerplate code
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 29/40] kvm: x86: Host feature SSBD doesnt imply guest feature SPEC_CTRL_SSBD Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 31/40] scsi: target: fix hang when multiple threads try to destroy the same iscsi session Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Rahul Kundu, Maurizio Lombardi,
	Martin K. Petersen, Sasha Levin

From: Maurizio Lombardi <mlombard@redhat.com>

[ Upstream commit e49a7d994379278d3353d7ffc7994672752fb0ad ]

iscsit_free_session() is equivalent to iscsit_stop_session() followed by a
call to iscsit_close_session().

Link: https://lore.kernel.org/r/20200313170656.9716-2-mlombard@redhat.com
Tested-by: Rahul Kundu <rahul.kundu@chelsio.com>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/target/iscsi/iscsi_target.c | 46 ++---------------------------
 drivers/target/iscsi/iscsi_target.h |  1 -
 2 files changed, 2 insertions(+), 45 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 03e9cb156df94..82b46bab8aabe 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4541,49 +4541,6 @@ void iscsit_fail_session(struct iscsi_session *sess)
 	sess->session_state = TARG_SESS_STATE_FAILED;
 }
 
-int iscsit_free_session(struct iscsi_session *sess)
-{
-	u16 conn_count = atomic_read(&sess->nconn);
-	struct iscsi_conn *conn, *conn_tmp = NULL;
-	int is_last;
-
-	spin_lock_bh(&sess->conn_lock);
-	atomic_set(&sess->sleep_on_sess_wait_comp, 1);
-
-	list_for_each_entry_safe(conn, conn_tmp, &sess->sess_conn_list,
-			conn_list) {
-		if (conn_count == 0)
-			break;
-
-		if (list_is_last(&conn->conn_list, &sess->sess_conn_list)) {
-			is_last = 1;
-		} else {
-			iscsit_inc_conn_usage_count(conn_tmp);
-			is_last = 0;
-		}
-		iscsit_inc_conn_usage_count(conn);
-
-		spin_unlock_bh(&sess->conn_lock);
-		iscsit_cause_connection_reinstatement(conn, 1);
-		spin_lock_bh(&sess->conn_lock);
-
-		iscsit_dec_conn_usage_count(conn);
-		if (is_last == 0)
-			iscsit_dec_conn_usage_count(conn_tmp);
-
-		conn_count--;
-	}
-
-	if (atomic_read(&sess->nconn)) {
-		spin_unlock_bh(&sess->conn_lock);
-		wait_for_completion(&sess->session_wait_comp);
-	} else
-		spin_unlock_bh(&sess->conn_lock);
-
-	iscsit_close_session(sess);
-	return 0;
-}
-
 void iscsit_stop_session(
 	struct iscsi_session *sess,
 	int session_sleep,
@@ -4668,7 +4625,8 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
 	list_for_each_entry_safe(se_sess, se_sess_tmp, &free_list, sess_list) {
 		sess = (struct iscsi_session *)se_sess->fabric_sess_ptr;
 
-		iscsit_free_session(sess);
+		iscsit_stop_session(sess, 1, 1);
+		iscsit_close_session(sess);
 		session_count++;
 	}
 
diff --git a/drivers/target/iscsi/iscsi_target.h b/drivers/target/iscsi/iscsi_target.h
index 48bac0acf8c76..11a481cf6eade 100644
--- a/drivers/target/iscsi/iscsi_target.h
+++ b/drivers/target/iscsi/iscsi_target.h
@@ -43,7 +43,6 @@ extern int iscsi_target_rx_thread(void *);
 extern int iscsit_close_connection(struct iscsi_conn *);
 extern int iscsit_close_session(struct iscsi_session *);
 extern void iscsit_fail_session(struct iscsi_session *);
-extern int iscsit_free_session(struct iscsi_session *);
 extern void iscsit_stop_session(struct iscsi_session *, int, int);
 extern int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *, int);
 
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH 4.19 31/40] scsi: target: fix hang when multiple threads try to destroy the same iscsi session
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 30/40] scsi: target: remove boilerplate code Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 32/40] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Matt Coleman, Rahul Kundu,
	Maurizio Lombardi, Martin K. Petersen, Sasha Levin

From: Maurizio Lombardi <mlombard@redhat.com>

[ Upstream commit 57c46e9f33da530a2485fa01aa27b6d18c28c796 ]

A number of hangs have been reported against the target driver; they are
due to the fact that multiple threads may try to destroy the iscsi session
at the same time. This may be reproduced for example when a "targetcli
iscsi/iqn.../tpg1 disable" command is executed while a logout operation is
underway.

When this happens, two or more threads may end up sleeping and waiting for
iscsit_close_connection() to execute "complete(session_wait_comp)".  Only
one of the threads will wake up and proceed to destroy the session
structure, the remaining threads will hang forever.

Note that if the blocked threads are somehow forced to wake up with
complete_all(), they will try to free the same iscsi session structure
destroyed by the first thread, causing double frees, memory corruptions
etc...

With this patch, the threads that want to destroy the iscsi session will
increase the session refcount and will set the "session_close" flag to 1;
then they wait for the driver to close the remaining active connections.
When the last connection is closed, iscsit_close_connection() will wake up
all the threads and will wait for the session's refcount to reach zero;
when this happens, iscsit_close_connection() will destroy the session
structure because no one is referencing it anymore.

 INFO: task targetcli:5971 blocked for more than 120 seconds.
       Tainted: P           OE    4.15.0-72-generic #81~16.04.1
 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 targetcli       D    0  5971      1 0x00000080
 Call Trace:
  __schedule+0x3d6/0x8b0
  ? vprintk_func+0x44/0xe0
  schedule+0x36/0x80
  schedule_timeout+0x1db/0x370
  ? __dynamic_pr_debug+0x8a/0xb0
  wait_for_completion+0xb4/0x140
  ? wake_up_q+0x70/0x70
  iscsit_free_session+0x13d/0x1a0 [iscsi_target_mod]
  iscsit_release_sessions_for_tpg+0x16b/0x1e0 [iscsi_target_mod]
  iscsit_tpg_disable_portal_group+0xca/0x1c0 [iscsi_target_mod]
  lio_target_tpg_enable_store+0x66/0xe0 [iscsi_target_mod]
  configfs_write_file+0xb9/0x120
  __vfs_write+0x1b/0x40
  vfs_write+0xb8/0x1b0
  SyS_write+0x5c/0xe0
  do_syscall_64+0x73/0x130
  entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Link: https://lore.kernel.org/r/20200313170656.9716-3-mlombard@redhat.com
Reported-by: Matt Coleman <mcoleman@datto.com>
Tested-by: Matt Coleman <mcoleman@datto.com>
Tested-by: Rahul Kundu <rahul.kundu@chelsio.com>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/target/iscsi/iscsi_target.c          | 35 ++++++++++++--------
 drivers/target/iscsi/iscsi_target_configfs.c |  5 ++-
 drivers/target/iscsi/iscsi_target_login.c    |  5 +--
 include/target/iscsi/iscsi_target_core.h     |  2 +-
 4 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 82b46bab8aabe..1633e26662687 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4275,30 +4275,37 @@ int iscsit_close_connection(
 	if (!atomic_read(&sess->session_reinstatement) &&
 	     atomic_read(&sess->session_fall_back_to_erl0)) {
 		spin_unlock_bh(&sess->conn_lock);
+		complete_all(&sess->session_wait_comp);
 		iscsit_close_session(sess);
 
 		return 0;
 	} else if (atomic_read(&sess->session_logout)) {
 		pr_debug("Moving to TARG_SESS_STATE_FREE.\n");
 		sess->session_state = TARG_SESS_STATE_FREE;
-		spin_unlock_bh(&sess->conn_lock);
 
-		if (atomic_read(&sess->sleep_on_sess_wait_comp))
-			complete(&sess->session_wait_comp);
+		if (atomic_read(&sess->session_close)) {
+			spin_unlock_bh(&sess->conn_lock);
+			complete_all(&sess->session_wait_comp);
+			iscsit_close_session(sess);
+		} else {
+			spin_unlock_bh(&sess->conn_lock);
+		}
 
 		return 0;
 	} else {
 		pr_debug("Moving to TARG_SESS_STATE_FAILED.\n");
 		sess->session_state = TARG_SESS_STATE_FAILED;
 
-		if (!atomic_read(&sess->session_continuation)) {
-			spin_unlock_bh(&sess->conn_lock);
+		if (!atomic_read(&sess->session_continuation))
 			iscsit_start_time2retain_handler(sess);
-		} else
-			spin_unlock_bh(&sess->conn_lock);
 
-		if (atomic_read(&sess->sleep_on_sess_wait_comp))
-			complete(&sess->session_wait_comp);
+		if (atomic_read(&sess->session_close)) {
+			spin_unlock_bh(&sess->conn_lock);
+			complete_all(&sess->session_wait_comp);
+			iscsit_close_session(sess);
+		} else {
+			spin_unlock_bh(&sess->conn_lock);
+		}
 
 		return 0;
 	}
@@ -4404,9 +4411,9 @@ static void iscsit_logout_post_handler_closesession(
 	complete(&conn->conn_logout_comp);
 
 	iscsit_dec_conn_usage_count(conn);
+	atomic_set(&sess->session_close, 1);
 	iscsit_stop_session(sess, sleep, sleep);
 	iscsit_dec_session_usage_count(sess);
-	iscsit_close_session(sess);
 }
 
 static void iscsit_logout_post_handler_samecid(
@@ -4551,8 +4558,6 @@ void iscsit_stop_session(
 	int is_last;
 
 	spin_lock_bh(&sess->conn_lock);
-	if (session_sleep)
-		atomic_set(&sess->sleep_on_sess_wait_comp, 1);
 
 	if (connection_sleep) {
 		list_for_each_entry_safe(conn, conn_tmp, &sess->sess_conn_list,
@@ -4610,12 +4615,15 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
 		spin_lock(&sess->conn_lock);
 		if (atomic_read(&sess->session_fall_back_to_erl0) ||
 		    atomic_read(&sess->session_logout) ||
+		    atomic_read(&sess->session_close) ||
 		    (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
 			spin_unlock(&sess->conn_lock);
 			continue;
 		}
+		iscsit_inc_session_usage_count(sess);
 		atomic_set(&sess->session_reinstatement, 1);
 		atomic_set(&sess->session_fall_back_to_erl0, 1);
+		atomic_set(&sess->session_close, 1);
 		spin_unlock(&sess->conn_lock);
 
 		list_move_tail(&se_sess->sess_list, &free_list);
@@ -4625,8 +4633,9 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force)
 	list_for_each_entry_safe(se_sess, se_sess_tmp, &free_list, sess_list) {
 		sess = (struct iscsi_session *)se_sess->fabric_sess_ptr;
 
+		list_del_init(&se_sess->sess_list);
 		iscsit_stop_session(sess, 1, 1);
-		iscsit_close_session(sess);
+		iscsit_dec_session_usage_count(sess);
 		session_count++;
 	}
 
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index 95d0a22b2ad61..d25cadc4f4f11 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1501,20 +1501,23 @@ static void lio_tpg_close_session(struct se_session *se_sess)
 	spin_lock(&sess->conn_lock);
 	if (atomic_read(&sess->session_fall_back_to_erl0) ||
 	    atomic_read(&sess->session_logout) ||
+	    atomic_read(&sess->session_close) ||
 	    (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
 		spin_unlock(&sess->conn_lock);
 		spin_unlock_bh(&se_tpg->session_lock);
 		return;
 	}
+	iscsit_inc_session_usage_count(sess);
 	atomic_set(&sess->session_reinstatement, 1);
 	atomic_set(&sess->session_fall_back_to_erl0, 1);
+	atomic_set(&sess->session_close, 1);
 	spin_unlock(&sess->conn_lock);
 
 	iscsit_stop_time2retain_timer(sess);
 	spin_unlock_bh(&se_tpg->session_lock);
 
 	iscsit_stop_session(sess, 1, 1);
-	iscsit_close_session(sess);
+	iscsit_dec_session_usage_count(sess);
 }
 
 static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg)
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index bb90c80ff3889..f25049ba4a85b 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -164,6 +164,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
 		spin_lock(&sess_p->conn_lock);
 		if (atomic_read(&sess_p->session_fall_back_to_erl0) ||
 		    atomic_read(&sess_p->session_logout) ||
+		    atomic_read(&sess_p->session_close) ||
 		    (sess_p->time2retain_timer_flags & ISCSI_TF_EXPIRED)) {
 			spin_unlock(&sess_p->conn_lock);
 			continue;
@@ -174,6 +175,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
 		   (sess_p->sess_ops->SessionType == sessiontype))) {
 			atomic_set(&sess_p->session_reinstatement, 1);
 			atomic_set(&sess_p->session_fall_back_to_erl0, 1);
+			atomic_set(&sess_p->session_close, 1);
 			spin_unlock(&sess_p->conn_lock);
 			iscsit_inc_session_usage_count(sess_p);
 			iscsit_stop_time2retain_timer(sess_p);
@@ -198,7 +200,6 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
 	if (sess->session_state == TARG_SESS_STATE_FAILED) {
 		spin_unlock_bh(&sess->conn_lock);
 		iscsit_dec_session_usage_count(sess);
-		iscsit_close_session(sess);
 		return 0;
 	}
 	spin_unlock_bh(&sess->conn_lock);
@@ -206,7 +207,6 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn)
 	iscsit_stop_session(sess, 1, 1);
 	iscsit_dec_session_usage_count(sess);
 
-	iscsit_close_session(sess);
 	return 0;
 }
 
@@ -494,6 +494,7 @@ static int iscsi_login_non_zero_tsih_s2(
 		sess_p = (struct iscsi_session *)se_sess->fabric_sess_ptr;
 		if (atomic_read(&sess_p->session_fall_back_to_erl0) ||
 		    atomic_read(&sess_p->session_logout) ||
+		    atomic_read(&sess_p->session_close) ||
 		   (sess_p->time2retain_timer_flags & ISCSI_TF_EXPIRED))
 			continue;
 		if (!memcmp(sess_p->isid, pdu->isid, 6) &&
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h
index f2e6abea84905..70d18444d18d8 100644
--- a/include/target/iscsi/iscsi_target_core.h
+++ b/include/target/iscsi/iscsi_target_core.h
@@ -674,7 +674,7 @@ struct iscsi_session {
 	atomic_t		session_logout;
 	atomic_t		session_reinstatement;
 	atomic_t		session_stop_active;
-	atomic_t		sleep_on_sess_wait_comp;
+	atomic_t		session_close;
 	/* connection list */
 	struct list_head	sess_conn_list;
 	struct list_head	cr_active_list;
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH 4.19 32/40] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 31/40] scsi: target: fix hang when multiple threads try to destroy the same iscsi session Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 33/40] x86/resctrl: Preserve CDP enable over CPU hotplug Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, John Allen, Borislav Petkov

From: John Allen <john.allen@amd.com>

commit bdf89df3c54518eed879d8fac7577fcfb220c67e upstream.

Future AMD CPUs will have microcode patches that exceed the default 4K
patch size. Raise our limit.

Signed-off-by: John Allen <john.allen@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org # v4.14..
Link: https://lkml.kernel.org/r/20200409152931.GA685273@mojo.amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/include/asm/microcode_amd.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/include/asm/microcode_amd.h
+++ b/arch/x86/include/asm/microcode_amd.h
@@ -41,7 +41,7 @@ struct microcode_amd {
 	unsigned int			mpb[0];
 };
 
-#define PATCH_MAX_SIZE PAGE_SIZE
+#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
 
 #ifdef CONFIG_MICROCODE_AMD
 extern void __init load_ucode_amd_bsp(unsigned int family);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 33/40] x86/resctrl: Preserve CDP enable over CPU hotplug
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 32/40] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 34/40] x86/resctrl: Fix invalid attempt at removing the default resource group Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Reinette Chatre, James Morse,
	Borislav Petkov

From: James Morse <james.morse@arm.com>

commit 9fe0450785abbc04b0ed5d3cf61fcdb8ab656b4b upstream.

Resctrl assumes that all CPUs are online when the filesystem is mounted,
and that CPUs remember their CDP-enabled state over CPU hotplug.

This goes wrong when resctrl's CDP-enabled state changes while all the
CPUs in a domain are offline.

When a domain comes online, enable (or disable!) CDP to match resctrl's
current setting.

Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support")
Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20200221162105.154163-1-james.morse@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/cpu/intel_rdt.c          |    2 ++
 arch/x86/kernel/cpu/intel_rdt.h          |    1 +
 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c |   13 +++++++++++++
 3 files changed, 16 insertions(+)

--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -555,6 +555,8 @@ static void domain_add_cpu(int cpu, stru
 	d->id = id;
 	cpumask_set_cpu(cpu, &d->cpu_mask);
 
+	rdt_domain_reconfigure_cdp(r);
+
 	if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
 		kfree(d);
 		return;
--- a/arch/x86/kernel/cpu/intel_rdt.h
+++ b/arch/x86/kernel/cpu/intel_rdt.h
@@ -567,5 +567,6 @@ void cqm_setup_limbo_handler(struct rdt_
 void cqm_handle_limbo(struct work_struct *work);
 bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
 void __check_limbo(struct rdt_domain *d, bool force_free);
+void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
 
 #endif /* _ASM_X86_INTEL_RDT_H */
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -1777,6 +1777,19 @@ static int set_cache_qos_cfg(int level,
 	return 0;
 }
 
+/* Restore the qos cfg state when a domain comes online */
+void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
+{
+	if (!r->alloc_capable)
+		return;
+
+	if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
+		l2_qos_cfg_update(&r->alloc_enabled);
+
+	if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
+		l3_qos_cfg_update(&r->alloc_enabled);
+}
+
 /*
  * Enable or disable the MBA software controller
  * which helps user specify bandwidth in MBps.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 34/40] x86/resctrl: Fix invalid attempt at removing the default resource group
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 33/40] x86/resctrl: Preserve CDP enable over CPU hotplug Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 35/40] wil6210: check rx_buff_mgmt before accessing it Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sai Praneeth Prakhya,
	Reinette Chatre, Borislav Petkov

From: Reinette Chatre <reinette.chatre@intel.com>

commit b0151da52a6d4f3951ea24c083e7a95977621436 upstream.

The default resource group ("rdtgroup_default") is associated with the
root of the resctrl filesystem and should never be removed. New resource
groups can be created as subdirectories of the resctrl filesystem and
they can be removed from user space.

There exists a safeguard in the directory removal code
(rdtgroup_rmdir()) that ensures that only subdirectories can be removed
by testing that the directory to be removed has to be a child of the
root directory.

A possible deadlock was recently fixed with

  334b0f4e9b1b ("x86/resctrl: Fix a deadlock due to inaccurate reference").

This fix involved associating the private data of the "mon_groups"
and "mon_data" directories to the resource group to which they belong
instead of NULL as before. A consequence of this change was that
the original safeguard code preventing removal of "mon_groups" and
"mon_data" found in the root directory failed resulting in attempts to
remove the default resource group that ends in a BUG:

  kernel BUG at mm/slub.c:3969!
  invalid opcode: 0000 [#1] SMP PTI

  Call Trace:
  rdtgroup_rmdir+0x16b/0x2c0
  kernfs_iop_rmdir+0x5c/0x90
  vfs_rmdir+0x7a/0x160
  do_rmdir+0x17d/0x1e0
  do_syscall_64+0x55/0x1d0
  entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fix this by improving the directory removal safeguard to ensure that
subdirectories of the resctrl root directory can only be removed if they
are a child of the resctrl filesystem's root _and_ not associated with
the default resource group.

Fixes: 334b0f4e9b1b ("x86/resctrl: Fix a deadlock due to inaccurate reference")
Reported-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/884cbe1773496b5dbec1b6bd11bb50cffa83603d.1584461853.git.reinette.chatre@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -2923,7 +2923,8 @@ static int rdtgroup_rmdir(struct kernfs_
 	 * If the rdtgroup is a mon group and parent directory
 	 * is a valid "mon_groups" directory, remove the mon group.
 	 */
-	if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn) {
+	if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn &&
+	    rdtgrp != &rdtgroup_default) {
 		if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP ||
 		    rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) {
 			ret = rdtgroup_ctrl_remove(kn, rdtgrp);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 35/40] wil6210: check rx_buff_mgmt before accessing it
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 34/40] x86/resctrl: Fix invalid attempt at removing the default resource group Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 36/40] wil6210: ignore HALP ICR if already handled Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dedy Lansky, Maya Erez, Kalle Valo,
	Lee Jones

From: Dedy Lansky <dlansky@codeaurora.org>

commit d6a553c0c61b0b0219764e4d4fc14e385085f374 upstream.

Make sure rx_buff_mgmt is initialized before accessing it.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/wil6210/txrx_edma.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
+++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
@@ -268,6 +268,9 @@ static void wil_move_all_rx_buff_to_free
 	struct list_head *active = &wil->rx_buff_mgmt.active;
 	dma_addr_t pa;
 
+	if (!wil->rx_buff_mgmt.buff_arr)
+		return;
+
 	while (!list_empty(active)) {
 		struct wil_rx_buff *rx_buff =
 			list_first_entry(active, struct wil_rx_buff, list);



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 36/40] wil6210: ignore HALP ICR if already handled
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (34 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 35/40] wil6210: check rx_buff_mgmt before accessing it Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 37/40] wil6210: add general initialization/size checks Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Maya Erez, Kalle Valo, Lee Jones

From: Maya Erez <merez@codeaurora.org>

commit 979c9d8d01c482b1befb44dc639ecb907b5a37bd upstream.

HALP ICR is set as long as the FW should stay awake.
To prevent its multiple handling the driver masks this IRQ bit.
However, if there is a different MISC ICR before the driver clears
this bit, there is a risk of race condition between HALP mask and
unmask. This race leads to HALP timeout, in case it is mistakenly
masked.
Add an atomic flag to indicate if HALP ICR should be handled.

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/wil6210/interrupt.c |   12 ++++++++----
 drivers/net/wireless/ath/wil6210/main.c      |    3 +++
 drivers/net/wireless/ath/wil6210/wil6210.h   |    1 +
 3 files changed, 12 insertions(+), 4 deletions(-)

--- a/drivers/net/wireless/ath/wil6210/interrupt.c
+++ b/drivers/net/wireless/ath/wil6210/interrupt.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -590,10 +590,14 @@ static irqreturn_t wil6210_irq_misc(int
 	}
 
 	if (isr & BIT_DMA_EP_MISC_ICR_HALP) {
-		wil_dbg_irq(wil, "irq_misc: HALP IRQ invoked\n");
-		wil6210_mask_halp(wil);
 		isr &= ~BIT_DMA_EP_MISC_ICR_HALP;
-		complete(&wil->halp.comp);
+		if (wil->halp.handle_icr) {
+			/* no need to handle HALP ICRs until next vote */
+			wil->halp.handle_icr = false;
+			wil_dbg_irq(wil, "irq_misc: HALP IRQ invoked\n");
+			wil6210_mask_halp(wil);
+			complete(&wil->halp.comp);
+		}
 	}
 
 	wil->isr_misc = isr;
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -1814,11 +1814,14 @@ void wil_halp_vote(struct wil6210_priv *
 
 	if (++wil->halp.ref_cnt == 1) {
 		reinit_completion(&wil->halp.comp);
+		/* mark to IRQ context to handle HALP ICR */
+		wil->halp.handle_icr = true;
 		wil6210_set_halp(wil);
 		rc = wait_for_completion_timeout(&wil->halp.comp, to_jiffies);
 		if (!rc) {
 			wil_err(wil, "HALP vote timed out\n");
 			/* Mask HALP as done in case the interrupt is raised */
+			wil->halp.handle_icr = false;
 			wil6210_mask_halp(wil);
 		} else {
 			wil_dbg_irq(wil,
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -778,6 +778,7 @@ struct wil_halp {
 	struct mutex		lock; /* protect halp ref_cnt */
 	unsigned int		ref_cnt;
 	struct completion	comp;
+	u8			handle_icr;
 };
 
 struct wil_blob_wrapper {



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 37/40] wil6210: add general initialization/size checks
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (35 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 36/40] wil6210: ignore HALP ICR if already handled Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 38/40] wil6210: make sure Rx ring sizes are correlated Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alexei Avshalom Lazar, Maya Erez,
	Kalle Valo, Lee Jones

From: Alexei Avshalom Lazar <ailizaro@codeaurora.org>

commit ac0e541ab2f2951845acee784ef487be40fb4c77 upstream.

Initialize unset variable, and verify that mid is valid.

Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/wil6210/debugfs.c |    2 ++
 drivers/net/wireless/ath/wil6210/wmi.c     |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -991,6 +991,8 @@ static ssize_t wil_write_file_txmgmt(str
 	int rc;
 	void *frame;
 
+	memset(&params, 0, sizeof(params));
+
 	if (!len)
 		return -EINVAL;
 
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -2802,7 +2802,7 @@ static void wmi_event_handle(struct wil6
 
 		if (mid == MID_BROADCAST)
 			mid = 0;
-		if (mid >= wil->max_vifs) {
+		if (mid >= ARRAY_SIZE(wil->vifs) || mid >= wil->max_vifs) {
 			wil_dbg_wmi(wil, "invalid mid %d, event skipped\n",
 				    mid);
 			return;



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 38/40] wil6210: make sure Rx ring sizes are correlated
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (36 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 37/40] wil6210: add general initialization/size checks Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 39/40] wil6210: remove reset file from debugfs Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dedy Lansky, Maya Erez, Kalle Valo,
	Lee Jones

From: Dedy Lansky <dlansky@codeaurora.org>

commit 61e5ec044748486f06dec760a19dce78247b3ad8 upstream.

When enlarging rx_ring_order module param, wil6210 fails to load
because there are not enough Rx buffers.
Fix this by enlarging number of Rx buffers at startup, if needed based
on rx_ring_order.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/ath/wil6210/main.c      |    2 +-
 drivers/net/wireless/ath/wil6210/txrx.c      |    4 ++--
 drivers/net/wireless/ath/wil6210/txrx_edma.c |   11 ++++++++---
 drivers/net/wireless/ath/wil6210/wil6210.h   |    2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -1687,7 +1687,7 @@ int __wil_up(struct wil6210_priv *wil)
 		return rc;
 
 	/* Rx RING. After MAC and beacon */
-	rc = wil->txrx_ops.rx_init(wil, 1 << rx_ring_order);
+	rc = wil->txrx_ops.rx_init(wil, rx_ring_order);
 	if (rc)
 		return rc;
 
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -881,7 +881,7 @@ static void wil_rx_buf_len_init(struct w
 	}
 }
 
-static int wil_rx_init(struct wil6210_priv *wil, u16 size)
+static int wil_rx_init(struct wil6210_priv *wil, uint order)
 {
 	struct wil_ring *vring = &wil->ring_rx;
 	int rc;
@@ -895,7 +895,7 @@ static int wil_rx_init(struct wil6210_pr
 
 	wil_rx_buf_len_init(wil);
 
-	vring->size = size;
+	vring->size = 1 << order;
 	vring->is_rx = true;
 	rc = wil_vring_alloc(wil, vring);
 	if (rc)
--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
+++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
@@ -593,9 +593,9 @@ static void wil_rx_buf_len_init_edma(str
 		WIL_MAX_ETH_MTU : WIL_EDMA_RX_BUF_LEN_DEFAULT;
 }
 
-static int wil_rx_init_edma(struct wil6210_priv *wil, u16 desc_ring_size)
+static int wil_rx_init_edma(struct wil6210_priv *wil, uint desc_ring_order)
 {
-	u16 status_ring_size;
+	u16 status_ring_size, desc_ring_size = 1 << desc_ring_order;
 	struct wil_ring *ring = &wil->ring_rx;
 	int rc;
 	size_t elem_size = wil->use_compressed_rx_status ?
@@ -610,7 +610,12 @@ static int wil_rx_init_edma(struct wil62
 			"compressed RX status cannot be used with SW reorder\n");
 		return -EINVAL;
 	}
-
+	if (wil->rx_status_ring_order <= desc_ring_order)
+		/* make sure sring is larger than desc ring */
+		wil->rx_status_ring_order = desc_ring_order + 1;
+	if (wil->rx_buff_id_count <= desc_ring_size)
+		/* make sure we will not run out of buff_ids */
+		wil->rx_buff_id_count = desc_ring_size + 512;
 	if (wil->rx_status_ring_order < WIL_SRING_SIZE_ORDER_MIN ||
 	    wil->rx_status_ring_order > WIL_SRING_SIZE_ORDER_MAX)
 		wil->rx_status_ring_order = WIL_RX_SRING_SIZE_ORDER_DEFAULT;
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -602,7 +602,7 @@ struct wil_txrx_ops {
 			   struct wil_ring *ring, struct sk_buff *skb);
 	irqreturn_t (*irq_tx)(int irq, void *cookie);
 	/* RX ops */
-	int (*rx_init)(struct wil6210_priv *wil, u16 ring_size);
+	int (*rx_init)(struct wil6210_priv *wil, uint ring_order);
 	void (*rx_fini)(struct wil6210_priv *wil);
 	int (*wmi_addba_rx_resp)(struct wil6210_priv *wil, u8 mid, u8 cid,
 				 u8 tid, u8 token, u16 status, bool amsdu,



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 39/40] wil6210: remove reset file from debugfs
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (37 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 38/40] wil6210: make sure Rx ring sizes are correlated Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 12:39 ` [PATCH 4.19 40/40] mm/vmalloc.c: move area->pages after if statement Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Karthick Gopalasubramanian,
	Maya Erez, Kalle Valo, Lee Jones

From: Karthick Gopalasubramanian <kargop@codeaurora.org>

commit 32dcfe8316cdbd885542967c0c85f5b9de78874b upstream.

Reset file is not used and may cause race conditions
with operational driver if used.

Signed-off-by: Karthick Gopalasubramanian <kargop@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/wil6210/debugfs.c |   27 ---------------------------
 1 file changed, 27 deletions(-)

--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -730,32 +730,6 @@ struct dentry *wil_debugfs_create_ioblob
 	return debugfs_create_file(name, mode, parent, wil_blob, &fops_ioblob);
 }
 
-/*---reset---*/
-static ssize_t wil_write_file_reset(struct file *file, const char __user *buf,
-				    size_t len, loff_t *ppos)
-{
-	struct wil6210_priv *wil = file->private_data;
-	struct net_device *ndev = wil->main_ndev;
-
-	/**
-	 * BUG:
-	 * this code does NOT sync device state with the rest of system
-	 * use with care, debug only!!!
-	 */
-	rtnl_lock();
-	dev_close(ndev);
-	ndev->flags &= ~IFF_UP;
-	rtnl_unlock();
-	wil_reset(wil, true);
-
-	return len;
-}
-
-static const struct file_operations fops_reset = {
-	.write = wil_write_file_reset,
-	.open  = simple_open,
-};
-
 /*---write channel 1..4 to rxon for it, 0 to rxoff---*/
 static ssize_t wil_write_file_rxon(struct file *file, const char __user *buf,
 				   size_t len, loff_t *ppos)
@@ -2461,7 +2435,6 @@ static const struct {
 	{"desc",	0444,		&fops_txdesc},
 	{"bf",		0444,		&fops_bf},
 	{"mem_val",	0644,		&fops_memread},
-	{"reset",	0244,		&fops_reset},
 	{"rxon",	0244,		&fops_rxon},
 	{"tx_mgmt",	0244,		&fops_txmgmt},
 	{"wmi_send", 0244,		&fops_wmi},



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH 4.19 40/40] mm/vmalloc.c: move area->pages after if statement
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (38 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 39/40] wil6210: remove reset file from debugfs Greg Kroah-Hartman
@ 2020-04-20 12:39 ` Greg Kroah-Hartman
  2020-04-20 14:17 ` [PATCH 4.19 00/40] 4.19.117-rc1 review Chris Paterson
                   ` (4 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-20 12:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Austin Kim, Michal Hocko,
	Andrew Morton, Uladzislau Rezki (Sony),
	Roman Gushchin, Roman Penyaev, Rick Edgecombe, Mike Rapoport,
	Andrey Ryabinin, Linus Torvalds, Lee Jones

From: Austin Kim <austindh.kim@gmail.com>

commit 7ea362427c170061b8822dd41bafaa72b3bcb9ad upstream.

If !area->pages statement is true where memory allocation fails, area is
freed.

In this case 'area->pages = pages' should not executed.  So move
'area->pages = pages' after if statement.

[akpm@linux-foundation.org: give area->pages the same treatment]
Link: http://lkml.kernel.org/r/20190830035716.GA190684@LGEARND20B15
Signed-off-by: Austin Kim <austindh.kim@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Roman Penyaev <rpenyaev@suse.de>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/vmalloc.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1668,7 +1668,6 @@ static void *__vmalloc_area_node(struct
 	nr_pages = get_vm_area_size(area) >> PAGE_SHIFT;
 	array_size = (nr_pages * sizeof(struct page *));
 
-	area->nr_pages = nr_pages;
 	/* Please note that the recursion is strictly bounded. */
 	if (array_size > PAGE_SIZE) {
 		pages = __vmalloc_node(array_size, 1, nested_gfp|highmem_mask,
@@ -1676,13 +1675,16 @@ static void *__vmalloc_area_node(struct
 	} else {
 		pages = kmalloc_node(array_size, nested_gfp, node);
 	}
-	area->pages = pages;
-	if (!area->pages) {
+
+	if (!pages) {
 		remove_vm_area(area->addr);
 		kfree(area);
 		return NULL;
 	}
 
+	area->pages = pages;
+	area->nr_pages = nr_pages;
+
 	for (i = 0; i < area->nr_pages; i++) {
 		struct page *page;
 



^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (39 preceding siblings ...)
  2020-04-20 12:39 ` [PATCH 4.19 40/40] mm/vmalloc.c: move area->pages after if statement Greg Kroah-Hartman
@ 2020-04-20 14:17 ` Chris Paterson
  2020-04-21  9:55   ` Greg Kroah-Hartman
  2020-04-20 19:51 ` Guenter Roeck
                   ` (3 subsequent siblings)
  44 siblings, 1 reply; 49+ messages in thread
From: Chris Paterson @ 2020-04-20 14:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, shuah, patches, ben.hutchings,
	lkft-triage, stable

Hello Greg,

> From: stable-owner@vger.kernel.org <stable-owner@vger.kernel.org> On
> Behalf Of Greg Kroah-Hartman
> Sent: 20 April 2020 13:39
> 
> This is the start of the stable review cycle for the 4.19.117 release.
> There are 40 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.

No build/boot issues seen for CIP configs for Linux 4.19.117-rc1 (df86600ce713).

Build/test pipeline/logs: https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/pipelines/137867597
GitLab CI pipeline: https://gitlab.com/cip-project/cip-testing/linux-cip-pipelines/-/blob/master/trees/linux-4.19.y.yml
Relevant LAVA jobs: https://lava.ciplatform.org/scheduler/alljobs?length=25&search=df86600ce#table

Kind regards, Chris

> 
> Responses should be made by Wed, 22 Apr 2020 12:10:36 +0000.
> 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.19.117-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> linux-4.19.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 
> -------------
> Pseudo-Shortlog of commits:
> 
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>     Linux 4.19.117-rc1
> 
> Austin Kim <austindh.kim@gmail.com>
>     mm/vmalloc.c: move 'area->pages' after if statement
> 
> Karthick Gopalasubramanian <kargop@codeaurora.org>
>     wil6210: remove reset file from debugfs
> 
> Dedy Lansky <dlansky@codeaurora.org>
>     wil6210: make sure Rx ring sizes are correlated
> 
> Alexei Avshalom Lazar <ailizaro@codeaurora.org>
>     wil6210: add general initialization/size checks
> 
> Maya Erez <merez@codeaurora.org>
>     wil6210: ignore HALP ICR if already handled
> 
> Dedy Lansky <dlansky@codeaurora.org>
>     wil6210: check rx_buff_mgmt before accessing it
> 
> Reinette Chatre <reinette.chatre@intel.com>
>     x86/resctrl: Fix invalid attempt at removing the default resource group
> 
> James Morse <james.morse@arm.com>
>     x86/resctrl: Preserve CDP enable over CPU hotplug
> 
> John Allen <john.allen@amd.com>
>     x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE
> 
> Maurizio Lombardi <mlombard@redhat.com>
>     scsi: target: fix hang when multiple threads try to destroy the same iscsi
> session
> 
> Maurizio Lombardi <mlombard@redhat.com>
>     scsi: target: remove boilerplate code
> 
> Jim Mattson <jmattson@google.com>
>     kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
> 
> Jan Kara <jack@suse.cz>
>     ext4: do not zeroout extents beyond i_disksize
> 
> Sergei Lopatin <magist3r@gmail.com>
>     drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled
> 
> Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>     usb: dwc3: gadget: Don't clear flags before transfer ended
> 
> Sasha Levin <sashal@kernel.org>
>     usb: dwc3: gadget: don't enable interrupt when disabling endpoint
> 
> Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
>     mac80211_hwsim: Use kstrndup() in place of kasprintf()
> 
> Josef Bacik <josef@toxicpanda.com>
>     btrfs: check commit root generation in should_ignore_root
> 
> Xiao Yang <yangx.jy@cn.fujitsu.com>
>     tracing: Fix the race between registering 'snapshot' event trigger and
> triggering 'snapshot' operation
> 
> Vasily Averin <vvs@virtuozzo.com>
>     keys: Fix proc_keys_next to increase position index
> 
> Takashi Iwai <tiwai@suse.de>
>     ALSA: usb-audio: Check mapping at creating connector controls, too
> 
> Takashi Iwai <tiwai@suse.de>
>     ALSA: usb-audio: Don't create jack controls for PCM terminals
> 
> Takashi Iwai <tiwai@suse.de>
>     ALSA: usb-audio: Don't override ignore_ctl_error value from the map
> 
> Takashi Iwai <tiwai@suse.de>
>     ALSA: usb-audio: Filter error from connector kctl ops, too
> 
> Colin Ian King <colin.king@canonical.com>
>     ASoC: Intel: mrfld: return error codes when an error occurs
> 
> Colin Ian King <colin.king@canonical.com>
>     ASoC: Intel: mrfld: fix incorrect check on p->sink
> 
> Josh Triplett <josh@joshtriplett.org>
>     ext4: fix incorrect inodes per group in error message
> 
> Josh Triplett <josh@joshtriplett.org>
>     ext4: fix incorrect group count in ext4_fill_super error message
> 
> Sven Van Asbroeck <TheSven73@gmail.com>
>     pwm: pca9685: Fix PWM/GPIO inter-operation
> 
> zhangyi (F) <yi.zhang@huawei.com>
>     jbd2: improve comments about freeing data buffers whose page mapping is
> NULL
> 
> Can Guo <cang@codeaurora.org>
>     scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic
> 
> Amir Goldstein <amir73il@gmail.com>
>     ovl: fix value of i_ino for lower hardlink corner case
> 
> DENG Qingfang <dqfext@gmail.com>
>     net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode
> 
> Florian Fainelli <f.fainelli@gmail.com>
>     net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes
> 
> Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
>     net: revert default NAPI poll timeout to 2 jiffies
> 
> Wang Wenhu <wenhu.wang@vivo.com>
>     net: qrtr: send msgs from local of same id as broadcast
> 
> Tim Stallard <code@timstallard.me.uk>
>     net: ipv6: do not consider routes via gateways for anycast address check
> 
> Taras Chornyi <taras.chornyi@plvision.eu>
>     net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin
> 
> Taehee Yoo <ap420073@gmail.com>
>     hsr: check protocol version in hsr_newlink()
> 
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>     amd-xgbe: Use __napi_schedule() in BH context
> 
> 
> -------------
> 
> Diffstat:
> 
>  Makefile                                          |  4 +-
>  arch/x86/include/asm/microcode_amd.h              |  2 +-
>  arch/x86/kernel/cpu/intel_rdt.c                   |  2 +
>  arch/x86/kernel/cpu/intel_rdt.h                   |  1 +
>  arch/x86/kernel/cpu/intel_rdt_rdtgroup.c          | 16 ++++-
>  arch/x86/kvm/cpuid.c                              |  3 +-
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c  |  5 +-
>  drivers/net/dsa/mt7530.c                          | 18 +++--
>  drivers/net/dsa/mt7530.h                          |  7 ++
>  drivers/net/ethernet/amd/xgbe/xgbe-drv.c          |  2 +-
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c |  2 +
>  drivers/net/wireless/ath/wil6210/debugfs.c        | 29 +-------
>  drivers/net/wireless/ath/wil6210/interrupt.c      | 12 ++--
>  drivers/net/wireless/ath/wil6210/main.c           |  5 +-
>  drivers/net/wireless/ath/wil6210/txrx.c           |  4 +-
>  drivers/net/wireless/ath/wil6210/txrx_edma.c      | 14 +++-
>  drivers/net/wireless/ath/wil6210/wil6210.h        |  3 +-
>  drivers/net/wireless/ath/wil6210/wmi.c            |  2 +-
>  drivers/net/wireless/mac80211_hwsim.c             | 12 ++--
>  drivers/pwm/pwm-pca9685.c                         | 85 +++++++++++++----------
>  drivers/scsi/ufs/ufshcd.c                         |  5 ++
>  drivers/target/iscsi/iscsi_target.c               | 79 ++++++---------------
>  drivers/target/iscsi/iscsi_target.h               |  1 -
>  drivers/target/iscsi/iscsi_target_configfs.c      |  5 +-
>  drivers/target/iscsi/iscsi_target_login.c         |  5 +-
>  drivers/usb/dwc3/gadget.c                         | 18 ++---
>  fs/btrfs/relocation.c                             |  4 +-
>  fs/ext4/extents.c                                 |  8 +--
>  fs/ext4/super.c                                   |  6 +-
>  fs/jbd2/commit.c                                  |  7 +-
>  fs/overlayfs/inode.c                              |  4 +-
>  include/net/ip6_route.h                           |  1 +
>  include/target/iscsi/iscsi_target_core.h          |  2 +-
>  kernel/trace/trace_events_trigger.c               | 10 +--
>  mm/vmalloc.c                                      |  8 ++-
>  net/core/dev.c                                    |  3 +-
>  net/hsr/hsr_netlink.c                             | 10 ++-
>  net/ipv4/devinet.c                                | 13 ++--
>  net/qrtr/qrtr.c                                   |  7 +-
>  security/keys/proc.c                              |  2 +
>  sound/soc/intel/atom/sst-atom-controls.c          |  2 +-
>  sound/soc/intel/atom/sst/sst_pci.c                |  2 +-
>  sound/usb/mixer.c                                 | 31 +++++----
>  sound/usb/mixer_maps.c                            |  4 +-
>  44 files changed, 252 insertions(+), 213 deletions(-)
> 


^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (40 preceding siblings ...)
  2020-04-20 14:17 ` [PATCH 4.19 00/40] 4.19.117-rc1 review Chris Paterson
@ 2020-04-20 19:51 ` Guenter Roeck
  2020-04-20 22:24 ` Naresh Kamboju
                   ` (2 subsequent siblings)
  44 siblings, 0 replies; 49+ messages in thread
From: Guenter Roeck @ 2020-04-20 19:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, shuah, patches, ben.hutchings, lkft-triage, stable

On 4/20/20 5:39 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.19.117 release.
> There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
> Anything received after that time might be too late.
> 

Build results:
	total: 155 pass: 155 fail: 0
Qemu test results:
	total: 418 pass: 418 fail: 0

Guenter

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (41 preceding siblings ...)
  2020-04-20 19:51 ` Guenter Roeck
@ 2020-04-20 22:24 ` Naresh Kamboju
  2020-04-21  9:56   ` Greg Kroah-Hartman
  2020-04-22 17:53   ` Ben Hutchings
  2020-04-21  9:52 ` Jon Hunter
  2020-04-21 20:04 ` shuah
  44 siblings, 2 replies; 49+ messages in thread
From: Naresh Kamboju @ 2020-04-20 22:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Netdev, netfilter-devel
  Cc: open list, Sasha Levin, Linus Torvalds, Andrew Morton,
	Guenter Roeck, Shuah Khan, patches, Ben Hutchings, lkft-triage,
	linux- stable, Wang Wenhu, Tim Stallard, Taras Chornyi,
	Taehee Yoo, Sebastian Andrzej Siewior, Florian Fainelli,
	DENG Qingfang, Konstantin Khlebnikov, David S. Miller

On Mon, 20 Apr 2020 at 18:21, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 4.19.117 release.
> There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
> 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.19.117-rc1.gz
> or in the git tree and branch at:
>         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h


Results from Linaro’s test farm.
Regressions on x86_64.

x86_64 boot failed due to kernel BUG and kernel panic.
It is hard to reproduce this BUG and kernel panic
We are investigating this problem. The full log links are at [1] and [2].

[ 0.000000] Linux version 4.19.117-rc1+ (TuxBuild@f0f6d9b6cd32) (gcc
version 9.3.0 (Debian 9.3.0-8)) #1 SMP Mon Apr 20 12:40:09 UTC 2020
<>
[    3.237717] igb 0000:01:00.0: Using MSI-X interrupts. 4 rx
queue(s), 4 tx queue(s)
[    3.246412] BUG: unable to handle kernel paging request at 00000000482444ab
[    3.246412] PGD 0 P4D 0
[    3.246412] Oops: 0002 [#1] SMP PTI
[    3.246412] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.117-rc1+ #1
[    3.246412] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS
2.0b 07/27/2017
[    3.246412] RIP: 0010:__hw_addr_add_ex+0xa/0xf0
[    3.246412] Code: 10 01 49 89 5f 08 48 83 c4 08 5b 5d 41 5c 41 5d
41 5e 41 5f c3 b8 f4 ff ff ff eb ea 0f 1f 40 00 41 57 41 56 41 55 41
54 55 53 <48> 83 8c 10 8b 44 24 48 89 4c 24 08 44 89 04 24 44 89 4c 24
04 89
[    3.246412] RSP: 0000:ffff9d614002fc48 EFLAGS: 00010246
[    3.246412] RAX: 0000000000000000 RBX: ffff975d9c17c000 RCX: 0000000000000001
[    3.246412] RDX: 0000000000000020 RSI: ffff9d614002fc88 RDI: ffff975d9c17c290
[    3.246412] RBP: ffff975d9c17c000 R08: 0000000000000000 R09: 0000000000000000
[    3.246412] R10: ffff975d9da8ee68 R11: 00000000ffffffff R12: 0000000000000008
[    3.246412] R13: ffffffffab8ba5bc R14: 0000000000000000 R15: ffffffffaafc93d0
[    3.246412] FS:  0000000000000000(0000) GS:ffff975d9fa80000(0000)
knlGS:0000000000000000
[    3.246412] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.438798] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    3.246412] CR2: 00000000482444ab CR3: 0000000211c0a001 CR4: 00000000003606e0
[    3.246412] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    3.246412] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    3.246412] Call Trace:
[    3.246412]  ? eth_header+0xb0/0xb0
[    3.246412]  dev_addr_init+0x76/0xb0
[    3.448543] ata4: SATA link down (SStatus 0 SControl 300)
[    3.246412]  alloc_netdev_mqs+0x9d/0x3e0
[    3.246412]  igb_probe+0x16e/0x14d0
[    3.462804] ata7: SATA link down (SStatus 0 SControl 300)
[    3.246412]  local_pci_probe+0x3e/0x90
[    3.246412]  pci_device_probe+0x102/0x1a0
[    3.246412]  really_probe+0x1be/0x260
[    3.472410] ata5: SATA link down (SStatus 0 SControl 300)
[    3.246412]  driver_probe_device+0x4b/0x90
[    3.246412]  __driver_attach+0xbb/0xc0
[    3.246412]  ? driver_probe_device+0x90/0x90
[    3.246412]  bus_for_each_dev+0x73/0xb0
[    3.246412]  bus_add_driver+0x192/0x1d0
[    3.246412]  driver_register+0x67/0xb0
[    3.246412]  ? e1000_init_module+0x34/0x34
[    3.246412]  do_one_initcall+0x41/0x1b4
[    3.246412]  kernel_init_freeable+0x15a/0x1e7
[    3.246412]  ? rest_init+0x9a/0x9a
[    3.246412]  kernel_init+0x5/0xf6
[    3.246412]  ret_from_fork+0x35/0x40
[    3.246412] Modules linked in:
[    3.246412] CR2: 00000000482444ab
[    3.246412] ---[ end trace 19f70173fca0a2aa ]---
[    3.246412] RIP: 0010:__hw_addr_add_ex+0xa/0xf0
[    3.246412] Code: 10 01 49 89 5f 08 48 83 c4 08 5b 5d 41 5c 41 5d
41 5e 41 5f c3 b8 f4 ff ff ff eb ea 0f 1f 40 00 41 57 41 56 41 55 41
54 55 53 <48> 83 8c 10 8b 44 24 48 89 4c 24 08 44 89 04 24 44 89 4c 24
04 89
[    3.246412] RSP: 0000:ffff9d614002fc48 EFLAGS: 00010246
[    3.246412] RAX: 0000000000000000 RBX: ffff975d9c17c000 RCX: 0000000000000001
[    3.246412] RDX: 0000000000000020 RSI: ffff9d614002fc88 RDI: ffff975d9c17c290
[    3.246412] RBP: ffff975d9c17c000 R08: 0000000000000000 R09: 0000000000000000
[    3.246412] R10: ffff975d9da8ee68 R11: 00000000ffffffff R12: 0000000000000008
[    3.246412] R13: ffffffffab8ba5bc R14: 0000000000000000 R15: ffffffffaafc93d0
[    3.246412] FS:  0000000000000000(0000) GS:ffff975d9fa80000(0000)
knlGS:0000000000000000
[    3.246412] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.246412] CR2: 00000000482444ab CR3: 0000000211c0a001 CR4: 00000000003606e0
[    3.246412] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    3.246412] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    3.670747] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x00000009
[    3.670747]
[    3.679456] Kernel Offset: 0x29600000 from 0xffffffff81000000
(relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[    3.679456] ---[ end Kernel panic - not syncing: Attempted to kill
init! exitcode=0x00000009
[    3.679456]  ]---
[    3.701024] ------------[ cut here ]------------
[    3.702023] sched: Unexpected reschedule of offline CPU#2!
[    3.702023] WARNING: CPU: 1 PID: 1 at arch/x86/kernel/smp.c:128
native_smp_send_reschedule+0x2f/0x40

ref:
[1] https://lkft.validation.linaro.org/scheduler/job/1379024#L744
[2] https://qa-reports.linaro.org/lkft/linux-stable-rc-4.19-oe/build/v4.19.116-41-gdf86600ce713/testrun/1379024/

-- 
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (42 preceding siblings ...)
  2020-04-20 22:24 ` Naresh Kamboju
@ 2020-04-21  9:52 ` Jon Hunter
  2020-04-21 20:04 ` shuah
  44 siblings, 0 replies; 49+ messages in thread
From: Jon Hunter @ 2020-04-21  9:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, shuah, patches, ben.hutchings,
	lkft-triage, stable, linux-tegra


On 20/04/2020 13:39, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.19.117 release.
> There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
> 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.19.117-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 
> -------------


All tests are passing for Tegra ...

Test results for stable-v4.19:
    11 builds:	11 pass, 0 fail
    22 boots:	22 pass, 0 fail
    32 tests:	32 pass, 0 fail

Linux version:	4.19.117-rc1-gdf86600ce713
Boards tested:	tegra124-jetson-tk1, tegra186-p2771-0000,
                tegra194-p2972-0000, tegra20-ventana,
                tegra210-p2371-2180, tegra30-cardhu-a04

Cheers
Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 14:17 ` [PATCH 4.19 00/40] 4.19.117-rc1 review Chris Paterson
@ 2020-04-21  9:55   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-21  9:55 UTC (permalink / raw)
  To: Chris Paterson
  Cc: linux-kernel, torvalds, akpm, linux, shuah, patches,
	ben.hutchings, lkft-triage, stable

On Mon, Apr 20, 2020 at 02:17:02PM +0000, Chris Paterson wrote:
> Hello Greg,
> 
> > From: stable-owner@vger.kernel.org <stable-owner@vger.kernel.org> On
> > Behalf Of Greg Kroah-Hartman
> > Sent: 20 April 2020 13:39
> > 
> > This is the start of the stable review cycle for the 4.19.117 release.
> > There are 40 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.
> 
> No build/boot issues seen for CIP configs for Linux 4.19.117-rc1 (df86600ce713).
> 
> Build/test pipeline/logs: https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/pipelines/137867597
> GitLab CI pipeline: https://gitlab.com/cip-project/cip-testing/linux-cip-pipelines/-/blob/master/trees/linux-4.19.y.yml
> Relevant LAVA jobs: https://lava.ciplatform.org/scheduler/alljobs?length=25&search=df86600ce#table

Great, thanks for letting me know.

greg k-h

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 22:24 ` Naresh Kamboju
@ 2020-04-21  9:56   ` Greg Kroah-Hartman
  2020-04-22 17:53   ` Ben Hutchings
  1 sibling, 0 replies; 49+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-21  9:56 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: Netdev, netfilter-devel, open list, Sasha Levin, Linus Torvalds,
	Andrew Morton, Guenter Roeck, Shuah Khan, patches, Ben Hutchings,
	lkft-triage, linux- stable, Wang Wenhu, Tim Stallard,
	Taras Chornyi, Taehee Yoo, Sebastian Andrzej Siewior,
	Florian Fainelli, DENG Qingfang, Konstantin Khlebnikov,
	David S. Miller

On Tue, Apr 21, 2020 at 03:54:20AM +0530, Naresh Kamboju wrote:
> On Mon, 20 Apr 2020 at 18:21, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > This is the start of the stable review cycle for the 4.19.117 release.
> > There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
> > 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.19.117-rc1.gz
> > or in the git tree and branch at:
> >         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> > and the diffstat can be found below.
> >
> > thanks,
> >
> > greg k-h
> 
> 
> Results from Linaro’s test farm.
> Regressions on x86_64.
> 
> x86_64 boot failed due to kernel BUG and kernel panic.
> It is hard to reproduce this BUG and kernel panic
> We are investigating this problem. The full log links are at [1] and [2].

THanks for testing all of these and if you find an offending commit for
this, please let me know.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
                   ` (43 preceding siblings ...)
  2020-04-21  9:52 ` Jon Hunter
@ 2020-04-21 20:04 ` shuah
  44 siblings, 0 replies; 49+ messages in thread
From: shuah @ 2020-04-21 20:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, patches, ben.hutchings, lkft-triage,
	stable, shuah

On 4/20/20 6:39 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.19.117 release.
> There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
> 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.19.117-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH 4.19 00/40] 4.19.117-rc1 review
  2020-04-20 22:24 ` Naresh Kamboju
  2020-04-21  9:56   ` Greg Kroah-Hartman
@ 2020-04-22 17:53   ` Ben Hutchings
  1 sibling, 0 replies; 49+ messages in thread
From: Ben Hutchings @ 2020-04-22 17:53 UTC (permalink / raw)
  To: Naresh Kamboju, Greg Kroah-Hartman, Netdev, netfilter-devel
  Cc: open list, Sasha Levin, Linus Torvalds, Andrew Morton,
	Guenter Roeck, Shuah Khan, patches, lkft-triage, linux- stable,
	Wang Wenhu, Tim Stallard, Taras Chornyi, Taehee Yoo,
	Sebastian Andrzej Siewior, Florian Fainelli, DENG Qingfang,
	Konstantin Khlebnikov, David S. Miller

On Tue, 2020-04-21 at 03:54 +0530, Naresh Kamboju wrote:
> On Mon, 20 Apr 2020 at 18:21, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > This is the start of the stable review cycle for the 4.19.117 release.
> > There are 40 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 Wed, 22 Apr 2020 12:10:36 +0000.
> > 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.19.117-rc1.gz
> > or in the git tree and branch at:
> >         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
> > and the diffstat can be found below.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Results from Linaro’s test farm.
> Regressions on x86_64.
> 
> x86_64 boot failed due to kernel BUG and kernel panic.
> It is hard to reproduce this BUG and kernel panic
> We are investigating this problem. The full log links are at [1] and [2].
> 
> [ 0.000000] Linux version 4.19.117-rc1+ (TuxBuild@f0f6d9b6cd32) (gcc
> version 9.3.0 (Debian 9.3.0-8)) #1 SMP Mon Apr 20 12:40:09 UTC 2020
> <>
> [    3.237717] igb 0000:01:00.0: Using MSI-X interrupts. 4 rx
> queue(s), 4 tx queue(s)
> [    3.246412] BUG: unable to handle kernel paging request at 00000000482444ab
> [    3.246412] PGD 0 P4D 0
> [    3.246412] Oops: 0002 [#1] SMP PTI
> [    3.246412] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.117-rc1+ #1
> [    3.246412] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS
> 2.0b 07/27/2017
> [    3.246412] RIP: 0010:__hw_addr_add_ex+0xa/0xf0
> [    3.246412] Code: 10 01 49 89 5f 08 48 83 c4 08 5b 5d 41 5c 41 5d
> 41 5e 41 5f c3 b8 f4 ff ff ff eb ea 0f 1f 40 00 41 57 41 56 41 55 41
> 54 55 53 <48> 83 8c 10 8b 44 24 48 89 4c 24 08 44 89 04 24 44 89 4c 24
> 04 89

The code from start of function to the faulting instruction is:

__hw_addr_add_ex:	41 57                	push   %r15
__hw_addr_add_ex+2:	41 56                	push   %r14
__hw_addr_add_ex+4:	41 55                	push   %r13
__hw_addr_add_ex+6:	41 54                	push   %r12
__hw_addr_add_ex+8:	55                   	push   %rbp
__hw_addr_add_ex+9:	53                   	push   %rbx
__hw_addr_add_ex+a:	48 83 8c 10 8b 44 24 	orq    $0xffffffffffffff89,0x4824448b(%rax,%rdx,1)

But in a Debian compiled 4.19 kernel the function starts with:

ffffffff815ec470:       e8 8b 53 21 00          callq  0xffffffff81801800
ffffffff815ec475:       41 57                   push   %r15
ffffffff815ec477:       41 56                   push   %r14
ffffffff815ec479:       41 55                   push   %r13
ffffffff815ec47b:       41 54                   push   %r12
ffffffff815ec47d:       55                      push   %rbp
ffffffff815ec47e:       53                      push   %rbx
ffffffff815ec47f:       48 83 ec 10             sub    $0x10,%rsp
ffffffff815ec483:       8b 44 24 48             mov    0x48(%rsp),%eax

(the first instruction is added by ftrace).

It looks like one byte of the faulting instruction has been corrupted
somehow.  So this function itself is probably not to blame.  It may be
worth running a memory test on the test system.

Ben.

> [    3.246412] RSP: 0000:ffff9d614002fc48 EFLAGS: 00010246
> [    3.246412] RAX: 0000000000000000 RBX: ffff975d9c17c000 RCX: 0000000000000001
> [    3.246412] RDX: 0000000000000020 RSI: ffff9d614002fc88 RDI: ffff975d9c17c290
> [    3.246412] RBP: ffff975d9c17c000 R08: 0000000000000000 R09: 0000000000000000
> [    3.246412] R10: ffff975d9da8ee68 R11: 00000000ffffffff R12: 0000000000000008
> [    3.246412] R13: ffffffffab8ba5bc R14: 0000000000000000 R15: ffffffffaafc93d0
> [    3.246412] FS:  0000000000000000(0000) GS:ffff975d9fa80000(0000)
> knlGS:0000000000000000
> [    3.246412] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    3.438798] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
> [    3.246412] CR2: 00000000482444ab CR3: 0000000211c0a001 CR4: 00000000003606e0
> [    3.246412] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [    3.246412] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [    3.246412] Call Trace:
> [    3.246412]  ? eth_header+0xb0/0xb0
> [    3.246412]  dev_addr_init+0x76/0xb0
> [    3.448543] ata4: SATA link down (SStatus 0 SControl 300)
> [    3.246412]  alloc_netdev_mqs+0x9d/0x3e0
> [    3.246412]  igb_probe+0x16e/0x14d0
> [    3.462804] ata7: SATA link down (SStatus 0 SControl 300)
> [    3.246412]  local_pci_probe+0x3e/0x90
> [    3.246412]  pci_device_probe+0x102/0x1a0
> [    3.246412]  really_probe+0x1be/0x260
> [    3.472410] ata5: SATA link down (SStatus 0 SControl 300)
> [    3.246412]  driver_probe_device+0x4b/0x90
> [    3.246412]  __driver_attach+0xbb/0xc0
> [    3.246412]  ? driver_probe_device+0x90/0x90
> [    3.246412]  bus_for_each_dev+0x73/0xb0
> [    3.246412]  bus_add_driver+0x192/0x1d0
> [    3.246412]  driver_register+0x67/0xb0
> [    3.246412]  ? e1000_init_module+0x34/0x34
> [    3.246412]  do_one_initcall+0x41/0x1b4
> [    3.246412]  kernel_init_freeable+0x15a/0x1e7
> [    3.246412]  ? rest_init+0x9a/0x9a
> [    3.246412]  kernel_init+0x5/0xf6
> [    3.246412]  ret_from_fork+0x35/0x40
> [    3.246412] Modules linked in:
> [    3.246412] CR2: 00000000482444ab
> [    3.246412] ---[ end trace 19f70173fca0a2aa ]---
> [    3.246412] RIP: 0010:__hw_addr_add_ex+0xa/0xf0
> [    3.246412] Code: 10 01 49 89 5f 08 48 83 c4 08 5b 5d 41 5c 41 5d
> 41 5e 41 5f c3 b8 f4 ff ff ff eb ea 0f 1f 40 00 41 57 41 56 41 55 41
> 54 55 53 <48> 83 8c 10 8b 44 24 48 89 4c 24 08 44 89 04 24 44 89 4c 24
> 04 89
> [    3.246412] RSP: 0000:ffff9d614002fc48 EFLAGS: 00010246
> [    3.246412] RAX: 0000000000000000 RBX: ffff975d9c17c000 RCX: 0000000000000001
> [    3.246412] RDX: 0000000000000020 RSI: ffff9d614002fc88 RDI: ffff975d9c17c290
> [    3.246412] RBP: ffff975d9c17c000 R08: 0000000000000000 R09: 0000000000000000
> [    3.246412] R10: ffff975d9da8ee68 R11: 00000000ffffffff R12: 0000000000000008
> [    3.246412] R13: ffffffffab8ba5bc R14: 0000000000000000 R15: ffffffffaafc93d0
> [    3.246412] FS:  0000000000000000(0000) GS:ffff975d9fa80000(0000)
> knlGS:0000000000000000
> [    3.246412] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    3.246412] CR2: 00000000482444ab CR3: 0000000211c0a001 CR4: 00000000003606e0
> [    3.246412] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [    3.246412] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [    3.670747] Kernel panic - not syncing: Attempted to kill init!
> exitcode=0x00000009
> [    3.670747]
> [    3.679456] Kernel Offset: 0x29600000 from 0xffffffff81000000
> (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
> [    3.679456] ---[ end Kernel panic - not syncing: Attempted to kill
> init! exitcode=0x00000009
> [    3.679456]  ]---
> [    3.701024] ------------[ cut here ]------------
> [    3.702023] sched: Unexpected reschedule of offline CPU#2!
> [    3.702023] WARNING: CPU: 1 PID: 1 at arch/x86/kernel/smp.c:128
> native_smp_send_reschedule+0x2f/0x40
> 
> ref:
> [1] https://lkft.validation.linaro.org/scheduler/job/1379024#L744
> [2] https://qa-reports.linaro.org/lkft/linux-stable-rc-4.19-oe/build/v4.19.116-41-gdf86600ce713/testrun/1379024/
> 
-- 
Ben Hutchings, Software Developer                         Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom


^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2020-04-22 17:53 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 12:39 [PATCH 4.19 00/40] 4.19.117-rc1 review Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 01/40] amd-xgbe: Use __napi_schedule() in BH context Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 02/40] hsr: check protocol version in hsr_newlink() Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 03/40] net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 04/40] net: ipv6: do not consider routes via gateways for anycast address check Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 05/40] net: qrtr: send msgs from local of same id as broadcast Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 06/40] net: revert default NAPI poll timeout to 2 jiffies Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 07/40] net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 08/40] net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 09/40] ovl: fix value of i_ino for lower hardlink corner case Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 10/40] scsi: ufs: Fix ufshcd_hold() caused scheduling while atomic Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 11/40] jbd2: improve comments about freeing data buffers whose page mapping is NULL Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 12/40] pwm: pca9685: Fix PWM/GPIO inter-operation Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 13/40] ext4: fix incorrect group count in ext4_fill_super error message Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 14/40] ext4: fix incorrect inodes per group in " Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 15/40] ASoC: Intel: mrfld: fix incorrect check on p->sink Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 16/40] ASoC: Intel: mrfld: return error codes when an error occurs Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 17/40] ALSA: usb-audio: Filter error from connector kctl ops, too Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 18/40] ALSA: usb-audio: Dont override ignore_ctl_error value from the map Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 19/40] ALSA: usb-audio: Dont create jack controls for PCM terminals Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 20/40] ALSA: usb-audio: Check mapping at creating connector controls, too Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 21/40] keys: Fix proc_keys_next to increase position index Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 22/40] tracing: Fix the race between registering snapshot event trigger and triggering snapshot operation Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 23/40] btrfs: check commit root generation in should_ignore_root Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 24/40] mac80211_hwsim: Use kstrndup() in place of kasprintf() Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 25/40] usb: dwc3: gadget: dont enable interrupt when disabling endpoint Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 26/40] usb: dwc3: gadget: Dont clear flags before transfer ended Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 27/40] drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 28/40] ext4: do not zeroout extents beyond i_disksize Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 29/40] kvm: x86: Host feature SSBD doesnt imply guest feature SPEC_CTRL_SSBD Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 30/40] scsi: target: remove boilerplate code Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 31/40] scsi: target: fix hang when multiple threads try to destroy the same iscsi session Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 32/40] x86/microcode/AMD: Increase microcode PATCH_MAX_SIZE Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 33/40] x86/resctrl: Preserve CDP enable over CPU hotplug Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 34/40] x86/resctrl: Fix invalid attempt at removing the default resource group Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 35/40] wil6210: check rx_buff_mgmt before accessing it Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 36/40] wil6210: ignore HALP ICR if already handled Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 37/40] wil6210: add general initialization/size checks Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 38/40] wil6210: make sure Rx ring sizes are correlated Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 39/40] wil6210: remove reset file from debugfs Greg Kroah-Hartman
2020-04-20 12:39 ` [PATCH 4.19 40/40] mm/vmalloc.c: move area->pages after if statement Greg Kroah-Hartman
2020-04-20 14:17 ` [PATCH 4.19 00/40] 4.19.117-rc1 review Chris Paterson
2020-04-21  9:55   ` Greg Kroah-Hartman
2020-04-20 19:51 ` Guenter Roeck
2020-04-20 22:24 ` Naresh Kamboju
2020-04-21  9:56   ` Greg Kroah-Hartman
2020-04-22 17:53   ` Ben Hutchings
2020-04-21  9:52 ` Jon Hunter
2020-04-21 20:04 ` shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).