ASoC: Intel: sof_sdw: add support for SKU 0B14
Subsystems (7)
Sasha Levin
maintainerPATCH 1/19 ASoC: Intel: sof_sdw: add support for SKU 0B14
From: Pierre-Louis Bossart <[email protected]>
[ Upstream commit fb0b8d299781be8d46b3612aa96cef28da0d93f4 ]
One more missing SKU in the list.
--- sound/soc/intel/boards/sof_sdw.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/intel/boards/sof_sdw.c +10 -0
@@ -347,6 +347,16 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {/* No Jack */ .driver_data = (void *)SOF_SDW_TGL_HDMI, }, + { + .callback = sof_sdw_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc" ), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B14"), + }, +/* No Jack */ + .driver_data = (void *)SOF_SDW_TGL_HDMI, + }, + { .callback = sof_sdw_quirk_cb, .matches = {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 2/19 ASoC: simple-card: fixup asoc_simple_probe() error handling
From: Kuninori Morimoto <[email protected]>
[ Upstream commit 41bae58df411f9accf01ea660730649b2fab1dab ]
asoc_simple_probe() is used for both "DT probe" (A) and "platform probe" (B). It uses "goto err" when error case, but it is not needed for "platform probe" case (B). Thus it is using "return" directly there.
static int asoc_simple_probe(...)
{ ^ if (...) {
| ...
(A) if (ret < 0)
| goto err;
v } else {
^ ...
| if (ret < 0)
(B) return -Exxx;
v }
...
^ if (ret < 0)
(C) goto err;
v ...
err:
(D) simple_util_clean_reference(card);
return ret; }
Both case are using (C) part, and it calls (D) when err case. But (D) will do nothing for (B) case.
Because of these behavior, current code itself is not wrong, but is confusable, and more, static analyzing tool will warning on
(B) part (should use goto err).
To avoid static analyzing tool warning, this patch uses "goto err" on (B) part.
--- sound/soc/generic/simple-card.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/generic/simple-card.c +4 -2
@@ -678,10 +678,12 @@ static int asoc_simple_probe(struct platform_device *pdev)struct snd_soc_dai_link *dai_link = priv->dai_link;struct simple_dai_props *dai_props = priv->dai_props; + ret = -EINVAL ; + cinfo = dev->platform_data;if (!cinfo) {dev_err (dev,"no info for asoc-simple-card\n" ); -return -EINVAL ; + goto err; } if (!cinfo->name ||
@@ -690,7 +692,7 @@ static int asoc_simple_probe(struct platform_device *pdev) !cinfo->platform || !cinfo->cpu_dai.name) {dev_err (dev,"insufficient asoc_simple_card_info settings\n" ); -return -EINVAL ; + goto err; } cpus = dai_link->cpus;
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 3/19 coresight: tmc-etr: Disable warnings for allocation failures
In reply to Sasha LevinFrom: Suzuki K Poulose <[email protected]>
[ Upstream commit e5028011885a85032aa3c1b7e3e493bcdacb4a0a ]
Running the following command on Juno triggers the warning:
$ perf record -e cs_etm// -m ,128M ...
------------[ cut here ]------------ WARNING: CPU: 1 PID: 412 at mm/page_alloc.c:4453 __alloc_pages+0x334/0x1420 CPU: 1 PID: 412 Comm: perf Not tainted 6.5.0-rc3+ #181 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Feb 1 2019 pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __alloc_pages+0x334/0x1420 lr : dma_common_alloc_pages+0x108/0x138 sp : ffffffc087fb7440 x29: ffffffc087fb7440 x28: 0000000000000000 x27: ffffffc07e48fba0 x26: 0000000000000001 x25: 000000000000000f x24: ffffffc081f24880 x23: 0000000000000cc0 x22: ffffff88012b6f08 x21: 0000000008000000 x20: ffffff8801433000 x19: 0000000000000000 x18: 0000000000000000 x17: ffffffc080316e5c x16: ffffffc07e46406c x15: ffffffc0803af580 x14: ffffffc08036b460 x13: ffffffc080025cbc x12: ffffffb8108c3fc4 x11: 1ffffff8108c3fc3 x10: 1ffffff810ff6eac x9 : 00000000f204f204 x8 : 000000000000f204 x7 : 00000000f2f2f2f2 x6 : 00000000f3f3f3f3 x5 : 0000000000000001 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000cc0 x1 : 0000000000000000 x0 : ffffffc085333000 Call trace: __alloc_pages+0x334/0x1420 dma_common_alloc_pages+0x108/0x138 __dma_alloc_pages+0xf4/0x108 dma_alloc_pages+0x18/0x30 tmc_etr_alloc_flat_buf+0xa0/0x190 [coresight_tmc] tmc_alloc_etr_buf.constprop.0+0x124/0x298 [coresight_tmc] alloc_etr_buf.constprop.0.isra.0+0x88/0xc8 [coresight_tmc] tmc_alloc_etr_buffer+0x164/0x2f0 [coresight_tmc] etm_setup_aux+0x32c/0x520 [coresight] rb_alloc_aux+0x29c/0x3f8 perf_mmap+0x59c/0xce0 mmap_region+0x340/0x10e0 do_mmap+0x48c/0x580 vm_mmap_pgoff+0x160/0x248 ksys_mmap_pgoff+0x1e8/0x278 __arm64_sys_mmap+0x8c/0xb8
With the flat mode, we only attempt to allocate large memory if there is an IOMMU connected to the ETR. If the allocation fails, we always have a fallback path and return an error if nothing else worked. So, suppress the warning for flat mode allocations.
--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tmc-etr.c +2 -1
@@ -610,7 +610,8 @@ static int tmc_etr_alloc_flat_buf(struct tmc_drvdata *drvdata, flat_buf->vaddr =dma_alloc_noncoherent (real_dev, etr_buf->size, &flat_buf->daddr, -DMA_FROM_DEVICE ,GFP_KERNEL ); +DMA_FROM_DEVICE , +GFP_KERNEL | __GFP_NOWARN);if (!flat_buf->vaddr) {kfree (flat_buf);return -ENOMEM ;
Signature · 7 lines
2.40.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 4/19 ACPI: EC: Add quirk for the HP Pavilion Gaming 15-dk1xxx
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit cd4aece493f99f95d41edcce32927d70a5dde923 ]
Added GPE quirk entry for the HP Pavilion Gaming 15-dk1xxx. There is a quirk entry for 2 15-c..... laptops, this is for a new version which has 15-dk1xxx as identifier.
This fixes the LID switch and rfkill and brightness hotkeys not working.
--- drivers/acpi/ec.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/acpi/ec.c +11 -0
@@ -1886,6 +1886,17 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "HP 15-cx0041ur"), }, }, + { +/* +* HP Pavilion Gaming Laptop 15-dk1xxx +* https://github.com/systemd/systemd/issues/28942 +*/ + .callback = ec_honor_dsdt_gpe, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"HP" ), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-dk1xxx"), + }, + }, {/* * Samsung hardware
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 5/19 ASoC: tlv320adc3xxx: BUG: Correct micbias setting
In reply to Sasha LevinFrom: Antoine Gennart <[email protected]>
[ Upstream commit e930bea4124b8a4a47ba4092d99da30099b9242d ]
The micbias setting for tlv320adc can also have the value '3' which means that the micbias ouput pin is connected to the input pin AVDD.
--- sound/soc/codecs/tlv320adc3xxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/tlv320adc3xxx.c +2 -2
@@ -293,7 +293,7 @@#define ADC3XXX_BYPASS_RPGA 0x80/* MICBIAS control bits */ -#define ADC3XXX_MICBIAS_MASK 0x2 +#define ADC3XXX_MICBIAS_MASK 0x3#define ADC3XXX_MICBIAS1_SHIFT 5#define ADC3XXX_MICBIAS2_SHIFT 3
@@ -1099,7 +1099,7 @@ static int adc3xxx_parse_dt_micbias(struct adc3xxx *adc3xxx,unsigned int val;if (!of_property_read_u32 (np, propname, &val)) { -if (val >=ADC3XXX_MICBIAS_AVDD ) { +if (val >ADC3XXX_MICBIAS_AVDD ) {dev_err (dev,"Invalid property value for '%s'\n" , propname);return -EINVAL ; }
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 6/19 Input: i8042 - add Fujitsu Lifebook E5411 to i8042 quirk table
In reply to Sasha LevinFrom: Szilard Fabian <[email protected]>
[ Upstream commit 80f39e1c27ba9e5a1ea7e68e21c569c9d8e46062 ]
In the initial boot stage the integrated keyboard of Fujitsu Lifebook E5411 refuses to work and it's not possible to type for example a dm-crypt passphrase without the help of an external keyboard.
i8042.nomux kernel parameter resolves this issue but using that a PS/2 mouse is detected. This input device is unused even when the i2c-hid-acpi kernel module is blacklisted making the integrated ELAN touchpad (04F3:308A) not working at all.
Since the integrated touchpad is managed by the i2c_designware input driver in the Linux kernel and you can't find a PS/2 mouse port on the computer I think it's safe to not use the PS/2 mouse port at all.
--- drivers/input/serio/i8042-acpipnpio.h | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/input/serio/i8042-acpipnpio.h +8 -0
@@ -618,6 +618,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { }, .driver_data = (void *)(SERIO_QUIRK_NOMUX) }, + { +/* Fujitsu Lifebook E5411 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"FUJITSU CLIENT COMPUTING LIMITED" ), + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"), + }, + .driver_data = (void *)(SERIO_QUIRK_NOAUX ) + }, {/* Gigabyte M912 */ .matches = {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 7/19 Input: goodix - ensure int GPIO is in input for gpio_count == 1 && gpio_int_idx == 0 case
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 423622a90abb243944d1517b9f57db53729e45c4 ]
Add a special case for gpio_count == 1 && gpio_int_idx == 0 to goodix_add_acpi_gpio_mappings().
It seems that on newer x86/ACPI devices the reset and irq GPIOs are no longer listed as GPIO resources instead there is only 1 GpioInt resource and _PS0 does the whole reset sequence for us.
This means that we must call acpi_device_fix_up_power() on these devices to ensure that the chip is reset before we try to use it.
This part was already fixed in commit 3de93e6ed2df ("Input: goodix - call acpi_device_fix_up_power() in some cases") by adding a call to acpi_device_fix_up_power() to the generic "Unexpected ACPI resources" catch all.
But it turns out that this case on some hw needs some more special handling. Specifically the firmware may bootup with the IRQ pin in output mode. The reset sequence from ACPI _PS0 (executed by acpi_device_fix_up_power()) should put the pin in input mode, but the GPIO subsystem has cached the direction at bootup, causing request_irq() to fail due to gpiochip_lock_as_irq() failure:
[ 9.119864] Goodix-TS i2c-GDIX1002:00: Unexpected ACPI resources: gpio_count 1, gpio_int_idx 0 [ 9.317443] Goodix-TS i2c-GDIX1002:00: ID 911, version: 1060 [ 9.321902] input: Goodix Capacitive TouchScreen as /devices/pci0000:00/0000:00:17.0/i2c_designware.4/i2c-5/i2c-GDIX1002:00/input/input8 [ 9.327840] gpio gpiochip0: (INT3453:00): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ [ 9.327856] gpio gpiochip0: (INT3453:00): unable to lock HW IRQ 26 for IRQ [ 9.327861] genirq: Failed to request resources for GDIX1002:00 (irq 131) on irqchip intel-gpio [ 9.327912] Goodix-TS i2c-GDIX1002:00: request IRQ failed: -5
Fix this by adding a special case for gpio_count == 1 && gpio_int_idx == 0 which adds an ACPI GPIO lookup table for the int GPIO even though we cannot use it for reset purposes (as there is no reset GPIO).
Adding the lookup will make the gpiod_int = gpiod_get(..., GPIOD_IN) call succeed, which will explicitly set the direction to input fixing the issue.
Note this re-uses the acpi_goodix_int_first_gpios[] lookup table, since there is only 1 GPIO in the ACPI resources the reset entry in that lookup table will amount to a no-op.
--- drivers/input/touchscreen/goodix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/input/touchscreen/goodix.c +19 -0
@@ -900,6 +900,25 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)dev_info (dev,"No ACPI GpioInt resource, assuming that the GPIO order is reset, int\n" ); ts->irq_pin_access_method =IRQ_PIN_ACCESS_ACPI_GPIO ; gpio_mapping = acpi_goodix_int_last_gpios; + }else if (ts->gpio_count ==1 && ts->gpio_int_idx ==0 ) { +/* +* On newer devices there is only 1 GpioInt resource and _PS0 +* does the whole reset sequence for us. +*/ +acpi_device_fix_up_power (ACPI_COMPANION (dev)); + +/* +* Before the _PS0 call the int GPIO may have been in output +* mode and the call should have put the int GPIO in input mode, +* but the GPIO subsys cached state may still think it is +* in output mode, causing gpiochip_lock_as_irq() failure. +* +* Add a mapping for the int GPIO to make the +* gpiod_int = gpiod_get(..., GPIOD_IN) call succeed, +* which will explicitly set the direction to input. +*/ + ts->irq_pin_access_method =IRQ_PIN_ACCESS_NONE ; + gpio_mapping = acpi_goodix_int_first_gpios; }else {dev_warn (dev,"Unexpected ACPI resources: gpio_count %d, gpio_int_idx %d\n" , ts->gpio_count, ts->gpio_int_idx);
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 8/19 workqueue: Fix UAF report by KASAN in pwq_release_workfn()
In reply to Sasha LevinFrom: Zqiang <[email protected]>
[ Upstream commit 643445531829d89dc5ddbe0c5ee4ff8f84ce8687 ]
Currently, for UNBOUND wq, if the apply_wqattrs_prepare() return error, the apply_wqattr_cleanup() will be called and use the pwq_release_worker kthread to release resources asynchronously. however, the kfree(wq) is invoked directly in failure path of alloc_workqueue(), if the kfree(wq) has been executed and when the pwq_release_workfn() accesses wq, this leads to the following scenario:
BUG: KASAN: slab-use-after-free in pwq_release_workfn+0x339/0x380 kernel/workqueue.c:4124 Read of size 4 at addr ffff888027b831c0 by task pool_workqueue_/3 CPU: 0 PID: 3 Comm: pool_workqueue_ Not tainted 6.5.0-rc7-next-20230825-syzkaller #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 pwq_release_workfn+0x339/0x380 kernel/workqueue.c:4124 kthread_worker_fn+0x2fc/0xa80 kernel/kthread.c:823 kthread+0x33a/0x430 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 </TASK> Allocated by task 5054: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_workqueue+0x16f/0x1490 kernel/workqueue.c:4684 kvm_mmu_init_tdp_mmu+0x23/0x100 arch/x86/kvm/mmu/tdp_mmu.c:19 kvm_mmu_init_vm+0x248/0x2e0 arch/x86/kvm/mmu/mmu.c:6180 kvm_arch_init_vm+0x39/0x720 arch/x86/kvm/x86.c:12311 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1222 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:5089 [inline] kvm_dev_ioctl+0xa31/0x1c20 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5131 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5054: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 alloc_workqueue+0xe76/0x1490 kernel/workqueue.c:4746 kvm_mmu_init_tdp_mmu+0x23/0x100 arch/x86/kvm/mmu/tdp_mmu.c:19 kvm_mmu_init_vm+0x248/0x2e0 arch/x86/kvm/mmu/mmu.c:6180 kvm_arch_init_vm+0x39/0x720 arch/x86/kvm/x86.c:12311 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1222 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:5089 [inline] kvm_dev_ioctl+0xa31/0x1c20 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5131 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
This commit therefore flush pwq_release_worker in the alloc_and_link_pwqs() before invoke kfree(wq).
--- kernel/workqueue.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/workqueue.c +6 -0
@@ -4242,6 +4242,12 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq) }cpus_read_unlock (); +/* for unbound pwq, flush the pwq_release_worker ensures that the +* pwq_release_workfn() completes before calling kfree(wq). +*/ +if (ret) +kthread_flush_worker (pwq_release_worker); +return ret; }
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 9/19 ALSA: usb-audio: Fix microphone sound on Opencomm2 Headset
In reply to Sasha LevinFrom: WhaleChang <[email protected]>
[ Upstream commit 6a83d6f3bb3c329a73e3483651fb77b78bac1878 ]
When a Opencomm2 Headset is connected to a Bluetooth USB dongle, the audio playback functions properly, but the microphone does not work.
In the dmesg logs, there are messages indicating that the init_pitch function fails when the capture process begins.
The microphone only functions when the ep pitch control is not set.
Toggling the pitch control off bypasses the init_piatch function and allows the microphone to work.
--- sound/usb/quirks.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/usb/quirks.c +5 -1
@@ -1992,7 +1992,11 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,/* mic works only when ep packet size is set to wMaxPacketSize */ fp->attributes |=UAC_EP_CS_ATTR_FILL_MAX ;break ; - +case USB_ID (0x3511 ,0x2b1e ):/* Opencomm2 UC USB Bluetooth dongle */ +/* mic works only when ep pitch control is not set */ +if (stream ==SNDRV_PCM_STREAM_CAPTURE ) + fp->attributes &= ~UAC_EP_CS_ATTR_PITCH_CONTROL ; +break ; } }
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 10/19 net: sched: cls_u32: Fix allocation size in u32_init()
In reply to Sasha LevinFrom: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit c4d49196ceec80e30e8d981410d73331b49b7850 ]
commit d61491a51f7e ("net/sched: cls_u32: Replace one-element array with flexible-array member") incorrecly replaced an instance of sizeof(*tp_c) with struct_size(tp_c, hlist->ht, 1). This results in a an over-allocation of 8 bytes.
This change is wrong because hlist in struct tc_u_common is a pointer:
net/sched/cls_u32.c:
struct tc_u_common {
struct tc_u_hnode __rcu *hlist;
void *ptr;
int refcnt;
struct idr handle_idr;
struct hlist_node hnode;
long knodes;
};So, the use of struct_size() makes no sense: we don't need to allocate any extra space for a flexible-array member. sizeof(*tp_c) is just fine.
So, struct_size(tp_c, hlist->ht, 1) translates to:
sizeof(*tp_c) + sizeof(tp_c->hlist->ht) == sizeof(struct tc_u_common) + sizeof(struct tc_u_knode *) ==
144 + 8 == 0x98 (byes) ^^^ | unnecessary extra allocation size
$ pahole -C tc_u_common net/sched/cls_u32.o
struct tc_u_common {
struct tc_u_hnode * hlist; /* 0 8 */
void * ptr; /* 8 8 */
int refcnt; /* 16 4 *//* XXX 4 bytes hole, try to pack */ struct idr handle_idr; /* 24 96 */ /* --- cacheline 1 boundary (64 bytes) was 56 bytes ago --- */ struct hlist_node hnode; /* 120 16 */ /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */ long int knodes; /* 136 8 */ /* size: 144, cachelines: 3, members: 6 */ /* sum members: 140, holes: 1, sum holes: 4 */ /* last cacheline: 16 bytes */ };
And with sizeof(*tp_c), we have:
sizeof(*tp_c) == sizeof(struct tc_u_common) == 144 == 0x90 (bytes)
which is the correct and original allocation size.
Fix this issue by replacing struct_size(tp_c, hlist->ht, 1) with sizeof(*tp_c), and avoid allocating 8 too many bytes.
The following difference in binary output is expected and reflects the desired change:
| net/sched/cls_u32.o | @@ -6148,7 +6148,7 @@ | include/linux/slab.h:599 | 2cf5: mov 0x0(%rip),%rdi # 2cfc <u32_init+0xfc> | 2cf8: R_X86_64_PC32 kmalloc_caches+0xc |- 2cfc: mov $0x98,%edx |+ 2cfc: mov $0x90,%edx
--- net/sched/cls_u32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/cls_u32.c +1 -1
@@ -364,7 +364,7 @@ static int u32_init(struct tcf_proto *tp)idr_init (&root_ht->handle_idr);if (tp_c ==NULL ) { - tp_c =kzalloc (struct_size (tp_c, hlist->ht,1 ),GFP_KERNEL ); + tp_c =kzalloc (sizeof (*tp_c),GFP_KERNEL );if (tp_c ==NULL ) {kfree (root_ht);return -ENOBUFS ;
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 11/19 irqchip/riscv-intc: Mark all INTC nodes as initialized
In reply to Sasha LevinFrom: Anup Patel <[email protected]>
[ Upstream commit e13cd66bd821be417c498a34928652db4ac6b436 ]
The RISC-V INTC local interrupts are per-HART (or per-CPU) so we create INTC IRQ domain only for the INTC node belonging to the boot HART. This means only the boot HART INTC node will be marked as initialized and other INTC nodes won't be marked which results downstream interrupt controllers (such as PLIC, IMSIC and APLIC direct-mode) not being probed due to missing device suppliers.
To address this issue, we mark all INTC node for which we don't create IRQ domain as initialized.
--- drivers/irqchip/irq-riscv-intc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/irqchip/irq-riscv-intc.c +9 -1
@@ -110,8 +110,16 @@ static int __init riscv_intc_init(struct device_node *node,* for each INTC DT node. We only need to do INTC initialization * for the INTC DT node belonging to boot CPU (or boot HART). */ -if (riscv_hartid_to_cpuid (hartid) !=smp_processor_id ()) +if (riscv_hartid_to_cpuid (hartid) !=smp_processor_id ()) { +/* +* The INTC nodes of each CPU are suppliers for downstream +* interrupt controllers (such as PLIC, IMSIC and APLIC +* direct-mode) so we should mark an INTC node as initialized +* if we are not creating IRQ domain for it. +*/ +fwnode_dev_initialized (of_fwnode_handle (node), true);return 0 ; + } intc_domain =irq_domain_add_linear (node,BITS_PER_LONG , &riscv_intc_domain_ops,NULL );
Signature · 7 lines
2.40.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Sasha Levin
maintainerPATCH 12/19 irqchip/stm32-exti: add missing DT IRQ flag translation
In reply to Sasha LevinFrom: Ben Wolsieffer <[email protected]>
[ Upstream commit 8554cba1d6dbd3c74e0549e28ddbaccbb1d6b30a ]
The STM32F4/7 EXTI driver was missing the xlate callback, so IRQ trigger flags specified in the device tree were being ignored. This was preventing the RTC alarm interrupt from working, because it must be set to trigger on the rising edge to function correctly.
--- drivers/irqchip/irq-stm32-exti.c | 1 + 1 file changed, 1 insertion(+)
drivers/irqchip/irq-stm32-exti.c +1 -0
@@ -458,6 +458,7 @@ static const struct irq_domain_ops irq_exti_domain_ops = { .map = irq_map_generic_chip, .alloc = stm32_exti_alloc, .free = stm32_exti_free, + .xlate = irq_domain_xlate_twocell, };static void stm32_irq_ack (struct irq_data *d)
Signature · 7 lines
2.40.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 13/19 dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
In reply to Sasha LevinFrom: Zhang Shurong <[email protected]>
[ Upstream commit 0618c077a8c20e8c81e367988f70f7e32bb5a717 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
We fix it by calling pm_runtime_disable when error returns.
--- drivers/dma/ste_dma40.c | 1 + 1 file changed, 1 insertion(+)
drivers/dma/ste_dma40.c +1 -0
@@ -3697,6 +3697,7 @@ static int __init d40_probe(struct platform_device *pdev)regulator_disable (base->lcpa_regulator);regulator_put (base->lcpa_regulator); } +pm_runtime_disable (base->dev);kfree (base->lcla_pool.alloc_map);kfree (base->lookup_log_chans);
Signature · 7 lines
2.40.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 14/19 ALSA: usb-audio: Fix microphone sound on Nexigo webcam.
In reply to Sasha LevinFrom: Christos Skevis <[email protected]>
[ Upstream commit 4a63e68a295187ae3c1cb3fa0c583c96a959714f ]
I own an external usb Webcam, model NexiGo N930AF, which had low mic volume and inconsistent sound quality. Video works as expected.
(snip)
[ +0.047857] usb 5-1: new high-speed USB device number 2 using xhci_hcd [ +0.003406] usb 5-1: New USB device found, idVendor=1bcf, idProduct=2283, bcdDevice=12.17 [ +0.000007] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ +0.000004] usb 5-1: Product: NexiGo N930AF FHD Webcam [ +0.000003] usb 5-1: Manufacturer: SHENZHEN AONI ELECTRONIC CO., LTD [ +0.000004] usb 5-1: SerialNumber: 20201217011 [ +0.003900] usb 5-1: Found UVC 1.00 device NexiGo N930AF FHD Webcam (1bcf:2283) [ +0.025726] usb 5-1: 3:1: cannot get usb sound sample rate freq at ep 0x86 [ +0.071482] usb 5-1: 3:2: cannot get usb sound sample rate freq at ep 0x86 [ +0.004679] usb 5-1: 3:3: cannot get usb sound sample rate freq at ep 0x86 [ +0.051607] usb 5-1: Warning! Unlikely big volume range (=4096), cval->res is probably wrong. [ +0.000005] usb 5-1: [7] FU [Mic Capture Volume] ch = 1, val = 0/4096/1
Set up quirk cval->res to 16 for 256 levels,
Set GET_SAMPLE_RATE quirk flag to stop trying to get the sample rate. Confirmed that happened anyway later due to the backoff mechanism, after 3 failures
All audio stream on device interfaces share the same values, apart from wMaxPacketSize and tSamFreq :
(snip)
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 3
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0 AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 8
bDelay 1 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 1
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 44100
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x005c 1x 92 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
(snip)
Based on the usb data about manufacturer, SPCA2281B3 is the most likely controller IC Manufacturer does not provide link for datasheet nor detailed specs.
No way to confirm if the firmware supports any other way of getting the sample rate.
Testing patch provides consistent good sound recording quality and volume range.
(snip)
[ +0.045764] usb 5-1: new high-speed USB device number 2 using xhci_hcd [ +0.106290] usb 5-1: New USB device found, idVendor=1bcf, idProduct=2283, bcdDevice=12.17 [ +0.000006] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ +0.000004] usb 5-1: Product: NexiGo N930AF FHD Webcam [ +0.000003] usb 5-1: Manufacturer: SHENZHEN AONI ELECTRONIC CO., LTD [ +0.000004] usb 5-1: SerialNumber: 20201217011 [ +0.043700] usb 5-1: set resolution quirk: cval->res = 16 [ +0.002585] usb 5-1: Found UVC 1.00 device NexiGo N930AF FHD Webcam (1bcf:2283)
--- sound/usb/mixer.c | 7 +++++++ sound/usb/quirks.c | 2 ++ 2 files changed, 9 insertions(+)
sound/usb/mixer.c +7 -0
@@ -1204,6 +1204,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, cval->res =16 ; }break ; +case USB_ID (0x1bcf ,0x2283 ):/* NexiGo N930AF FHD Webcam */ +if (!strcmp (kctl->id.name,"Mic Capture Volume" )) { +usb_audio_info (chip, +"set resolution quirk: cval->res = 16\n" ); + cval->res =16 ; + } +break ; } }
sound/usb/quirks.c +2 -0
@@ -2175,6 +2175,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_FIXED_RATE),DEVICE_FLG (0x0ecb ,0x2069 ,/* JBL Quantum810 Wireless */ QUIRK_FLAG_FIXED_RATE ), +DEVICE_FLG (0x1bcf ,0x2283 ,/* NexiGo N930AF FHD Webcam */ +QUIRK_FLAG_GET_SAMPLE_RATE ),/* Vendor matches */ VENDOR_FLG(0x045e, /* MS Lifecam */
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 15/19 net: macsec: indicate next pn update when offloading
In reply to Sasha LevinFrom: "Radu Pirea (NXP OSS)" <[email protected]>
[ Upstream commit 0412cc846a1ef38697c3f321f9b174da91ecd3b5 ]
Indicate next PN update using update_pn flag in macsec_context. Offloaded MACsec implementations does not know whether or not the MACSEC_SA_ATTR_PN attribute was passed for an SA update and assume that next PN should always updated, but this is not always true.
The PN can be reset to its initial value using the following command:
$ ip macsec set macsec0 tx sa 0 off #octeontx2-pf case
Or, the update PN command will succeed even if the driver does not support PN updates.
$ ip macsec set macsec0 tx sa 0 pn 1 on #mscc phy driver case
Comparing the initial PN with the new PN value is not a solution. When the user updates the PN using its initial value the command will succeed, even if the driver does not support it. Like this:
$ ip macsec add macsec0 tx sa 0 pn 1 on key 00 \ ead3664f508eb06c40ac7104cdae4ce5 $ ip macsec set macsec0 tx sa 0 pn 1 on #mlx5 case
--- drivers/net/macsec.c | 2 ++ include/net/macsec.h | 1 + 2 files changed, 3 insertions(+)
drivers/net/macsec.c +2 -0
@@ -2384,6 +2384,7 @@ static int macsec_upd_txsa(struct sk_buff *skb, struct genl_info *info) ctx.sa.assoc_num = assoc_num; ctx.sa.tx_sa = tx_sa; + ctx.sa.update_pn = !!prev_pn.full64; ctx.secy = secy; ret =macsec_offload (ops->mdo_upd_txsa, &ctx);
@@ -2477,6 +2478,7 @@ static int macsec_upd_rxsa(struct sk_buff *skb, struct genl_info *info) ctx.sa.assoc_num = assoc_num; ctx.sa.rx_sa = rx_sa; + ctx.sa.update_pn = !!prev_pn.full64; ctx.secy = secy; ret =macsec_offload (ops->mdo_upd_rxsa, &ctx);
include/net/macsec.h +1 -0
@@ -257,6 +257,7 @@ struct macsec_context {struct macsec_secy *secy;struct macsec_rx_sc *rx_sc;struct { +bool update_pn;unsigned char assoc_num;u8 key[MACSEC_MAX_KEY_LEN ];union {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 16/19 powerpc/85xx: Fix math emulation exception
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit 8e8a12ecbc86700b5e1a3596ce2b3c43dafad336 ]
Booting mpc85xx_defconfig kernel on QEMU leads to:
Bad trap at PC: fe9bab0, SR: 2d000, vector=800
awk[82]: unhandled trap (5) at 0 nip fe9bab0 lr fe9e01c code 5 in libc-2.27.so[fe5a000+17a000] awk[82]: code: 3aa00000 3a800010 4bffe03c 9421fff0 7ca62b78 38a00000 93c10008 83c10008 awk[82]: code: 38210010 4bffdec8 9421ffc0 7c0802a6 <fc00048e> d8010008 4815190d 93810030 Trace/breakpoint trap
WARNING: no useful console
This is because allthough CONFIG_MATH_EMULATION is selected, Exception 800 calls unknown_exception().
Call emulation_assist_interrupt() instead.
--- arch/powerpc/kernel/head_85xx.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/head_85xx.S +1 -1
@@ -394,7 +394,7 @@ interrupt_base: #ifdef CONFIG_PPC_FPU FP_UNAVAILABLE_EXCEPTION #else - EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception) + EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt) #endif /* System Call Interrupt */
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 17/19 Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport
In reply to Sasha LevinFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 5030b2fe6aab37fe42d14f31842ea38be7c55c57 ]
Touch controllers need some time after receiving reset command for the firmware to finish re-initializing and be ready to respond to commands from the host. The driver already had handling for the post-reset delay for I2C and SPI transports, this change adds the handling to SMBus-connected devices.
SMBus devices are peculiar because they implement legacy PS/2 compatibility mode, so reset is actually issued by psmouse driver on the associated serio port, after which the control is passed to the RMI4 driver with SMBus companion device.
Note that originally the delay was added to psmouse driver in 92e24e0e57f7 ("Input: psmouse - add delay when deactivating for SMBus mode"), but that resulted in an unwanted delay in "fast" reconnect handler for the serio port, so it was decided to revert the patch and have the delay being handled in the RMI4 driver, similar to the other transports.
--- drivers/input/mouse/synaptics.c | 1 + drivers/input/rmi4/rmi_smbus.c | 50 ++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 22 deletions(-)
drivers/input/mouse/synaptics.c +1 -0
@@ -1752,6 +1752,7 @@ static int synaptics_create_intertouch(struct psmouse *psmouse,psmouse_matches_pnp_id (psmouse, topbuttonpad_pnp_ids) && !SYN_CAP_EXT_BUTTONS_STICK (info->ext_cap_10);const struct rmi_device_platform_data pdata = { + .reset_delay_ms =30 , .sensor_pdata = { .sensor_type = rmi_sensor_touchpad, .axis_align.flip_y = true,
drivers/input/rmi4/rmi_smbus.c +28 -22
76 lines not on this page · raw message
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 18/19 Input: xpad - add PXN V900 support
In reply to Sasha LevinFrom: Matthias Berndt <[email protected]>
[ Upstream commit a65cd7ef5a864bdbbe037267c327786b7759d4c6 ]
Add VID and PID to the xpad_device table to allow driver to use the PXN V900 steering wheel, which is XTYPE_XBOX360 compatible in xinput mode.
--- drivers/input/joystick/xpad.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
@@ -272,6 +272,7 @@ static const struct xpad_device { { 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 }, { 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 }, { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 }, + { 0x11ff, 0x0511, "PXN V900", 0, XTYPE_XBOX360 }, { 0x1209, 0x2882, "Ardwiino Controller", 0, XTYPE_XBOX360 }, { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
@@ -474,6 +475,7 @@ static const struct usb_device_id xpad_table[] = {XPAD_XBOXONE_VENDOR (0x0f0d ),/* Hori Controllers */ XPAD_XBOX360_VENDOR (0x1038 ),/* SteelSeries Controllers */ XPAD_XBOX360_VENDOR (0x11c9 ),/* Nacon GC100XF */ +XPAD_XBOX360_VENDOR (0x11ff ),/* PXN V900 */ XPAD_XBOX360_VENDOR (0x1209 ),/* Ardwiino Controllers */ XPAD_XBOX360_VENDOR (0x12ab ),/* X-Box 360 dance pads */ XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 19/19 Input: powermate - fix use-after-free in powermate_config_complete
In reply to Sasha LevinFrom: Javier Carrasco <[email protected]>
[ Upstream commit 5c15c60e7be615f05a45cd905093a54b11f461bc ]
syzbot has found a use-after-free bug [1] in the powermate driver. This happens when the device is disconnected, which leads to a memory free from the powermate_device struct. When an asynchronous control message completes after the kfree and its callback is invoked, the lock does not exist anymore and hence the bug.
Use usb_kill_urb() on pm->config to cancel any in-progress requests upon device disconnection.
[1] https://syzkaller.appspot.com/bug?extid=0434ac83f907a1dbdd1e
--- drivers/input/misc/powermate.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/misc/powermate.c +1 -0
@@ -425,6 +425,7 @@ static void powermate_disconnect(struct usb_interface *intf) pm->requires_update =0 ;usb_kill_urb (pm->irq);input_unregister_device (pm->input); +usb_kill_urb (pm->config);usb_free_urb (pm->irq);usb_free_urb (pm->config);powermate_free_buffers (interface_to_usbdev (intf), pm);
Signature · 1 line
2.40.1