gpio: arizona: handle pm_runtime_get_sync failure case
Subsystems (10)
Sasha Levin
maintainerPATCH 1/19 gpio: arizona: handle pm_runtime_get_sync failure case
From: Navid Emamdoost <[email protected]>
[ Upstream commit e6f390a834b56583e6fc0949822644ce92fbb107 ]
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.
--- drivers/gpio/gpio-arizona.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-arizona.c +1 -0
@@ -106,6 +106,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip, ret =pm_runtime_get_sync (chip->parent);if (ret <0 ) {dev_err (chip->parent,"Failed to resume: %d\n" , ret); +pm_runtime_put (chip->parent);return ret; } }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 2/19 gpio: arizona: put pm_runtime in case of failure
From: Navid Emamdoost <[email protected]>
[ Upstream commit 861254d826499944cb4d9b5a15f5a794a6b99a69 ]
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count if pm_runtime_put is not called in error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.
--- drivers/gpio/gpio-arizona.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpio/gpio-arizona.c +5 -1
@@ -64,6 +64,7 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset) ret =pm_runtime_get_sync (chip->parent);if (ret <0 ) {dev_err (chip->parent,"Failed to resume: %d\n" , ret); +pm_runtime_put_autosuspend (chip->parent);return ret; }
@@ -72,12 +73,15 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset)if (ret <0 ) {dev_err (chip->parent,"Failed to drop cache: %d\n" , ret); +pm_runtime_put_autosuspend (chip->parent);return ret; } ret =regmap_read (arizona->regmap, reg, &val); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_autosuspend (chip->parent);return ret; + }pm_runtime_mark_last_busy (chip->parent);pm_runtime_put_autosuspend (chip->parent);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 3/19 KVM: s390: reduce number of IO pins to 1
In reply to Sasha LevinFrom: Christian Borntraeger <[email protected]>
[ Upstream commit 774911290c589e98e3638e73b24b0a4d4530e97c ]
The current number of KVM_IRQCHIP_NUM_PINS results in an order 3 allocation (32kb) for each guest start/restart. This can result in OOM killer activity even with free swap when the memory is fragmented enough:
kernel: qemu-system-s39 invoked oom-killer: gfp_mask=0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), order=3, oom_score_adj=0 kernel: CPU: 1 PID: 357274 Comm: qemu-system-s39 Kdump: loaded Not tainted 5.4.0-29-generic #33-Ubuntu kernel: Hardware name: IBM 8562 T02 Z06 (LPAR) kernel: Call Trace: kernel: ([<00000001f848fe2a>] show_stack+0x7a/0xc0) kernel: [<00000001f8d3437a>] dump_stack+0x8a/0xc0 kernel: [<00000001f8687032>] dump_header+0x62/0x258 kernel: [<00000001f8686122>] oom_kill_process+0x172/0x180 kernel: [<00000001f8686abe>] out_of_memory+0xee/0x580 kernel: [<00000001f86e66b8>] __alloc_pages_slowpath+0xd18/0xe90 kernel: [<00000001f86e6ad4>] __alloc_pages_nodemask+0x2a4/0x320 kernel: [<00000001f86b1ab4>] kmalloc_order+0x34/0xb0 kernel: [<00000001f86b1b62>] kmalloc_order_trace+0x32/0xe0 kernel: [<00000001f84bb806>] kvm_set_irq_routing+0xa6/0x2e0 kernel: [<00000001f84c99a4>] kvm_arch_vm_ioctl+0x544/0x9e0 kernel: [<00000001f84b8936>] kvm_vm_ioctl+0x396/0x760 kernel: [<00000001f875df66>] do_vfs_ioctl+0x376/0x690 kernel: [<00000001f875e304>] ksys_ioctl+0x84/0xb0 kernel: [<00000001f875e39a>] __s390x_sys_ioctl+0x2a/0x40 kernel: [<00000001f8d55424>] system_call+0xd8/0x2c8
As far as I can tell s390x does not use the iopins as we bail our for anything other than KVM_IRQ_ROUTING_S390_ADAPTER and the chip/pin is only used for KVM_IRQ_ROUTING_IRQCHIP. So let us use a small number to reduce the memory footprint.
--- arch/s390/include/asm/kvm_host.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/s390/include/asm/kvm_host.h +4 -4
@@ -31,12 +31,12 @@#define KVM_USER_MEM_SLOTS 32/* -* These seem to be used for allocating ->chip in the routing table, -* which we don't use. 4096 is an out-of-thin-air value. If we need -* to look at ->chip later on, we'll need to revisit this. +* These seem to be used for allocating ->chip in the routing table, which we +* don't use. 1 is as small as we can get to reduce the needed memory. If we +* need to look at ->chip later on, we'll need to revisit this. */ #define KVM_NR_IRQCHIPS 1 -#define KVM_IRQCHIP_NUM_PINS 4096 +#define KVM_IRQCHIP_NUM_PINS 1#define KVM_HALT_POLL_NS_DEFAULT 50000/* s390-specific vcpu->requests bit members */
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 4/19 pinctrl: amd: fix npins for uart0 in kerncz_groups
In reply to Sasha LevinFrom: Jacky Hu <[email protected]>
[ Upstream commit 69339d083dfb7786b0e0b3fc19eaddcf11fabdfb ]
uart0_pins is defined as:
static const unsigned uart0_pins[] = {135, 136, 137, 138, 139};
which npins is wronly specified as 9 later
{
.name = "uart0",
.pins = uart0_pins,
.npins = 9,
},npins should be 5 instead of 9 according to the definition.
--- drivers/pinctrl/pinctrl-amd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-amd.h +1 -1
@@ -252,7 +252,7 @@ static const struct amd_pingroup kerncz_groups[] = { { .name = "uart0", .pins = uart0_pins, - .npins = 9, + .npins = 5, }, { .name = "uart1",
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 5/19 bpf: Set the number of exception entries properly for subprograms
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit c4c0bdc0d2d084ed847c7066bdf59fe2cd25aa17 ]
Currently, if a bpf program has more than one subprograms, each program will be jitted separately. For programs with bpf-to-bpf calls the prog->aux->num_exentries is not setup properly. For example, with bpf_iter_netlink.c modified to force one function to be not inlined and with CONFIG_BPF_JIT_ALWAYS_ON the following error is seen:
$ ./test_progs -n 3/3
...
libbpf: failed to load program 'iter/netlink'
libbpf: failed to load object 'bpf_iter_netlink'
libbpf: failed to load BPF skeleton 'bpf_iter_netlink': -4007
test_netlink:FAIL:bpf_iter_netlink__open_and_load skeleton open_and_load failed
#3/3 netlink:FAIL
The dmesg shows the following errors:
ex gen bug
which is triggered by the following code in arch/x86/net/bpf_jit_comp.c:
if (excnt >= bpf_prog->aux->num_exentries) {
pr_err("ex gen bug\n");
return -EFAULT;
}This patch fixes the issue by computing proper num_exentries for each subprogram before calling JIT.
--- kernel/bpf/verifier.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
kernel/bpf/verifier.c +9 -1
@@ -9613,7 +9613,7 @@ static int jit_subprogs(struct bpf_verifier_env *env)int i, j, subprog_start, subprog_end =0 , len, subprog;struct bpf_insn *insn;void *old_bpf_func; -int err; +int err, num_exentries;if (env->subprog_cnt <=1 )return 0 ;
@@ -9688,6 +9688,14 @@ static int jit_subprogs(struct bpf_verifier_env *env) func[i]->aux->nr_linfo = prog->aux->nr_linfo; func[i]->aux->jited_linfo = prog->aux->jited_linfo; func[i]->aux->linfo_idx = env->subprog_info[i].linfo_idx; + num_exentries =0 ; + insn = func[i]->insnsi; +for (j =0 ; j < func[i]->len; j++, insn++) { +if (BPF_CLASS (insn->code) ==BPF_LDX && +BPF_MODE (insn->code) ==BPF_PROBE_MEM ) + num_exentries++; + } + func[i]->aux->num_exentries = num_exentries; func[i] =bpf_int_jit_compile (func[i]);if (!func[i]->jited) { err = -ENOTSUPP ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 6/19 mac80211: allow rx of mesh eapol frames with default rx key
In reply to Sasha LevinFrom: Markus Theil <[email protected]>
[ Upstream commit 0b467b63870d9c05c81456aa9bfee894ab2db3b6 ]
Without this patch, eapol frames cannot be received in mesh mode, when 802.1X should be used. Initially only a MGTK is defined, which is found and set as rx->key, when there are no other keys set. ieee80211_drop_unencrypted would then drop these eapol frames, as they are data frames without encryption and there exists some rx->key.
Fix this by differentiating between mesh eapol frames and other data frames with existing rx->key. Allow mesh mesh eapol frames only if they are for our vif address.
With this patch in-place, ieee80211_rx_h_mesh_fwding continues after the ieee80211_drop_unencrypted check and notices, that these eapol frames have to be delivered locally, as they should.
--- net/mac80211/rx.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
net/mac80211/rx.c +26 -0
@@ -2357,6 +2357,7 @@ static int ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx)static int ieee80211_drop_unencrypted (struct ieee80211_rx_data *rx,__le16 fc) { +struct ieee80211_hdr *hdr = (void *)rx->skb->data;struct sk_buff *skb = rx->skb;struct ieee80211_rx_status *status =IEEE80211_SKB_RXCB (skb);
@@ -2367,6 +2368,31 @@ static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)if (status->flag &RX_FLAG_DECRYPTED )return 0 ; +/* check mesh EAPOL frames first */ +if (unlikely (rx->sta &&ieee80211_vif_is_mesh (&rx->sdata->vif) && +ieee80211_is_data (fc))) { +struct ieee80211s_hdr *mesh_hdr; +u16 hdr_len =ieee80211_hdrlen (fc); +u16 ethertype_offset; +__be16 ethertype; + +if (!ether_addr_equal (hdr->addr1, rx->sdata->vif.addr)) + goto drop_check; + +/* make sure fixed part of mesh header is there, also checks skb len */ +if (!pskb_may_pull (rx->skb, hdr_len +6 )) + goto drop_check; + + mesh_hdr = (struct ieee80211s_hdr *)(skb->data + hdr_len); + ethertype_offset = hdr_len +ieee80211_get_mesh_hdrlen (mesh_hdr) + +sizeof (rfc1042_header); + +if (skb_copy_bits (rx->skb, ethertype_offset, ðertype,2 ) ==0 && + ethertype == rx->sdata->control_port_protocol) +return 0 ; + } + +drop_check:/* Drop unencrypted frames if key is set. */ if (unlikely(!ieee80211_has_protected(fc) && !ieee80211_is_any_nullfunc(fc) &&
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 7/19 scsi: scsi_transport_spi: Fix function pointer check
In reply to Sasha LevinFrom: Tom Rix <[email protected]>
[ Upstream commit 5aee52c44d9170591df65fafa1cd408acc1225ce ]
clang static analysis flags several null function pointer problems.
drivers/scsi/scsi_transport_spi.c:374:1: warning: Called function pointer is null (null dereference) [core.CallAndMessage] spi_transport_max_attr(offset, "%d\n");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reviewing the store_spi_store_max macro
if (i->f->set_##field) return -EINVAL;
should be
if (!i->f->set_##field) return -EINVAL;
--- drivers/scsi/scsi_transport_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_spi.c +1 -1
@@ -339,7 +339,7 @@ store_spi_transport_##field(struct device *dev, \struct spi_transport_attrs *tp \ = (struct spi_transport_attrs *)&starget->starget_data; \ \ - if (i->f->set_##field) \ + if (!i->f->set_##field) \ return -EINVAL; \ val = simple_strtoul(buf, NULL, 0); \ if (val > tp->max_##field) \
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 8/19 xtensa: fix __sync_fetch_and_{and,or}_4 declarations
In reply to Sasha LevinFrom: Max Filippov <[email protected]>
[ Upstream commit 73f9941306d5ce030f3ffc7db425c7b2a798cf8e ]
Building xtensa kernel with gcc-10 produces the following warnings:
arch/xtensa/kernel/xtensa_ksyms.c:90:15: warning: conflicting types
for built-in function ‘__sync_fetch_and_and_4’; expected ‘unsigned int(volatile void *, unsigned int)’ [-Wbuiltin-declaration-mismatch]
arch/xtensa/kernel/xtensa_ksyms.c:96:15: warning: conflicting types
for built-in function ‘__sync_fetch_and_or_4’; expected ‘unsigned int(volatile void *, unsigned int)’ [-Wbuiltin-declaration-mismatch]
Fix declarations of these functions to avoid the warning.
--- arch/xtensa/kernel/xtensa_ksyms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/xtensa/kernel/xtensa_ksyms.c +2 -2
@@ -87,13 +87,13 @@ void __xtensa_libgcc_window_spill(void) }EXPORT_SYMBOL (__xtensa_libgcc_window_spill); -unsigned long __sync_fetch_and_and_4 (unsigned long *p,unsigned long v) +unsigned int __sync_fetch_and_and_4 (volatile void *p,unsigned int v) {BUG (); }EXPORT_SYMBOL (__sync_fetch_and_and_4); -unsigned long __sync_fetch_and_or_4 (unsigned long *p,unsigned long v) +unsigned int __sync_fetch_and_or_4 (volatile void *p,unsigned int v) {BUG (); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 9/19 xtensa: update *pos in cpuinfo_op.next
In reply to Sasha LevinFrom: Max Filippov <[email protected]>
[ Upstream commit 0d5ab144429e8bd80889b856a44d56ab4a5cd59b ]
Increment *pos in the cpuinfo_op.next to fix the following warning triggered by cat /proc/cpuinfo:
seq_file: buggy .next function c_next did not update position index
--- arch/xtensa/kernel/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/xtensa/kernel/setup.c +2 -1
@@ -725,7 +725,8 @@ c_start(struct seq_file *f, loff_t *pos)static void *c_next (struct seq_file *f,void *v,loff_t *pos) { -return NULL ; + ++*pos; +return c_start (f, pos); } static void
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 10/19 scsi: mpt3sas: Fix unlock imbalance
In reply to Sasha LevinFrom: Damien Le Moal <[email protected]>
[ Upstream commit cb551b8dc079d2ef189145782627c99cb68c0255 ]
In BRM_status_show(), if the condition "!ioc->is_warpdrive" tested on entry to the function is true, a "goto out" is called. This results in unlocking ioc->pci_access_mutex without this mutex lock being taken. This generates the following splat:
[ 1148.539883] mpt3sas_cm2: BRM_status_show: BRM attribute is only for warpdrive
[ 1148.547184]
[ 1148.548708] =====================================
[ 1148.553501] WARNING: bad unlock balance detected!
[ 1148.558277] 5.8.0-rc3+ #827 Not tainted
[ 1148.562183] -------------------------------------
[ 1148.566959] cat/5008 is trying to release lock (&ioc->pci_access_mutex) at:
[ 1148.574035] [<ffffffffc070b7a3>] BRM_status_show+0xd3/0x100 [mpt3sas]
[ 1148.580574] but there are no more locks to release!
[ 1148.585524]
[ 1148.585524] other info that might help us debug this:
[ 1148.599624] 3 locks held by cat/5008:
[ 1148.607085] #0: ffff92aea3e392c0 (&p->lock){+.+.}-{3:3}, at: seq_read+0x34/0x480
[ 1148.618509] #1: ffff922ef14c4888 (&of->mutex){+.+.}-{3:3}, at: kernfs_seq_start+0x2a/0xb0
[ 1148.630729] #2: ffff92aedb5d7310 (kn->active#224){.+.+}-{0:0}, at: kernfs_seq_start+0x32/0xb0
[ 1148.643347]
[ 1148.643347] stack backtrace:
[ 1148.655259] CPU: 73 PID: 5008 Comm: cat Not tainted 5.8.0-rc3+ #827
[ 1148.665309] Hardware name: HGST H4060-S/S2600STB, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
[ 1148.678394] Call Trace:
[ 1148.684750] dump_stack+0x78/0xa0
[ 1148.691802] lock_release.cold+0x45/0x4a
[ 1148.699451] __mutex_unlock_slowpath+0x35/0x270
[ 1148.707675] BRM_status_show+0xd3/0x100 [mpt3sas]
[ 1148.716092] dev_attr_show+0x19/0x40
[ 1148.723664] sysfs_kf_seq_show+0x87/0x100
[ 1148.731193] seq_read+0xbc/0x480
[ 1148.737882] vfs_read+0xa0/0x160
[ 1148.744514] ksys_read+0x58/0xd0
[ 1148.751129] do_syscall_64+0x4c/0xa0
[ 1148.757941] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 1148.766240] RIP: 0033:0x7f1230566542
[ 1148.772957] Code: Bad RIP value.
[ 1148.779206] RSP: 002b:00007ffeac1bcac8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 1148.790063] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f1230566542
[ 1148.800284] RDX: 0000000000020000 RSI: 00007f1223460000 RDI: 0000000000000003
[ 1148.810474] RBP: 00007f1223460000 R08: 00007f122345f010 R09: 0000000000000000
[ 1148.820641] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000000000
[ 1148.830728] R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000Fix this by returning immediately instead of jumping to the out label.
--- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_ctl.c +1 -1
@@ -3145,7 +3145,7 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr,if (!ioc->is_warpdrive) {ioc_err (ioc,"%s: BRM attribute is only for warpdrive\n" , __func__); - goto out; +return 0 ; }/* pci_access_mutex lock acquired by sysfs show path */ mutex_lock (&ioc->pci_access_mutex);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 11/19 drivers/net/wan/lapbether: Fixed the value of hard_header_len
In reply to Sasha LevinFrom: Xie He <[email protected]>
[ Upstream commit 9dc829a135fb5927f1519de11286e2bbb79f5b66 ]
When this driver transmits data,
first this driver will remove a pseudo header of 1 byte, then the lapb module will prepend the LAPB header of 2 or 3 bytes, then this driver will prepend a length field of 2 bytes, then the underlying Ethernet device will prepend its own header.
So, the header length required should be:
-1 + 3 + 2 + "the header length needed by the underlying device".
This patch fixes kernel panic when this driver is used with AF_PACKET SOCK_DGRAM sockets.
--- drivers/net/wan/lapbether.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/wan/lapbether.c +8 -1
@@ -303,7 +303,6 @@ static void lapbeth_setup(struct net_device *dev) dev->netdev_ops = &lapbeth_netdev_ops; dev->needs_free_netdev = true; dev->type =ARPHRD_X25 ; - dev->hard_header_len =3 ; dev->mtu =1000 ; dev->addr_len =0 ; }
@@ -324,6 +323,14 @@ static int lapbeth_new_device(struct net_device *dev)if (!ndev) goto out; +/* When transmitting data: +* first this driver removes a pseudo header of 1 byte, +* then the lapb module prepends an LAPB header of at most 3 bytes, +* then this driver prepends a length field of 2 bytes, +* then the underlying Ethernet device prepends its own header. +*/ + ndev->hard_header_len =-1 +3 +2 + dev->hard_header_len; + lapbeth =netdev_priv (ndev); lapbeth->axdev = ndev;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 12/19 ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later
In reply to Sasha LevinFrom: Kai Vehmanen <[email protected]>
[ Upstream commit 56275036d8185f92eceac7479d48b858ee3dab84 ]
When HDMI PCM devices are opened in a specific order, with at least one HDMI/DP receiver connected, ALSA PCM open fails to -EBUSY on the connected monitor, on recent Intel platforms (ICL/JSL and newer). While this is not a typical sequence, at least Pulseaudio does this every time when it is started, to discover the available PCMs.
The rootcause is an invalid assumption in hdmi_add_pin(), where the total number of converters is assumed to be known at the time the function is called. On older Intel platforms this held true, but after ICL/JSL, the order how pins and converters are in the subnode list as returned by snd_hda_get_sub_nodes(), was changed. As a result, information for some converters was not stored to per_pin->mux_nids. And this means some pins cannot be connected to all converters, and application instead gets -EBUSY instead at open.
The assumption that converters are always before pins in the subnode list, is not really a valid one. Fix the problem in hdmi_parse_codec() by introducing separate loops for discovering converters and pins.
--- sound/pci/hda/patch_hdmi.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-)
sound/pci/hda/patch_hdmi.c +23 -13
@@ -1804,33 +1804,43 @@ static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)static int hdmi_parse_codec (struct hda_codec *codec) { -hda_nid_t nid; +hda_nid_t start_nid; +unsigned int caps;int i, nodes; - nodes =snd_hda_get_sub_nodes (codec, codec->core.afg, &nid); -if (!nid || nodes <0 ) { + nodes =snd_hda_get_sub_nodes (codec, codec->core.afg, &start_nid); +if (!start_nid || nodes <0 ) {codec_warn (codec,"HDMI: failed to get afg sub nodes\n" );return -EINVAL ; } -for (i =0 ; i < nodes; i++, nid++) { -unsigned int caps; -unsigned int type; +/* +* hdmi_add_pin() assumes total amount of converters to +* be known, so first discover all converters +*/ +for (i =0 ; i < nodes; i++) { +hda_nid_t nid = start_nid + i; caps =get_wcaps (codec, nid); - type =get_wcaps_type (caps);if (!(caps &AC_WCAP_DIGITAL ))continue ; -switch (type) { -case AC_WID_AUD_OUT : +if (get_wcaps_type (caps) ==AC_WID_AUD_OUT )hdmi_add_cvt (codec, nid); -break ; -case AC_WID_PIN : + } + +/* discover audio pins */ +for (i =0 ; i < nodes; i++) { +hda_nid_t nid = start_nid + i; + + caps =get_wcaps (codec, nid); + +if (!(caps &AC_WCAP_DIGITAL )) +continue ; + +if (get_wcaps_type (caps) ==AC_WID_PIN )hdmi_add_pin (codec, nid); -break ; - } }return 0 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 13/19 net: usb: qmi_wwan: add support for Quectel EG95 LTE modem
In reply to Sasha LevinFrom: AceLan Kao <[email protected]>
[ Upstream commit f815dd5cf48b905eeecf0a2b990e9b7ab048b4f1 ]
Add support for Quectel Wireless Solutions Co., Ltd. EG95 LTE modem
T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0195 Rev=03.18 S: Manufacturer=Android S: Product=Android C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
--- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1370,6 +1370,7 @@ static const struct usb_device_id products[] = { {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ + {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */ {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 14/19 net: sky2: initialize return of gm_phy_read
In reply to Sasha LevinFrom: Tom Rix <[email protected]>
[ Upstream commit 28b18e4eb515af7c6661c3995c6e3c34412c2874 ]
clang static analysis flags this garbage return
drivers/net/ethernet/marvell/sky2.c:208:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
return v;
^~~~~~~~static inline u16 gm_phy_read( ...
{
u16 v;
__gm_phy_read(hw, port, reg, &v);
return v;
}__gm_phy_read can return without setting v.
So handle similar to skge.c's gm_phy_read, initialize v.
--- drivers/net/ethernet/marvell/sky2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/sky2.c +1 -1
@@ -203,7 +203,7 @@ static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val)static inline u16 gm_phy_read (struct sky2_hw *hw,unsigned port,u16 reg) { -u16 v; +u16 v =0 ;__gm_phy_read (hw, port, reg, &v);return v; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 15/19 drm/nouveau/i2c/g94-: increase NV_PMGR_DP_AUXCTL_TRANSACTREQ timeout
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit 0156e76d388310a490aeb0f2fbb5b284ded3aecc ]
Tegra TRM says worst-case reply time is 1216us, and this should fix some spurious timeouts that have been popping up.
--- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c | 4 ++-- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +2 -2
@@ -118,10 +118,10 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,if (retries)udelay (400 ); -/* transaction request, wait up to 1ms for it to complete */ +/* transaction request, wait up to 2ms for it to complete */ nvkm_wr32 (device,0x00e4e4 + base,0x00010000 | ctrl); - timeout =1000 ; + timeout =2000 ; do { ctrl = nvkm_rd32(device, 0x00e4e4 + base); udelay(1);
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +2 -2
@@ -118,10 +118,10 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,if (retries)udelay (400 ); -/* transaction request, wait up to 1ms for it to complete */ +/* transaction request, wait up to 2ms for it to complete */ nvkm_wr32 (device,0x00d954 + base,0x00010000 | ctrl); - timeout =1000 ; + timeout =2000 ; do { ctrl = nvkm_rd32(device, 0x00d954 + base); udelay(1);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 16/19 scsi: mpt3sas: Fix error returns in BRM_status_show
In reply to Sasha LevinFrom: Johannes Thumshirn <[email protected]>
[ Upstream commit 0fd181456aa0826057adbfb6c79c40f4083cfd75 ]
BRM_status_show() has several error branches, but none of them record the error in the error return.
Also while at it remove the manual mutex_unlock() of the pci_access_mutex in case of an ongoing pci error recovery or host removal and jump to the cleanup label instead.
Note: We can safely jump to out from here as io_unit_pg3 is initialized to NULL and if it hasn't been allocated, kfree() skips the NULL pointer.
[mkp: compilation warning]
--- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_ctl.c +6 -4
@@ -3149,15 +3149,14 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr, }/* pci_access_mutex lock acquired by sysfs show path */ mutex_lock (&ioc->pci_access_mutex); -if (ioc->pci_error_recovery || ioc->remove_host) { -mutex_unlock (&ioc->pci_access_mutex); -return 0 ; - } +if (ioc->pci_error_recovery || ioc->remove_host) + goto out;/* allocate upto GPIOVal 36 entries */ sz = offsetof(Mpi2IOUnitPage3_t , GPIOVal) + (sizeof (u16) *36 ); io_unit_pg3 =kzalloc (sz,GFP_KERNEL );if (!io_unit_pg3) { + rc = -ENOMEM ;ioc_err (ioc,"%s: failed allocating memory for iounit_pg3: (%d) bytes\n" , __func__, sz); goto out;
@@ -3167,6 +3166,7 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr, 0) {ioc_err (ioc,"%s: failed reading iounit_pg3\n" , __func__); + rc = -EINVAL ; goto out; }
@@ -3174,12 +3174,14 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr,if (ioc_status !=MPI2_IOCSTATUS_SUCCESS ) {ioc_err (ioc,"%s: iounit_pg3 failed with ioc_status(0x%04x)\n" , __func__, ioc_status); + rc = -EINVAL ; goto out; }if (io_unit_pg3->GPIOCount <25 ) {ioc_err (ioc,"%s: iounit_pg3->GPIOCount less than 25 entries, detected (%d) entries\n" , __func__, io_unit_pg3->GPIOCount); + rc = -EINVAL ; goto out; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 17/19 scsi: dh: Add Fujitsu device to devinfo and dh lists
In reply to Sasha LevinFrom: Steve Schremmer <[email protected]>
[ Upstream commit e094fd346021b820f37188aaa6b502c7490ab5b5 ]
Add FUJITSU ETERNUS_AHB
--- drivers/scsi/scsi_devinfo.c | 1 + drivers/scsi/scsi_dh.c | 1 + 2 files changed, 2 insertions(+)
drivers/scsi/scsi_devinfo.c +1 -0
@@ -239,6 +239,7 @@ static struct { {"LSI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"ENGENIO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"LENOVO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, + {"FUJITSU", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"SanDisk", "Cruzer Blade", NULL, BLIST_TRY_VPD_PAGES | BLIST_INQUIRY_36}, {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36},
drivers/scsi/scsi_dh.c +1 -0
@@ -63,6 +63,7 @@ static const struct scsi_dh_blist scsi_dh_blist[] = { {"LSI", "INF-01-00", "rdac", }, {"ENGENIO", "INF-01-00", "rdac", }, {"LENOVO", "DE_Series", "rdac", }, + {"FUJITSU", "ETERNUS_AHB", "rdac", }, {NULL, NULL, NULL }, };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 18/19 dm: use bio_uninit instead of bio_disassociate_blkg
In reply to Sasha LevinFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 382761dc6312965a11f82f2217e16ec421bf17ae ]
bio_uninit is the proper API to clean up a BIO that has been allocated on stack or inside a structure that doesn't come from the BIO allocator. Switch dm to use that instead of bio_disassociate_blkg, which really is an implementation detail. Note that the bio_uninit calls are also moved to the two callers of __send_empty_flush, so that they better pair with the bio_init calls used to initialize them.
--- drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/md/dm.c +2 -3
@@ -1445,9 +1445,6 @@ static int __send_empty_flush(struct clone_info *ci)BUG_ON (bio_has_data (ci->bio));while ((ti =dm_table_get_target (ci->map, target_nr++)))__send_duplicate_bios (ci, ti, ti->num_flush_bios,NULL ); - -bio_disassociate_blkg (ci->bio); -return 0 ; }
@@ -1635,6 +1632,7 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, ci.bio = &flush_bio; ci.sector_count =0 ; error =__send_empty_flush (&ci); +bio_uninit (ci.bio);/* dec_pending submits any data associated with flush */ }else if (op_is_zone_mgmt (bio_op (bio))) { ci.bio = bio;
@@ -1709,6 +1707,7 @@ static blk_qc_t __process_bio(struct mapped_device *md, struct dm_table *map, ci.bio = &flush_bio; ci.sector_count =0 ; error =__send_empty_flush (&ci); +bio_uninit (ci.bio);/* dec_pending submits any data associated with flush */ }else {struct dm_target_io *tio;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 19/19 drivers/firmware/psci: Fix memory leakage in alloc_init_cpu_groups()
In reply to Sasha LevinFrom: Gavin Shan <[email protected]>
[ Upstream commit c377e67c6271954969384f9be1b1b71de13eba30 ]
The CPU mask (@tmp) should be released on failing to allocate @cpu_groups or any of its elements. Otherwise, it leads to memory leakage because the CPU mask variable is dynamically allocated when CONFIG_CPUMASK_OFFSTACK is enabled.
--- drivers/firmware/psci/psci_checker.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/psci/psci_checker.c +4 -1
@@ -157,8 +157,10 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) cpu_groups =kcalloc (nb_available_cpus,sizeof (cpu_groups),GFP_KERNEL ); -if (!cpu_groups) +if (!cpu_groups) { +free_cpumask_var (tmp);return -ENOMEM ; + }cpumask_copy (tmp, cpu_online_mask);
@@ -167,6 +169,7 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups)topology_core_cpumask (cpumask_any (tmp));if (!alloc_cpumask_var (&cpu_groups[num_groups],GFP_KERNEL )) { +free_cpumask_var (tmp);free_cpu_groups (num_groups, &cpu_groups);return -ENOMEM ; }
Signature · 1 line
2.25.1