6.10.5-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 123/263 media: ipu-bridge: fix ipu6 Kconfig dependencies
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit d7b5f7537c8282e1e1919408d0b6c69877fd35f8 upstream.
Commit 4670c8c3fb04 ("media: ipu-bridge: Fix Kconfig dependencies") changed how IPU_BRIDGE dependencies are handled for all drivers, but the IPU6 variant was added the old way, which causes build time warnings when I2C is turned off:
WARNING: unmet direct dependencies detected for IPU_BRIDGE
Depends on [n]: MEDIA_SUPPORT [=m] && PCI [=y] && MEDIA_PCI_SUPPORT [=y] && (ACPI [=y] || COMPILE_TEST [=y]) && I2C [=n]
Selected by [m]:
- VIDEO_INTEL_IPU6 [=m] && MEDIA_SUPPORT [=m] && PCI [=y] && MEDIA_PCI_SUPPORT [=y] && (ACPI [=y] || COMPILE_TEST [=y]) && VIDEO_DEV [=m] && X86 [=y] && X86_64 [=y] && HAS_DMA [=y]
To make it consistent with the other IPU drivers as well as avoid this warning, change the 'select' into 'depends on'.
--- drivers/media/pci/intel/ipu6/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu6/Kconfig +1 -1
@@ -3,13 +3,13 @@ config VIDEO_INTEL_IPU6 depends on ACPI || COMPILE_TEST depends on VIDEO_DEV depends on X86 && X86_64 && HAS_DMA + depends on IPU_BRIDGE || !IPU_BRIDGE select DMA_OPS select IOMMU_IOVA select VIDEO_V4L2_SUBDEV_API select MEDIA_CONTROLLER select VIDEOBUF2_DMA_CONTIG select V4L2_FWNODE - select IPU_BRIDGE help This is the 6th Gen Intel Image Processing Unit, found in Intel SoCs and used for capturing images and video from camera sensors.
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 124/263 media: intel/ipu6: select AUXILIARY_BUS in Kconfig
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bingbu Cao <[email protected]>
commit 423a77ae3a3f916809ff3ab1c8db6d3d580c3120 upstream.
Intel IPU6 PCI driver need register its devices on auxiliary bus, so it needs to select the AUXILIARY_BUS in Kconfig.
--- drivers/media/pci/intel/ipu6/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/media/pci/intel/ipu6/Kconfig +1 -0
@@ -4,6 +4,7 @@ config VIDEO_INTEL_IPU6 depends on VIDEO_DEV depends on X86 && X86_64 && HAS_DMA depends on IPU_BRIDGE || !IPU_BRIDGE + select AUXILIARY_BUS select DMA_OPS select IOMMU_IOVA select VIDEO_V4L2_SUBDEV_API
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 125/263 irqchip/meson-gpio: Convert meson_gpio_irq_controller::lock to raw_spinlock_t
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arseniy Krasnov <[email protected]>
commit f872d4af79fe8c71ae291ce8875b477e1669a6c7 upstream.
This lock is acquired under irq_desc::lock with interrupts disabled.
When PREEMPT_RT is enabled, 'spinlock_t' becomes preemptible, which results in invalid lock acquire context;
[ BUG: Invalid wait context ]
swapper/0/1 is trying to lock:
ffff0000008fed30 (&ctl->lock){....}-{3:3}, at: meson_gpio_irq_update_bits0 other info that might help us debug this:
context-{5:5}
3 locks held by swapper/0/1:
#0: ffff0000003cd0f8 (&dev->mutex){....}-{4:4}, at: __driver_attach+0x90c #1: ffff000004714650 (&desc->request_mutex){+.+.}-{4:4}, at: __setup_irq0 #2: ffff0000047144c8 (&irq_desc_lock_class){-.-.}-{2:2}, at: __setup_irq0
stack backtrace: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.9.9-sdkernel #1 Call trace: _raw_spin_lock_irqsave+0x60/0x88 meson_gpio_irq_update_bits+0x34/0x70 meson8_gpio_irq_set_type+0x78/0xc4 meson_gpio_irq_set_type+0x30/0x60 __irq_set_trigger+0x60/0x180 __setup_irq+0x30c/0x6e0 request_threaded_irq+0xec/0x1a4
--- drivers/irqchip/irq-meson-gpio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/irqchip/irq-meson-gpio.c +7 -7
@@ -178,7 +178,7 @@ struct meson_gpio_irq_controller {void __iomem *base;u32 channel_irqs[MAX_NUM_CHANNEL ];DECLARE_BITMAP (channel_map,MAX_NUM_CHANNEL ); -spinlock_t lock; +raw_spinlock_t lock; }; static void meson_gpio_irq_update_bits(struct meson_gpio_irq_controller *ctl,
@@ -187,14 +187,14 @@ static void meson_gpio_irq_update_bits(sunsigned long flags;u32 tmp; -spin_lock_irqsave (&ctl->lock, flags); +raw_spin_lock_irqsave (&ctl->lock, flags); tmp =readl_relaxed (ctl->base + reg); tmp &= ~mask; tmp |= val;writel_relaxed (tmp, ctl->base + reg); -spin_unlock_irqrestore (&ctl->lock, flags); +raw_spin_unlock_irqrestore (&ctl->lock, flags); }static void meson_gpio_irq_init_dummy (struct meson_gpio_irq_controller *ctl)
@@ -244,12 +244,12 @@ meson_gpio_irq_request_channel(struct meunsigned long flags;unsigned int idx; -spin_lock_irqsave (&ctl->lock, flags); +raw_spin_lock_irqsave (&ctl->lock, flags);/* Find a free channel */ idx =find_first_zero_bit (ctl->channel_map, ctl->params->nr_channels);if (idx >= ctl->params->nr_channels) { -spin_unlock_irqrestore (&ctl->lock, flags); +raw_spin_unlock_irqrestore (&ctl->lock, flags);pr_err ("No channel available\n" );return -ENOSPC ; }
@@ -257,7 +257,7 @@ meson_gpio_irq_request_channel(struct me/* Mark the channel as used */ set_bit (idx, ctl->channel_map); -spin_unlock_irqrestore (&ctl->lock, flags); +raw_spin_unlock_irqrestore (&ctl->lock, flags);/* * Setup the mux of the channel to route the signal of the pad
@@ -567,7 +567,7 @@ static int meson_gpio_irq_of_init(structif (!ctl)return -ENOMEM ; -spin_lock_init (&ctl->lock); +raw_spin_lock_init (&ctl->lock); ctl->base =of_iomap (node,0 );if (!ctl->base) {
Greg Kroah-Hartman
maintainerPATCH 126/263 irqchip/loongarch-cpu: Fix return value of lpic_gsi_to_irq()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit 81a91abab1307d7725fa4620952c0767beae7753 upstream.
lpic_gsi_to_irq() should return a valid Linux interrupt number if acpi_register_gsi() succeeds, and return 0 otherwise. But lpic_gsi_to_irq() converts a negative return value of acpi_register_gsi() to a positive value silently.
Convert the return value explicitly.
--- drivers/irqchip/irq-loongarch-cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/irqchip/irq-loongarch-cpu.c +4 -2
@@ -18,11 +18,13 @@ struct fwnode_handle *cpuintc_handle;static u32 lpic_gsi_to_irq (u32 gsi) { +int irq =0 ; +/* Only pch irqdomain transferring is required for LoongArch. */ if (gsi >=GSI_MIN_PCH_IRQ && gsi <=GSI_MAX_PCH_IRQ ) -return acpi_register_gsi (NULL , gsi,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_HIGH ); + irq =acpi_register_gsi (NULL , gsi,ACPI_LEVEL_SENSITIVE ,ACPI_ACTIVE_HIGH ); -return 0 ; +return (irq >0 ) ? irq :0 ; }static struct fwnode_handle *lpic_get_gsi_domain_id (u32 gsi)
Greg Kroah-Hartman
maintainerPATCH 127/263 sched/cputime: Fix mul_u64_u64_div_u64() precision for cputime
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Zucheng <[email protected]>
commit 77baa5bafcbe1b2a15ef9c37232c21279c95481c upstream.
In extreme test scenarios:
the 14th field utime in /proc/xx/stat is greater than sum_exec_runtime, utime = 18446744073709518790 ns, rtime = 135989749728000 ns
In cputime_adjust() process, stime is greater than rtime due to mul_u64_u64_div_u64() precision problem.
before call mul_u64_u64_div_u64(),
stime = 175136586720000, rtime = 135989749728000, utime = 1416780000. after call mul_u64_u64_div_u64(),
stime = 135989949653530
unsigned reversion occurs because rtime is less than stime. utime = rtime - stime = 135989749728000 - 135989949653530
= -199925530 = (u64)18446744073709518790
Trigger condition:
1). User task run in kernel mode most of time 2). ARM64 architecture
3). TICK_CPU_ACCOUNTING=y
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
Fix mul_u64_u64_div_u64() conversion precision by reset stime to rtime
--- kernel/sched/cputime.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/sched/cputime.c +6 -0
@@ -582,6 +582,12 @@ void cputime_adjust(struct task_cputime } stime =mul_u64_u64_div_u64 (stime, rtime, stime + utime); +/* +* Because mul_u64_u64_div_u64() can approximate on some +* achitectures; enforce the constraint that: a*b/(b+c) <= a. +*/ +if (unlikely (stime > rtime)) + stime = rtime; update:/*
Greg Kroah-Hartman
maintainerPATCH 128/263 net: drop bad gso csum_start and offset in virtio_net_hdr
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
commit 89add40066f9ed9abe5f7f886fe5789ff7e0c50e upstream.
Tighten csum_start and csum_offset checks in virtio_net_hdr_to_skb for GSO packets.
The function already checks that a checksum requested with VIRTIO_NET_HDR_F_NEEDS_CSUM is in skb linear. But for GSO packets this might not hold for segs after segmentation.
Syzkaller demonstrated to reach this warning in skb_checksum_help
offset = skb_checksum_start_offset(skb); ret = -EINVAL; if (WARN_ON_ONCE(offset >= skb_headlen(skb)))
By injecting a TSO packet:
WARNING: CPU: 1 PID: 3539 at net/core/dev.c:3284 skb_checksum_help+0x3d0/0x5b0 ip_do_fragment+0x209/0x1b20 net/ipv4/ip_output.c:774 ip_finish_output_gso net/ipv4/ip_output.c:279 [inline] __ip_finish_output+0x2bd/0x4b0 net/ipv4/ip_output.c:301 iptunnel_xmit+0x50c/0x930 net/ipv4/ip_tunnel_core.c:82 ip_tunnel_xmit+0x2296/0x2c70 net/ipv4/ip_tunnel.c:813 __gre_xmit net/ipv4/ip_gre.c:469 [inline] ipgre_xmit+0x759/0xa60 net/ipv4/ip_gre.c:661 __netdev_start_xmit include/linux/netdevice.h:4850 [inline] netdev_start_xmit include/linux/netdevice.h:4864 [inline] xmit_one net/core/dev.c:3595 [inline] dev_hard_start_xmit+0x261/0x8c0 net/core/dev.c:3611 __dev_queue_xmit+0x1b97/0x3c90 net/core/dev.c:4261 packet_snd net/packet/af_packet.c:3073 [inline]
The geometry of the bad input packet at tcp_gso_segment:
[ 52.003050][ T8403] skb len=12202 headroom=244 headlen=12093 tailroom=0 [ 52.003050][ T8403] mac=(168,24) mac_len=24 net=(192,52) trans=244 [ 52.003050][ T8403] shinfo(txflags=0 nr_frags=1 gso(size=1552 type=3 segs=0)) [ 52.003050][ T8403] csum(0x60000c7 start=199 offset=1536
ip_summed=3 complete_sw=0 valid=0 level=0)
Mitigate with stricter input validation.
csum_offset: for GSO packets, deduce the correct value from gso_type. This is already done for USO. Extend it to TSO. Let UFO be:
udp[46]_ufo_fragment ignores these fields and always computes the checksum in software.
csum_start: finding the real offset requires parsing to the transport header. Do not add a parser, use existing segmentation parsing. Thanks to SKB_GSO_DODGY, that also catches bad packets that are hw offloaded. Again test both TSO and USO. Do not test UFO for the above reason, and do not test UDP tunnel offload.
GSO packet are almost always CHECKSUM_PARTIAL. USO packets may be CHECKSUM_NONE since commit 10154dbded6d6 ("udp: Allow GSO transmit from devices with no checksum offload"), but then still these fields are initialized correctly in udp4_hwcsum/udp6_hwcsum_outgoing. So no need to test for ip_summed == CHECKSUM_PARTIAL first.
This revises an existing fix mentioned in the Fixes tag, which broke small packets with GSO offload, as detected by kselftests.
--- include/linux/virtio_net.h | 16 +++++----------- net/ipv4/tcp_offload.c | 3 +++ net/ipv4/udp_offload.c | 4 ++++ 3 files changed, 12 insertions(+), 11 deletions(-)
include/linux/virtio_net.h +5 -11
@@ -56,7 +56,6 @@ static inline int virtio_net_hdr_to_skb(unsigned int thlen =0 ;unsigned int p_off =0 ;unsigned int ip_proto; -u64 ret, remainder, gso_size;if (hdr->gso_type !=VIRTIO_NET_HDR_GSO_NONE ) {switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN ) {
@@ -99,16 +98,6 @@ static inline int virtio_net_hdr_to_skb(u32 off =__virtio16_to_cpu (little_endian, hdr->csum_offset);u32 needed = start +max_t (u32, thlen, off +sizeof (__sum16)); -if (hdr->gso_size) { - gso_size =__virtio16_to_cpu (little_endian, hdr->gso_size); - ret =div64_u64_rem (skb->len, gso_size, &remainder); -if (!(ret && (hdr->gso_size > needed) && - ((remainder > needed) || (remainder ==0 )))) { -return -EINVAL ; - } -skb_shinfo (skb)->tx_flags |=SKBFL_SHARED_FRAG ; - } -if (!pskb_may_pull (skb, needed))return -EINVAL ;
@@ -182,6 +171,11 @@ retry:if (gso_type !=SKB_GSO_UDP_L4 )return -EINVAL ;break ; +case SKB_GSO_TCPV4 : +case SKB_GSO_TCPV6 : +if (skb->csum_offset != offsetof(struct tcphdr , check)) +return -EINVAL ; +break ; }/* Kernel has a special handling for GSO_BY_FRAGS. */
net/ipv4/tcp_offload.c +3 -0
@@ -140,6 +140,9 @@ struct sk_buff *tcp_gso_segment(struct sif (thlen <sizeof (*th)) goto out; +if (unlikely (skb_checksum_start (skb) !=skb_transport_header (skb))) + goto out; +if (!pskb_may_pull (skb, thlen)) goto out;
net/ipv4/udp_offload.c +4 -0
@@ -278,6 +278,10 @@ struct sk_buff *__udp_gso_segment(structif (gso_skb->len <=sizeof (*uh) + mss)return ERR_PTR (-EINVAL ); +if (unlikely (skb_checksum_start (gso_skb) != +skb_transport_header (gso_skb))) +return ERR_PTR (-EINVAL ); +if (skb_gso_ok (gso_skb, features |NETIF_F_GSO_ROBUST )) {/* Packet is from an untrusted source, reset gso_segs. */ skb_shinfo(gso_skb)->gso_segs = DIV_ROUND_UP(gso_skb->len - sizeof(*uh),
Greg Kroah-Hartman
maintainerPATCH 129/263 arm64: cputype: Add Cortex-X3 definitions
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit be5a6f238700f38b534456608588723fba96c5ab ]
Add cputype definitions for Cortex-X3. These will be used for errata detection in subsequent patches.
These values can be found in Table A-263 ("MIDR_EL1 bit descriptions") in issue 07 of the Cortex-X3 TRM, which can be found at:
https://developer.arm.com/documentation/101593/0102/?lang=en
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -86,6 +86,7 @@#define ARM_CPU_PART_CORTEX_X2 0xD48#define ARM_CPU_PART_NEOVERSE_N2 0xD49#define ARM_CPU_PART_CORTEX_A78C 0xD4B +#define ARM_CPU_PART_CORTEX_X3 0xD4E#define ARM_CPU_PART_NEOVERSE_V2 0xD4F#define ARM_CPU_PART_CORTEX_X4 0xD82#define ARM_CPU_PART_NEOVERSE_V3 0xD84
@@ -162,6 +163,7 @@#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)#define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)#define MIDR_CORTEX_A78C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78C) +#define MIDR_CORTEX_X3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X3)#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2)#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 130/263 arm64: cputype: Add Cortex-A720 definitions
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit add332c40328cf06fe35e4b3cde8ec315c4629e5 ]
Add cputype definitions for Cortex-A720. These will be used for errata detection in subsequent patches.
These values can be found in Table A-186 ("MIDR_EL1 bit descriptions") in issue 0002-05 of the Cortex-A720 TRM, which can be found at:
https://developer.arm.com/documentation/102530/0002/?lang=en
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -88,6 +88,7 @@#define ARM_CPU_PART_CORTEX_A78C 0xD4B#define ARM_CPU_PART_CORTEX_X3 0xD4E#define ARM_CPU_PART_NEOVERSE_V2 0xD4F +#define ARM_CPU_PART_CORTEX_A720 0xD81#define ARM_CPU_PART_CORTEX_X4 0xD82#define ARM_CPU_PART_NEOVERSE_V3 0xD84
@@ -165,6 +166,7 @@#define MIDR_CORTEX_A78C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78C)#define MIDR_CORTEX_X3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X3)#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2) +#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 131/263 arm64: cputype: Add Cortex-X925 definitions
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit fd2ff5f0b320f418288e7a1f919f648fbc8a0dfc ]
Add cputype definitions for Cortex-X925. These will be used for errata detection in subsequent patches.
These values can be found in Table A-285 ("MIDR_EL1 bit descriptions") in issue 0001-05 of the Cortex-X925 TRM, which can be found at:
https://developer.arm.com/documentation/102807/0001/?lang=en
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -91,6 +91,7 @@#define ARM_CPU_PART_CORTEX_A720 0xD81#define ARM_CPU_PART_CORTEX_X4 0xD82#define ARM_CPU_PART_NEOVERSE_V3 0xD84 +#define ARM_CPU_PART_CORTEX_X925 0xD85#define APM_CPU_PART_XGENE 0x000#define APM_CPU_VAR_POTENZA 0x00
@@ -169,6 +170,7 @@#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3) +#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 132/263 arm64: errata: Unify speculative SSBS errata logic
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit ec768766608092087dfb5c1fc45a16a6f524dee2 ]
Cortex-X4 erratum 3194386 and Neoverse-V3 erratum 3312417 are identical, with duplicate Kconfig text and some unsightly ifdeffery. While we try to share code behind CONFIG_ARM64_WORKAROUND_SPECULATIVE_SSBS, having separate options results in a fair amount of boilerplate code, and this will only get worse as we expand the set of affected CPUs.
To reduce this boilerplate, unify the two behind a common Kconfig option. This removes the duplicate text and Kconfig logic, and removes the need for the intermediate ARM64_WORKAROUND_SPECULATIVE_SSBS option. The set of affected CPUs is described as a list so that this can easily be extended.
I've used ARM64_ERRATUM_3194386 (matching the Neoverse-V3 erratum ID) as the common option, matching the way we use ARM64_ERRATUM_1319367 to cover Cortex-A57 erratum 1319537 and Cortex-A72 erratum 1319367.
--- Documentation/arch/arm64/silicon-errata.rst | 2 +- arch/arm64/Kconfig | 29 +++------------------ arch/arm64/include/asm/cpucaps.h | 2 +- arch/arm64/kernel/cpu_errata.c | 8 ++---- arch/arm64/kernel/proton-pack.c | 2 +- 5 files changed, 9 insertions(+), 34 deletions(-)
Documentation/arch/arm64/silicon-errata.rst +1 -1
@@ -158,7 +158,7 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V1 | #1619801 | N/A | +----------------+-----------------+-----------------+-----------------------------+ -| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3312417 | +| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | MMU-500 | #841119,826419 | N/A | +----------------+-----------------+-----------------+-----------------------------+
arch/arm64/Kconfig +4 -25
@@ -1067,34 +1067,14 @@ config ARM64_ERRATUM_3117295 If unsure, say Y. -config ARM64_WORKAROUND_SPECULATIVE_SSBS - bool - config ARM64_ERRATUM_3194386 - bool "Cortex-X4: 3194386: workaround for MSR SSBS not self-synchronizing" - select ARM64_WORKAROUND_SPECULATIVE_SSBS + bool "Cortex-X4/Neoverse-V3: workaround for MSR SSBS not self-synchronizing" default y help - This option adds the workaround for ARM Cortex-X4 erratum 3194386. + This option adds the workaround for the following errata: - On affected cores "MSR SSBS, #0" instructions may not affect - subsequent speculative instructions, which may permit unexepected - speculative store bypassing. - - Work around this problem by placing a speculation barrier after - kernel changes to SSBS. The presence of the SSBS special-purpose - register is hidden from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such - that userspace will use the PR_SPEC_STORE_BYPASS prctl to change - SSBS. - - If unsure, say Y. - -config ARM64_ERRATUM_3312417 - bool "Neoverse-V3: 3312417: workaround for MSR SSBS not self-synchronizing" - select ARM64_WORKAROUND_SPECULATIVE_SSBS - default y - help - This option adds the workaround for ARM Neoverse-V3 erratum 3312417. + * ARM Cortex-X4 erratum 3194386 + * ARM Neoverse-V3 erratum 3312417 On affected cores "MSR SSBS, #0" instructions may not affect subsequent speculative instructions, which may permit unexepected
@@ -1108,7 +1088,6 @@ config ARM64_ERRATUM_3312417 If unsure, say Y. - config CAVIUM_ERRATUM_22375 bool "Cavium erratum 22375, 24313" default y
arch/arm64/include/asm/cpucaps.h +1 -1
@@ -59,7 +59,7 @@ cpucap_is_possible(const unsigned int cap)case ARM64_WORKAROUND_REPEAT_TLBI :return IS_ENABLED (CONFIG_ARM64_WORKAROUND_REPEAT_TLBI );case ARM64_WORKAROUND_SPECULATIVE_SSBS : -return IS_ENABLED (CONFIG_ARM64_WORKAROUND_SPECULATIVE_SSBS ); +return IS_ENABLED (CONFIG_ARM64_ERRATUM_3194386 ); }return true;
arch/arm64/kernel/cpu_errata.c +2 -6
@@ -432,14 +432,10 @@ static const struct midr_range erratum_spec_unpriv_load_list[] = { };#endif -#ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_SSBS -static const struct midr_range erratum_spec_ssbs_list[] = {#ifdef CONFIG_ARM64_ERRATUM_3194386 +static const struct midr_range erratum_spec_ssbs_list[] = {MIDR_ALL_VERSIONS (MIDR_CORTEX_X4 ), -#endif -#ifdef CONFIG_ARM64_ERRATUM_3312417MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3 ), -#endif {} };#endif
@@ -741,7 +737,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { MIDR_FIXED(MIDR_CPU_VAR_REV(1,1), BIT(25)), },#endif -#ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_SSBS +#ifdef CONFIG_ARM64_ERRATUM_3194386 { .desc = "ARM errata 3194386, 3312417", .capability = ARM64_WORKAROUND_SPECULATIVE_SSBS,
arch/arm64/kernel/proton-pack.c +1 -1
@@ -567,7 +567,7 @@ static enum mitigation_state spectre_v4_enable_hw_mitigation(void)* Mitigate this with an unconditional speculation barrier, as CPUs * could mis-speculate branches and bypass a conditional barrier. */ -if (IS_ENABLED (CONFIG_ARM64_WORKAROUND_SPECULATIVE_SSBS )) +if (IS_ENABLED (CONFIG_ARM64_ERRATUM_3194386 ))spec_bar ();return SPECTRE_MITIGATED ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 133/263 arm64: errata: Expand speculative SSBS workaround
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 75b3c43eab594bfbd8184ec8ee1a6b820950819a ]
A number of Arm Ltd CPUs suffer from errata whereby an MSR to the SSBS special-purpose register does not affect subsequent speculative instructions, permitting speculative store bypassing for a window of time.
We worked around this for Cortex-X4 and Neoverse-V3, in commit:
7187bb7d0b5c7dfa ("arm64: errata: Add workaround for Arm errata 3194386 and 3312417")
... as per their Software Developer Errata Notice (SDEN) documents:
* Cortex-X4 SDEN v8.0, erratum 3194386:
https://developer.arm.com/documentation/SDEN-2432808/0800/
* Neoverse-V3 SDEN v6.0, erratum 3312417:
https://developer.arm.com/documentation/SDEN-2891958/0600/
Since then, similar errata have been published for a number of other Arm Ltd CPUs, for which the mitigation is the same. This is described in their respective SDEN documents:
* Cortex-A710 SDEN v19.0, errataum 3324338
https://developer.arm.com/documentation/SDEN-1775101/1900/?lang=en
* Cortex-A720 SDEN v11.0, erratum 3456091
https://developer.arm.com/documentation/SDEN-2439421/1100/?lang=en
* Cortex-X2 SDEN v19.0, erratum 3324338
https://developer.arm.com/documentation/SDEN-1775100/1900/?lang=en
* Cortex-X3 SDEN v14.0, erratum 3324335
https://developer.arm.com/documentation/SDEN-2055130/1400/?lang=en
* Cortex-X925 SDEN v8.0, erratum 3324334
https://developer.arm.com/documentation/109108/800/?lang=en
* Neoverse-N2 SDEN v17.0, erratum 3324339
https://developer.arm.com/documentation/SDEN-1982442/1700/?lang=en
* Neoverse-V2 SDEN v9.0, erratum 3324336
https://developer.arm.com/documentation/SDEN-2332927/900/?lang=en
Note that due to shared design lineage, some CPUs share the same erratum number.
Add these to the existing mitigation under CONFIG_ARM64_ERRATUM_3194386. As listing all of the erratum IDs in the runtime description would be unwieldy, this is reduced to:
"SSBS not fully self-synchronizing"
... matching the description of the errata in all of the SDENs.
--- Documentation/arch/arm64/silicon-errata.rst | 14 ++++++++++++++ arch/arm64/Kconfig | 9 ++++++++- arch/arm64/kernel/cpu_errata.c | 9 ++++++++- 3 files changed, 30 insertions(+), 2 deletions(-)
Documentation/arch/arm64/silicon-errata.rst +14 -0
@@ -132,16 +132,26 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A710 | #2224489 | ARM64_ERRATUM_2224489 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A710 | #3324338 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X1 | #1502854 | N/A | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X2 | #3324338 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X3 | #3324335 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X4 | #3194386 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X925 | #3324334 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N1 | #1188873,1418040| ARM64_ERRATUM_1418040 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N1 | #1349291 | N/A |
@@ -156,8 +166,12 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N2 | #2253138 | ARM64_ERRATUM_2253138 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-N2 | #3324339 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V1 | #1619801 | N/A | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | MMU-500 | #841119,826419 | N/A |
arch/arm64/Kconfig +8 -1
@@ -1068,12 +1068,19 @@ config ARM64_ERRATUM_3117295 If unsure, say Y. config ARM64_ERRATUM_3194386 - bool "Cortex-X4/Neoverse-V3: workaround for MSR SSBS not self-synchronizing" + bool "Cortex-{A720,X4,X925}/Neoverse-V3: workaround for MSR SSBS not self-synchronizing" default y help This option adds the workaround for the following errata: + * ARM Cortex-A710 erratam 3324338 + * ARM Cortex-A720 erratum 3456091 + * ARM Cortex-X2 erratum 3324338 + * ARM Cortex-X3 erratum 3324335 * ARM Cortex-X4 erratum 3194386 + * ARM Cortex-X925 erratum 3324334 + * ARM Neoverse N2 erratum 3324339 + * ARM Neoverse V2 erratum 3324336 * ARM Neoverse-V3 erratum 3312417 On affected cores "MSR SSBS, #0" instructions may not affect
arch/arm64/kernel/cpu_errata.c +8 -1
@@ -434,8 +434,15 @@ static const struct midr_range erratum_spec_unpriv_load_list[] = {#ifdef CONFIG_ARM64_ERRATUM_3194386 static const struct midr_range erratum_spec_ssbs_list[] = { +MIDR_ALL_VERSIONS (MIDR_CORTEX_A710 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_A720 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_X2 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_X3 ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X4 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_X925 ), +MIDR_ALL_VERSIONS (MIDR_NEOVERSE_N2 ),MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3 ), +MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V2 ), {} };#endif
@@ -739,7 +746,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {#endif #ifdef CONFIG_ARM64_ERRATUM_3194386 { - .desc = "ARM errata 3194386, 3312417", + .desc = "SSBS not fully self-synchronizing", .capability = ARM64_WORKAROUND_SPECULATIVE_SSBS, ERRATA_MIDR_RANGE_LIST(erratum_spec_ssbs_list), },
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 134/263 arm64: cputype: Add Cortex-X1C definitions
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 58d245e03c324d083a0ec3b9ab8ebd46ec9848d7 ]
Add cputype definitions for Cortex-X1C. These will be used for errata detection in subsequent patches.
These values can be found in the Cortex-X1C TRM:
https://developer.arm.com/documentation/101968/0002/
... in section B2.107 ("MIDR_EL1, Main ID Register, EL1").
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -86,6 +86,7 @@#define ARM_CPU_PART_CORTEX_X2 0xD48#define ARM_CPU_PART_NEOVERSE_N2 0xD49#define ARM_CPU_PART_CORTEX_A78C 0xD4B +#define ARM_CPU_PART_CORTEX_X1C 0xD4C#define ARM_CPU_PART_CORTEX_X3 0xD4E#define ARM_CPU_PART_NEOVERSE_V2 0xD4F#define ARM_CPU_PART_CORTEX_A720 0xD81
@@ -165,6 +166,7 @@#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)#define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)#define MIDR_CORTEX_A78C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78C) +#define MIDR_CORTEX_X1C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1C)#define MIDR_CORTEX_X3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X3)#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2)#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 135/263 arm64: cputype: Add Cortex-A725 definitions
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 9ef54a384526911095db465e77acc1cb5266b32c ]
Add cputype definitions for Cortex-A725. These will be used for errata detection in subsequent patches.
These values can be found in the Cortex-A725 TRM:
https://developer.arm.com/documentation/107652/0001/
... in table A-247 ("MIDR_EL1 bit descriptions").
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -93,6 +93,7 @@#define ARM_CPU_PART_CORTEX_X4 0xD82#define ARM_CPU_PART_NEOVERSE_V3 0xD84#define ARM_CPU_PART_CORTEX_X925 0xD85 +#define ARM_CPU_PART_CORTEX_A725 0xD87#define APM_CPU_PART_XGENE 0x000#define APM_CPU_VAR_POTENZA 0x00
@@ -173,6 +174,7 @@#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925) +#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 136/263 arm64: errata: Expand speculative SSBS workaround (again)
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit adeec61a4723fd3e39da68db4cc4d924e6d7f641 ]
A number of Arm Ltd CPUs suffer from errata whereby an MSR to the SSBS special-purpose register does not affect subsequent speculative instructions, permitting speculative store bypassing for a window of time.
We worked around this for a number of CPUs in commits:
* 7187bb7d0b5c7dfa ("arm64: errata: Add workaround for Arm errata 3194386 and 3312417")
* 75b3c43eab594bfb ("arm64: errata: Expand speculative SSBS workaround")
Since then, similar errata have been published for a number of other Arm Ltd CPUs, for which the same mitigation is sufficient. This is described in their respective Software Developer Errata Notice (SDEN) documents:
* Cortex-A76 (MP052) SDEN v31.0, erratum 3324349
https://developer.arm.com/documentation/SDEN-885749/3100/
* Cortex-A77 (MP074) SDEN v19.0, erratum 3324348
https://developer.arm.com/documentation/SDEN-1152370/1900/
* Cortex-A78 (MP102) SDEN v21.0, erratum 3324344
https://developer.arm.com/documentation/SDEN-1401784/2100/
* Cortex-A78C (MP138) SDEN v16.0, erratum 3324346
https://developer.arm.com/documentation/SDEN-1707916/1600/
* Cortex-A78C (MP154) SDEN v10.0, erratum 3324347
https://developer.arm.com/documentation/SDEN-2004089/1000/
* Cortex-A725 (MP190) SDEN v5.0, erratum 3456106
https://developer.arm.com/documentation/SDEN-2832921/0500/
* Cortex-X1 (MP077) SDEN v21.0, erratum 3324344
https://developer.arm.com/documentation/SDEN-1401782/2100/
* Cortex-X1C (MP136) SDEN v16.0, erratum 3324346
https://developer.arm.com/documentation/SDEN-1707914/1600/
* Neoverse-N1 (MP050) SDEN v32.0, erratum 3324349
https://developer.arm.com/documentation/SDEN-885747/3200/
* Neoverse-V1 (MP076) SDEN v19.0, erratum 3324341
https://developer.arm.com/documentation/SDEN-1401781/1900/
Note that due to the manner in which Arm develops IP and tracks errata, some CPUs share a common erratum number and some CPUs have multiple erratum numbers for the same HW issue.
On parts without SB, it is necessary to use ISB for the workaround. The spec_bar() macro used in the mitigation will expand to a "DSB SY; ISB" sequence in this case, which is sufficient on all affected parts.
Enable the existing mitigation by adding the relevant MIDRs to erratum_spec_ssbs_list. The list is sorted alphanumerically (involving moving Neoverse-V3 after Neoverse-V2) so that this is easy to audit and potentially extend again in future. The Kconfig text is also updated to clarify the set of affected parts and the mitigation.
--- Documentation/arch/arm64/silicon-errata.rst | 18 +++++++++++++++++ arch/arm64/Kconfig | 22 +++++++++++++++------ arch/arm64/kernel/cpu_errata.c | 11 ++++++++++- 3 files changed, 44 insertions(+), 7 deletions(-)
Documentation/arch/arm64/silicon-errata.rst +18 -0
@@ -122,10 +122,18 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A76 | #1490853 | N/A | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A76 | #3324349 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A77 | #1491015 | N/A | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A77 | #1508412 | ARM64_ERRATUM_1508412 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A77 | #3324348 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A78 | #3324344 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A78C | #3324346,3324347| ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 |
@@ -138,8 +146,14 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X1 | #1502854 | N/A | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X1 | #3324344 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X1C | #3324346 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 |
@@ -160,6 +174,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N1 | #1542419 | ARM64_ERRATUM_1542419 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-N1 | #3324349 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N2 | #2139208 | ARM64_ERRATUM_2139208 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N2 | #2067961 | ARM64_ERRATUM_2067961 |
@@ -170,6 +186,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V1 | #1619801 | N/A | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
arch/arm64/Kconfig +16 -6
@@ -1068,18 +1068,28 @@ config ARM64_ERRATUM_3117295 If unsure, say Y. config ARM64_ERRATUM_3194386 - bool "Cortex-{A720,X4,X925}/Neoverse-V3: workaround for MSR SSBS not self-synchronizing" + bool "Cortex-*/Neoverse-*: workaround for MSR SSBS not self-synchronizing" default y help This option adds the workaround for the following errata: + * ARM Cortex-A76 erratum 3324349 + * ARM Cortex-A77 erratum 3324348 + * ARM Cortex-A78 erratum 3324344 + * ARM Cortex-A78C erratum 3324346 + * ARM Cortex-A78C erratum 3324347 * ARM Cortex-A710 erratam 3324338 * ARM Cortex-A720 erratum 3456091 + * ARM Cortex-A725 erratum 3456106 + * ARM Cortex-X1 erratum 3324344 + * ARM Cortex-X1C erratum 3324346 * ARM Cortex-X2 erratum 3324338 * ARM Cortex-X3 erratum 3324335 * ARM Cortex-X4 erratum 3194386 * ARM Cortex-X925 erratum 3324334 + * ARM Neoverse-N1 erratum 3324349 * ARM Neoverse N2 erratum 3324339 + * ARM Neoverse-V1 erratum 3324341 * ARM Neoverse V2 erratum 3324336 * ARM Neoverse-V3 erratum 3312417
@@ -1087,11 +1097,11 @@ config ARM64_ERRATUM_3194386 subsequent speculative instructions, which may permit unexepected speculative store bypassing. - Work around this problem by placing a speculation barrier after - kernel changes to SSBS. The presence of the SSBS special-purpose - register is hidden from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such - that userspace will use the PR_SPEC_STORE_BYPASS prctl to change - SSBS. + Work around this problem by placing a Speculation Barrier (SB) or + Instruction Synchronization Barrier (ISB) after kernel changes to + SSBS. The presence of the SSBS special-purpose register is hidden + from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such that userspace + will use the PR_SPEC_STORE_BYPASS prctl to change SSBS. If unsure, say Y.
arch/arm64/kernel/cpu_errata.c +10 -1
@@ -434,15 +434,24 @@ static const struct midr_range erratum_spec_unpriv_load_list[] = {#ifdef CONFIG_ARM64_ERRATUM_3194386 static const struct midr_range erratum_spec_ssbs_list[] = { +MIDR_ALL_VERSIONS (MIDR_CORTEX_A76 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_A77 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_A78 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_A78C ),MIDR_ALL_VERSIONS (MIDR_CORTEX_A710 ),MIDR_ALL_VERSIONS (MIDR_CORTEX_A720 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_A725 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_X1 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_X1C ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X2 ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X3 ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X4 ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X925 ), +MIDR_ALL_VERSIONS (MIDR_NEOVERSE_N1 ),MIDR_ALL_VERSIONS (MIDR_NEOVERSE_N2 ), -MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3 ), +MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V1 ),MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V2 ), +MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3 ), {} };#endif
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 137/263 nfsd: dont set SVC_SOCK_ANONYMOUS when creating nfsd sockets
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
[ Upstream commit 91da337e5d506f2c065d20529d105ca40090e320 ]
When creating nfsd sockets via the netlink interface, we do want to register with the portmapper. Don't set SVC_SOCK_ANONYMOUS.
--- fs/nfsd/nfsctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfsd/nfsctl.c +1 -2
@@ -2053,8 +2053,7 @@ int nfsd_nl_listener_set_doit(struct sk_buff *skb, struct genl_info *info)continue ; } - ret =svc_xprt_create_from_sa (serv, xcl_name, net, sa, -SVC_SOCK_ANONYMOUS , + ret =svc_xprt_create_from_sa (serv, xcl_name, net, sa,0 ,get_current_cred ());/* always save the latest error */ if (ret <0 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 138/263 i2c: smbus: Improve handling of stuck alerts
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 37c526f00bc1c4f847fc800085f8f009d2e11be6 ]
The following messages were observed while testing alert functionality on systems with multiple I2C devices on a single bus if alert was active on more than one chip.
smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0 smbus_alert 3-000c: no driver alert()!
and:
smbus_alert 3-000c: SMBALERT# from dev 0x28, flag 0
Once it starts, this message repeats forever at high rate. There is no device at any of the reported addresses.
Analysis shows that this is seen if multiple devices have the alert pin active. Apparently some devices do not support SMBus arbitration correctly. They keep sending address bits after detecting an address collision and handle the collision not at all or too late.
Specifically, address 0x0c is seen with ADT7461A at address 0x4c and ADM1021 at address 0x18 if alert is active on both chips. Address 0x28 is seen with ADT7483 at address 0x2a and ADT7461 at address 0x4c if alert is active on both chips.
Once the system is in bad state (alert is set by more than one chip), it often only recovers by power cycling.
To reduce the impact of this problem, abort the endless loop in smbus_alert() if the same address is read more than once and not handled by a driver.
--- drivers/i2c/i2c-smbus.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-)
drivers/i2c/i2c-smbus.c +25 -7
@@ -34,6 +34,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)struct i2c_client *client =i2c_verify_client (dev);struct alert_data *data = addrp;struct i2c_driver *driver; +int ret;if (!client || client->addr != data->addr)return 0 ;
@@ -47,16 +48,21 @@ static int smbus_do_alert(struct device *dev, void *addrp)device_lock (dev);if (client->dev.driver) { driver =to_i2c_driver (client->dev.driver); -if (driver->alert) +if (driver->alert) { +/* Stop iterating after we find the device */ driver->alert (client, data->type, data->data); -else + ret = -EBUSY ; + }else {dev_warn (&client->dev,"no driver alert()!\n" ); - }else + ret = -EOPNOTSUPP ; + } + }else {dev_dbg (&client->dev,"alert with no driver\n" ); + ret = -ENODEV ; + }device_unlock (dev); -/* Stop iterating after we find the device */ -return -EBUSY ; +return ret; }/*
@@ -67,6 +73,7 @@ static irqreturn_t smbus_alert(int irq, void *d) {struct i2c_smbus_alert *alert = d;struct i2c_client *ara; +unsigned short prev_addr =I2C_CLIENT_END ;/* Not a valid address */ ara = alert->ara;
@@ -94,8 +101,19 @@ static irqreturn_t smbus_alert(int irq, void *d) data.addr, data.data);/* Notify driver for the device which issued the alert */ -device_for_each_child (&ara->adapter->dev, &data, - smbus_do_alert); + status =device_for_each_child (&ara->adapter->dev, &data, + smbus_do_alert); +/* +* If we read the same address more than once, and the alert +* was not handled by a driver, it won't do any good to repeat +* the loop because it will never terminate. +* Bail out in this case. +* Note: This assumes that a driver with alert handler handles +* the alert properly and clears it if necessary. +*/ +if (data.addr == prev_addr && status != -EBUSY ) +break ; + prev_addr = data.addr; }return IRQ_HANDLED ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 139/263 ASoC: codecs: wcd938x-sdw: Correct Soundwire ports mask
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 3f6fb03dae9c7dfba7670858d29e03c8faaa89fe ]
Device has up to WCD938X_MAX_SWR_PORTS number of ports and the array assigned to prop.src_dpn_prop and prop.sink_dpn_prop has 0..WCD938X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WCD938X_MAX_SWR_PORTS-1.
Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave().
--- sound/soc/codecs/wcd938x-sdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wcd938x-sdw.c +2 -2
@@ -1252,12 +1252,12 @@ static int wcd9380_probe(struct sdw_slave *pdev, pdev->prop.lane_control_support = true; pdev->prop.simple_clk_stop_capable = true;if (wcd->is_tx) { - pdev->prop.source_ports =GENMASK (WCD938X_MAX_SWR_PORTS ,0 ); + pdev->prop.source_ports =GENMASK (WCD938X_MAX_SWR_PORTS -1 ,0 ); pdev->prop.src_dpn_prop = wcd938x_dpn_prop; wcd->ch_info = &wcd938x_sdw_tx_ch_info[0 ]; pdev->prop.wake_capable = true; }else { - pdev->prop.sink_ports =GENMASK (WCD938X_MAX_SWR_PORTS ,0 ); + pdev->prop.sink_ports =GENMASK (WCD938X_MAX_SWR_PORTS -1 ,0 ); pdev->prop.sink_dpn_prop = wcd938x_dpn_prop; wcd->ch_info = &wcd938x_sdw_rx_ch_info[0 ]; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 140/263 ASoC: codecs: wcd939x-sdw: Correct Soundwire ports mask
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 74a79977c4e1d09eced33e6e22f875a5bb3fad29 ]
Device has up to WCD939X_MAX_TX_SWR_PORTS (or WCD939X_MAX_RX_SWR_PORTS for sink) number of ports and the array assigned to prop.src_dpn_prop and prop.sink_dpn_prop has 0..WCD939X_MAX_TX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WCD939X_MAX_TX_SWR_PORTS-1.
Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave().
--- sound/soc/codecs/wcd939x-sdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/wcd939x-sdw.c +2 -2
@@ -1453,12 +1453,12 @@ static int wcd9390_probe(struct sdw_slave *pdev, const struct sdw_device_id *id) pdev->prop.lane_control_support = true; pdev->prop.simple_clk_stop_capable = true;if (wcd->is_tx) { - pdev->prop.source_ports =GENMASK (WCD939X_MAX_TX_SWR_PORTS ,0 ); + pdev->prop.source_ports =GENMASK (WCD939X_MAX_TX_SWR_PORTS -1 ,0 ); pdev->prop.src_dpn_prop = wcd939x_tx_dpn_prop; wcd->ch_info = &wcd939x_sdw_tx_ch_info[0 ]; pdev->prop.wake_capable = true; }else { - pdev->prop.sink_ports =GENMASK (WCD939X_MAX_RX_SWR_PORTS ,0 ); + pdev->prop.sink_ports =GENMASK (WCD939X_MAX_RX_SWR_PORTS -1 ,0 ); pdev->prop.sink_dpn_prop = wcd939x_rx_dpn_prop; wcd->ch_info = &wcd939x_sdw_rx_ch_info[0 ]; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 141/263 ASoC: codecs: wsa881x: Correct Soundwire ports mask
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit eb11c3bb64ad0a05aeacdb01039863aa2aa3614b ]
Device has up to WSA881X_MAX_SWR_PORTS number of ports and the array assigned to prop.sink_dpn_prop has 0..WSA881X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WSA881X_MAX_SWR_PORTS-1.
Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave().
--- sound/soc/codecs/wsa881x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wsa881x.c +1 -1
@@ -1152,7 +1152,7 @@ static int wsa881x_probe(struct sdw_slave *pdev, wsa881x->sconfig.frame_rate =48000 ; wsa881x->sconfig.direction =SDW_DATA_DIR_RX ; wsa881x->sconfig.type =SDW_STREAM_PDM ; - pdev->prop.sink_ports =GENMASK (WSA881X_MAX_SWR_PORTS ,0 ); + pdev->prop.sink_ports =GENMASK (WSA881X_MAX_SWR_PORTS -1 ,0 ); pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop; pdev->prop.scp_int1_mask =SDW_SCP_INT1_BUS_CLASH |SDW_SCP_INT1_PARITY ; pdev->prop.clk_stop_mode1 = true;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 142/263 ASoC: codecs: wsa883x: parse port-mapping information
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
[ Upstream commit 1cf3295bd108abbd7f128071ae9775fd18394ca9 ]
Add support to parse static master port map information from device tree.
Stable-dep-of: 6801ac36f256 ("ASoC: codecs: wsa883x: Correct Soundwire ports mask")
--- sound/soc/codecs/wsa883x.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/soc/codecs/wsa883x.c +8 -0
@@ -1399,6 +1399,14 @@ static int wsa883x_probe(struct sdw_slave *pdev, wsa883x->sconfig.direction =SDW_DATA_DIR_RX ; wsa883x->sconfig.type =SDW_STREAM_PDM ; +/** +* Port map index starts with 0, however the data port for this codec +* are from index 1 +*/ +if (of_property_read_u32_array (dev->of_node,"qcom,port-mapping" , &pdev->m_port_map[1 ], +WSA883X_MAX_SWR_PORTS )) +dev_dbg (dev,"Static Port mapping not specified\n" ); + pdev->prop.sink_ports =GENMASK (WSA883X_MAX_SWR_PORTS ,0 ); pdev->prop.simple_clk_stop_capable = true; pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 143/263 ASoC: codecs: wsa883x: Correct Soundwire ports mask
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 6801ac36f25690e14955f7f9eace1eaa29edbdd0 ]
Device has up to WSA883X_MAX_SWR_PORTS number of ports and the array assigned to prop.sink_dpn_prop has 0..WSA883X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WSA883X_MAX_SWR_PORTS-1.
Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave().
--- sound/soc/codecs/wsa883x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wsa883x.c +1 -1
@@ -1407,7 +1407,7 @@ static int wsa883x_probe(struct sdw_slave *pdev, WSA883X_MAX_SWR_PORTS)) dev_dbg(dev, "Static Port mapping not specified\n"); - pdev->prop.sink_ports =GENMASK (WSA883X_MAX_SWR_PORTS ,0 ); + pdev->prop.sink_ports =GENMASK (WSA883X_MAX_SWR_PORTS -1 ,0 ); pdev->prop.simple_clk_stop_capable = true; pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop; pdev->prop.scp_int1_mask =SDW_SCP_INT1_BUS_CLASH |SDW_SCP_INT1_PARITY ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 144/263 ASoC: codecs: wsa884x: parse port-mapping information
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
[ Upstream commit e1bc5c324bcca3acdbe817ccbf9aa7992d89479d ]
Add support to parse static master port map information from device tree. This is required for correct port mapping between soundwire device and master ports.
Stable-dep-of: dcb6631d0515 ("ASoC: codecs: wsa884x: Correct Soundwire ports mask")
--- sound/soc/codecs/wsa884x.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/soc/codecs/wsa884x.c +8 -0
@@ -1887,6 +1887,14 @@ static int wsa884x_probe(struct sdw_slave *pdev, wsa884x->sconfig.direction =SDW_DATA_DIR_RX ; wsa884x->sconfig.type =SDW_STREAM_PDM ; +/** +* Port map index starts with 0, however the data port for this codec +* are from index 1 +*/ +if (of_property_read_u32_array (dev->of_node,"qcom,port-mapping" , &pdev->m_port_map[1 ], +WSA884X_MAX_SWR_PORTS )) +dev_dbg (dev,"Static Port mapping not specified\n" ); + pdev->prop.sink_ports =GENMASK (WSA884X_MAX_SWR_PORTS ,0 ); pdev->prop.simple_clk_stop_capable = true; pdev->prop.sink_dpn_prop = wsa884x_sink_dpn_prop;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 145/263 ASoC: codecs: wsa884x: Correct Soundwire ports mask
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit dcb6631d05152930e2ea70fd2abfd811b0e970b5 ]
Device has up to WSA884X_MAX_SWR_PORTS number of ports and the array assigned to prop.sink_dpn_prop has 0..WSA884X_MAX_SWR_PORTS-1 elements. On the other hand, GENMASK(high, low) creates an inclusive mask between <high, low>, so we need the mask from 0 up to WSA884X_MAX_SWR_PORTS-1.
Theoretically, too wide mask could cause an out of bounds read in sdw_get_slave_dpn_prop() in stream.c, however only in the case of buggy driver, e.g. adding incorrect number of ports via sdw_stream_add_slave().
--- sound/soc/codecs/wsa884x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wsa884x.c +1 -1
@@ -1895,7 +1895,7 @@ static int wsa884x_probe(struct sdw_slave *pdev, WSA884X_MAX_SWR_PORTS)) dev_dbg(dev, "Static Port mapping not specified\n"); - pdev->prop.sink_ports =GENMASK (WSA884X_MAX_SWR_PORTS ,0 ); + pdev->prop.sink_ports =GENMASK (WSA884X_MAX_SWR_PORTS -1 ,0 ); pdev->prop.simple_clk_stop_capable = true; pdev->prop.sink_dpn_prop = wsa884x_sink_dpn_prop; pdev->prop.scp_int1_mask =SDW_SCP_INT1_BUS_CLASH |SDW_SCP_INT1_PARITY ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 146/263 ASoC: sti: add missing probe entry for player and reader
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Audu <[email protected]>
[ Upstream commit 6b99068d5ea0aa295f15f30afc98db74d056ec7b ]
This patch addresses a regression in the ASoC STI drivers that was introduced in Linux version 6.6.y. The issue originated from a series of patches (see https://lore.kernel.org/all/[email protected]/)
that unintentionally omitted necessary probe functions for the player
and reader components.
Probe function in sound/soc/sti/sti_uniperif.c:415 is being replaced by another probe function located at sound/soc/sti/sti_uniperif.c:453, which should instead be derived from the player and reader components. This patch correctly reinserts the missing probe entries, restoring the intended functionality.
--- sound/soc/sti/sti_uniperif.c | 2 +- sound/soc/sti/uniperif.h | 1 + sound/soc/sti/uniperif_player.c | 1 + sound/soc/sti/uniperif_reader.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-)
sound/soc/sti/sti_uniperif.c +1 -1
@@ -352,7 +352,7 @@ static int sti_uniperiph_resume(struct snd_soc_component *component)return ret; } -static int sti_uniperiph_dai_probe (struct snd_soc_dai *dai) +int sti_uniperiph_dai_probe (struct snd_soc_dai *dai) {struct sti_uniperiph_data *priv =snd_soc_dai_get_drvdata (dai);struct sti_uniperiph_dai *dai_data = &priv->dai_data;
sound/soc/sti/uniperif.h +1 -0
@@ -1380,6 +1380,7 @@ int uni_reader_init(struct platform_device *pdev, struct uniperif *reader);/* common */ +int sti_uniperiph_dai_probe (struct snd_soc_dai *dai);int sti_uniperiph_dai_set_fmt (struct snd_soc_dai *dai,unsigned int fmt);
sound/soc/sti/uniperif_player.c +1 -0
@@ -1038,6 +1038,7 @@ static const struct snd_soc_dai_ops uni_player_dai_ops = { .startup = uni_player_startup, .shutdown = uni_player_shutdown, .prepare = uni_player_prepare, + .probe = sti_uniperiph_dai_probe, .trigger = uni_player_trigger, .hw_params = sti_uniperiph_dai_hw_params, .set_fmt = sti_uniperiph_dai_set_fmt,
sound/soc/sti/uniperif_reader.c +1 -0
@@ -401,6 +401,7 @@ static const struct snd_soc_dai_ops uni_reader_dai_ops = { .startup = uni_reader_startup, .shutdown = uni_reader_shutdown, .prepare = uni_reader_prepare, + .probe = sti_uniperiph_dai_probe, .trigger = uni_reader_trigger, .hw_params = sti_uniperiph_dai_hw_params, .set_fmt = sti_uniperiph_dai_set_fmt,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 147/263 spi: spidev: Add missing spi_device_id for bh2228fv
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit e4c4638b6a10427d30e29d22351c375886025f47 ]
When the of_device_id entry for "rohm,bh2228fv" was added, the corresponding spi_device_id was forgotten, causing a warning message during boot-up:
SPI driver spidev has no spi_device_id for rohm,bh2228fv
Fix module autoloading and shut up the warning by adding the missing entry.
--- drivers/spi/spidev.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spidev.c +1 -0
@@ -700,6 +700,7 @@ static const struct class spidev_class = { };static const struct spi_device_id spidev_spi_ids[] = { + { .name ="bh2228fv" }, { .name ="dh2228fv" }, { .name ="ltc2488" }, { .name ="sx1301" },
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 148/263 ASoC: SOF: Remove libraries from topology lookups
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Curtis Malainey <[email protected]>
[ Upstream commit 7354eb7f1558466e92e926802d36e69e42938ea9 ]
Default firmware shipped in open source are not licensed for 3P libraries, therefore topologies should not reference them.
If a OS wants to use 3P (that they have licensed) then they should use the appropriate topology override mechanisms.
--- sound/soc/sof/mediatek/mt8195/mt8195.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/mediatek/mt8195/mt8195.c +1 -1
@@ -573,7 +573,7 @@ static const struct snd_sof_dsp_ops sof_mt8195_ops = {static struct snd_sof_of_mach sof_mt8195_machs[] = { { .compatible ="google,tomato" , - .sof_tplg_filename ="sof-mt8195-mt6359-rt1019-rt5682-dts.tplg" + .sof_tplg_filename ="sof-mt8195-mt6359-rt1019-rt5682.tplg" }, { .compatible ="mediatek,mt8195" , .sof_tplg_filename ="sof-mt8195.tplg"
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 149/263 i2c: smbus: Send alert notifications to all devices if source not found
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit f6c29f710c1ff2590109f83be3e212b86c01e0f3 ]
If a SMBus alert is received and the originating device is not found, the reason may be that the address reported on the SMBus alert address is corrupted, for example because multiple devices asserted alert and do not correctly implement SMBus arbitration.
If this happens, call alert handlers on all devices connected to the given I2C bus, in the hope that this cleans up the situation.
This change reliably fixed the problem on a system with multiple devices on a single bus. Example log where the device on address 0x18 (ADM1021) and on address 0x4c (ADT7461A) both had the alert line asserted:
smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0 smbus_alert 3-000c: no driver alert()! smbus_alert 3-000c: SMBALERT# from dev 0x0c, flag 0 smbus_alert 3-000c: no driver alert()!
lm90 3-0018: temp1 out of range, please check! lm90 3-0018: Disabling ALERT#
lm90 3-0029: Everything OK
lm90 3-002a: Everything OK
lm90 3-004c: temp1 out of range, please check! lm90 3-004c: temp2 out of range, please check! lm90 3-004c: Disabling ALERT#
--- drivers/i2c/i2c-smbus.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
drivers/i2c/i2c-smbus.c +35 -3
@@ -65,6 +65,32 @@ static int smbus_do_alert(struct device *dev, void *addrp)return ret; } +/* Same as above, but call back all drivers with alert handler */ + +static int smbus_do_alert_force (struct device *dev,void *addrp) +{ +struct i2c_client *client =i2c_verify_client (dev); +struct alert_data *data = addrp; +struct i2c_driver *driver; + +if (!client || (client->flags &I2C_CLIENT_TEN )) +return 0 ; + +/* +* Drivers should either disable alerts, or provide at least +* a minimal handler. Lock so the driver won't change. +*/ +device_lock (dev); +if (client->dev.driver) { + driver =to_i2c_driver (client->dev.driver); +if (driver->alert) + driver->alert (client, data->type, data->data); + } +device_unlock (dev); + +return 0 ; +} +/* * The alert IRQ handler needs to hand work off to a task which can issue * SMBus calls, because those sleeping calls can't be made in IRQ context.
@@ -106,13 +132,19 @@ static irqreturn_t smbus_alert(int irq, void *d)/* * If we read the same address more than once, and the alert * was not handled by a driver, it won't do any good to repeat -* the loop because it will never terminate. -* Bail out in this case. +* the loop because it will never terminate. Try again, this +* time calling the alert handlers of all devices connected to +* the bus, and abort the loop afterwards. If this helps, we +* are all set. If it doesn't, there is nothing else we can do, +* so we might as well abort the loop. * Note: This assumes that a driver with alert handler handles * the alert properly and clears it if necessary. */ -if (data.addr == prev_addr && status != -EBUSY ) +if (data.addr == prev_addr && status != -EBUSY ) { +device_for_each_child (&ara->adapter->dev, &data, + smbus_do_alert_force);break ; + } prev_addr = data.addr; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 150/263 bpf: kprobe: remove unused declaring of bpf_kprobe_override
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Menglong Dong <[email protected]>
[ Upstream commit 0e8b53979ac86eddb3fd76264025a70071a25574 ]
After the commit 66665ad2f102 ("tracing/kprobe: bpf: Compare instruction pointer with original one"), "bpf_kprobe_override" is not used anywhere anymore, and we can remove it now.
--- include/linux/trace_events.h | 1 - 1 file changed, 1 deletion(-)
include/linux/trace_events.h +0 -1
@@ -880,7 +880,6 @@ do { \struct perf_event ; DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); -DECLARE_PER_CPU (int, bpf_kprobe_override);extern int perf_trace_init (struct perf_event *event);extern void perf_trace_destroy (struct perf_event *event);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 151/263 kprobes: Fix to check symbol prefixes correctly
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <[email protected]>
[ Upstream commit 8c8acb8f26cbde665b233dd1b9bbcbb9b86822dc ]
Since str_has_prefix() takes the prefix as the 2nd argument and the string as the first, is_cfi_preamble_symbol() always fails to check the prefix. Fix the function parameter order so that it correctly check the prefix.
--- kernel/kprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/kprobes.c +2 -2
@@ -1557,8 +1557,8 @@ static bool is_cfi_preamble_symbol(unsigned long addr)if (lookup_symbol_name (addr, symbuf))return false; -return str_has_prefix ("__cfi_" , symbuf) || -str_has_prefix ("__pfx_" , symbuf); +return str_has_prefix (symbuf,"__cfi_" ) || +str_has_prefix (symbuf,"__pfx_" ); } static int check_kprobe_address_safe(struct kprobe *p,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 152/263 ASoC: cs-amp-lib: Fix NULL pointer crash if efi.get_variable is NULL
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <[email protected]>
[ Upstream commit dc268085e499666b9f4f0fcb4c5a94e1c0b193b3 ]
Call efi_rt_services_supported() to check that efi.get_variable exists before calling it.
--- sound/soc/codecs/cs-amp-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs-amp-lib.c +1 -1
@@ -108,7 +108,7 @@ static efi_status_t cs_amp_get_efi_variable(efi_char16_t *name,KUNIT_STATIC_STUB_REDIRECT (cs_amp_get_efi_variable, name, guid, size, buf); -if (IS_ENABLED (CONFIG_EFI )) +if (efi_rt_services_supported (EFI_RT_SUPPORTED_GET_VARIABLE ))return efi.get_variable (name, guid, &attr, size, buf);return EFI_NOT_FOUND ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 153/263 i2c: qcom-geni: Add missing clk_disable_unprepare in geni_i2c_runtime_resume
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gaosheng Cui <[email protected]>
[ Upstream commit b93d16bee557302d4e588375ececd833cc048acc ]
Add the missing clk_disable_unprepare() before return in geni_i2c_runtime_resume().
--- drivers/i2c/busses/i2c-qcom-geni.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-qcom-geni.c +3 -1
@@ -990,8 +990,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)return ret; ret =geni_se_resources_on (&gi2c->se); -if (ret) +if (ret) { +clk_disable_unprepare (gi2c->core_clk);return ret; + }enable_irq (gi2c->irq); gi2c->suspended =0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 154/263 ASoC: cs35l56: Revert support for dual-ownership of ASP registers
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <[email protected]>
[ Upstream commit 5d7e328e20b3d2bd3e1e8bea7a868ab8892aeed1 ]
This patch reverts a series of commits that allowed for the ASP registers to be owned by either the driver or the firmware. Nothing currently depends on the functionality that is being reverted, so it is safe to remove.
The commits being reverted are (last 3 are bugfixes to the first 2):
commit 72a77d7631c6
("ASoC: cs35l56: Fix to ensure ASP1 registers match cache") commit 07f7d6e7a124
("ASoC: cs35l56: Fix for initializing ASP1 mixer registers") commit 4703b014f28b
("ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()") commit c14f09f010cc
("ASoC: cs35l56: Fix deadlock in ASP1 mixer register initialization") commit dfd2ffb37399
("ASoC: cs35l56: Prevent overwriting firmware ASP config")
These reverts have been squashed into a single commit because there would be no reason to revert only some of them (which would just reintroduce bugs).
The changes introduced by the commits were well-intentioned but somewhat misguided. ACPI does not provide any information about how audio hardware is linked together, so that information has to be hardcoded into drivers. On Windows the firmware is customized to statically setup appropriate configuration of the audio links, and the intent of the commits was to re-use this information if the Linux host drivers aren't taking control of the ASP. This would avoid having to hardcode the ASP config into the machine driver on some systems.
However, this added complexity and race conditions into the driver. It also complicates implementation of new code.
The only case where the ASP is used but the host is not taking ownership is when CS35L56 is used in SoundWire mode with the ASP as a reference audio interconnect. But even in that case it's not necessarily required even if the firmware initialized it. Typically it is used to avoid the host SDCA drivers having to be capable of aggregating capture paths from multiple SoundWire peripherals. But the SOF SoundWire support is capable of doing that aggregation.
Reverting all these commits significantly simplifies the driver. Let's just use the normal Linux mechanisms of the machine driver and ALSA controls to set things up instead of trying to use the firmware to do use-case setup.
Stable-dep-of: e42066df07c0 ("ASoC: cs35l56: Handle OTP read latency over SoundWire")
--- include/sound/cs35l56.h | 9 +- sound/soc/codecs/cs35l56-shared.c | 101 ++++----------- sound/soc/codecs/cs35l56.c | 205 ++---------------------------- sound/soc/codecs/cs35l56.h | 1 - 4 files changed, 43 insertions(+), 273 deletions(-)
include/sound/cs35l56.h +6 -3
@@ -267,13 +267,18 @@ struct cs35l56_base {bool fw_patched;bool secured;bool can_hibernate; -bool fw_owns_asp1;bool cal_data_valid;s8 cal_index;struct cirrus_amp_cal_data cal_data;struct gpio_desc *reset_gpio; }; +/* Temporary to avoid a build break with the HDA driver */ +static inline int cs35l56_force_sync_asp1_registers_from_cache (struct cs35l56_base *cs35l56_base) +{ +return 0 ; +} +extern struct regmap_config cs35l56_regmap_i2c;extern struct regmap_config cs35l56_regmap_spi;extern struct regmap_config cs35l56_regmap_sdw;
@@ -284,8 +289,6 @@ extern const char * const cs35l56_tx_input_texts[CS35L56_NUM_INPUT_SRC];extern const unsigned int cs35l56_tx_input_values[CS35L56_NUM_INPUT_SRC ];int cs35l56_set_patch (struct cs35l56_base *cs35l56_base); -int cs35l56_init_asp1_regs_for_driver_control (struct cs35l56_base *cs35l56_base); -int cs35l56_force_sync_asp1_registers_from_cache (struct cs35l56_base *cs35l56_base);int cs35l56_mbox_send (struct cs35l56_base *cs35l56_base,unsigned int command);int cs35l56_firmware_shutdown (struct cs35l56_base *cs35l56_base);int cs35l56_wait_for_firmware_boot (struct cs35l56_base *cs35l56_base);
sound/soc/codecs/cs35l56-shared.c +24 -77
119 lines not on this page · raw message
sound/soc/codecs/cs35l56.c +13 -192
296 lines not on this page · raw message
sound/soc/codecs/cs35l56.h +0 -1
@@ -51,7 +51,6 @@ struct cs35l56_private {u8 asp_slot_count;bool tdm_mode;bool sysclk_set; -bool asp1_mixer_widgets_initialized;u8 old_sdw_clock_scale; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 155/263 ASoC: cs35l56: Handle OTP read latency over SoundWire
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <[email protected]>
[ Upstream commit e42066df07c0fcedebb32ed56f8bc39b4bf86337 ]
Use the late-read buffer in the CS35L56 SoundWire interface to read OTP memory.
The OTP memory has a longer access latency than chip registers and cannot guarantee to return the data value in the SoundWire control response if the bus clock is >4.8 MHz. The Cirrus SoundWire peripheral IP exposes the bridge-to-bus read buffer and status bits. For a read from OTP the bridge status bits are polled to wait for the OTP data to be loaded into the read buffer and the data is then read from there.
--- include/sound/cs35l56.h | 5 +++ sound/soc/codecs/cs35l56-sdw.c | 77 ++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+)
include/sound/cs35l56.h +5 -0
@@ -279,6 +279,11 @@ static inline int cs35l56_force_sync_asp1_registers_from_cache(struct cs35l56_bareturn 0 ; } +static inline bool cs35l56_is_otp_register (unsigned int reg) +{ +return (reg >>16 ) ==3 ; +} +extern struct regmap_config cs35l56_regmap_i2c;extern struct regmap_config cs35l56_regmap_spi;extern struct regmap_config cs35l56_regmap_sdw;
sound/soc/codecs/cs35l56-sdw.c +77 -0
89 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 156/263 drm/atomic: allow no-op FB_ID updates for async flips
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Ser <[email protected]>
[ Upstream commit 929725bd7eb4eea1f75197d9847f3f1ea5afdad1 ]
User-space is allowed to submit any property in an async flip as long as the value doesn't change. However we missed one case:
as things stand, the kernel rejects no-op FB_ID changes on non-primary planes. Fix this by changing the conditional and skipping drm_atomic_check_prop_changes() only for FB_ID on the primary plane (instead of skipping for FB_ID on any plane).
--- drivers/gpu/drm/drm_atomic_uapi.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/drm_atomic_uapi.c +4 -11
@@ -1067,23 +1067,16 @@ int drm_atomic_set_property(struct drm_atomic_state *state, }if (async_flip && - prop != config->prop_fb_id && - prop != config->prop_in_fence_fd && - prop != config->prop_fb_damage_clips) { + (plane_state->plane->type !=DRM_PLANE_TYPE_PRIMARY || + (prop != config->prop_fb_id && + prop != config->prop_in_fence_fd && + prop != config->prop_fb_damage_clips))) { ret =drm_atomic_plane_get_property (plane, plane_state, prop, &old_val); ret =drm_atomic_check_prop_changes (ret, old_val, prop_value, prop);break ; } -if (async_flip && plane_state->plane->type !=DRM_PLANE_TYPE_PRIMARY ) { -drm_dbg_atomic (prop->dev, -"[OBJECT:%d] Only primary planes can be changed during async flip\n" , - obj->id); - ret = -EINVAL ; -break ; - } - ret =drm_atomic_plane_set_property (plane, plane_state, file_priv, prop, prop_value);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 157/263 i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gaosheng Cui <[email protected]>
[ Upstream commit 9ba48db9f77ce0001dbb882476fa46e092feb695 ]
Add the missing geni_icc_disable() before return in geni_i2c_runtime_resume().
--- drivers/i2c/busses/i2c-qcom-geni.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-qcom-geni.c +1 -0
@@ -992,6 +992,7 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev) ret =geni_se_resources_on (&gi2c->se);if (ret) {clk_disable_unprepare (gi2c->core_clk); +geni_icc_disable (&gi2c->se);return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 158/263 drm/i915: Allow evicting to use the requested placement
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Gow <[email protected]>
[ Upstream commit 264b5b5980061d8c6a6a30c031cdec1179fe2bae ]
In commit a78a8da51b36 ("drm/ttm: replace busy placement with flags v6"), the old system of having a separate placement list (for placements which should be used without eviction) and a 'busy' placement list (for placements which should be attempted if eviction is required) was replaced with a new one where placements could be marked 'FALLBACK' (to be attempted if eviction is required) or 'DESIRED' (to be attempted first, but not if eviction is required).
i915 had always included the requested placement in the list of 'busy' placements: i.e., the placement could be used either if eviction is required or not. But when the new system was put in place, the requested (first) placement was marked 'DESIRED', so would never be used if eviction became necessary. While a bug in the original commit prevented this flag from working, when this was fixed in 4a0e7b3c ("drm/i915: fix applying placement flag"), it caused long hangs on DG2 systems with small BAR.
Don't mark the requested placement DESIRED (or FALLBACK), allowing it to be used in both situations. This matches the old behaviour, and resolves the hangs.
Thanks to Justin Brewer for bisecting the issue.
--- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +0 -1
@@ -165,7 +165,6 @@ i915_ttm_placement_from_obj(const struct drm_i915_gem_object *obj,i915_ttm_place_from_region (num_allowed ? obj->mm.placements[0 ] : obj->mm.region, &places[0 ], obj->bo_offset, obj->base.size, flags); - places[0 ].flags |=TTM_PL_FLAG_DESIRED ;/* Cache this on object? */ for (i =0 ; i < num_allowed; ++i) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 159/263 drm/i915: Attempt to get pages without eviction first
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Gow <[email protected]>
[ Upstream commit 787db3bb6ed5cee56fc97fecdd61517d89763f0a ]
In commit a78a8da51b36 ("drm/ttm: replace busy placement with flags v6"), __i915_ttm_get_pages was updated to use flags instead of the separate 'busy' placement list. However, the behaviour was subtly changed. Originally, the function would attempt to use the preferred placement without eviction, and give an opportunity to restart the operation before falling back to allowing eviction.
This was unintentionally changed, as the preferred placement was not given the TTM_PL_FLAG_DESIRED flag, and so eviction could be triggered in that first pass. This caused thrashing, and a significant performance regression on DG2 systems with small BAR. For example, Minecraft and Team Fortress 2 would drop to single-digit framerates.
Restore the original behaviour by marking the initial placement as desired on that first attempt. Also, rework this to use a separate struct ttm_palcement, as the individual placements are marked 'const', so hot-patching the flags is even more dodgy than before.
Thanks to Justin Brewer for bisecting this.
--- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +7 -5
@@ -778,13 +778,16 @@ static int __i915_ttm_get_pages(struct drm_i915_gem_object *obj, .interruptible = true, .no_wait_gpu = false, }; -int real_num_busy; +struct ttm_placement initial_placement; +struct ttm_place initial_place;int ret;/* First try only the requested placement. No eviction. */ - real_num_busy = placement->num_placement; - placement->num_placement =1 ; - ret =ttm_bo_validate (bo, placement, &ctx); + initial_placement.num_placement =1 ; +memcpy (&initial_place, placement->placement,sizeof (struct ttm_place )); + initial_place.flags |=TTM_PL_FLAG_DESIRED ; + initial_placement.placement = &initial_place; + ret =ttm_bo_validate (bo, &initial_placement, &ctx);if (ret) { ret =i915_ttm_err_to_gem (ret);/*
@@ -799,7 +802,6 @@ static int __i915_ttm_get_pages(struct drm_i915_gem_object *obj,* If the initial attempt fails, allow all accepted placements, * evicting if necessary. */ - placement->num_placement = real_num_busy; ret =ttm_bo_validate (bo, placement, &ctx);if (ret)return i915_ttm_err_to_gem (ret);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 160/263 drm/amd/display: Replace dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rodrigo Siqueira <[email protected]>
[ Upstream commit f2aaed194a54d78c307c44d1829c7e1ba67e9ba5 ]
In the commit c2cec7a872b6 ("drm/amd/display: Wake DMCUB before sending a command for replay feature"), replaced dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd in multiple areas, but due to merge issues the replacement of this function in the dmub_replay_copy_settings was missed. This commit replaces the old dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +1 -2
@@ -209,8 +209,7 @@ static bool dmub_replay_copy_settings(struct dmub_replay *dmub,else copy_settings_data->flags.bitfields.force_wakeup_by_tps3 =0 ; - -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 161/263 spi: spi-fsl-lpspi: Fix scldiv calculation
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit 730bbfaf7d4890bd99e637db7767dc68cfeb24e7 ]
The effective SPI clock frequency should never exceed speed_hz otherwise this might result in undefined behavior of the SPI device.
Currently the scldiv calculation could violate this constraint. For the example parameters perclk_rate = 24 MHz and speed_hz = 7 MHz, the function fsl_lpspi_set_bitrate will determine perscale = 0 and scldiv = 1, which is a effective SPI clock of 8 MHz.
So fix this by rounding up the quotient of perclk_rate and speed_hz. While this never change within the loop, we can pull this out.
--- drivers/spi/spi-fsl-lpspi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/spi/spi-fsl-lpspi.c +4 -2
@@ -296,7 +296,7 @@ static void fsl_lpspi_set_watermark(struct fsl_lpspi_data *fsl_lpspi)static int fsl_lpspi_set_bitrate (struct fsl_lpspi_data *fsl_lpspi) {struct lpspi_config config = fsl_lpspi->config; -unsigned int perclk_rate, scldiv; +unsigned int perclk_rate, scldiv, div;u8 prescale; perclk_rate =clk_get_rate (fsl_lpspi->clk_per);
@@ -313,8 +313,10 @@ static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi)return -EINVAL ; } + div =DIV_ROUND_UP (perclk_rate, config.speed_hz); +for (prescale =0 ; prescale <8 ; prescale++) { - scldiv = perclk_rate / config.speed_hz / (1 << prescale) -2 ; + scldiv = div / (1 << prescale) -2 ;if (scldiv <256 ) { fsl_lpspi->config.prescale = prescale;break ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 162/263 ALSA: usb-audio: Re-add ScratchAmp quirk entries
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 03898691d42e0170e7d00f07cbe21ce0e9f3a8fa ]
At the code refactoring of USB-audio quirk handling, I assumed that the quirk entries of Stanton ScratchAmp devices were only about the device name, and moved them completely into the rename table. But it seems that the device requires the quirk entry so that it's probed by the driver itself.
This re-adds back the quirk entries of ScratchAmp, but in a minimalistic manner.
--- sound/usb/quirks-table.h | 4 ++++ 1 file changed, 4 insertions(+)
sound/usb/quirks-table.h +4 -0
@@ -2594,6 +2594,10 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, +/* Stanton ScratchAmp */ +{ USB_DEVICE(0x103d, 0x0100) }, +{ USB_DEVICE(0x103d, 0x0101) }, +/* Novation EMS devices */ { USB_DEVICE_VENDOR_SPEC(0x1235, 0x0001),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 163/263 drm/xe/rtp: Fix off-by-one when processing rules
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lucas De Marchi <[email protected]>
[ Upstream commit ae02c7b7fea3e034fbd724c21d88406f71ccc2f8 ]
Gustavo noticed an odd "+ 2" in rtp_mark_active() while processing rtp rules and pointed that it should be "+ 1". In fact, while processing entries without actions (OOB workarounds), if the WA is activated and has OR rules, it will also inadvertently activate the very next workaround.
Test in a LNL B0 platform by moving 18024947630 on top of 16020292621, makes the latter become active:
$ cat /sys/kernel/debug/dri/0/gt0/workarounds ... OOB Workarounds 18024947630 16020292621 14018094691 16022287689 13011645652 22019338487_display
In future a kunit test will be added to cover the rtp checks for entries without actions.
--- drivers/gpu/drm/xe/xe_rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_rtp.c +1 -1
@@ -200,7 +200,7 @@ static void rtp_mark_active(struct xe_device *xe,if (first == last)bitmap_set (ctx->active_entries, first,1 );else -bitmap_set (ctx->active_entries, first, last - first +2 ); +bitmap_set (ctx->active_entries, first, last - first +1 ); }/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 164/263 drm/xe: Use dma_fence_chain_free in chain fence unused as a sync
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Brost <[email protected]>
[ Upstream commit 4f854a8b1b85d46abd5ce206936d23f87ac5e0c9 ]
A chain fence is uninitialized if not installed in a drm sync obj. Thus if xe_sync_entry_cleanup is called and sync->chain_fence is non-NULL the proper cleanup is dma_fence_chain_free rather than a dma-fence put.
--- drivers/gpu/drm/xe/xe_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_sync.c +1 -1
@@ -263,7 +263,7 @@ void xe_sync_entry_cleanup(struct xe_sync_entry *sync)if (sync->fence)dma_fence_put (sync->fence);if (sync->chain_fence) -dma_fence_put (&sync->chain_fence->base); +dma_fence_chain_free (sync->chain_fence);if (sync->ufence)user_fence_put (sync->ufence); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 165/263 drm/xe/hwmon: Fix PL1 disable flow in xe_hwmon_power_max_write
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <[email protected]>
[ Upstream commit ac3191c5cf47e2d5220a1ed7353a2e498a1f415e ]
In xe_hwmon_power_max_write, for PL1 disable supported case, instead of returning after PL1 disable, PL1 enable path was also being run. Fixed it by returning after disable.
v2: Correct typo and grammar in commit message. (Jonathan)
--- drivers/gpu/drm/xe/xe_hwmon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_hwmon.c +2 -1
@@ -200,9 +200,10 @@ static int xe_hwmon_power_max_write(struct xe_hwmon *hwmon, int channel, long va PKG_PWR_LIM_1_EN, 0, channel);if (reg_val &PKG_PWR_LIM_1_EN ) { +drm_warn (>_to_xe (hwmon->gt)->drm,"PL1 disable is not supported!\n" ); ret = -EOPNOTSUPP ; - goto unlock; } + goto unlock; }/* Computation in 64-bits to avoid overflow. Round to nearest. */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 166/263 drm/xe: Minor cleanup in LRC handling
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niranjana Vishwanathapura <[email protected]>
[ Upstream commit 85cfc412579c041f1aaebba71427acec75ceca39 ]
Properly define register fields and remove redundant lower_32_bits().
Stable-dep-of: 642dfc9d5964 ("drm/xe: Take ref to VM in delayed snapshot")
--- drivers/gpu/drm/xe/regs/xe_engine_regs.h | 4 ++-- drivers/gpu/drm/xe/xe_lrc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/regs/xe_engine_regs.h +2 -2
@@ -44,9 +44,10 @@#define GSCCS_RING_BASE 0x11a000#define RING_TAIL (base) XE_REG((base) + 0x30) +#define TAIL_ADDR REG_GENMASK(20, 3)#define RING_HEAD (base) XE_REG((base) + 0x34) -#define HEAD_ADDR 0x001FFFFC +#define HEAD_ADDR REG_GENMASK(20, 2)#define RING_START (base) XE_REG((base) + 0x38)
@@ -135,7 +136,6 @@#define RING_VALID_MASK 0x00000001#define RING_VALID 0x00000001#define STOP_RING REG_BIT(8) -#define TAIL_ADDR 0x001FFFF8#define RING_CTX_TIMESTAMP (base) XE_REG((base) + 0x3a8)#define CSBE_DEBUG_STATUS (base) XE_REG((base) + 0x3fc)
drivers/gpu/drm/xe/xe_lrc.c +1 -1
@@ -1354,7 +1354,7 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)if (!snapshot)return NULL ; - snapshot->context_desc =lower_32_bits (xe_lrc_ggtt_addr (lrc)); + snapshot->context_desc =xe_lrc_ggtt_addr (lrc); snapshot->head =xe_lrc_ring_head (lrc); snapshot->tail.internal = lrc->ring.tail; snapshot->tail.memory =xe_lrc_read_ctx_reg (lrc,CTX_RING_TAIL );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 167/263 drm/xe: Take ref to VM in delayed snapshot
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Brost <[email protected]>
[ Upstream commit 642dfc9d5964b26f66fa6c28ce2861e11f9232aa ]
Kernel BO's don't take a ref to the VM, we need the VM for the delayed snapshot, so take a ref to the VM in delayed snapshot.
v2:
- Check for lrc_bo before taking a VM ref (CI)
- Check lrc_bo->vm before taking / dropping a VM ref (CI)
- Drop VM in xe_lrc_snapshot_free
v5:
- Fix commit message wording (Johnathan)
--- drivers/gpu/drm/xe/xe_lrc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_lrc.c +14 -1
@@ -1354,6 +1354,9 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)if (!snapshot)return NULL ; +if (lrc->bo && lrc->bo->vm) +xe_vm_get (lrc->bo->vm); + snapshot->context_desc =xe_lrc_ggtt_addr (lrc); snapshot->head =xe_lrc_ring_head (lrc); snapshot->tail.internal = lrc->ring.tail;
@@ -1370,12 +1373,14 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)void xe_lrc_snapshot_capture_delayed (struct xe_lrc_snapshot *snapshot) {struct xe_bo *bo; +struct xe_vm *vm;struct iosys_map src;if (!snapshot)return ; bo = snapshot->lrc_bo; + vm = bo->vm; snapshot->lrc_bo =NULL ; snapshot->lrc_snapshot =kvmalloc (snapshot->lrc_size,GFP_KERNEL );
@@ -1395,6 +1400,8 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)dma_resv_unlock (bo->ttm.base.resv); put_bo:xe_bo_put (bo); +if (vm) +xe_vm_put (vm); }void xe_lrc_snapshot_print (struct xe_lrc_snapshot *snapshot,struct drm_printer *p)
@@ -1440,7 +1447,13 @@ void xe_lrc_snapshot_free(struct xe_lrc_snapshot *snapshot)return ;kvfree (snapshot->lrc_snapshot); -if (snapshot->lrc_bo) +if (snapshot->lrc_bo) { +struct xe_vm *vm; + + vm = snapshot->lrc_bo->vm;xe_bo_put (snapshot->lrc_bo); +if (vm) +xe_vm_put (vm); + }kfree (snapshot); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 168/263 ASoC: meson: axg-fifo: fix irq scheduling issue with PREEMPT_RT
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Brunet <[email protected]>
[ Upstream commit 5003d0ce5c7da3a02c0aff771f516f99731e7390 ]
With PREEMPT_RT enabled a spinlock_t becomes a sleeping lock.
This is usually not a problem with spinlocks used in IRQ context since IRQ handlers get threaded. However, if IRQF_ONESHOT is set, the primary handler won't be force-threaded and runs always in hardirq context. This is a problem because spinlock_t requires a preemptible context on PREEMPT_RT.
In this particular instance, regmap mmio uses spinlock_t to protect the register access and IRQF_ONESHOT is set on the IRQ. In this case, it is actually better to do everything in threaded handler and it solves the problem with PREEMPT_RT.
--- sound/soc/meson/axg-fifo.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)
sound/soc/meson/axg-fifo.c +10 -16
@@ -207,25 +207,18 @@ static irqreturn_t axg_fifo_pcm_irq_block(int irq, void *dev_id) status =FIELD_GET (STATUS1_INT_STS , status);axg_fifo_ack_irq (fifo, status); -/* Use the thread to call period elapsed on nonatomic links */ -if (status &FIFO_INT_COUNT_REPEAT ) -return IRQ_WAKE_THREAD ; +if (status & ~FIFO_INT_COUNT_REPEAT ) +dev_dbg (axg_fifo_dev (ss),"unexpected irq - STS 0x%02x\n" , + status); -dev_dbg (axg_fifo_dev (ss),"unexpected irq - STS 0x%02x\n" , - status); +if (status &FIFO_INT_COUNT_REPEAT ) { +snd_pcm_period_elapsed (ss); +return IRQ_HANDLED ; + }return IRQ_NONE ; } -static irqreturn_t axg_fifo_pcm_irq_block_thread (int irq,void *dev_id) -{ -struct snd_pcm_substream *ss = dev_id; - -snd_pcm_period_elapsed (ss); - -return IRQ_HANDLED ; -} -int axg_fifo_pcm_open (struct snd_soc_component *component,struct snd_pcm_substream *ss) {
@@ -251,8 +244,9 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,if (ret)return ret; - ret =request_threaded_irq (fifo->irq, axg_fifo_pcm_irq_block, - axg_fifo_pcm_irq_block_thread, +/* Use the threaded irq handler only with non-atomic links */ + ret =request_threaded_irq (fifo->irq,NULL , + axg_fifo_pcm_irq_block,IRQF_ONESHOT ,dev_name (dev), ss);if (ret)return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 169/263 cifs: cifs_inval_name_dfs_link_error: correct the check for fullpath
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gleb Korobeynikov <[email protected]>
[ Upstream commit 36bb22a08a69d9984a8399c07310d18b115eae20 ]
Replace the always-true check tcon->origin_fullpath with check of server->leaf_fullpath
See https://bugzilla.kernel.org/show_bug.cgi?id=219083
The check of the new @tcon will always be true during mounting, since @tcon->origin_fullpath will only be set after the tree is connected to the latest common resource, as well as checking if the prefix paths from it are fully accessible.
--- fs/smb/client/misc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
fs/smb/client/misc.c +5 -4
@@ -1288,6 +1288,7 @@ int cifs_inval_name_dfs_link_error(const unsigned int xid,const char *full_path, bool *islink) { + struct TCP_Server_Info *server = tcon->ses->server;struct cifs_ses *ses = tcon->ses;size_t len;char *path;
@@ -1304,12 +1305,12 @@ int cifs_inval_name_dfs_link_error(const unsigned int xid, !is_tcon_dfs(tcon))return 0 ; -spin_lock (&tcon->tc_lock); -if (!tcon->origin_fullpath) { -spin_unlock (&tcon->tc_lock); +spin_lock (&server->srv_lock); +if (!server->leaf_fullpath) { +spin_unlock (&server->srv_lock);return 0 ; } -spin_unlock (&tcon->tc_lock); +spin_unlock (&server->srv_lock);/* * Slow path - tcon is DFS and @full_path has prefix path, so attempt
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 170/263 module: warn about excessively long module waits
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit cb5b81bc9a448f8db817566f60f92e2ea788ea0f ]
Russell King reported that the arm cbc(aes) crypto module hangs when loaded, and Herbert Xu bisected it to commit 9b9879fc0327 ("modules:
catch concurrent module loads, treat them as idempotent"), and noted:
"So what's happening here is that the first modprobe tries to load a
fallback CBC implementation, in doing so it triggers a load of the exact same module due to module aliases.
IOW we're loading aes-arm-bs which provides cbc(aes). However, this needs a fallback of cbc(aes) to operate, which is made out of the generic cbc module + any implementation of aes, or ecb(aes). The latter happens to also be provided by aes-arm-cb so that's why it tries to load the same module again"
So loading the aes-arm-bs module ends up wanting to recursively load itself, and the recursive load then ends up waiting for the original module load to complete.
This is a regression, in that it used to be that we just tried to load the module multiple times, and then as we went on to install it the second time we would instead just error out because the module name already existed.
That is actually also exactly what the original "catch concurrent loads" patch did in commit 9828ed3f695a ("module: error out early on concurrent load of the same module file"), but it turns out that it ends up being racy, in that erroring out before the module has been fully initialized will cause failures in dependent module loading.
See commit ac2263b588df (which was the revert of that "error out early") commit for details about why erroring out before the module has been initialized is actually fundamentally racy.
Now, for the actual recursive module load (as opposed to just concurrently loading the same module twice), the race is not an issue.
At the same time it's hard for the kernel to see that this is recursion, because the module load is always done from a usermode helper, so the recursion is not some simple callchain within the kernel.
End result: this is not the real fix, but this at least adds a warning for the situation (admittedly much too late for all the debugging pain that Russell and Herbert went through) and if we can come to a resolution on how to detect the recursion properly, this re-organizes the code to make that easier.
Stable-dep-of: 2124d84db293 ("module: make waiting for a concurrent module loader interruptible")
--- kernel/module/main.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
kernel/module/main.c +20 -7
@@ -3180,15 +3180,28 @@ static int idempotent_init_module(struct file *f, const char __user * uargs, intif (!f || !(f->f_mode &FMODE_READ ))return -EBADF ; -/* See if somebody else is doing the operation? */ -if (idempotent (&idem,file_inode (f))) { -wait_for_completion (&idem.complete); -return idem.ret; +/* Are we the winners of the race and get to do this? */ +if (!idempotent (&idem,file_inode (f))) { +int ret =init_module_from_file (f, uargs, flags); +return idempotent_complete (&idem, ret); } -/* Otherwise, we'll do it and complete others */ -return idempotent_complete (&idem, -init_module_from_file (f, uargs, flags)); +/* +* Somebody else won the race and is loading the module. +* +* We have to wait for it forever, since our 'idem' is +* on the stack and the list entry stays there until +* completed (but we could fix it under the idem_lock) +* +* It's also unclear what a real timeout might be, +* but we could maybe at least make this killable +* and remove the idem entry in that case? +*/ +for (;;) { +if (wait_for_completion_timeout (&idem.complete,10 *HZ )) +return idem.ret; +pr_warn_once ("module '%pD' taking a long time to load" , f); + } } SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 171/263 module: make waiting for a concurrent module loader interruptible
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 2124d84db293ba164059077944e6b429ba530495 ]
The recursive aes-arm-bs module load situation reported by Russell King is getting fixed in the crypto layer, but this in the meantime fixes the "recursive load hangs forever" by just making the waiting for the first module load be interruptible.
This should now match the old behavior before commit 9b9879fc0327 ("modules: catch concurrent module loads, treat them as idempotent"), which used the different "wait for module to be ready" code in module_patient_check_exists().
End result: a recursive module load will still block, but now a signal will interrupt it and fail the second module load, at which point the first module will successfully complete loading.
--- kernel/module/main.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-)
kernel/module/main.c +25 -15
@@ -3101,7 +3101,7 @@ static bool idempotent(struct idempotent *u, const void *cookie)struct idempotent *existing;bool first; - u->ret =0 ; + u->ret = -EINTR ; u->cookie = cookie;init_completion (&u->complete);
@@ -3137,7 +3137,7 @@ static int idempotent_complete(struct idempotent *u, int ret)hlist_for_each_entry_safe (pos, next, head, entry) {if (pos->cookie != cookie)continue ; -hlist_del (&pos->entry); +hlist_del_init (&pos->entry); pos->ret = ret;complete (&pos->complete); }
@@ -3145,6 +3145,28 @@ static int idempotent_complete(struct idempotent *u, int ret)return ret; } +/* +* Wait for the idempotent worker. +* +* If we get interrupted, we need to remove ourselves from the +* the idempotent list, and the completion may still come in. +* +* The 'idem_lock' protects against the race, and 'idem.ret' was +* initialized to -EINTR and is thus always the right return +* value even if the idempotent work then completes between +* the wait_for_completion and the cleanup. +*/ +static int idempotent_wait_for_completion (struct idempotent *u) +{ +if (wait_for_completion_interruptible (&u->complete)) { +spin_lock (&idem_lock); +if (!hlist_unhashed (&u->entry)) +hlist_del (&u->entry); +spin_unlock (&idem_lock); + } +return u->ret; +} +static int init_module_from_file (struct file *f,const char __user * uargs,int flags) {struct load_info info = { };
@@ -3188,20 +3210,8 @@ static int idempotent_init_module(struct file *f, const char __user * uargs, int/* * Somebody else won the race and is loading the module. -* -* We have to wait for it forever, since our 'idem' is -* on the stack and the list entry stays there until -* completed (but we could fix it under the idem_lock) -* -* It's also unclear what a real timeout might be, -* but we could maybe at least make this killable -* and remove the idem entry in that case? */ -for (;;) { -if (wait_for_completion_timeout (&idem.complete,10 *HZ )) -return idem.ret; -pr_warn_once ("module '%pD' taking a long time to load" , f); - } +return idempotent_wait_for_completion (&idem); } SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 172/263 drm/i915/gem: Fix Virtual Memory mapping boundaries calculation
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andi Shyti <[email protected]>
commit 8bdd9ef7e9b1b2a73e394712b72b22055e0e26c3 upstream.
Calculating the size of the mapped area as the lesser value between the requested size and the actual size does not consider the partial mapping offset. This can cause page fault access.
Fix the calculation of the starting and ending addresses, the total size is now deduced from the difference between the end and start addresses.
Additionally, the calculations have been rewritten in a clearer and more understandable form.
Requires: 60a2066c5005 ("drm/i915/gem: Adjust vma offset for framebuffer mmap offset")
--- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 53 +++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_mman.c +47 -6
@@ -290,6 +290,41 @@ out:return i915_error_to_vmf_fault (err); } +static void set_address_limits (struct vm_area_struct *area, +struct i915_vma *vma, +unsigned long obj_offset, +unsigned long *start_vaddr, +unsigned long *end_vaddr) +{ +unsigned long vm_start, vm_end, vma_size;/* user's memory parameters */ +long start, end;/* memory boundaries */ + +/* +* Let's move into the ">> PAGE_SHIFT" +* domain to be sure not to lose bits +*/ + vm_start = area->vm_start >>PAGE_SHIFT ; + vm_end = area->vm_end >>PAGE_SHIFT ; + vma_size = vma->size >>PAGE_SHIFT ; + +/* +* Calculate the memory boundaries by considering the offset +* provided by the user during memory mapping and the offset +* provided for the partial mapping. +*/ + start = vm_start; + start -= obj_offset; + start += vma->gtt_view.partial.offset; + end = start + vma_size; + + start =max_t (long, start, vm_start); + end =min_t (long, end, vm_end); + +/* Let's move back into the "<< PAGE_SHIFT" domain */ + *start_vaddr = (unsigned long )start <<PAGE_SHIFT ; + *end_vaddr = (unsigned long )end <<PAGE_SHIFT ; +} +static vm_fault_t vm_fault_gtt (struct vm_fault *vmf) {#define MIN_CHUNK_PAGES (SZ_1M >> PAGE_SHIFT)
@@ -302,14 +337,18 @@ static vm_fault_t vm_fault_gtt(struct vmstruct i915_ggtt *ggtt =to_gt (i915)->ggtt;bool write = area->vm_flags &VM_WRITE ;struct i915_gem_ww_ctx ww; +unsigned long obj_offset; +unsigned long start, end;/* memory boundaries */ intel_wakeref_t wakeref;struct i915_vma *vma;pgoff_t page_offset; +unsigned long pfn;int srcu;int ret; -/* We don't use vmf->pgoff since that has the fake offset */ + obj_offset = area->vm_pgoff -drm_vma_node_start (&mmo->vma_node); page_offset = (vmf->address - area->vm_start) >>PAGE_SHIFT ; + page_offset += obj_offset;trace_i915_gem_object_fault (obj, page_offset, true, write);
@@ -402,12 +441,14 @@ retry:if (ret) goto err_unpin; +set_address_limits (area, vma, obj_offset, &start, &end); + + pfn = (ggtt->gmadr.start +i915_ggtt_offset (vma)) >>PAGE_SHIFT ; + pfn += (start - area->vm_start) >>PAGE_SHIFT ; + pfn += obj_offset - vma->gtt_view.partial.offset; +/* Finally, remap it using the new GTT offset */ - ret =remap_io_mapping (area, - area->vm_start + (vma->gtt_view.partial.offset <<PAGE_SHIFT ), - (ggtt->gmadr.start +i915_ggtt_offset (vma)) >>PAGE_SHIFT , -min_t (u64, vma->size, area->vm_end - area->vm_start), - &ggtt->iomap); + ret =remap_io_mapping (area, start, pfn, end - start, &ggtt->iomap);if (ret) goto err_fence;
Greg Kroah-Hartman
maintainerPATCH 173/263 drm/amd/display: Skip Recompute DSC Params if no Stream on Link
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fangzhi Zuo <[email protected]>
commit 50e376f1fe3bf571d0645ddf48ad37eb58323919 upstream.
[why]
Encounter NULL pointer dereference uner mst + dsc setup.
BUG: kernel NULL pointer dereference, address: 0000000000000008
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 4 PID: 917 Comm: sway Not tainted 6.3.9-arch1-1 #1 124dc55df4f5272ccb409f39ef4872fc2b3376a2
Hardware name: LENOVO 20NKS01Y00/20NKS01Y00, BIOS R12ET61W(1.31 ) 07/28/2022
RIP: 0010:drm_dp_atomic_find_time_slots+0x5e/0x260 [drm_display_helper]
Code: 01 00 00 48 8b 85 60 05 00 00 48 63 80 88 00 00 00 3b 43 28 0f 8d 2e 01 00 00 48 8b 53 30 48 8d 04 80 48 8d 04 c2 48 8b 40 18 <48> 8>
RSP: 0018:ffff960cc2df77d8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff8afb87e81280 RCX: 0000000000000224
RDX: ffff8afb9ee37c00 RSI: ffff8afb8da1a578 RDI: ffff8afb87e81280
RBP: ffff8afb83d67000 R08: 0000000000000001 R09: ffff8afb9652f850
R10: ffff960cc2df7908 R11: 0000000000000002 R12: 0000000000000000
R13: ffff8afb8d7688a0 R14: ffff8afb8da1a578 R15: 0000000000000224
FS: 00007f4dac35ce00(0000) GS:ffff8afe30b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000008 CR3: 000000010ddc6000 CR4: 00000000003506e0
Call Trace:
<TASK>
? __die+0x23/0x70
? page_fault_oops+0x171/0x4e0
? plist_add+0xbe/0x100
? exc_page_fault+0x7c/0x180
? asm_exc_page_fault+0x26/0x30
? drm_dp_atomic_find_time_slots+0x5e/0x260 [drm_display_helper 0e67723696438d8e02b741593dd50d80b44c2026]
? drm_dp_atomic_find_time_slots+0x28/0x260 [drm_display_helper 0e67723696438d8e02b741593dd50d80b44c2026]
compute_mst_dsc_configs_for_link+0x2ff/0xa40 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
? fill_plane_buffer_attributes+0x419/0x510 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
compute_mst_dsc_configs_for_state+0x1e1/0x250 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
amdgpu_dm_atomic_check+0xecd/0x1190 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
drm_atomic_check_only+0x5c5/0xa40
drm_mode_atomic_ioctl+0x76e/0xbc0[how]
dsc recompute should be skipped if no mode change detected on the new request. If detected, keep checking whether the stream is already on current state or not.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +3 -0
@@ -1264,6 +1264,9 @@ static bool is_dsc_need_re_compute( } } +if (new_stream_on_link_num ==0 ) +return false; +/* check current_state if there stream on link but it is not in * new request state */
Greg Kroah-Hartman
maintainerPATCH 174/263 drm/amdgpu: Forward soft recovery errors to userspace
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joshua Ashton <[email protected]>
commit 829798c789f567ef6ba4b084c15b7b5f3bd98d51 upstream.
As we discussed before[1], soft recovery should be forwarded to userspace, or we can get into a really bad state where apps will keep submitting hanging command buffers cascading us to a hard reset.
1: https://lore.kernel.org/all/[email protected]/
--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1 -2
@@ -262,9 +262,8 @@ amdgpu_job_prepare_job(struct drm_sched_struct dma_fence *fence =NULL ;int r; -/* Ignore soft recovered fences here */ r =drm_sched_entity_error (s_entity); -if (r && r != -ENODATA ) +if (r) goto error;if (!fence && job->gang_submit)
Greg Kroah-Hartman
maintainerPATCH 175/263 drm/i915/gem: Adjust vma offset for framebuffer mmap offset
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andi Shyti <[email protected]>
commit 1ac5167b3a90c9820daa64cc65e319b2d958d686 upstream.
When mapping a framebuffer object, the virtual memory area (VMA) offset ('vm_pgoff') should be adjusted by the start of the 'vma_node' associated with the object. This ensures that the VMA offset is correctly aligned with the corresponding offset within the GGTT aperture.
Increment vm_pgoff by the start of the vma_node with the offset= provided by the user.
--- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_mman.c +2 -0
@@ -1125,6 +1125,8 @@ int i915_gem_fb_mmap(struct drm_i915_gem mmo =mmap_offset_attach (obj, mmap_type,NULL );if (IS_ERR (mmo))return PTR_ERR (mmo); + + vma->vm_pgoff +=drm_vma_node_start (&mmo->vma_node); }/*
Greg Kroah-Hartman
maintainerPATCH 176/263 drm/client: fix null pointer dereference in drm_client_modeset_probe
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Ke <[email protected]>
commit 113fd6372a5bb3689aba8ef5b8a265ed1529a78f upstream.
In drm_client_modeset_probe(), the return value of drm_mode_duplicate() is assigned to modeset->mode, which will lead to a possible NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd.
--- drivers/gpu/drm/drm_client_modeset.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_client_modeset.c +5 -0
@@ -880,6 +880,11 @@ int drm_client_modeset_probe(struct drm_kfree (modeset->mode); modeset->mode =drm_mode_duplicate (dev, mode); +if (!modeset->mode) { + ret = -ENOMEM ; +break ; + } +drm_connector_get (connector); modeset->connectors[modeset->num_connectors++] = connector; modeset->x = offset->x;
Greg Kroah-Hartman
maintainerPATCH 177/263 drm/i915/display: correct dual pps handling for MTL_PCH+
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dnyaneshwar Bhadane <[email protected]>
commit 1b85bdb0fadb42f5ef75ddcd259fc1ef13ec04de upstream.
On the PCH side the second PPS was introduced in ICP+.Add condition On MTL_PCH and greater platform also having the second PPS.
Note that DG1/2 south block only has the single PPS, so need to exclude the fake DG1/2 PCHs
--- drivers/gpu/drm/i915/display/intel_backlight.c | 3 +++ drivers/gpu/drm/i915/display/intel_pps.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/gpu/drm/i915/display/intel_backlight.c +3 -0
@@ -1449,6 +1449,9 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)static int cnp_num_backlight_controllers (struct drm_i915_private *i915) { +if (INTEL_PCH_TYPE (i915) >=PCH_MTL ) +return 2 ; +if (INTEL_PCH_TYPE (i915) >=PCH_DG1 )return 1 ;
drivers/gpu/drm/i915/display/intel_pps.c +3 -0
@@ -351,6 +351,9 @@ static int intel_num_pps(struct drm_i915_private *i915)if (IS_GEMINILAKE (i915) ||IS_BROXTON (i915))return 2 ; +if (INTEL_PCH_TYPE (i915) >=PCH_MTL ) +return 2 ; +if (INTEL_PCH_TYPE (i915) >=PCH_DG1 )return 1 ;
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 178/263 drm/test: fix the gem shmem test to map the sg table.
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
commit 62b45bab010d1b0cea6166f818f1cd0666a6d8d8 upstream.
The test here creates an sg table, but never maps it, when we get to drm_gem_shmem_free, the helper tries to unmap and this causes warnings on some platforms and debug kernels.
This also sets a 64-bit dma mask, as I see an swiotlb warning if I stick with the default 32-bit one.
--- drivers/gpu/drm/tests/drm_gem_shmem_test.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/tests/drm_gem_shmem_test.c +11 -0
@@ -102,6 +102,17 @@ static void drm_gem_shmem_test_obj_creatsg_init_one (sgt->sgl, buf,TEST_SIZE ); +/* +* Set the DMA mask to 64-bits and map the sgtables +* otherwise drm_gem_shmem_free will cause a warning +* on debug kernels. +*/ + ret =dma_set_mask (drm_dev->dev,DMA_BIT_MASK (64 )); +KUNIT_ASSERT_EQ (test, ret,0 ); + + ret =dma_map_sgtable (drm_dev->dev, sgt,DMA_BIDIRECTIONAL ,0 ); +KUNIT_ASSERT_EQ (test, ret,0 ); +/* Init a mock DMA-BUF */ buf_mock.size =TEST_SIZE ; attach_mock.dmabuf = &buf_mock;
Greg Kroah-Hartman
maintainerPATCH 179/263 io_uring/net: ensure expanded bundle recv gets marked for cleanup
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit 11893e144ed75be55d99349760513ca104781fc0 upstream.
If the iovec inside the kmsg isn't already allocated AND one gets expanded beyond the fixed size, then the request may not already have been marked for cleanup. Ensure that it is.
--- io_uring/net.c | 1 + 1 file changed, 1 insertion(+)
io_uring/net.c +1 -0
@@ -1084,6 +1084,7 @@ static int io_recv_buf_select(struct io_if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) { kmsg->free_iov_nr = ret; kmsg->free_iov = arg.iovs; + req->flags |=REQ_F_NEED_CLEANUP ; } }else {void __user *buf;
Greg Kroah-Hartman
maintainerPATCH 180/263 io_uring/net: ensure expanded bundle send gets marked for cleanup
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit 70ed519ed59da3a92c3acedeb84a30e5a66051ce upstream.
If the iovec inside the kmsg isn't already allocated AND one gets expanded beyond the fixed size, then the request may not already have been marked for cleanup. Ensure that it is.
--- io_uring/net.c | 1 + 1 file changed, 1 insertion(+)
io_uring/net.c +1 -0
@@ -613,6 +613,7 @@ retry_bundle:if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) { kmsg->free_iov_nr = ret; kmsg->free_iov = arg.iovs; + req->flags |=REQ_F_NEED_CLEANUP ; } }
Greg Kroah-Hartman
maintainerPATCH 181/263 io_uring/net: dont pick multiple buffers for non-bundle send
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit 8fe8ac24adcd76b12edbfdefa078567bfff117d4 upstream.
If a send is issued marked with IOSQE_BUFFER_SELECT for selecting a buffer, unless it's a bundle, it should not select multiple buffers.
--- io_uring/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
io_uring/net.c +3 -2
@@ -591,17 +591,18 @@ retry_bundle: .iovs = &kmsg->fast_iov, .max_len = INT_MAX, .nr_iovs = 1, - .mode = KBUF_MODE_EXPAND, };if (kmsg->free_iov) { arg.nr_iovs = kmsg->free_iov_nr; arg.iovs = kmsg->free_iov; - arg.mode |=KBUF_MODE_FREE ; + arg.mode =KBUF_MODE_FREE ; }if (!(sr->flags &IORING_RECVSEND_BUNDLE )) arg.nr_iovs =1 ; +else + arg.mode |=KBUF_MODE_EXPAND ; ret =io_buffers_select (req, &arg, issue_flags);if (unlikely (ret <0 ))
Greg Kroah-Hartman
maintainerPATCH 182/263 ALSA: line6: Fix racy access to midibuf
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 15b7a03205b31bc5623378c190d22b7ff60026f1 upstream.
There can be concurrent accesses to line6 midibuf from both the URB completion callback and the rawmidi API access. This could be a cause of KMSAN warning triggered by syzkaller below (so put as reported-by here).
This patch protects the midibuf call of the former code path with a spinlock for avoiding the possible races.
--- sound/usb/line6/driver.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/usb/line6/driver.c +5 -0
@@ -286,12 +286,14 @@ static void line6_data_received(struct u {struct usb_line6 *line6 = (struct usb_line6 *)urb->context;struct midi_buffer *mb = &line6->line6midi->midibuf_in; +unsigned long flags;int done;if (urb->status == -ESHUTDOWN )return ;if (line6->properties->capabilities &LINE6_CAP_CONTROL_MIDI ) { +spin_lock_irqsave (&line6->line6midi->lock, flags); done =line6_midibuf_write (mb, urb->transfer_buffer, urb->actual_length);
@@ -300,12 +302,15 @@ static void line6_data_received(struct udev_dbg (line6->ifcdev,"%d %d buffer overflow - message skipped\n" , done, urb->actual_length); } +spin_unlock_irqrestore (&line6->line6midi->lock, flags);for (;;) { +spin_lock_irqsave (&line6->line6midi->lock, flags); done =line6_midibuf_read (mb, line6->buffer_message,LINE6_MIDI_MESSAGE_MAXLEN ,LINE6_MIDIBUF_READ_RX ); +spin_unlock_irqrestore (&line6->line6midi->lock, flags);if (done <=0 )break ;
Greg Kroah-Hartman
maintainerPATCH 183/263 ALSA: hda: Add HP MP9 G4 Retail System AMS to force connect list
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven 'Steve' Kendall <[email protected]>
commit 7e1e206b99f4b3345aeb49d94584a420b7887f1d upstream.
In recent HP UEFI firmware (likely v2.15 and above, tested on 2.27), these pins are incorrectly set for HDMI/DP audio. Tested on HP MP9 G4 Retail System AMS. Tested audio with two monitors connected via DisplayPort.
--- sound/pci/hda/patch_hdmi.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_hdmi.c +1 -0
@@ -1989,6 +1989,7 @@ static int hdmi_add_cvt(struct hda_codec }static const struct snd_pci_quirk force_connect_list[] = { +SND_PCI_QUIRK (0x103c ,0x83ef ,"HP MP9 G4 Retail System AMS" ,1 ),SND_PCI_QUIRK (0x103c ,0x870f ,"HP" ,1 ),SND_PCI_QUIRK (0x103c ,0x871a ,"HP" ,1 ),SND_PCI_QUIRK (0x103c ,0x8711 ,"HP" ,1 ),
Greg Kroah-Hartman
maintainerPATCH 184/263 ALSA: hda/realtek: Add Framework Laptop 13 (Intel Core Ultra) to quirks
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dustin L. Howett <[email protected]>
commit eb91c456f3714c336f0812dccab422ec0e72bde4 upstream.
The Framework Laptop 13 (Intel Core Ultra) has an ALC285 that ships in a similar configuration to the ALC295 in previous models. It requires the same quirk for headset detection.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10671,6 +10671,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x8086 ,0x3038 ,"Intel NUC 13" ,ALC295_FIXUP_CHROME_BOOK ),SND_PCI_QUIRK (0xf111 ,0x0001 ,"Framework Laptop" ,ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0xf111 ,0x0006 ,"Framework Laptop" ,ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0xf111 ,0x0009 ,"Framework Laptop" ,ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE ), #if 0/* Below is a quirk table taken from the old code.
Greg Kroah-Hartman
maintainerPATCH 185/263 ALSA: hda/hdmi: Yet more pin fix for HP EliteDesk 800 G4
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 176fd1511dd9086ab4fa9323cb232177c6235288 upstream.
HP EliteDesk 800 G4 (PCI SSID 103c:83e2) is another Kabylake machine where BIOS misses the HDMI pin initializations. Add the quirk entry.
--- sound/pci/hda/patch_hdmi.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_hdmi.c +1 -0
@@ -1989,6 +1989,7 @@ static int hdmi_add_cvt(struct hda_codec }static const struct snd_pci_quirk force_connect_list[] = { +SND_PCI_QUIRK (0x103c ,0x83e2 ,"HP EliteDesk 800 G4" ,1 ),SND_PCI_QUIRK (0x103c ,0x83ef ,"HP MP9 G4 Retail System AMS" ,1 ),SND_PCI_QUIRK (0x103c ,0x870f ,"HP" ,1 ),SND_PCI_QUIRK (0x103c ,0x871a ,"HP" ,1 ),
Greg Kroah-Hartman
maintainerPATCH 186/263 usb: vhci-hcd: Do not drop references before new references are gained
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit afdcfd3d6fcdeca2735ca8d994c5f2d24a368f0a upstream.
At a few places the driver carries stale pointers
to references that can still be used. Make sure that does not happen. This strictly speaking closes ZDI-CAN-22273, though there may be similar races in the driver.
--- drivers/usb/usbip/vhci_hcd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/usb/usbip/vhci_hcd.c +6 -3
@@ -745,6 +745,7 @@ static int vhci_urb_enqueue(struct usb_h* */ if (usb_pipedevice (urb->pipe) ==0 ) { +struct usb_device *old;__u8 type =usb_pipetype (urb->pipe);struct usb_ctrlrequest *ctrlreq = (struct usb_ctrlrequest *) urb->setup_packet;
@@ -755,14 +756,15 @@ static int vhci_urb_enqueue(struct usb_h goto no_need_xmit; } + old = vdev->udev;switch (ctrlreq->bRequest) {case USB_REQ_SET_ADDRESS :/* set_address may come when a device is reset */ dev_info (dev,"SetAddress Request (%d) to port %d\n" , ctrlreq->wValue, vdev->rhport); -usb_put_dev (vdev->udev); vdev->udev =usb_get_dev (urb->dev); +usb_put_dev (old);spin_lock (&vdev->ud.lock); vdev->ud.status =VDEV_ST_USED ;
@@ -781,8 +783,8 @@ static int vhci_urb_enqueue(struct usb_husbip_dbg_vhci_hc ("Not yet?:Get_Descriptor to device 0 (get max pipe size)\n" ); -usb_put_dev (vdev->udev); vdev->udev =usb_get_dev (urb->dev); +usb_put_dev (old); goto out;default :
@@ -1067,6 +1069,7 @@ static void vhci_shutdown_connection(strstatic void vhci_device_reset (struct usbip_device *ud) { struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); +struct usb_device *old = vdev->udev;unsigned long flags;spin_lock_irqsave (&ud->lock, flags);
@@ -1074,8 +1077,8 @@ static void vhci_device_reset(struct usb vdev->speed =0 ; vdev->devid =0 ; -usb_put_dev (vdev->udev); vdev->udev =NULL ; +usb_put_dev (old);if (ud->tcp_socket) {sockfd_put (ud->tcp_socket);
Greg Kroah-Hartman
maintainerPATCH 187/263 USB: serial: debug: do not echo input by default
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Marczykowski-Górecki <[email protected]>
commit 00af4f3dda1461ec90d892edc10bec6d3c50c554 upstream.
This driver is intended as a "client" end of the console connection. When connected to a host it's supposed to receive debug logs, and possibly allow to interact with whatever debug console is available there. Feeding messages back, depending on a configuration may cause log messages be executed as shell commands (which can be really bad if one is unlucky, imagine a log message like "prevented running rm -rf /home"). In case of Xen, it exposes sysrq-like debug interface, and feeding it its own logs will pretty quickly hit 'R' for "instant reboot".
Contrary to a classic serial console, the USB one cannot be configured ahead of time, as the device shows up only when target OS is up. And at the time device is opened to execute relevant ioctl, it's already too late, especially when logs start flowing shortly after device is initialized.
Avoid the issue by changing default to no echo for this type of devices.
--- drivers/usb/serial/usb_debug.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/serial/usb_debug.c +7 -0
@@ -76,6 +76,11 @@ static void usb_debug_process_read_urb(susb_serial_generic_process_read_urb (urb); } +static void usb_debug_init_termios (struct tty_struct *tty) +{ + tty->termios.c_lflag &= ~(ECHO |ECHONL ); +} +static struct usb_serial_driver debug_device = { .driver = { .owner =THIS_MODULE ,
@@ -85,6 +90,7 @@ static struct usb_serial_driver debug_de .num_ports = 1, .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, .break_ctl = usb_debug_break_ctl, + .init_termios = usb_debug_init_termios, .process_read_urb = usb_debug_process_read_urb, };
@@ -96,6 +102,7 @@ static struct usb_serial_driver dbc_devi .id_table = dbc_id_table, .num_ports = 1, .break_ctl = usb_debug_break_ctl, + .init_termios = usb_debug_init_termios, .process_read_urb = usb_debug_process_read_urb, };
Greg Kroah-Hartman
maintainerPATCH 188/263 usb: typec: fsa4480: Check if the chip is really there
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
commit e885f5f1f2b43575aa8e4e31404132d77d6663d1 upstream.
Currently, the driver will happily register the switch/mux devices, and so long as the i2c master doesn't complain, the user would never know there's something wrong.
Add a device id check (based on [1]) and return -ENODEV if the read fails or returns nonsense.
Checking the value on a Qualcomm SM6115P-based Lenovo Tab P11 tablet, the ID mentioned in the datasheet does indeed show up:
fsa4480 1-0042: Found FSA4480 v1.1 (Vendor ID = 0)
[1] https://www.onsemi.com/pdf/datasheet/fsa4480-d.pdf
--- drivers/usb/typec/mux/fsa4480.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/usb/typec/mux/fsa4480.c +14 -0
@@ -13,6 +13,10 @@#include <linux/usb/typec_dp.h> #include <linux/usb/typec_mux.h> +#define FSA4480_DEVICE_ID 0x00 +#define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6) +#define FSA4480_DEVICE_ID_VERSION_ID GENMASK(5, 3) +#define FSA4480_DEVICE_ID_REV_ID GENMASK(2, 0)#define FSA4480_SWITCH_ENABLE 0x04#define FSA4480_SWITCH_SELECT 0x05#define FSA4480_SWITCH_STATUS1 0x07
@@ -251,6 +255,7 @@ static int fsa4480_probe(struct i2c_cliestruct typec_switch_desc sw_desc = { };struct typec_mux_desc mux_desc = { };struct fsa4480 *fsa; +int val =0 ;int ret; fsa =devm_kzalloc (dev,sizeof (*fsa),GFP_KERNEL );
@@ -268,6 +273,15 @@ static int fsa4480_probe(struct i2c_clieif (IS_ERR (fsa->regmap))return dev_err_probe (dev,PTR_ERR (fsa->regmap),"failed to initialize regmap\n" ); + ret =regmap_read (fsa->regmap,FSA4480_DEVICE_ID , &val); +if (ret || !val) +return dev_err_probe (dev, -ENODEV ,"FSA4480 not found\n" ); + +dev_dbg (dev,"Found FSA4480 v%lu.%lu (Vendor ID = %lu)\n" , +FIELD_GET (FSA4480_DEVICE_ID_VERSION_ID , val), +FIELD_GET (FSA4480_DEVICE_ID_REV_ID , val), +FIELD_GET (FSA4480_DEVICE_ID_VENDOR_ID , val)); +/* Safe mode */ fsa->cur_enable =FSA4480_ENABLE_DEVICE |FSA4480_ENABLE_USB ; fsa->mode =TYPEC_STATE_SAFE ;
Greg Kroah-Hartman
maintainerPATCH 189/263 usb: gadget: core: Check for unset descriptor
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wulff <[email protected]>
commit 973a57891608a98e894db2887f278777f564de18 upstream.
Make sure the descriptor has been set before looking at maxpacket. This fixes a null pointer panic in this case.
This may happen if the gadget doesn't properly set up the endpoint for the current speed, or the gadget descriptors are malformed and the descriptor for the speed/endpoint are not found.
No current gadget driver is known to have this problem, but this may cause a hard-to-find bug during development of new gadgets.
--- drivers/usb/gadget/udc/core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/usb/gadget/udc/core.c +4 -6
@@ -118,12 +118,10 @@ int usb_ep_enable(struct usb_ep *ep) goto out;/* UDC drivers can't handle endpoints with maxpacket size 0 */ -if (usb_endpoint_maxp (ep->desc) ==0 ) { -/* -* We should log an error message here, but we can't call -* dev_err() because there's no way to find the gadget -* given only ep. -*/ +if (!ep->desc ||usb_endpoint_maxp (ep->desc) ==0 ) { +WARN_ONCE (1 ,"%s: ep%d (%s) has %s\n" , __func__, ep->address, ep->name, + (!ep->desc) ?"NULL descriptor" :"maxpacket 0" ); + ret = -EINVAL ; goto out; }
Greg Kroah-Hartman
maintainerPATCH 190/263 usb: gadget: midi2: Fix the response for FB info with block 0xff
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 228a953e61d6d608a3facc1c3a27b9fb03c99de7 upstream.
When the block number 0xff is given to Function Block Discovery message, the device should return the information of all Function Blocks, but currently the gadget driver treats it as an error.
Implement the proper behavior for the block 0xff instead.
--- drivers/usb/gadget/function/f_midi2.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/usb/gadget/function/f_midi2.c +15 -6
@@ -642,12 +642,21 @@ static void process_ump_stream_msg(strucif (format)return ;// invalid blk = (*data >>8 ) &0xff ; -if (blk >= ep->num_blks) -return ; -if (*data &UMP_STREAM_MSG_REQUEST_FB_INFO ) -reply_ump_stream_fb_info (ep, blk); -if (*data &UMP_STREAM_MSG_REQUEST_FB_NAME ) -reply_ump_stream_fb_name (ep, blk); +if (blk ==0xff ) { +/* inquiry for all blocks */ +for (blk =0 ; blk < ep->num_blks; blk++) { +if (*data &UMP_STREAM_MSG_REQUEST_FB_INFO ) +reply_ump_stream_fb_info (ep, blk); +if (*data &UMP_STREAM_MSG_REQUEST_FB_NAME ) +reply_ump_stream_fb_name (ep, blk); + } + }else if (blk < ep->num_blks) { +/* only the specified block */ +if (*data &UMP_STREAM_MSG_REQUEST_FB_INFO ) +reply_ump_stream_fb_info (ep, blk); +if (*data &UMP_STREAM_MSG_REQUEST_FB_NAME ) +reply_ump_stream_fb_name (ep, blk); + }return ; } }
Greg Kroah-Hartman
maintainerPATCH 191/263 usb: gadget: u_serial: Set start_delayed during suspend
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prashanth K <[email protected]>
commit 5a444bea37e2759549ef72bfe83d1c8712e76b3d upstream.
Upstream commit aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks") added started_delayed flag, so that new ports which are opened after USB suspend can start IO while resuming. But if the port was already opened, and gadget suspend kicks in afterwards, start_delayed will never be set. This causes resume to bail out before calling gs_start_io(). Fix this by setting start_delayed during suspend.
--- drivers/usb/gadget/function/u_serial.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/function/u_serial.c +1 -0
@@ -1441,6 +1441,7 @@ void gserial_suspend(struct gserial *gsespin_lock (&port->port_lock);spin_unlock (&serial_port_lock); port->suspended = true; + port->start_delayed = true;spin_unlock_irqrestore (&port->port_lock, flags); }EXPORT_SYMBOL_GPL (gserial_suspend);
Greg Kroah-Hartman
maintainerPATCH 192/263 usb: gadget: f_fs: restore ffs_func_disable() functionality
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tudor Ambarus <[email protected]>
commit 382b6eabb0316b7334d97afbdcf33a4e20b0ecd8 upstream.
The blamed commit made ffs_func_disable() always return -EINVAL as the method calls ffs_func_set_alt() with the ``alt`` argument being ``(unsigned)-1``, which is always greater than MAX_ALT_SETTINGS. Use the MAX_ALT_SETTINGS check just in the f->set_alt() code path, f->disable() doesn't care about the ``alt`` parameter.
Make a surgical fix, but really the f->disable() code shall be pulled out from ffs_func_set_alt(), the code will become clearer. A patch will follow.
Note that ffs_func_disable() always returning -EINVAL made pixel6 crash on USB disconnect.
--- drivers/usb/gadget/function/f_fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/function/f_fs.c +3 -3
@@ -3731,10 +3731,10 @@ static int ffs_func_set_alt(struct usb_fstruct ffs_data *ffs = func->ffs;int ret =0 , intf; -if (alt >MAX_ALT_SETTINGS ) -return -EINVAL ; -if (alt != (unsigned )-1 ) { +if (alt >MAX_ALT_SETTINGS ) +return -EINVAL ; + intf =ffs_func_revmap_intf (func, interface);if (intf <0 )return intf;
Greg Kroah-Hartman
maintainerPATCH 193/263 usb: gadget: u_audio: Check return codes from usb_ep_enable and config_ep_by_speed.
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wulff <[email protected]>
commit 76a7bfc445b8e9893c091e24ccfd4f51dfdc0a70 upstream.
These functions can fail if descriptors are malformed, or missing, for the selected USB speed.
--- drivers/usb/gadget/function/u_audio.c | 42 +++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-)
drivers/usb/gadget/function/u_audio.c +34 -8
@@ -592,16 +592,25 @@ int u_audio_start_capture(struct g_audiostruct usb_ep *ep, *ep_fback;struct uac_rtd_params *prm;struct uac_params *params = &audio_dev->params; -int req_len, i; +int req_len, i, ret; prm = &uac->c_prm;dev_dbg (dev,"start capture with rate %d\n" , prm->srate); ep = audio_dev->out_ep; -config_ep_by_speed (gadget, &audio_dev->func, ep); + ret =config_ep_by_speed (gadget, &audio_dev->func, ep); +if (ret <0 ) { +dev_err (dev,"config_ep_by_speed for out_ep failed (%d)\n" , ret); +return ret; + } + req_len = ep->maxpacket; prm->ep_enabled = true; -usb_ep_enable (ep); + ret =usb_ep_enable (ep); +if (ret <0 ) { +dev_err (dev,"usb_ep_enable failed for out_ep (%d)\n" , ret); +return ret; + }for (i =0 ; i < params->req_number; i++) {if (!prm->reqs[i]) {
@@ -629,9 +638,18 @@ int u_audio_start_capture(struct g_audioreturn 0 ;/* Setup feedback endpoint */ -config_ep_by_speed (gadget, &audio_dev->func, ep_fback); + ret =config_ep_by_speed (gadget, &audio_dev->func, ep_fback); +if (ret <0 ) { +dev_err (dev,"config_ep_by_speed in_ep_fback failed (%d)\n" , ret); +return ret;// TODO: Clean up out_ep + } + prm->fb_ep_enabled = true; -usb_ep_enable (ep_fback); + ret =usb_ep_enable (ep_fback); +if (ret <0 ) { +dev_err (dev,"usb_ep_enable failed for in_ep_fback (%d)\n" , ret); +return ret;// TODO: Clean up out_ep + } req_len = ep_fback->maxpacket; req_fback =usb_ep_alloc_request (ep_fback,GFP_ATOMIC );
@@ -687,13 +705,17 @@ int u_audio_start_playback(struct g_audistruct uac_params *params = &audio_dev->params;unsigned int factor;const struct usb_endpoint_descriptor *ep_desc; -int req_len, i; +int req_len, i, ret;unsigned int p_pktsize; prm = &uac->p_prm;dev_dbg (dev,"start playback with rate %d\n" , prm->srate); ep = audio_dev->in_ep; -config_ep_by_speed (gadget, &audio_dev->func, ep); + ret =config_ep_by_speed (gadget, &audio_dev->func, ep); +if (ret <0 ) { +dev_err (dev,"config_ep_by_speed for in_ep failed (%d)\n" , ret); +return ret; + } ep_desc = ep->desc;/*
@@ -720,7 +742,11 @@ int u_audio_start_playback(struct g_audi uac->p_residue_mil =0 ; prm->ep_enabled = true; -usb_ep_enable (ep); + ret =usb_ep_enable (ep); +if (ret <0 ) { +dev_err (dev,"usb_ep_enable failed for in_ep (%d)\n" , ret); +return ret; + }for (i =0 ; i < params->req_number; i++) {if (!prm->reqs[i]) {
Greg Kroah-Hartman
maintainerPATCH 194/263 scsi: mpi3mr: Avoid IOMMU page faults on REPORT ZONES
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
commit 1abc900ddda8ad2ef739fedf498d415655b6c3b8 upstream.
Some firmware versions of the 9600 series SAS HBA byte-swap the REPORT ZONES command reply buffer from ATA-ZAC devices by directly accessing the buffer in the host memory. This does not respect the default command DMA direction and causes IOMMU page faults on architectures with an IOMMU enforcing write-only mappings for DMA_FROM_DEVICE DMA direction (e.g. AMD hosts), leading to the device capacity to be dropped to 0:
scsi 18:0:58:0: Direct-Access-ZBC ATA WDC WSH722626AL W930 PQ: 0 ANSI: 7
scsi 18:0:58:0: Power-on or device reset occurred
sd 18:0:58:0: Attached scsi generic sg9 type 20
sd 18:0:58:0: [sdj] Host-managed zoned block device
mpi3mr 0000:c1:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0001 address=0xfec0c400 flags=0x0050] mpi3mr 0000:c1:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0001 address=0xfec0c500 flags=0x0050] sd 18:0:58:0: [sdj] REPORT ZONES start lba 0 failed
sd 18:0:58:0: [sdj] REPORT ZONES: Result: hostbyte=DID_SOFT_ERROR driverbyte=DRIVER_OK sd 18:0:58:0: [sdj] 0 4096-byte logical blocks: (0 B/0 B)
sd 18:0:58:0: [sdj] Write Protect is off
sd 18:0:58:0: [sdj] Mode Sense: 6b 00 10 08
sd 18:0:58:0: [sdj] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 18:0:58:0: [sdj] Attached SCSI disk
Avoid this issue by always mapping the buffer of REPORT ZONES commands using DMA_BIDIRECTIONAL, that is, using a read-write IOMMU mapping.
--- drivers/scsi/mpi3mr/mpi3mr_os.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_os.c +11 -0
@@ -3453,6 +3453,17 @@ static int mpi3mr_prepare_sg_scmd(struct scmd->sc_data_direction); priv->meta_sg_valid =1 ;/* To unmap meta sg DMA */ }else { +/* +* Some firmware versions byte-swap the REPORT ZONES command +* reply from ATA-ZAC devices by directly accessing in the host +* buffer. This does not respect the default command DMA +* direction and causes IOMMU page faults on some architectures +* with an IOMMU enforcing write mappings (e.g. AMD hosts). +* Avoid such issue by making the REPORT ZONES buffer mapping +* bi-directional. +*/ +if (scmd->cmnd[0 ] ==ZBC_IN && scmd->cmnd[1 ] ==ZI_REPORT_ZONES ) + scmd->sc_data_direction =DMA_BIDIRECTIONAL ; sg_scmd =scsi_sglist (scmd); sges_left =scsi_dma_map (scmd); }
Greg Kroah-Hartman
maintainerPATCH 195/263 scsi: ufs: core: Fix deadlock during RTC update
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <[email protected]>
commit 3911af778f208e5f49d43ce739332b91e26bc48e upstream.
There is a deadlock when runtime suspend waits for the flush of RTC work, and the RTC work calls ufshcd_rpm_get_sync() to wait for runtime resume.
Here is deadlock backtrace:
kworker/0:1 D 4892.876354 10 10971 4859 0x4208060 0x8 10 0 120 670730152367
ptr f0ffff80c2e40000 0 1 0x00000001 0x000000ff 0x000000ff 0x000000ff
<ffffffee5e71ddb0> __switch_to+0x1a8/0x2d4 <ffffffee5e71e604> __schedule+0x684/0xa98 <ffffffee5e71ea60> schedule+0x48/0xc8 <ffffffee5e725f78> schedule_timeout+0x48/0x170 <ffffffee5e71fb74> do_wait_for_common+0x108/0x1b0 <ffffffee5e71efe0> wait_for_completion+0x44/0x60 <ffffffee5d6de968> __flush_work+0x39c/0x424 <ffffffee5d6decc0> __cancel_work_sync+0xd8/0x208 <ffffffee5d6dee2c> cancel_delayed_work_sync+0x14/0x28 <ffffffee5e2551b8> __ufshcd_wl_suspend+0x19c/0x480 <ffffffee5e255fb8> ufshcd_wl_runtime_suspend+0x3c/0x1d4 <ffffffee5dffd80c> scsi_runtime_suspend+0x78/0xc8 <ffffffee5df93580> __rpm_callback+0x94/0x3e0 <ffffffee5df90b0c> rpm_suspend+0x2d4/0x65c <ffffffee5df91448> __pm_runtime_suspend+0x80/0x114 <ffffffee5dffd95c> scsi_runtime_idle+0x38/0x6c <ffffffee5df912f4> rpm_idle+0x264/0x338 <ffffffee5df90f14> __pm_runtime_idle+0x80/0x110 <ffffffee5e24ce44> ufshcd_rtc_work+0x128/0x1e4 <ffffffee5d6e3a40> process_one_work+0x26c/0x650 <ffffffee5d6e65c8> worker_thread+0x260/0x3d8 <ffffffee5d6edec8> kthread+0x110/0x134 <ffffffee5d616b18> ret_from_fork+0x10/0x20
Skip updating RTC if RPM state is not RPM_ACTIVE.
--- drivers/ufs/core/ufshcd-priv.h | 5 +++++ drivers/ufs/core/ufshcd.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd-priv.h +5 -0
@@ -329,6 +329,11 @@ static inline int ufshcd_rpm_get_sync(streturn pm_runtime_get_sync (&hba->ufs_device_wlun->sdev_gendev); } +static inline int ufshcd_rpm_get_if_active (struct ufs_hba *hba) +{ +return pm_runtime_get_if_active (&hba->ufs_device_wlun->sdev_gendev); +} +static inline int ufshcd_rpm_put_sync (struct ufs_hba *hba) {return pm_runtime_put_sync (&hba->ufs_device_wlun->sdev_gendev);
drivers/ufs/core/ufshcd.c +4 -1
@@ -8171,7 +8171,10 @@ static void ufshcd_update_rtc(struct ufs*/ val = ts64.tv_sec - hba->dev_info.rtc_time_baseline; -ufshcd_rpm_get_sync (hba); +/* Skip update RTC if RPM state is not RPM_ACTIVE */ +if (ufshcd_rpm_get_if_active (hba) <=0 ) +return ; + err =ufshcd_query_attr (hba,UPIU_QUERY_OPCODE_WRITE_ATTR ,QUERY_ATTR_IDN_SECONDS_PASSED ,0 ,0 , &val);ufshcd_rpm_put_sync (hba);
Greg Kroah-Hartman
maintainerPATCH 196/263 scsi: ufs: core: Do not set link to OFF state while waking up from hibernation
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
commit ac6efb12ca64156f4a94e964acdb96ee7d59630d upstream.
UFS link is just put into hibern8 state during the 'freeze' process of the hibernation. Afterwards, the system may get powered down. But that doesn't matter during wakeup. Because during wakeup from hibernation, UFS link is again put into hibern8 state by the restore kernel and then the control is handed over to the to image kernel.
So in both the places, UFS link is never turned OFF. But ufshcd_system_restore() just assumes that the link will be in OFF state and sets the link state accordingly. And this breaks hibernation wakeup:
[ 2445.371335] phy phy-1d87000.phy.3: phy_power_on was called before phy_init [ 2445.427883] ufshcd-qcom 1d84000.ufshc: Controller enable failed [ 2445.427890] ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5 [ 2445.427906] ufs_device_wlun 0:0:0:49488: ufshcd_wl_resume failed: -5 [ 2445.427918] ufs_device_wlun 0:0:0:49488: PM: dpm_run_callback(): scsi_bus_restore returns -5 [ 2445.427973] ufs_device_wlun 0:0:0:49488: PM: failed to restore async: error -5
So fix the issue by removing the code that sets the link to OFF state.
--- drivers/ufs/core/ufshcd.c | 3 --- 1 file changed, 3 deletions(-)
drivers/ufs/core/ufshcd.c +0 -3
@@ -10223,9 +10223,6 @@ int ufshcd_system_restore(struct device*/ ufshcd_readl (hba,REG_UTP_TASK_REQ_LIST_BASE_H ); -/* Resuming from hibernate, assume that link was OFF */ -ufshcd_set_link_off (hba); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 197/263 scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vamshi Gajjela <[email protected]>
commit ab9fd06cb8f0db0854291833fc40c789e43a361f upstream.
The ufshcd_add_delay_before_dme_cmd() always introduces a delay of MIN_DELAY_BEFORE_DME_CMDS_US between DME commands even when it's not required. The delay is added when the UFS host controller supplies the quirk UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS.
Fix the logic to update hba->last_dme_cmd_tstamp to ensure subsequent DME commands have the correct delay in the range of 0 to MIN_DELAY_BEFORE_DME_CMDS_US.
Update the timestamp at the end of the function to ensure it captures the latest time after any necessary delay has been applied.
--- drivers/ufs/core/ufshcd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/ufs/core/ufshcd.c +8 -3
@@ -4086,11 +4086,16 @@ static inline void ufshcd_add_delay_befo min_sleep_time_us =MIN_DELAY_BEFORE_DME_CMDS_US - delta; else - return;/* no more delay required */ + min_sleep_time_us =0 ;/* no more delay required */ } -/* allow sleep for extra 50us if needed */ -usleep_range (min_sleep_time_us, min_sleep_time_us +50 ); +if (min_sleep_time_us >0 ) { +/* allow sleep for extra 50us if needed */ +usleep_range (min_sleep_time_us, min_sleep_time_us +50 ); + } + +/* update the last_dme_cmd_tstamp */ + hba->last_dme_cmd_tstamp =ktime_get (); }/**
Greg Kroah-Hartman
maintainerPATCH 198/263 tick/broadcast: Move per CPU pointer access into the atomic section
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 6881e75237a84093d0986f56223db3724619f26e upstream.
The recent fix for making the take over of the broadcast timer more reliable retrieves a per CPU pointer in preemptible context.
This went unnoticed as compilers hoist the access into the non-preemptible region where the pointer is actually used. But of course it's valid that the compiler keeps it at the place where the code puts it which rightfully triggers:
BUG: using smp_processor_id() in preemptible [00000000] code:
caller is hotplug_cpu__broadcast_tick_pull+0x1c/0xc0Move it to the actual usage site which is in a non-preemptible region.
--- kernel/time/tick-broadcast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/time/tick-broadcast.c +2 -1
@@ -1141,7 +1141,6 @@ void tick_broadcast_switch_to_oneshot(vo#ifdef CONFIG_HOTPLUG_CPU void hotplug_cpu__broadcast_tick_pull (int deadcpu) { -struct tick_device *td =this_cpu_ptr (&tick_cpu_device);struct clock_event_device *bc;unsigned long flags;
@@ -1167,6 +1166,8 @@ void hotplug_cpu__broadcast_tick_pull(in* device to avoid the starvation. */ if (tick_check_broadcast_expired ()) { +struct tick_device *td =this_cpu_ptr (&tick_cpu_device); +cpumask_clear_cpu (smp_processor_id (), tick_broadcast_force_mask);tick_program_event (td->evtdev->next_event,1 ); }
Greg Kroah-Hartman
maintainerPATCH 199/263 media: v4l: Fix missing tabular column hint for Y14P format
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Michel Hautbois <[email protected]>
commit 914f8961879de6fadd166ebd75151a778481e09a upstream.
The original patch added two columns in the flat-table of Luma-Only Image Formats, without updating hints to latex: above it. This results in wrong column count in the output of Sphinx's latex builder.
Fix it.
--- Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst +2 -2
@@ -21,9 +21,9 @@ are often referred to as greyscale formats. .. raw:: latex - \scriptsize + \tiny -.. tabularcolumns:: |p{3.6cm}|p{3.0cm}|p{1.3cm}|p{2.6cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}| +.. tabularcolumns:: |p{3.6cm}|p{2.4cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}| .. flat-table:: Luma-Only Image Formats :header-rows: 1
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 200/263 vhost-vdpa: switch to use vmf_insert_pfn() in the fault handler
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Wang <[email protected]>
commit 0823dc64586ba5ea13a7d200a5d33e4c5fa45950 upstream.
remap_pfn_page() should not be called in the fault handler as it may change the vma->flags which may trigger lockdep warning since the vma write lock is not held. Actually there's no need to modify the vma->flags as it has been set in the mmap(). So this patch switches to use vmf_insert_pfn() instead.
Message-Id: <[email protected]>
--- drivers/vhost/vdpa.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/vhost/vdpa.c +1 -7
@@ -1483,13 +1483,7 @@ static vm_fault_t vhost_vdpa_fault(struc notify = ops->get_vq_notification (vdpa, index); - vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); -if (remap_pfn_range (vma, vmf->address &PAGE_MASK , -PFN_DOWN (notify.addr),PAGE_SIZE , - vma->vm_page_prot)) -return VM_FAULT_SIGBUS ; - -return VM_FAULT_NOPAGE ; +return vmf_insert_pfn (vma, vmf->address &PAGE_MASK ,PFN_DOWN (notify.addr)); }static const struct vm_operations_struct vhost_vdpa_vm_ops = {
Greg Kroah-Hartman
maintainerPATCH 201/263 spmi: pmic-arb: add missing newline in dev_err format strings
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Collins <[email protected]>
[ Upstream commit ffcf2eb4bfa24f7256de53a95182c3e3e23fdc6c ]
dev_err() format strings should end with '\n'. Several such format strings in the spmi-pmic-arb driver are missing it. Add newlines where needed.
--- drivers/spmi/spmi-pmic-arb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spmi/spmi-pmic-arb.c +4 -4
@@ -398,7 +398,7 @@ static int pmic_arb_fmt_read_cmd(struct spmi_pmic_arb_bus *bus, u8 opc, u8 sid, *offset = rc;if (bc >=PMIC_ARB_MAX_TRANS_BYTES ) { -dev_err (&bus->spmic->dev,"pmic-arb supports 1..%d bytes per trans, but:%zu requested" , +dev_err (&bus->spmic->dev,"pmic-arb supports 1..%d bytes per trans, but:%zu requested\n" ,PMIC_ARB_MAX_TRANS_BYTES , len);return -EINVAL ; }
@@ -477,7 +477,7 @@ static int pmic_arb_fmt_write_cmd(struct spmi_pmic_arb_bus *bus, u8 opc, *offset = rc;if (bc >=PMIC_ARB_MAX_TRANS_BYTES ) { -dev_err (&bus->spmic->dev,"pmic-arb supports 1..%d bytes per trans, but:%zu requested" , +dev_err (&bus->spmic->dev,"pmic-arb supports 1..%d bytes per trans, but:%zu requested\n" ,PMIC_ARB_MAX_TRANS_BYTES , len);return -EINVAL ; }
@@ -1702,7 +1702,7 @@ static int spmi_pmic_arb_bus_init(struct platform_device *pdev, index =of_property_match_string (node,"reg-names" ,"cnfg" );if (index <0 ) { -dev_err (dev,"cnfg reg region missing" ); +dev_err (dev,"cnfg reg region missing\n" );return -EINVAL ; }
@@ -1712,7 +1712,7 @@ static int spmi_pmic_arb_bus_init(struct platform_device *pdev, index =of_property_match_string (node,"reg-names" ,"intr" );if (index <0 ) { -dev_err (dev,"intr reg region missing" ); +dev_err (dev,"intr reg region missing\n" );return -EINVAL ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 202/263 ntp: Clamp maxerror and esterror to operating range
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Stitt <[email protected]>
[ Upstream commit 87d571d6fb77ec342a985afa8744bb9bb75b3622 ]
Using syzkaller alongside the newly reintroduced signed integer overflow sanitizer spits out this report:
UBSAN: signed-integer-overflow in ../kernel/time/ntp.c:461:16 9223372036854775807 + 500 cannot be represented in type 'long' Call Trace: handle_overflow+0x171/0x1b0 second_overflow+0x2d6/0x500 accumulate_nsecs_to_secs+0x60/0x160 timekeeping_advance+0x1fe/0x890 update_wall_time+0x10/0x30
time_maxerror is unconditionally incremented and the result is checked against NTP_PHASE_LIMIT, but the increment itself can overflow, resulting in wrap-around to negative space.
Before commit eea83d896e31 ("ntp: NTP4 user space bits update") the user supplied value was sanity checked to be in the operating range. That change removed the sanity check and relied on clamping in handle_overflow() which does not work correctly when the user supplied value is in the overflow zone of the '+ 500' operation.
The operation requires CAP_SYS_TIME and the side effect of the overflow is NTP getting out of sync.
Miroslav confirmed that the input value should be clamped to the operating range and the same applies to time_esterror. The latter is not used by the kernel, but the value still should be in the operating range as it was before the sanity check got removed.
Clamp them to the operating range.
[ tglx: Changed it to clamping and included time_esterror ]
--- kernel/time/ntp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/time/ntp.c +2 -2
@@ -727,10 +727,10 @@ static inline void process_adjtimex_modes(const struct __kernel_timex *txc, }if (txc->modes &ADJ_MAXERROR ) - time_maxerror = txc->maxerror; + time_maxerror =clamp (txc->maxerror,0 ,NTP_PHASE_LIMIT );if (txc->modes &ADJ_ESTERROR ) - time_esterror = txc->esterror; + time_esterror =clamp (txc->esterror,0 ,NTP_PHASE_LIMIT );if (txc->modes &ADJ_TIMECONST ) { time_constant = txc->constant;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 203/263 driver core: Fix uevent_show() vs driver detach race
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 15fffc6a5624b13b428bb1c6e9088e32a55eb82c upstream.
uevent_show() wants to de-reference dev->driver->name. There is no clean way for a device attribute to de-reference dev->driver unless that attribute is defined via (struct device_driver).dev_groups. Instead, the anti-pattern of taking the device_lock() in the attribute handler risks deadlocks with code paths that remove device attributes while holding the lock.
This deadlock is typically invisible to lockdep given the device_lock() is marked lockdep_set_novalidate_class(), but some subsystems allocate a local lockdep key for @dev->mutex to reveal reports of the form:
======================================================
WARNING: possible circular locking dependency detected
6.10.0-rc7+ #275 Tainted: G OE N
------------------------------------------------------
modprobe/2374 is trying to acquire lock:
ffff8c2270070de0 (kn->active#6){++++}-{0:0}, at: __kernfs_remove+0xde/0x220
but task is already holding lock:
ffff8c22016e88f8 (&cxl_root_key){+.+.}-{3:3}, at: device_release_driver_internal+0x39/0x210
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&cxl_root_key){+.+.}-{3:3}:
__mutex_lock+0x99/0xc30
uevent_show+0xac/0x130
dev_attr_show+0x18/0x40
sysfs_kf_seq_show+0xac/0xf0
seq_read_iter+0x110/0x450
vfs_read+0x25b/0x340
ksys_read+0x67/0xf0
do_syscall_64+0x75/0x190
entry_SYSCALL_64_after_hwframe+0x76/0x7e-> #0 (kn->active#6){++++}-{0:0}:
__lock_acquire+0x121a/0x1fa0
lock_acquire+0xd6/0x2e0
kernfs_drain+0x1e9/0x200
__kernfs_remove+0xde/0x220
kernfs_remove_by_name_ns+0x5e/0xa0
device_del+0x168/0x410
device_unregister+0x13/0x60
devres_release_all+0xb8/0x110
device_unbind_cleanup+0xe/0x70
device_release_driver_internal+0x1c7/0x210
driver_detach+0x47/0x90
bus_remove_driver+0x6c/0xf0
cxl_acpi_exit+0xc/0x11 [cxl_acpi]
__do_sys_delete_module.isra.0+0x181/0x260
do_syscall_64+0x75/0x190
entry_SYSCALL_64_after_hwframe+0x76/0x7eThe observation though is that driver objects are typically much longer lived than device objects. It is reasonable to perform lockless de-reference of a @driver pointer even if it is racing detach from a device. Given the infrequency of driver unregistration, use synchronize_rcu() in module_remove_driver() to close any potential races. It is potentially overkill to suffer synchronize_rcu() just to handle the rare module removal racing uevent_show() event.
Thanks to Tetsuo Handa for the debug analysis of the syzbot report [1].
--- drivers/base/core.c | 13 ++++++++----- drivers/base/module.c | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/base/core.c +8 -5
@@ -25,6 +25,7 @@#include <linux/mutex.h> #include <linux/pm_runtime.h> #include <linux/netdevice.h> +#include <linux/rcupdate.h> #include <linux/sched/signal.h> #include <linux/sched/mm.h> #include <linux/string_helpers.h>
@@ -2640,6 +2641,7 @@ static const char *dev_uevent_name(conststatic int dev_uevent (const struct kobject *kobj,struct kobj_uevent_env *env) {const struct device *dev =kobj_to_dev (kobj); +struct device_driver *driver;int retval =0 ;/* add device node properties if present */
@@ -2668,8 +2670,12 @@ static int dev_uevent(const struct kobjeif (dev->type && dev->type->name)add_uevent_var (env,"DEVTYPE=%s" , dev->type->name); -if (dev->driver) -add_uevent_var (env,"DRIVER=%s" , dev->driver->name); +/* Synchronize with module_remove_driver() */ +rcu_read_lock (); + driver =READ_ONCE (dev->driver); +if (driver) +add_uevent_var (env,"DRIVER=%s" , driver->name); +rcu_read_unlock ();/* Add common DT information about the device */ of_device_uevent (dev, env);
@@ -2739,11 +2745,8 @@ static ssize_t uevent_show(struct deviceif (!env)return -ENOMEM ; -/* Synchronize with really_probe() */ -device_lock (dev);/* let the kset specific function add its keys */ retval = kset->uevent_ops->uevent (&dev->kobj, env); -device_unlock (dev);if (retval) goto out;
drivers/base/module.c +4 -0
@@ -7,6 +7,7 @@#include <linux/errno.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/rcupdate.h> #include "base.h" static char *make_driver_name (struct device_driver *drv)
@@ -97,6 +98,9 @@ void module_remove_driver(struct device_if (!drv)return ; +/* Synchronize with dev_uevent() */ +synchronize_rcu (); +sysfs_remove_link (&drv->p->kobj,"module" );if (drv->owner)
Greg Kroah-Hartman
maintainerPATCH 204/263 arm64: dts: ti: k3-am62-verdin-dahlia: Keep CTRL_SLEEP_MOCI# regulator on
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francesco Dolcini <[email protected]>
commit 9438f970296f9c3a6dd340ae0ad01d2f056c88e6 upstream.
This reverts commit 3935fbc87ddebea5439f3ab6a78b1e83e976bf88.
CTRL_SLEEP_MOCI# is a signal that is defined for all the SoM implementing the Verdin family specification, this signal is supposed to control the power enable in the carrier board when the system is in deep sleep mode. However this is not possible with Texas Instruments AM62 SoC, IOs output buffer is disabled in deep sleep and IOs are in tri-state mode.
Given that we cannot properly control this pin, force it to be always high to minimize potential issues.
--- arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi | 22 ---------------------- arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 6 ------ 2 files changed, 28 deletions(-)
arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi +0 -22
@@ -43,15 +43,6 @@ sound-dai = <&mcasp0>; }; }; - - reg_usb_hub: regulator-usb-hub { - compatible = "regulator-fixed"; - enable-active-high; - /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */ - gpio = <&main_gpio0 31 GPIO_ACTIVE_HIGH>; - regulator-boot-on; - regulator-name = "HUB_PWR_EN"; - }; }; /* Verdin ETHs */
@@ -193,11 +184,6 @@ status = "okay"; }; -/* Do not force CTRL_SLEEP_MOCI# always enabled */ -®_force_sleep_moci { - status = "disabled"; -}; - /* Verdin SD_1 */ &sdhci1 { status = "okay";
@@ -218,15 +204,7 @@ }; &usb1 { - #address-cells = <1>; - #size-cells = <0>; status = "okay"; - - usb-hub@1 { - compatible = "usb424,2744"; - reg = <1>; - vdd-supply = <®_usb_hub>; - }; }; /* Verdin CTRL_WAKE1_MICO# */
arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi +0 -6
@@ -138,12 +138,6 @@ vin-supply = <®_1v8>; }; - /* - * By default we enable CTRL_SLEEP_MOCI#, this is required to have - * peripherals on the carrier board powered. - * If more granularity or power saving is required this can be disabled - * in the carrier board device tree files. - */ reg_force_sleep_moci: regulator-force-sleep-moci { compatible = "regulator-fixed"; enable-active-high;
Greg Kroah-Hartman
maintainerPATCH 205/263 tracefs: Fix inode allocation
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 0df2ac59bebfac221463ef57ed3554899b41d75f upstream.
The leading comment above alloc_inode_sb() is pretty explicit about it:
/*
* This must be used for allocating filesystems specific inodes to set
* up the inode reclaim context correctly.
*/
Switch tracefs over to alloc_inode_sb() to make sure inodes are properly linked.
--- fs/tracefs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/tracefs/inode.c +1 -1
@@ -42,7 +42,7 @@ static struct inode *tracefs_alloc_inodestruct tracefs_inode *ti;unsigned long flags; - ti =kmem_cache_alloc (tracefs_inode_cachep,GFP_KERNEL ); + ti =alloc_inode_sb (sb, tracefs_inode_cachep,GFP_KERNEL );if (!ti)return NULL ;
Greg Kroah-Hartman
maintainerPATCH 206/263 tracefs: Use generic inode RCU for synchronizing freeing
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
commit 0b6743bd60a56a701070b89fb80c327a44b7b3e2 upstream.
With structure layout randomization enabled for 'struct inode' we need to avoid overlapping any of the RCU-used / initialized-only-once members, e.g. i_lru or i_sb_list to not corrupt related list traversals when making use of the rcu_head.
For an unlucky structure layout of 'struct inode' we may end up with the following splat when running the ftrace selftests:
[<...>] list_del corruption, ffff888103ee2cb0->next (tracefs_inode_cache+0x0/0x4e0 [slab object]) is NULL (prev is tracefs_inode_cache+0x78/0x4e0 [slab object])
[<...>] ------------[ cut here ]------------
[<...>] kernel BUG at lib/list_debug.c:54!
[<...>] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
[<...>] CPU: 3 PID: 2550 Comm: mount Tainted: G N 6.8.12-grsec+ #122 ed2f536ca62f28b087b90e3cc906a8d25b3ddc65
[<...>] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
[<...>] RIP: 0010:[<ffffffff84656018>] __list_del_entry_valid_or_report+0x138/0x3e0
[<...>] Code: 48 b8 99 fb 65 f2 ff ff ff ff e9 03 5c d9 fc cc 48 b8 99 fb 65 f2 ff ff ff ff e9 33 5a d9 fc cc 48 b8 99 fb 65 f2 ff ff ff ff <0f> 0b 4c 89 e9 48 89 ea 48 89 ee 48 c7 c7 60 8f dd 89 31 c0 e8 2f [<...>] RSP: 0018:fffffe80416afaf0 EFLAGS: 00010283
[<...>] RAX: 0000000000000098 RBX: ffff888103ee2cb0 RCX: 0000000000000000
[<...>] RDX: ffffffff84655fe8 RSI: ffffffff89dd8b60 RDI: 0000000000000001
[<...>] RBP: ffff888103ee2cb0 R08: 0000000000000001 R09: fffffbd0082d5f25
[<...>] R10: fffffe80416af92f R11: 0000000000000001 R12: fdf99c16731d9b6d
[<...>] R13: 0000000000000000 R14: ffff88819ad4b8b8 R15: 0000000000000000
[<...>] RBX: tracefs_inode_cache+0x0/0x4e0 [slab object]
[<...>] RDX: __list_del_entry_valid_or_report+0x108/0x3e0
[<...>] RSI: __func__.47+0x4340/0x4400
[<...>] RBP: tracefs_inode_cache+0x0/0x4e0 [slab object]
[<...>] RSP: process kstack fffffe80416afaf0+0x7af0/0x8000 [mount 2550 2550]
[<...>] R09: kasan shadow of process kstack fffffe80416af928+0x7928/0x8000 [mount 2550 2550]
[<...>] R10: process kstack fffffe80416af92f+0x792f/0x8000 [mount 2550 2550]
[<...>] R14: tracefs_inode_cache+0x78/0x4e0 [slab object]
[<...>] FS: 00006dcb380c1840(0000) GS:ffff8881e0600000(0000) knlGS:0000000000000000
[<...>] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[<...>] CR2: 000076ab72b30e84 CR3: 000000000b088004 CR4: 0000000000360ef0 shadow CR4: 0000000000360ef0
[<...>] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[<...>] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[<...>] ASID: 0003
[<...>] Stack:
[<...>] ffffffff818a2315 00000000f5c856ee ffffffff896f1840 ffff888103ee2cb0 [<...>] ffff88812b6b9750 0000000079d714b6 fffffbfff1e9280b ffffffff8f49405f [<...>] 0000000000000001 0000000000000000 ffff888104457280 ffffffff8248b392 [<...>] Call Trace: [<...>] <TASK> [<...>] [<ffffffff818a2315>] ? lock_release+0x175/0x380 fffffe80416afaf0 [<...>] [<ffffffff8248b392>] list_lru_del+0x152/0x740 fffffe80416afb48 [<...>] [<ffffffff8248ba93>] list_lru_del_obj+0x113/0x280 fffffe80416afb88 [<...>] [<ffffffff8940fd19>] ? _atomic_dec_and_lock+0x119/0x200 fffffe80416afb90 [<...>] [<ffffffff8295b244>] iput_final+0x1c4/0x9a0 fffffe80416afbb8 [<...>] [<ffffffff8293a52b>] dentry_unlink_inode+0x44b/0xaa0 fffffe80416afbf8 [<...>] [<ffffffff8293fefc>] __dentry_kill+0x23c/0xf00 fffffe80416afc40 [<...>] [<ffffffff8953a85f>] ? __this_cpu_preempt_check+0x1f/0xa0 fffffe80416afc48 [<...>] [<ffffffff82949ce5>] ? shrink_dentry_list+0x1c5/0x760 fffffe80416afc70 [<...>] [<ffffffff82949b71>] ? shrink_dentry_list+0x51/0x760 fffffe80416afc78 [<...>] [<ffffffff82949da8>] shrink_dentry_list+0x288/0x760 fffffe80416afc80 [<...>] [<ffffffff8294ae75>] shrink_dcache_sb+0x155/0x420 fffffe80416afcc8 [<...>] [<ffffffff8953a7c3>] ? debug_smp_processor_id+0x23/0xa0 fffffe80416afce0 [<...>] [<ffffffff8294ad20>] ? do_one_tree+0x140/0x140 fffffe80416afcf8 [<...>] [<ffffffff82997349>] ? do_remount+0x329/0xa00 fffffe80416afd18 [<...>] [<ffffffff83ebf7a1>] ? security_sb_remount+0x81/0x1c0 fffffe80416afd38 [<...>] [<ffffffff82892096>] reconfigure_super+0x856/0x14e0 fffffe80416afd70 [<...>] [<ffffffff815d1327>] ? ns_capable_common+0xe7/0x2a0 fffffe80416afd90 [<...>] [<ffffffff82997436>] do_remount+0x416/0xa00 fffffe80416afdd0 [<...>] [<ffffffff829b2ba4>] path_mount+0x5c4/0x900 fffffe80416afe28 [<...>] [<ffffffff829b25e0>] ? finish_automount+0x13a0/0x13a0 fffffe80416afe60 [<...>] [<ffffffff82903812>] ? user_path_at_empty+0xb2/0x140 fffffe80416afe88 [<...>] [<ffffffff829b2ff5>] do_mount+0x115/0x1c0 fffffe80416afeb8 [<...>] [<ffffffff829b2ee0>] ? path_mount+0x900/0x900 fffffe80416afed8 [<...>] [<ffffffff8272461c>] ? __kasan_check_write+0x1c/0xa0 fffffe80416afee0 [<...>] [<ffffffff829b31cf>] __do_sys_mount+0x12f/0x280 fffffe80416aff30 [<...>] [<ffffffff829b36cd>] __x64_sys_mount+0xcd/0x2e0 fffffe80416aff70 [<...>] [<ffffffff819f8818>] ? syscall_trace_enter+0x218/0x380 fffffe80416aff88 [<...>] [<ffffffff8111655e>] x64_sys_call+0x5d5e/0x6720 fffffe80416affa8 [<...>] [<ffffffff8952756d>] do_syscall_64+0xcd/0x3c0 fffffe80416affb8 [<...>] [<ffffffff8100119b>] entry_SYSCALL_64_safe_stack+0x4c/0x87 fffffe80416affe8 [<...>] </TASK> [<...>] <PTREGS>
[<...>] RIP: 0033:[<00006dcb382ff66a>] vm_area_struct[mount 2550 2550 file 6dcb38225000-6dcb3837e000 22 55(read|exec|mayread|mayexec)]+0x0/0xb8 [userland map]
[<...>] Code: 48 8b 0d 29 18 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f6 17 0d 00 f7 d8 64 89 01 48 [<...>] RSP: 002b:0000763d68192558 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
[<...>] RAX: ffffffffffffffda RBX: 00006dcb38433264 RCX: 00006dcb382ff66a
[<...>] RDX: 000017c3e0d11210 RSI: 000017c3e0d1a5a0 RDI: 000017c3e0d1ae70
[<...>] RBP: 000017c3e0d10fb0 R08: 000017c3e0d11260 R09: 00006dcb383d1be0
[<...>] R10: 000000000020002e R11: 0000000000000246 R12: 0000000000000000
[<...>] R13: 000017c3e0d1ae70 R14: 000017c3e0d11210 R15: 000017c3e0d10fb0
[<...>] RBX: vm_area_struct[mount 2550 2550 file 6dcb38433000-6dcb38434000 5b 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map]
[<...>] RCX: vm_area_struct[mount 2550 2550 file 6dcb38225000-6dcb3837e000 22 55(read|exec|mayread|mayexec)]+0x0/0xb8 [userland map]
[<...>] RDX: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] RSI: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] RDI: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] RBP: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] RSP: vm_area_struct[mount 2550 2550 anon 763d68173000-763d68195000 7ffffffdd 100133(read|write|mayread|maywrite|growsdown|account)]+0x0/0xb8 [userland map] [<...>] R08: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] R09: vm_area_struct[mount 2550 2550 file 6dcb383d1000-6dcb383d3000 1cd 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] R13: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] R14: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map] [<...>] R15: vm_area_struct[mount 2550 2550 anon 17c3e0d0f000-17c3e0d31000 17c3e0d0f 100033(read|write|mayread|maywrite|account)]+0x0/0xb8 [userland map]
[<...>] </PTREGS>
[<...>] Modules linked in:
[<...>] ---[ end trace 0000000000000000 ]---
The list debug message as well as RBX's symbolic value point out that the object in question was allocated from 'tracefs_inode_cache' and that the list's '->next' member is at offset 0. Dumping the layout of the relevant parts of 'struct tracefs_inode' gives the following:
struct tracefs_inode {
union {
struct inode {
struct list_head {
struct list_head * next; /* 0 8 */
struct list_head * prev; /* 8 8 */
} i_lru;
[...]
} vfs_inode;
struct callback_head {
void (*func)(struct callback_head *); /* 0 8 */
struct callback_head * next; /* 8 8 */
} rcu;
};
[...]
};Above shows that 'vfs_inode.i_lru' overlaps with 'rcu' which will destroy the 'i_lru' list as soon as the 'rcu' member gets used, e.g. in call_rcu() or later when calling the RCU callback. This will disturb concurrent list traversals as well as object reuse which assumes these list heads will keep their integrity.
For reproduction, the following diff manually overlays 'i_lru' with 'rcu' as, otherwise, one would require some good portion of luck for gambling an unlucky RANDSTRUCT seed:
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -629,6 +629,7 @@ struct inode {
umode_t i_mode;
unsigned short i_opflags;
kuid_t i_uid;
+ struct list_head i_lru; /* inode LRU list */
kgid_t i_gid;
unsigned int i_flags;
@@ -690,7 +691,6 @@ struct inode {
u16 i_wb_frn_avg_time;
u16 i_wb_frn_history;
#endif
- struct list_head i_lru; /* inode LRU list */
struct list_head i_sb_list;
struct list_head i_wb_list; /* backing dev writeback list */
union {The tracefs inode does not need to supply its own RCU delayed destruction of its inode. The inode code itself offers both a "destroy_inode()" callback that gets called when the last reference of the inode is released, and the "free_inode()" which is called after a RCU synchronization period from the "destroy_inode()".
The tracefs code can unlink the inode from its list in the destroy_inode() callback, and the simply free it from the free_inode() callback. This should provide the same protection.
--- fs/tracefs/inode.c | 10 ++++------ fs/tracefs/internal.h | 5 +---- include/linux/fs.h | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-)
fs/tracefs/inode.c +4 -6
@@ -53,15 +53,14 @@ static struct inode *tracefs_alloc_inodereturn &ti->vfs_inode; } -static void tracefs_free_inode_rcu (struct rcu_head *rcu) +static void tracefs_free_inode (struct inode *inode) { -struct tracefs_inode *ti; +struct tracefs_inode *ti =get_tracefs (inode); - ti = container_of(rcu, struct tracefs_inode, rcu);kmem_cache_free (tracefs_inode_cachep, ti); } -static void tracefs_free_inode (struct inode *inode) +static void tracefs_destroy_inode (struct inode *inode) {struct tracefs_inode *ti =get_tracefs (inode);unsigned long flags;
@@ -69,8 +68,6 @@ static void tracefs_free_inode(struct inspin_lock_irqsave (&tracefs_inode_lock, flags);list_del_rcu (&ti->list);spin_unlock_irqrestore (&tracefs_inode_lock, flags); - -call_rcu (&ti->rcu, tracefs_free_inode_rcu); } static ssize_t default_read_file(struct file *file, char __user *buf,
@@ -445,6 +442,7 @@ static int tracefs_drop_inode(struct inostatic const struct super_operations tracefs_super_operations = { .alloc_inode = tracefs_alloc_inode, .free_inode = tracefs_free_inode, + .destroy_inode = tracefs_destroy_inode, .drop_inode = tracefs_drop_inode, .statfs = simple_statfs, .show_options = tracefs_show_options,
fs/tracefs/internal.h +1 -4
@@ -10,10 +10,7 @@ enum { };struct tracefs_inode { -union { -struct inode vfs_inode; -struct rcu_head rcu; - }; +struct inode vfs_inode;/* The below gets initialized with memset_after(ti, 0, vfs_inode) */ struct list_head list;unsigned long flags;
include/linux/fs.h +1 -1
@@ -629,6 +629,7 @@ struct inode {umode_t i_mode;unsigned short i_opflags;kuid_t i_uid; +struct list_head i_lru;/* inode LRU list */ kgid_t i_gid;unsigned int i_flags;
@@ -690,7 +691,6 @@ struct inode {u16 i_wb_frn_avg_time;u16 i_wb_frn_history;#endif -struct list_head i_lru;/* inode LRU list */ struct list_head i_sb_list;struct list_head i_wb_list;/* backing dev writeback list */ union {
Greg Kroah-Hartman
maintainerPATCH 207/263 ntp: Safeguard against time_constant overflow
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Stitt <[email protected]>
commit 06c03c8edce333b9ad9c6b207d93d3a5ae7c10c0 upstream.
Using syzkaller with the recently reintroduced signed integer overflow sanitizer produces this UBSAN report:
UBSAN: signed-integer-overflow in ../kernel/time/ntp.c:738:18 9223372036854775806 + 4 cannot be represented in type 'long' Call Trace: handle_overflow+0x171/0x1b0 __do_adjtimex+0x1236/0x1440 do_adjtimex+0x2be/0x740
The user supplied time_constant value is incremented by four and then clamped to the operating range.
Before commit eea83d896e31 ("ntp: NTP4 user space bits update") the user supplied value was sanity checked to be in the operating range. That change removed the sanity check and relied on clamping after incrementing which does not work correctly when the user supplied value is in the overflow zone of the '+ 4' operation.
The operation requires CAP_SYS_TIME and the side effect of the overflow is NTP getting out of sync.
Similar to the fixups for time_maxerror and time_esterror, clamp the user space supplied value to the operating range.
[ tglx: Switch to clamping ]
--- kernel/time/ntp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/time/ntp.c +2 -3
@@ -733,11 +733,10 @@ static inline void process_adjtimex_mode time_esterror =clamp (txc->esterror,0 ,NTP_PHASE_LIMIT );if (txc->modes &ADJ_TIMECONST ) { - time_constant = txc->constant; + time_constant =clamp (txc->constant,0 ,MAXTC );if (!(time_status &STA_NANO )) time_constant +=4 ; - time_constant =min (time_constant, (long )MAXTC ); - time_constant =max (time_constant,0l ); + time_constant =clamp (time_constant,0 ,MAXTC ); } if (txc->modes & ADJ_TAI &&
Greg Kroah-Hartman
maintainerPATCH 208/263 timekeeping: Fix bogus clock_was_set() invocation in do_adjtimex()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 5916be8a53de6401871bdd953f6c60237b47d6d3 upstream.
The addition of the bases argument to clock_was_set() fixed up all call sites correctly except for do_adjtimex(). This uses CLOCK_REALTIME instead of CLOCK_SET_WALL as argument. CLOCK_REALTIME is 0.
As a result the effect of that clock_was_set() notification is incomplete and might result in timers expiring late because the hrtimer code does not re-evaluate the affected clock bases.
Use CLOCK_SET_WALL instead of CLOCK_REALTIME to tell the hrtimers code which clock bases need to be re-evaluated.
--- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/timekeeping.c +1 -1
@@ -2479,7 +2479,7 @@ int do_adjtimex(struct __kernel_timex *t clock_set |=timekeeping_advance (TK_ADV_FREQ );if (clock_set) -clock_was_set (CLOCK_REALTIME ); +clock_was_set (CLOCK_SET_WALL );ntp_notify_cmos_timer ();
Greg Kroah-Hartman
maintainerPATCH 209/263 serial: core: check uartclk for zero to avoid divide by zero
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: George Kennedy <[email protected]>
commit 6eabce6608d6f3440f4c03aa3d3ef50a47a3d193 upstream.
Calling ioctl TIOCSSERIAL with an invalid baud_base can result in uartclk being zero, which will result in a divide by zero error in uart_get_divisor(). The check for uartclk being zero in uart_set_info() needs to be done before other settings are made as subsequent calls to ioctl TIOCSSERIAL for the same port would be impacted if the uartclk check was done where uartclk gets set.
Oops: divide error: 0000 PREEMPT SMP KASAN PTI
RIP: 0010:uart_get_divisor (drivers/tty/serial/serial_core.c:580)
Call Trace:
<TASK>
serial8250_get_divisor (drivers/tty/serial/8250/8250_port.c:2576
drivers/tty/serial/8250/8250_port.c:2589)
serial8250_do_set_termios (drivers/tty/serial/8250/8250_port.c:502
drivers/tty/serial/8250/8250_port.c:2741)
serial8250_set_termios (drivers/tty/serial/8250/8250_port.c:2862)
uart_change_line_settings (./include/linux/spinlock.h:376
./include/linux/serial_core.h:608 drivers/tty/serial/serial_core.c:222)uart_port_startup (drivers/tty/serial/serial_core.c:342) uart_startup (drivers/tty/serial/serial_core.c:368) uart_set_info (drivers/tty/serial/serial_core.c:1034) uart_set_info_user (drivers/tty/serial/serial_core.c:1059) tty_set_serial (drivers/tty/tty_io.c:2637)
tty_ioctl (drivers/tty/tty_io.c:2647 drivers/tty/tty_io.c:2791)
__x64_sys_ioctl (fs/ioctl.c:52 fs/ioctl.c:907
fs/ioctl.c:893 fs/ioctl.c:893)
do_syscall_64 (arch/x86/entry/common.c:52
(discriminator 1) arch/x86/entry/common.c:83 (discriminator 1))entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
Rule: add
--- drivers/tty/serial/serial_core.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/tty/serial/serial_core.c +8 -0
@@ -881,6 +881,14 @@ static int uart_set_info(struct tty_stru new_flags = (__force upf_t )new_info->flags; old_custom_divisor = uport->custom_divisor; +if (!(uport->flags &UPF_FIXED_PORT )) { +unsigned int uartclk = new_info->baud_base *16 ; +/* check needs to be done here before other settings made */ +if (uartclk ==0 ) { + retval = -EINVAL ; + goto exit; + } + }if (!capable (CAP_SYS_ADMIN )) { retval = -EPERM ; if (change_irq || change_port ||
Greg Kroah-Hartman
maintainerPATCH 210/263 serial: sc16is7xx: fix TX fifo corruption
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
commit 133f4c00b8b2bfcacead9b81e7e8edfceb4b06c4 upstream.
Sometimes, when a packet is received on channel A at almost the same time as a packet is about to be transmitted on channel B, we observe with a logic analyzer that the received packet on channel A is transmitted on channel B. In other words, the Tx buffer data on channel B is corrupted with data from channel A.
The problem appeared since commit 4409df5866b7 ("serial: sc16is7xx: change EFR lock to operate on each channels"), which changed the EFR locking to operate on each channel instead of chip-wise.
This commit has introduced a regression, because the EFR lock is used not only to protect the EFR registers access, but also, in a very obscure and undocumented way, to protect access to the data buffer, which is shared by the Tx and Rx handlers, but also by each channel of the IC.
Fix this regression first by switching to kfifo_out_linear_ptr() in sc16is7xx_handle_tx() to eliminate the need for a shared Rx/Tx buffer.
Secondly, replace the chip-wise Rx buffer with a separate Rx buffer for each channel.
--- drivers/tty/serial/sc16is7xx.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/tty/serial/sc16is7xx.c +11 -10
@@ -326,6 +326,7 @@ struct sc16is7xx_one {struct kthread_work reg_work;struct kthread_delayed_work ms_work;struct sc16is7xx_one_config config; +unsigned char buf[SC16IS7XX_FIFO_SIZE ];/* Rx buffer. */ unsigned int old_mctrl;u8 old_lcr;/* Value before EFR access. */ bool irda_mode;
@@ -339,7 +340,6 @@ struct sc16is7xx_port {unsigned long gpio_valid_mask;#endif u8 mctrl_mask; -unsigned char buf[SC16IS7XX_FIFO_SIZE ];struct kthread_worker kworker;struct task_struct *kworker_task;struct sc16is7xx_one p[];
@@ -611,18 +611,18 @@ static int sc16is7xx_set_baud(struct uarstatic void sc16is7xx_handle_rx (struct uart_port *port,unsigned int rxlen,unsigned int iir) { -struct sc16is7xx_port *s =dev_get_drvdata (port->dev); +struct sc16is7xx_one *one =to_sc16is7xx_one (port, port);unsigned int lsr =0 , bytes_read, i;bool read_lsr = (iir ==SC16IS7XX_IIR_RLSE_SRC ) ? true : false;u8 ch, flag; -if (unlikely (rxlen >=sizeof (s->buf))) { +if (unlikely (rxlen >=sizeof (one->buf))) {dev_warn_ratelimited (port->dev,"ttySC%i: Possible RX FIFO overrun: %d\n" , port->line, rxlen); port->icount.buf_overrun++;/* Ensure sanity of RX level */ - rxlen =sizeof (s->buf); + rxlen =sizeof (one->buf); }while (rxlen) {
@@ -635,10 +635,10 @@ static void sc16is7xx_handle_rx(struct u lsr =0 ;if (read_lsr) { - s->buf[0 ] =sc16is7xx_port_read (port,SC16IS7XX_RHR_REG ); + one->buf[0 ] =sc16is7xx_port_read (port,SC16IS7XX_RHR_REG ); bytes_read =1 ; }else { -sc16is7xx_fifo_read (port, s->buf, rxlen); +sc16is7xx_fifo_read (port, one->buf, rxlen); bytes_read = rxlen; }
@@ -671,7 +671,7 @@ static void sc16is7xx_handle_rx(struct u }for (i =0 ; i < bytes_read; ++i) { - ch = s->buf[i]; + ch = one->buf[i];if (uart_handle_sysrq_char (port, ch))continue ;
@@ -689,10 +689,10 @@ static void sc16is7xx_handle_rx(struct ustatic void sc16is7xx_handle_tx (struct uart_port *port) { -struct sc16is7xx_port *s =dev_get_drvdata (port->dev);struct tty_port *tport = &port->state->port;unsigned long flags;unsigned int txlen; +unsigned char *tail;if (unlikely (port->x_char)) {sc16is7xx_port_write (port,SC16IS7XX_THR_REG , port->x_char);
@@ -717,8 +717,9 @@ static void sc16is7xx_handle_tx(struct u txlen =0 ; } - txlen =uart_fifo_out (port, s->buf, txlen); -sc16is7xx_fifo_write (port, s->buf, txlen); + txlen =kfifo_out_linear_ptr (&tport->xmit_fifo, &tail, txlen); +sc16is7xx_fifo_write (port, tail, txlen); +uart_xmit_advance (port, txlen);uart_port_lock_irqsave (port, &flags);if (kfifo_len (&tport->xmit_fifo) <WAKEUP_CHARS )
Greg Kroah-Hartman
maintainerPATCH 211/263 serial: sc16is7xx: fix invalid FIFO access with special register set
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
commit 7d3b793faaab1305994ce568b59d61927235f57b upstream.
When enabling access to the special register set, Receiver time-out and RHR interrupts can happen. In this case, the IRQ handler will try to read from the FIFO thru the RHR register at address 0x00, but address 0x00 is mapped to DLL register, resulting in erroneous FIFO reading.
Call graph example:
sc16is7xx_startup(): entry
sc16is7xx_ms_proc(): entry
sc16is7xx_set_termios(): entry
sc16is7xx_set_baud(): DLH/DLL = $009C --> access special register set
sc16is7xx_port_irq() entry --> IIR is 0x0C
sc16is7xx_handle_rx() entry
sc16is7xx_fifo_read(): --> unable to access FIFO (RHR) because it is
mapped to DLL (LCR=LCR_CONF_MODE_A)
sc16is7xx_set_baud(): exit --> Restore access to general register setFix the problem by claiming the efr_lock mutex when accessing the Special register set.
--- drivers/tty/serial/sc16is7xx.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/sc16is7xx.c +4 -0
@@ -591,6 +591,8 @@ static int sc16is7xx_set_baud(struct uarSC16IS7XX_MCR_CLKSEL_BIT , prescaler == 1 ? 0 : SC16IS7XX_MCR_CLKSEL_BIT); +mutex_lock (&one->efr_lock); +/* Backup LCR and access special register set (DLL/DLH) */ lcr =sc16is7xx_port_read (port,SC16IS7XX_LCR_REG ); sc16is7xx_port_write(port, SC16IS7XX_LCR_REG,
@@ -605,6 +607,8 @@ static int sc16is7xx_set_baud(struct uar/* Restore LCR and access to general register set */ sc16is7xx_port_write (port,SC16IS7XX_LCR_REG , lcr); +mutex_unlock (&one->efr_lock); +return DIV_ROUND_CLOSEST ((clk / prescaler) /16 , div); }
Greg Kroah-Hartman
maintainerPATCH 212/263 tty: vt: conmakehash: cope with abs_srctree no longer in env
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Krummenacher <[email protected]>
commit 6e20753da6bc651e02378a0cdb78f16c42098c88 upstream.
conmakehash uses getenv("abs_srctree") from the environment to strip the absolute path from the generated sources.
However since commit e2bad142bb3d ("kbuild: unexport abs_srctree and abs_objtree") this environment variable no longer gets set. Instead use basename() to indicate the used file in a comment of the generated source file.
--- drivers/tty/vt/conmakehash.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/tty/vt/conmakehash.c +7 -13
@@ -11,6 +11,8 @@* Copyright (C) 1995-1997 H. Peter Anvin */ +#include <libgen.h> +#include <linux/limits.h> #include <stdio.h> #include <stdlib.h> #include <sysexits.h>
@@ -76,8 +78,8 @@ static void addpair(int fp, int un)int main (int argc,char *argv[]) {FILE *ctbl; -const char *tblname, *rel_tblname; -const char *abs_srctree; +const char *tblname; +char base_tblname[PATH_MAX ];char buffer[65536 ];int fontlen;int i, nuni, nent;
@@ -102,16 +104,6 @@ int main(int argc, char *argv[]) } } - abs_srctree =getenv ("abs_srctree" ); -if (abs_srctree && !strncmp (abs_srctree, tblname,strlen (abs_srctree))) - { - rel_tblname = tblname +strlen (abs_srctree); -while (*rel_tblname =='/' ) - ++rel_tblname; - } -else - rel_tblname = tblname; -/* For now we assume the default font is always 256 characters. */ fontlen =256 ;
@@ -253,6 +245,8 @@ int main(int argc, char *argv[])for ( i =0 ; i < fontlen ; i++ ) nuni += unicount[i]; +strncpy (base_tblname, tblname,PATH_MAX ); + base_tblname[PATH_MAX -1 ] =0 ; printf("\ /*\n\ * Do not edit this file; it was automatically generated by\n\
@@ -264,7 +258,7 @@ int main(int argc, char *argv[]) #include <linux/types.h>\n\ \n\ u8 dfont_unicount[%d] = \n\ -{\n\t", rel_tblname, fontlen); +{\n\t", basename(base_tblname), fontlen); for ( i = 0 ; i < fontlen ; i++ ) {
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 213/263 memcg: protect concurrent access to mem_cgroup_idr
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <[email protected]>
commit 9972605a238339b85bd16b084eed5f18414d22db upstream.
Commit 73f576c04b94 ("mm: memcontrol: fix cgroup creation failure after many small jobs") decoupled the memcg IDs from the CSS ID space to fix the cgroup creation failures. It introduced IDR to maintain the memcg ID space. The IDR depends on external synchronization mechanisms for modifications. For the mem_cgroup_idr, the idr_alloc() and idr_replace() happen within css callback and thus are protected through cgroup_mutex from concurrent modifications. However idr_remove() for mem_cgroup_idr was not protected against concurrency and can be run concurrently for different memcgs when they hit their refcnt to zero. Fix that.
We have been seeing list_lru based kernel crashes at a low frequency in our fleet for a long time. These crashes were in different part of list_lru code including list_lru_add(), list_lru_del() and reparenting code. Upon further inspection, it looked like for a given object (dentry and inode), the super_block's list_lru didn't have list_lru_one for the memcg of that object. The initial suspicions were either the object is not allocated through kmem_cache_alloc_lru() or somehow memcg_list_lru_alloc() failed to allocate list_lru_one() for a memcg but returned success. No evidence were found for these cases.
Looking more deeply, we started seeing situations where valid memcg's id is not present in mem_cgroup_idr and in some cases multiple valid memcgs have same id and mem_cgroup_idr is pointing to one of them. So, the most reasonable explanation is that these situations can happen due to race between multiple idr_remove() calls or race between idr_alloc()/idr_replace() and idr_remove(). These races are causing multiple memcgs to acquire the same ID and then offlining of one of them would cleanup list_lrus on the system for all of them. Later access from other memcgs to the list_lru cause crashes due to missing list_lru_one.
--- mm/memcontrol.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
mm/memcontrol.c +20 -2
@@ -5568,11 +5568,28 @@ static struct cftype mem_cgroup_legacy_f#define MEM_CGROUP_ID_MAX ((1UL << MEM_CGROUP_ID_SHIFT) - 1)static DEFINE_IDR (mem_cgroup_idr); +static DEFINE_SPINLOCK (memcg_idr_lock); + +static int mem_cgroup_alloc_id (void ) +{ +int ret; + +idr_preload (GFP_KERNEL ); +spin_lock (&memcg_idr_lock); + ret =idr_alloc (&mem_cgroup_idr,NULL ,1 ,MEM_CGROUP_ID_MAX +1 , +GFP_NOWAIT ); +spin_unlock (&memcg_idr_lock); +idr_preload_end (); +return ret; +}static void mem_cgroup_id_remove (struct mem_cgroup *memcg) {if (memcg->id.id >0 ) { +spin_lock (&memcg_idr_lock);idr_remove (&mem_cgroup_idr, memcg->id.id); +spin_unlock (&memcg_idr_lock); + memcg->id.id =0 ; } }
@@ -5706,8 +5723,7 @@ static struct mem_cgroup *mem_cgroup_allif (!memcg)return ERR_PTR (error); - memcg->id.id =idr_alloc (&mem_cgroup_idr,NULL , -1 ,MEM_CGROUP_ID_MAX +1 ,GFP_KERNEL ); + memcg->id.id =mem_cgroup_alloc_id ();if (memcg->id.id <0 ) { error = memcg->id.id; goto fail;
@@ -5854,7 +5870,9 @@ static int mem_cgroup_css_online(struct* publish it here at the end of onlining. This matches the * regular ID destruction during offlining. */ +spin_lock (&memcg_idr_lock);idr_replace (&mem_cgroup_idr, memcg, memcg->id.id); +spin_unlock (&memcg_idr_lock);return 0 ; offline_kmem:
Greg Kroah-Hartman
maintainerPATCH 214/263 parisc: fix unaligned accesses in BPF
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 1fd2c10acb7b35d72101a4619ee5b2cddb9efd3a upstream.
There were spurious unaligned access warnings when calling BPF code. Sometimes, the warnings were triggered with any incoming packet, making the machine hard to use.
The reason for the warnings is this: on parisc64, pointers to functions are not really pointers to functions, they are pointers to 16-byte descriptor. The first 8 bytes of the descriptor is a pointer to the function and the next 8 bytes of the descriptor is the content of the "dp" register. This descriptor is generated in the function bpf_jit_build_prologue.
The problem is that the function bpf_int_jit_compile advertises 4-byte alignment when calling bpf_jit_binary_alloc, bpf_jit_binary_alloc randomizes the returned array and if the array happens to be not aligned on 8-byte boundary, the descriptor generated in bpf_jit_build_prologue is also not aligned and this triggers the unaligned access warning.
Fix this by advertising 8-byte alignment on parisc64 when calling bpf_jit_binary_alloc.
--- arch/parisc/net/bpf_jit_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/net/bpf_jit_core.c +1 -1
@@ -114,7 +114,7 @@ struct bpf_prog *bpf_int_jit_compile(str jit_data->header =bpf_jit_binary_alloc (prog_size + extable_size, &jit_data->image, -sizeof (u32), +sizeof (long ), bpf_fill_ill_insns);if (!jit_data->header) { prog = orig_prog;
Greg Kroah-Hartman
maintainerPATCH 215/263 parisc: fix a possible DMA corruption
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 7ae04ba36b381bffe2471eff3a93edced843240f upstream.
ARCH_DMA_MINALIGN was defined as 16 - this is too small - it may be possible that two unrelated 16-byte allocations share a cache line. If one of these allocations is written using DMA and the other is written using cached write, the value that was written with DMA may be corrupted.
This commit changes ARCH_DMA_MINALIGN to be 128 on PA20 and 32 on PA1.1 - that's the largest possible cache line size.
As different parisc microarchitectures have different cache line size, we define arch_slab_minalign(), cache_line_size() and dma_get_cache_alignment() so that the kernel may tune slab cache parameters dynamically, based on the detected cache line size.
--- arch/parisc/Kconfig | 1 + arch/parisc/include/asm/cache.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
arch/parisc/Kconfig +1 -0
@@ -20,6 +20,7 @@ config PARISC select ARCH_SUPPORTS_HUGETLBFS if PA20 select ARCH_SUPPORTS_MEMORY_FAILURE select ARCH_STACKWALK + select ARCH_HAS_CACHE_LINE_SIZE select ARCH_HAS_DEBUG_VM_PGTABLE select HAVE_RELIABLE_STACKTRACE select DMA_OPS
arch/parisc/include/asm/cache.h +10 -1
@@ -20,7 +20,16 @@#define SMP_CACHE_BYTES L1_CACHE_BYTES -#define ARCH_DMA_MINALIGN L1_CACHE_BYTES +#ifdef CONFIG_PA20 +#define ARCH_DMA_MINALIGN 128 +#else +#define ARCH_DMA_MINALIGN 32 +#endif +#define ARCH_KMALLOC_MINALIGN 16/* ldcw requires 16-byte alignment */ + +#define arch_slab_minalign () ((unsigned)dcache_stride) +#define cache_line_size () dcache_stride +#define dma_get_cache_alignment cache_line_size#define __read_mostly __section(".data..read_mostly")
Greg Kroah-Hartman
maintainerPATCH 216/263 ASoC: amd: yc: Add quirk entry for OMEN by HP Gaming Laptop 16-n0xxx
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 6675e76a5c441b52b1b983ebb714122087020ebe upstream.
Fix the missing mic on OMEN by HP Gaming Laptop 16-n0xxx by adding the quirk entry with the board ID 8A44.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -413,6 +413,13 @@ static const struct dmi_system_id yc_acp .driver_data = &acp6x_card, .matches = {DMI_MATCH (DMI_BOARD_VENDOR ,"HP" ), + DMI_MATCH(DMI_BOARD_NAME, "8A44"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"HP" ), DMI_MATCH(DMI_BOARD_NAME, "8A22"), } },
Greg Kroah-Hartman
maintainerPATCH 217/263 spmi: pmic-arb: Pass the correct of_node to irq_domain_add_tree
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
commit f38ba5459ced3441852f37f20fcfb7bd39d20f62 upstream.
Currently, irqchips for all of the subnodes (which represent a given bus master) point to the parent wrapper node. This is no bueno, as no interrupts arrive, ever (because nothing references that node).
Fix that by passing a reference to the respective master's of_node.
Worth noting, this is a NOP for devices with only a single master described.
--- drivers/spmi/spmi-pmic-arb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spmi/spmi-pmic-arb.c +1 -2
@@ -1737,8 +1737,7 @@ static int spmi_pmic_arb_bus_init(struct platform_device *pdev,dev_dbg (&pdev->dev,"adding irq domain for bus %d\n" , bus_index); - bus->domain =irq_domain_add_tree (dev->of_node, - &pmic_arb_irq_domain_ops, bus); + bus->domain =irq_domain_add_tree (node, &pmic_arb_irq_domain_ops, bus);if (!bus->domain) {dev_err (&pdev->dev,"unable to create irq_domain\n" );return -ENOMEM ;
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 218/263 kcov: properly check for softirq context
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Konovalov <[email protected]>
commit 7d4df2dad312f270d62fecb0e5c8b086c6d7dcfc upstream.
When collecting coverage from softirqs, KCOV uses in_serving_softirq() to check whether the code is running in the softirq context. Unfortunately, in_serving_softirq() is > 0 even when the code is running in the hardirq or NMI context for hardirqs and NMIs that happened during a softirq.
As a result, if a softirq handler contains a remote coverage collection section and a hardirq with another remote coverage collection section happens during handling the softirq, KCOV incorrectly detects a nested softirq coverate collection section and prints a WARNING, as reported by syzbot.
This issue was exposed by commit a7f3813e589f ("usb: gadget: dummy_hcd:
Switch to hrtimer transfer scheduler"), which switched dummy_hcd to using hrtimer and made the timer's callback be executed in the hardirq context.
Change the related checks in KCOV to account for this behavior of in_serving_softirq() and make KCOV ignore remote coverage collection sections in the hardirq and NMI contexts.
This prevents the WARNING printed by syzbot but does not fix the inability of KCOV to collect coverage from the __usb_hcd_giveback_urb when dummy_hcd is in use (caused by a7f3813e589f); a separate patch is required for that.
--- kernel/kcov.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
kernel/kcov.c +12 -3
@@ -161,6 +161,15 @@ static void kcov_remote_area_put(structkmsan_unpoison_memory (&area->list,sizeof (area->list)); } +/* +* Unlike in_serving_softirq(), this function returns false when called during +* a hardirq or an NMI that happened in the softirq context. +*/ +static inline bool in_softirq_really (void ) +{ +return in_serving_softirq () && !in_hardirq () && !in_nmi (); +} + static notrace bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t) {unsigned int mode;
@@ -170,7 +179,7 @@ static notrace bool check_kcov_mode(enum* so we ignore code executed in interrupts, unless we are in a remote * coverage collection section in a softirq. */ -if (!in_task () && !(in_serving_softirq () && t->kcov_softirq)) +if (!in_task () && !(in_softirq_really () && t->kcov_softirq))return false; mode =READ_ONCE (t->kcov_mode);/*
@@ -849,7 +858,7 @@ void kcov_remote_start(u64 handle)if (WARN_ON (!kcov_check_handle (handle, true, true, true)))return ; -if (!in_task () && !in_serving_softirq ()) +if (!in_task () && !in_softirq_really ())return ;local_lock_irqsave (&kcov_percpu_data.lock, flags);
@@ -991,7 +1000,7 @@ void kcov_remote_stop(void)int sequence;unsigned long flags; -if (!in_task () && !in_serving_softirq ()) +if (!in_task () && !in_softirq_really ())return ;local_lock_irqsave (&kcov_percpu_data.lock, flags);
Greg Kroah-Hartman
maintainerPATCH 219/263 irqchip/xilinx: Fix shift out of bounds
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <[email protected]>
commit d73f0f49daa84176c3beee1606e73c7ffb6af8b2 upstream.
The device tree property 'xlnx,kind-of-intr' is sanity checked that the bitmask contains only set bits which are in the range of the number of interrupts supported by the controller.
The check is done by shifting the mask right by the number of supported interrupts and checking the result for zero.
The data type of the mask is u32 and the number of supported interrupts is up to 32. In case of 32 interrupts the shift is out of bounds, resulting in a mismatch warning. The out of bounds condition is also reported by UBSAN:
UBSAN: shift-out-of-bounds in irq-xilinx-intc.c:332:22 shift exponent 32 is too large for 32-bit type 'unsigned int'
Fix it by promoting the mask to u64 for the test.
--- drivers/irqchip/irq-xilinx-intc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-xilinx-intc.c +1 -1
@@ -189,7 +189,7 @@ static int __init xilinx_intc_of_init(st irqc->intr_mask =0 ; } -if (irqc->intr_mask >> irqc->nr_irq) +if ((u64 )irqc->intr_mask >> irqc->nr_irq)pr_warn ("irq-xilinx: mismatch in kind-of-intr param\n" ); pr_info("irq-xilinx: %pOF: num_irq=%d, edge=0x%x\n",
Greg Kroah-Hartman
maintainerPATCH 220/263 irqchip/riscv-aplic: Retrigger MSI interrupt on source configuration
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yong-Xuan Wang <[email protected]>
commit 03f9885c60adf73488fe32aab628ee3d4a39598e upstream.
The section 4.5.2 of the RISC-V AIA specification says that "any write to a sourcecfg register of an APLIC might (or might not) cause the corresponding interrupt-pending bit to be set to one if the rectified input value is high (= 1) under the new source mode."
When the interrupt type is changed in the sourcecfg register, the APLIC device might not set the corresponding pending bit, so the interrupt might never become pending.
To handle sourcecfg register changes for level-triggered interrupts in MSI mode, manually set the pending bit for retriggering interrupt so it gets retriggered if it was already asserted.
--- drivers/irqchip/irq-riscv-aplic-msi.c | 32 +++++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-)
drivers/irqchip/irq-riscv-aplic-msi.c +25 -7
@@ -32,15 +32,10 @@ static void aplic_msi_irq_unmask(struct irq_data *d)aplic_irq_unmask (d); } -static void aplic_msi_irq_eoi (struct irq_data *d) +static void aplic_msi_irq_retrigger_level (struct irq_data *d) {struct aplic_priv *priv =irq_data_get_irq_chip_data (d); -/* -* EOI handling is required only for level-triggered interrupts -* when APLIC is in MSI mode. -*/ -switch (irqd_get_trigger_type (d)) {case IRQ_TYPE_LEVEL_LOW :case IRQ_TYPE_LEVEL_HIGH :
@@ -59,6 +54,29 @@ static void aplic_msi_irq_eoi(struct irq_data *d) } } +static void aplic_msi_irq_eoi (struct irq_data *d) +{ +/* +* EOI handling is required only for level-triggered interrupts +* when APLIC is in MSI mode. +*/ +aplic_msi_irq_retrigger_level (d); +} + +static int aplic_msi_irq_set_type (struct irq_data *d,unsigned int type) +{ +int rc =aplic_irq_set_type (d, type); + +if (rc) +return rc; +/* +* Updating sourcecfg register for level-triggered interrupts +* requires interrupt retriggering when APLIC is in MSI mode. +*/ +aplic_msi_irq_retrigger_level (d); +return 0 ; +} +static void aplic_msi_write_msg (struct irq_data *d,struct msi_msg *msg) {unsigned int group_index, hart_index, guest_index, val;
@@ -130,7 +148,7 @@ static const struct msi_domain_template aplic_msi_template = { .name = "APLIC-MSI", .irq_mask = aplic_msi_irq_mask, .irq_unmask = aplic_msi_irq_unmask, - .irq_set_type = aplic_irq_set_type, + .irq_set_type = aplic_msi_irq_set_type, .irq_eoi = aplic_msi_irq_eoi, #ifdef CONFIG_SMP .irq_set_affinity = irq_chip_set_affinity_parent,
Signature · 1 line
2.46.0
Greg Kroah-Hartman
maintainerPATCH 221/263 genirq/irqdesc: Honor caller provided affinity in alloc_desc()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <[email protected]>
commit edbbaae42a56f9a2b39c52ef2504dfb3fb0a7858 upstream.
Currently, whenever a caller is providing an affinity hint for an interrupt, the allocation code uses it to calculate the node and copies the cpumask into irq_desc::affinity.
If the affinity for the interrupt is not marked 'managed' then the startup of the interrupt ignores irq_desc::affinity and uses the system default affinity mask.
Prevent this by setting the IRQD_AFFINITY_SET flag for the interrupt in the allocator, which causes irq_setup_affinity() to use irq_desc::affinity on interrupt startup if the mask contains an online CPU.
[ tglx: Massaged changelog ]
--- kernel/irq/irqdesc.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
@@ -530,6 +530,7 @@ static int alloc_descs(unsigned int star flags =IRQD_AFFINITY_MANAGED |IRQD_MANAGED_SHUTDOWN ; } + flags |=IRQD_AFFINITY_SET ; mask = &affinity->mask; node =cpu_to_node (cpumask_first (mask)); affinity++;
Greg Kroah-Hartman
maintainerPATCH 222/263 LoongArch: Enable general EFI poweroff method
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miao Wang <[email protected]>
commit e688c220732e518c2eb1639e9ef77d4a9311713c upstream.
efi_shutdown_init() can register a general sys_off handler named efi_power_off(). Enable this by providing efi_poweroff_required(), like arm and x86. Since EFI poweroff is also supported on LoongArch, and the enablement makes the poweroff function usable for hardwares which lack ACPI S5.
We prefer ACPI poweroff rather than EFI poweroff (like x86), so we only require EFI poweroff if acpi_gbl_reduced_hardware or acpi_no_s5 is true.
--- arch/loongarch/kernel/efi.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/loongarch/kernel/efi.c +6 -0
@@ -66,6 +66,12 @@ void __init efi_runtime_init(void)set_bit (EFI_RUNTIME_SERVICES , &efi.flags); } +bool efi_poweroff_required (void ) +{ +return efi_enabled (EFI_RUNTIME_SERVICES ) && + (acpi_gbl_reduced_hardware || acpi_no_s5); +} +unsigned long __initdata screen_info_table =EFI_INVALID_TABLE_ADDR ;#if defined(CONFIG_SYSFB ) || defined(CONFIG_EFI_EARLYCON )
Greg Kroah-Hartman
maintainerPATCH 223/263 power: supply: qcom_battmgr: return EAGAIN when firmware service is not up
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
commit bf9d5cb588755ee41ac12a8976dccf44ae18281b upstream.
The driver returns -ENODEV when the firmware battmrg service hasn't started yet, while per-se -ENODEV is fine, we usually use -EAGAIN to tell the user to retry again later. And the power supply core uses -EGAIN when the device isn't initialized, let's use the same return.
This notably causes an infinite spam of:
thermal thermal_zoneXX: failed to read out thermal zone (-19) because the thermal core doesn't understand -ENODEV, but only considers -EAGAIN as a non-fatal error.
While it didn't appear until now, commit [1] fixes thermal core and no more ignores thermal zones returning an error at first temperature update.
[1] 5725f40698b9 ("thermal: core: Call monitor_thermal_zone() if zone temperature is invalid")
--- drivers/power/supply/qcom_battmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/power/supply/qcom_battmgr.c +4 -4
@@ -486,7 +486,7 @@ static int qcom_battmgr_bat_get_propertyint ret;if (!battmgr->service_up) -return -ENODEV ; +return -EAGAIN ;if (battmgr->variant ==QCOM_BATTMGR_SC8280XP ) ret =qcom_battmgr_bat_sc8280xp_update (battmgr, psp);
@@ -683,7 +683,7 @@ static int qcom_battmgr_ac_get_property(int ret;if (!battmgr->service_up) -return -ENODEV ; +return -EAGAIN ; ret =qcom_battmgr_bat_sc8280xp_update (battmgr, psp);if (ret)
@@ -748,7 +748,7 @@ static int qcom_battmgr_usb_get_propertyint ret;if (!battmgr->service_up) -return -ENODEV ; +return -EAGAIN ;if (battmgr->variant ==QCOM_BATTMGR_SC8280XP ) ret =qcom_battmgr_bat_sc8280xp_update (battmgr, psp);
@@ -867,7 +867,7 @@ static int qcom_battmgr_wls_get_propertyint ret;if (!battmgr->service_up) -return -ENODEV ; +return -EAGAIN ;if (battmgr->variant ==QCOM_BATTMGR_SC8280XP ) ret =qcom_battmgr_bat_sc8280xp_update (battmgr, psp);
Greg Kroah-Hartman
maintainerPATCH 224/263 power: supply: axp288_charger: Fix constant_charge_voltage writes
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit b34ce4a59cfe9cd0d6f870e6408e8ec88a964585 upstream.
info->max_cv is in millivolts, divide the microvolt value being written to constant_charge_voltage by 1000 *before* clamping it to info->max_cv.
Before this fix the code always tried to set constant_charge_voltage to max_cv / 1000 = 4 millivolt, which ends up in setting it to 4.1V which is the lowest supported value.
--- drivers/power/supply/axp288_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/axp288_charger.c +2 -2
@@ -337,8 +337,8 @@ static int axp288_charger_usb_set_proper }break ;case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE : - scaled_val =min (val->intval, info->max_cv); - scaled_val =DIV_ROUND_CLOSEST (scaled_val,1000 ); + scaled_val =DIV_ROUND_CLOSEST (val->intval,1000 ); + scaled_val =min (scaled_val, info->max_cv); ret =axp288_charger_set_cv (info, scaled_val);if (ret <0 ) {dev_warn (&info->pdev->dev,"set charge voltage failed\n" );
Greg Kroah-Hartman
maintainerPATCH 225/263 power: supply: axp288_charger: Round constant_charge_voltage writes down
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 81af7f2342d162e24ac820c10e68684d9f927663 upstream.
Round constant_charge_voltage writes down to the first supported lower value, rather then rounding them up to the first supported higher value.
This fixes e.g. writing 4250000 resulting in a value of 4350000 which might be dangerous, instead writing 4250000 will now result in a safe 4200000 value.
--- drivers/power/supply/axp288_charger.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/power/supply/axp288_charger.c +9 -9
@@ -178,18 +178,18 @@ static inline int axp288_charger_set_cv(u8 reg_val;int ret; -if (cv <=CV_4100MV ) { - reg_val =CHRG_CCCV_CV_4100MV ; - cv =CV_4100MV ; - }else if (cv <=CV_4150MV ) { - reg_val =CHRG_CCCV_CV_4150MV ; - cv =CV_4150MV ; - }else if (cv <=CV_4200MV ) { +if (cv >=CV_4350MV ) { + reg_val =CHRG_CCCV_CV_4350MV ; + cv =CV_4350MV ; + }else if (cv >=CV_4200MV ) { reg_val =CHRG_CCCV_CV_4200MV ; cv =CV_4200MV ; + }else if (cv >=CV_4150MV ) { + reg_val =CHRG_CCCV_CV_4150MV ; + cv =CV_4150MV ; }else { - reg_val =CHRG_CCCV_CV_4350MV ; - cv =CV_4350MV ; + reg_val =CHRG_CCCV_CV_4100MV ; + cv =CV_4100MV ; } reg_val = reg_val <<CHRG_CCCV_CV_BIT_POS ;
Greg Kroah-Hartman
maintainerPATCH 226/263 tracing: Have format file honor EVENT_FILE_FL_FREED
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
commit b1560408692cd0ab0370cfbe9deb03ce97ab3f6d upstream.
When eventfs was introduced, special care had to be done to coordinate the freeing of the file meta data with the files that are exposed to user space. The file meta data would have a ref count that is set when the file is created and would be decremented and freed after the last user that opened the file closed it. When the file meta data was to be freed, it would set a flag (EVENT_FILE_FL_FREED) to denote that the file is freed, and any new references made (like new opens or reads) would fail as it is marked freed. This allowed other meta data to be freed after this flag was set (under the event_mutex).
All the files that were dynamically created in the events directory had a pointer to the file meta data and would call event_release() when the last reference to the user space file was closed. This would be the time that it is safe to free the file meta data.
A shortcut was made for the "format" file. It's i_private would point to the "call" entry directly and not point to the file's meta data. This is because all format files are the same for the same "call", so it was thought there was no reason to differentiate them. The other files maintain state (like the "enable", "trigger", etc). But this meant if the file were to disappear, the "format" file would be unaware of it.
This caused a race that could be trigger via the user_events test (that would create dynamic events and free them), and running a loop that would read the user_events format files:
In one console run:
# cd tools/testing/selftests/user_events # while true; do ./ftrace_test; done
And in another console run:
# cd /sys/kernel/tracing/ # while true; do cat events/user_events/__test_event/format; done 2>/dev/null
With KASAN memory checking, it would trigger a use-after-free bug report (which was a real bug). This was because the format file was not checking the file's meta data flag "EVENT_FILE_FL_FREED", so it would access the event that the file meta data pointed to after the event was freed.
After inspection, there are other locations that were found to not check the EVENT_FILE_FL_FREED flag when accessing the trace_event_file. Add a new helper function: event_file_file() that will make sure that the event_mutex is held, and will return NULL if the trace_event_file has the EVENT_FILE_FL_FREED flag set. Have the first reference of the struct file pointer use event_file_file() and check for NULL. Later uses can still use the event_file_data() helper function if the event_mutex is still held and was not released since the event_file_file() call.
--- kernel/trace/trace.h | 23 +++++++++++++++++++++++ kernel/trace/trace_events.c | 33 ++++++++++++++++++++------------- kernel/trace/trace_events_hist.c | 4 ++-- kernel/trace/trace_events_inject.c | 2 +- kernel/trace/trace_events_trigger.c | 6 +++--- 5 files changed, 49 insertions(+), 19 deletions(-)
kernel/trace/trace.h +23 -0
@@ -1573,6 +1573,29 @@ static inline void *event_file_data(struextern struct mutex event_mutex;extern struct list_head ftrace_events; +/* +* When the trace_event_file is the filp->i_private pointer, +* it must be taken under the event_mutex lock, and then checked +* if the EVENT_FILE_FL_FREED flag is set. If it is, then the +* data pointed to by the trace_event_file can not be trusted. +* +* Use the event_file_file() to access the trace_event_file from +* the filp the first time under the event_mutex and check for +* NULL. If it is needed to be retrieved again and the event_mutex +* is still held, then the event_file_data() can be used and it +* is guaranteed to be valid. +*/ +static inline struct trace_event_file *event_file_file (struct file *filp) +{ +struct trace_event_file *file; + +lockdep_assert_held (&event_mutex); + file =READ_ONCE (file_inode (filp)->i_private); +if (!file || file->flags &EVENT_FILE_FL_FREED ) +return NULL ; +return file; +} +extern const struct file_operations event_trigger_fops;extern const struct file_operations event_hist_fops;extern const struct file_operations event_hist_debug_fops;
kernel/trace/trace_events.c +20 -13
@@ -1386,12 +1386,12 @@ event_enable_read(struct file *filp, chachar buf[4 ] ="0" ;mutex_lock (&event_mutex); - file =event_file_data (filp); + file =event_file_file (filp);if (likely (file)) flags = file->flags;mutex_unlock (&event_mutex); -if (!file || flags &EVENT_FILE_FL_FREED ) +if (!file)return -ENODEV ; if (flags & EVENT_FILE_FL_ENABLED &&
@@ -1424,8 +1424,8 @@ event_enable_write(struct file *filp, cocase 1 : ret = -ENODEV ;mutex_lock (&event_mutex); - file =event_file_data (filp); -if (likely (file && !(file->flags &EVENT_FILE_FL_FREED ))) { + file =event_file_file (filp); +if (likely (file)) { ret =tracing_update_buffers (file->tr);if (ret <0 ) {mutex_unlock (&event_mutex);
@@ -1540,7 +1540,8 @@ enum {static void *f_next (struct seq_file *m,void *v,loff_t *pos) { -struct trace_event_call *call =event_file_data (m->private); +struct trace_event_file *file =event_file_data (m->private); +struct trace_event_call *call = file->event_call;struct list_head *common_head = &ftrace_common_fields;struct list_head *head =trace_get_fields (call);struct list_head *node = v;
@@ -1572,7 +1573,8 @@ static void *f_next(struct seq_file *m,static int f_show (struct seq_file *m,void *v) { -struct trace_event_call *call =event_file_data (m->private); +struct trace_event_file *file =event_file_data (m->private); +struct trace_event_call *call = file->event_call;struct ftrace_event_field *field;const char *array_descriptor;
@@ -1627,12 +1629,14 @@ static int f_show(struct seq_file *m, vostatic void *f_start (struct seq_file *m,loff_t *pos) { +struct trace_event_file *file;void *p = (void *)FORMAT_HEADER ;loff_t l =0 ;/* ->stop() is called even if ->start() fails */ mutex_lock (&event_mutex); -if (!event_file_data (m->private)) + file =event_file_file (m->private); +if (!file)return ERR_PTR (-ENODEV );while (l < *pos && p)
@@ -1706,8 +1710,8 @@ event_filter_read(struct file *filp, chatrace_seq_init (s);mutex_lock (&event_mutex); - file =event_file_data (filp); -if (file && !(file->flags &EVENT_FILE_FL_FREED )) + file =event_file_file (filp); +if (file)print_event_filter (file, s);mutex_unlock (&event_mutex);
@@ -1736,9 +1740,13 @@ event_filter_write(struct file *filp, coreturn PTR_ERR (buf);mutex_lock (&event_mutex); - file =event_file_data (filp); -if (file) - err =apply_event_filter (file, buf); + file =event_file_file (filp); +if (file) { +if (file->flags &EVENT_FILE_FL_FREED ) + err = -ENODEV ; +else + err =apply_event_filter (file, buf); + }mutex_unlock (&event_mutex);kfree (buf);
@@ -2485,7 +2493,6 @@ static int event_callback(const char *naif (strcmp (name,"format" ) ==0 ) { *mode =TRACE_MODE_READ ; *fops = &ftrace_event_format_fops; - *data = call;return 1 ; }
kernel/trace/trace_events_hist.c +2 -2
@@ -5601,7 +5601,7 @@ static int hist_show(struct seq_file *m,mutex_lock (&event_mutex); - event_file =event_file_data (m->private); + event_file =event_file_file (m->private);if (unlikely (!event_file)) { ret = -ENODEV ; goto out_unlock;
@@ -5880,7 +5880,7 @@ static int hist_debug_show(struct seq_fimutex_lock (&event_mutex); - event_file =event_file_data (m->private); + event_file =event_file_file (m->private);if (unlikely (!event_file)) { ret = -ENODEV ; goto out_unlock;
kernel/trace/trace_events_inject.c +1 -1
@@ -299,7 +299,7 @@ event_inject_write(struct file *filp, costrim (buf);mutex_lock (&event_mutex); - file =event_file_data (filp); + file =event_file_file (filp);if (file) { call = file->event_call; size =parse_entry (buf, call, &entry);
kernel/trace/trace_events_trigger.c +3 -3
@@ -159,7 +159,7 @@ static void *trigger_start(struct seq_fi/* ->stop() is called even if ->start() fails */ mutex_lock (&event_mutex); - event_file =event_file_data (m->private); + event_file =event_file_file (m->private);if (unlikely (!event_file))return ERR_PTR (-ENODEV );
@@ -213,7 +213,7 @@ static int event_trigger_regex_open(strumutex_lock (&event_mutex); -if (unlikely (!event_file_data (file))) { +if (unlikely (!event_file_file (file))) {mutex_unlock (&event_mutex);return -ENODEV ; }
@@ -293,7 +293,7 @@ static ssize_t event_trigger_regex_writestrim (buf);mutex_lock (&event_mutex); - event_file =event_file_data (file); + event_file =event_file_file (file);if (unlikely (!event_file)) {mutex_unlock (&event_mutex);kfree (buf);
Greg Kroah-Hartman
maintainerPATCH 227/263 tracing: Fix overflow in get_free_elt()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tze-nan Wu <[email protected]>
commit bcf86c01ca4676316557dd482c8416ece8c2e143 upstream.
"tracing_map->next_elt" in get_free_elt() is at risk of overflowing.
Once it overflows, new elements can still be inserted into the tracing_map even though the maximum number of elements (max_elts) has been reached. Continuing to insert elements after the overflow could result in the tracing_map containing "tracing_map->max_size" elements, leaving no empty entries.
If any attempt is made to insert an element into a full tracing_map using __tracing_map_insert(), it will cause an infinite loop with preemption disabled, leading to a CPU hang problem.
Fix this by preventing any further increments to "tracing_map->next_elt" once it reaches "tracing_map->max_elt".
--- kernel/trace/tracing_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/tracing_map.c +3 -3
@@ -454,7 +454,7 @@ static struct tracing_map_elt *get_free_struct tracing_map_elt *elt =NULL ;int idx; - idx =atomic_inc_return (&map->next_elt); + idx =atomic_fetch_add_unless (&map->next_elt,1 , map->max_elts);if (idx < map->max_elts) { elt = *(TRACING_MAP_ELT (map->elts, idx));if (map->ops && map->ops->elt_init)
@@ -699,7 +699,7 @@ void tracing_map_clear(struct tracing_ma {unsigned int i; -atomic_set (&map->next_elt,-1 ); +atomic_set (&map->next_elt,0 );atomic64_set (&map->hits,0 );atomic64_set (&map->drops,0 );
@@ -783,7 +783,7 @@ struct tracing_map *tracing_map_create(u map->map_bits = map_bits; map->max_elts = (1 << map_bits); -atomic_set (&map->next_elt,-1 ); +atomic_set (&map->next_elt,0 ); map->map_size = (1 << (map_bits +1 )); map->ops = ops;
Greg Kroah-Hartman
maintainerPATCH 228/263 padata: Fix possible divide-by-0 panic in padata_mt_helper()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <[email protected]>
commit 6d45e1c948a8b7ed6ceddb14319af69424db730c upstream.
We are hit with a not easily reproducible divide-by-0 panic in padata.c at bootup time.
[ 10.017908] Oops: divide error: 0000 1 PREEMPT SMP NOPTI
[ 10.017908] CPU: 26 PID: 2627 Comm: kworker/u1666:1 Not tainted 6.10.0-15.el10.x86_64 #1
[ 10.017908] Hardware name: Lenovo ThinkSystem SR950 [7X12CTO1WW]/[7X12CTO1WW], BIOS [PSE140J-2.30] 07/20/2021
[ 10.017908] Workqueue: events_unbound padata_mt_helper
[ 10.017908] RIP: 0010:padata_mt_helper+0x39/0xb0
:
[ 10.017963] Call Trace:
[ 10.017968] <TASK>
[ 10.018004] ? padata_mt_helper+0x39/0xb0
[ 10.018084] process_one_work+0x174/0x330
[ 10.018093] worker_thread+0x266/0x3a0
[ 10.018111] kthread+0xcf/0x100
[ 10.018124] ret_from_fork+0x31/0x50
[ 10.018138] ret_from_fork_asm+0x1a/0x30
[ 10.018147] </TASK>Looking at the padata_mt_helper() function, the only way a divide-by-0 panic can happen is when ps->chunk_size is 0. The way that chunk_size is initialized in padata_do_multithreaded(), chunk_size can be 0 when the min_chunk in the passed-in padata_mt_job structure is 0.
Fix this divide-by-0 panic by making sure that chunk_size will be at least 1 no matter what the input parameters are.
--- kernel/padata.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/padata.c +7 -0
@@ -517,6 +517,13 @@ void __init padata_do_multithreaded(stru ps.chunk_size =max (ps.chunk_size, job->min_chunk); ps.chunk_size =roundup (ps.chunk_size, job->align); +/* +* chunk_size can be 0 if the caller sets min_chunk to 0. So force it +* to at least 1 to prevent divide-by-0 panic in padata_mt_helper().` +*/ +if (!ps.chunk_size) + ps.chunk_size =1U ; +list_for_each_entry (pw, &works, pw_list)if (job->numa_aware) {int old_node =atomic_read (&last_used_nid);
Greg Kroah-Hartman
maintainerPATCH 229/263 smb3: fix setting SecurityFlags when encryption is required
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steve French <[email protected]>
commit 1b5487aefb1ce7a6b1f15a33297d1231306b4122 upstream.
Setting encryption as required in security flags was broken. For example (to require all mounts to be encrypted by setting):
"echo 0x400c5 > /proc/fs/cifs/SecurityFlags"
Would return "Invalid argument" and log "Unsupported security flags" This patch fixes that (e.g. allowing overriding the default for SecurityFlags 0x00c5, including 0x40000 to require seal, ie SMB3.1.1 encryption) so now that works and forces encryption on subsequent mounts.
--- Documentation/admin-guide/cifs/usage.rst | 2 +- fs/smb/client/cifs_debug.c | 2 +- fs/smb/client/cifsglob.h | 8 ++++---- fs/smb/client/smb2pdu.c | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-)
Documentation/admin-guide/cifs/usage.rst +1 -1
@@ -742,7 +742,7 @@ SecurityFlags Flags which control secur may use NTLMSSP 0x00080 must use NTLMSSP 0x80080 seal (packet encryption) 0x00040 - must seal (not implemented yet) 0x40040 + must seal 0x40040 cifsFYI If set to non-zero value, additional debug information will be logged to the system error log. This field
fs/smb/client/cifs_debug.c +1 -1
@@ -1072,7 +1072,7 @@ static int cifs_security_flags_proc_openstatic void cifs_security_flags_handle_must_flags (unsigned int *flags) { -unsigned int signflags = *flags &CIFSSEC_MUST_SIGN ; +unsigned int signflags = *flags & (CIFSSEC_MUST_SIGN |CIFSSEC_MUST_SEAL );if ((*flags &CIFSSEC_MUST_KRB5 ) ==CIFSSEC_MUST_KRB5 ) *flags =CIFSSEC_MUST_KRB5 ;
fs/smb/client/cifsglob.h +4 -4
@@ -1901,7 +1901,7 @@ static inline bool is_replayable_error(i#define CIFSSEC_MAY_SIGN 0x00001#define CIFSSEC_MAY_NTLMV2 0x00004#define CIFSSEC_MAY_KRB5 0x00008 -#define CIFSSEC_MAY_SEAL 0x00040/* not supported yet */ +#define CIFSSEC_MAY_SEAL 0x00040#define CIFSSEC_MAY_NTLMSSP 0x00080/* raw ntlmssp with ntlmv2 */ #define CIFSSEC_MUST_SIGN 0x01001
@@ -1911,11 +1911,11 @@ require use of the stronger protocol */#define CIFSSEC_MUST_NTLMV2 0x04004#define CIFSSEC_MUST_KRB5 0x08008#ifdef CONFIG_CIFS_UPCALL -#define CIFSSEC_MASK 0x8F08F/* flags supported if no weak allowed */ +#define CIFSSEC_MASK 0xCF0CF/* flags supported if no weak allowed */ #else -#define CIFSSEC_MASK 0x87087/* flags supported if no weak allowed */ +#define CIFSSEC_MASK 0xC70C7/* flags supported if no weak allowed */ #endif /* UPCALL */ -#define CIFSSEC_MUST_SEAL 0x40040/* not supported yet */ +#define CIFSSEC_MUST_SEAL 0x40040#define CIFSSEC_MUST_NTLMSSP 0x80080/* raw ntlmssp with ntlmv2 */ #define CIFSSEC_DEF (CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLMV2 | CIFSSEC_MAY_NTLMSSP | CIFSSEC_MAY_SEAL)
fs/smb/client/smb2pdu.c +3 -0
@@ -82,6 +82,9 @@ int smb3_encryption_required(const strucif (tcon->seal && (tcon->ses->server->capabilities &SMB2_GLOBAL_CAP_ENCRYPTION ))return 1 ; +if (((global_secflags &CIFSSEC_MUST_SEAL ) ==CIFSSEC_MUST_SEAL ) && + (tcon->ses->server->capabilities &SMB2_GLOBAL_CAP_ENCRYPTION )) +return 1 ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 230/263 eventfs: Dont return NULL in eventfs_create_dir()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 12c20c65d0460cf34f9a665d8f0c0d77d45a3829 upstream.
Commit 77a06c33a22d ("eventfs: Test for ei->is_freed when accessing ei->dentry") added another check, testing if the parent was freed after we released the mutex. If so, the function returns NULL. However, all callers expect it to either return a valid pointer or an error pointer, at least since commit 5264a2f4bb3b ("tracing: Fix a NULL vs IS_ERR() bug in event_subsystem_dir()"). Returning NULL will therefore fail the error condition check in the caller.
Fix this by substituting the NULL return value with a fitting error pointer.
--- fs/tracefs/event_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/tracefs/event_inode.c +1 -1
@@ -736,7 +736,7 @@ struct eventfs_inode *eventfs_create_dir/* Was the parent freed? */ if (list_empty (&ei->list)) {cleanup_ei (ei); - ei =NULL ; + ei =ERR_PTR (-EBUSY ); }return ei; }
Greg Kroah-Hartman
maintainerPATCH 231/263 eventfs: Use SRCU for freeing eventfs_inodes
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
commit 8e556432477e97ad6179c61b61a32bf5f1af2355 upstream.
To mirror the SRCU lock held in eventfs_iterate() when iterating over eventfs inodes, use call_srcu() to free them too.
This was accidentally(?) degraded to RCU in commit 43aa6f97c2d0 ("eventfs: Get rid of dentry pointers without refcounts").
--- fs/tracefs/event_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/tracefs/event_inode.c +1 -1
@@ -112,7 +112,7 @@ static void release_ei(struct kref *ref) entry->release (entry->name, ei->data); } -call_rcu (&ei->rcu, free_ei_rcu); +call_srcu (&eventfs_srcu, &ei->rcu, free_ei_rcu); }static inline void put_ei (struct eventfs_inode *ei)
Greg Kroah-Hartman
maintainerPATCH 232/263 selftests: mm: add s390 to ARCH check
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nico Pache <[email protected]>
commit 30b651c8bc788c068a978dc760e9d5f824f7019e upstream.
commit 0518dbe97fe6 ("selftests/mm: fix cross compilation with LLVM") changed the env variable for the architecture from MACHINE to ARCH.
This is preventing 3 required TEST_GEN_FILES from being included when cross compiling s390x and errors when trying to run the test suite. This is due to the ARCH variable already being set and the arch folder name being s390.
Add "s390" to the filtered list to cover this case and have the 3 files included in the build.
--- tools/testing/selftests/mm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/Makefile +1 -1
@@ -106,7 +106,7 @@ endif endif -ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64)) +ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 powerpc riscv64 s390x sparc64 x86_64 s390)) TEST_GEN_FILES += va_high_addr_switch TEST_GEN_FILES += virtual_address_range TEST_GEN_FILES += write_to_hugetlbfs
Greg Kroah-Hartman
maintainerPATCH 233/263 mm: list_lru: fix UAF for memory cgroup
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muchun Song <[email protected]>
commit 5161b48712dcd08ec427c450399d4d1483e21dea upstream.
The mem_cgroup_from_slab_obj() is supposed to be called under rcu lock or cgroup_mutex or others which could prevent returned memcg from being freed. Fix it by adding missing rcu read lock.
Found by code inspection.
--- mm/list_lru.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)
mm/list_lru.c +22 -6
@@ -85,6 +85,7 @@ list_lru_from_memcg_idx(struct list_lru }#endif /* CONFIG_MEMCG_KMEM */ +/* The caller must ensure the memcg lifetime. */ bool list_lru_add (struct list_lru *lru,struct list_head *item,int nid,struct mem_cgroup *memcg) {
@@ -109,14 +110,22 @@ EXPORT_SYMBOL_GPL(list_lru_add);bool list_lru_add_obj (struct list_lru *lru,struct list_head *item) { +bool ret;int nid =page_to_nid (virt_to_page (item)); -struct mem_cgroup *memcg =list_lru_memcg_aware (lru) ? -mem_cgroup_from_slab_obj (item) :NULL ; -return list_lru_add (lru, item, nid, memcg); +if (list_lru_memcg_aware (lru)) { +rcu_read_lock (); + ret =list_lru_add (lru, item, nid,mem_cgroup_from_slab_obj (item)); +rcu_read_unlock (); + }else { + ret =list_lru_add (lru, item, nid,NULL ); + } + +return ret; }EXPORT_SYMBOL_GPL (list_lru_add_obj); +/* The caller must ensure the memcg lifetime. */ bool list_lru_del (struct list_lru *lru,struct list_head *item,int nid,struct mem_cgroup *memcg) {
@@ -139,11 +148,18 @@ EXPORT_SYMBOL_GPL(list_lru_del);bool list_lru_del_obj (struct list_lru *lru,struct list_head *item) { +bool ret;int nid =page_to_nid (virt_to_page (item)); -struct mem_cgroup *memcg =list_lru_memcg_aware (lru) ? -mem_cgroup_from_slab_obj (item) :NULL ; -return list_lru_del (lru, item, nid, memcg); +if (list_lru_memcg_aware (lru)) { +rcu_read_lock (); + ret =list_lru_del (lru, item, nid,mem_cgroup_from_slab_obj (item)); +rcu_read_unlock (); + }else { + ret =list_lru_del (lru, item, nid,NULL ); + } + +return ret; }EXPORT_SYMBOL_GPL (list_lru_del_obj);
Greg Kroah-Hartman
maintainerPATCH 234/263 net/tcp: Disable TCP-AO static key after RCU grace period
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Safonov <[email protected]>
commit 14ab4792ee120c022f276a7e4768f4dcb08f0cdd upstream.
The lifetime of TCP-AO static_key is the same as the last tcp_ao_info. On the socket destruction tcp_ao_info ceases to be with RCU grace period, while tcp-ao static branch is currently deferred destructed. The static key definition is
: DEFINE_STATIC_KEY_DEFERRED_FALSE(tcp_ao_needed, HZ);
which means that if RCU grace period is delayed by more than a second and tcp_ao_needed is in the process of disablement, other CPUs may yet see tcp_ao_info which atent dead, but soon-to-be.
And that breaks the assumption of static_key_fast_inc_not_disabled().
See the comment near the definition:
Quoted 3 lines
* The caller must make sure that the static key can't get disabled while
* in this function. It doesn't patch jump labels, only adds a user to
* an already enabled static key.
Originally it was introduced in commit eb8c507296f6 ("jump_label:
Prevent key->enabled int overflow"), which is needed for the atomic contexts, one of which would be the creation of a full socket from a request socket. In that atomic context, it's known by the presence of the key (md5/ao) that the static branch is already enabled. So, the ref counter for that static branch is just incremented instead of holding the proper mutex. static_key_fast_inc_not_disabled() is just a helper for such usage case. But it must not be used if the static branch could get disabled in parallel as it's not protected by jump_label_mutex and as a result, races with jump_label_update() implementation details.
Happened on netdev test-bot[1], so not a theoretical issue:
[] jump_label: Fatal kernel bug, unexpected op at tcp_inbound_hash+0x1a7/0x870 [ffffffffa8c4e9b7] (eb 50 0f 1f 44 != 66 90 0f 1f 00)) size:2 type:1 [] ------------[ cut here ]------------
[] kernel BUG at arch/x86/kernel/jump_label.c:73!
[] Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
[] CPU: 3 PID: 243 Comm: kworker/3:3 Not tainted 6.10.0-virtme #1
[] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
[] Workqueue: events jump_label_update_timeout
[] RIP: 0010:__jump_label_patch+0x2f6/0x350
...
[] Call Trace:
[] <TASK> [] arch_jump_label_transform_queue+0x6c/0x110 [] __jump_label_update+0xef/0x350 [] __static_key_slow_dec_cpuslocked.part.0+0x3c/0x60 [] jump_label_update_timeout+0x2c/0x40 [] process_one_work+0xe3b/0x1670 [] worker_thread+0x587/0xce0 [] kthread+0x28a/0x350 [] ret_from_fork+0x31/0x70 [] ret_from_fork_asm+0x1a/0x30 [] </TASK>
[] Modules linked in: veth
[] ---[ end trace 0000000000000000 ]---
[] RIP: 0010:__jump_label_patch+0x2f6/0x350
[1]: https://netdev-3.bots.linux.dev/vmksft-tcp-ao-dbg/results/696681/5-connect-deny-ipv6/stderr
--- net/ipv4/tcp_ao.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-)
net/ipv4/tcp_ao.c +30 -13
@@ -266,32 +266,49 @@ static void tcp_ao_key_free_rcu(struct rkfree_sensitive (key); } -void tcp_ao_destroy_sock (struct sock *sk,bool twsk) +static void tcp_ao_info_free_rcu (struct rcu_head *head) { -struct tcp_ao_info *ao; + struct tcp_ao_info *ao = container_of(head, struct tcp_ao_info, rcu);struct tcp_ao_key *key;struct hlist_node *n; +hlist_for_each_entry_safe (key, n, &ao->head, node) { +hlist_del (&key->node); +tcp_sigpool_release (key->tcp_sigpool_id); +kfree_sensitive (key); + } +kfree (ao); +static_branch_slow_dec_deferred (&tcp_ao_needed); +} + +static void tcp_ao_sk_omem_free (struct sock *sk,struct tcp_ao_info *ao) +{ +size_t total_ao_sk_mem =0 ; +struct tcp_ao_key *key; + +hlist_for_each_entry (key, &ao->head, node) + total_ao_sk_mem +=tcp_ao_sizeof_key (key); +atomic_sub (total_ao_sk_mem, &sk->sk_omem_alloc); +} + +void tcp_ao_destroy_sock (struct sock *sk,bool twsk) +{ +struct tcp_ao_info *ao; +if (twsk) { ao =rcu_dereference_protected (tcp_twsk (sk)->ao_info,1 ); -tcp_twsk (sk)->ao_info =NULL ; +rcu_assign_pointer (tcp_twsk (sk)->ao_info,NULL ); }else { ao =rcu_dereference_protected (tcp_sk (sk)->ao_info,1 ); -tcp_sk (sk)->ao_info =NULL ; +rcu_assign_pointer (tcp_sk (sk)->ao_info,NULL ); }if (!ao || !refcount_dec_and_test (&ao->refcnt))return ; -hlist_for_each_entry_safe (key, n, &ao->head, node) { -hlist_del_rcu (&key->node); -if (!twsk) -atomic_sub (tcp_ao_sizeof_key (key), &sk->sk_omem_alloc); -call_rcu (&key->rcu, tcp_ao_key_free_rcu); - } - -kfree_rcu (ao, rcu); -static_branch_slow_dec_deferred (&tcp_ao_needed); +if (!twsk) +tcp_ao_sk_omem_free (sk, ao); +call_rcu (&ao->rcu, tcp_ao_info_free_rcu); }void tcp_ao_time_wait (struct tcp_timewait_sock *tcptw,struct tcp_sock *tp)
Greg Kroah-Hartman
maintainerPATCH 235/263 btrfs: avoid using fixed char array size for tree names
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit 12653ec36112ab55fa06c01db7c4432653d30a8d upstream.
[BUG]
There is a bug report that using the latest trunk GCC 15, btrfs would cause unterminated-string-initialization warning:
linux-6.6/fs/btrfs/print-tree.c:29:49: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization]
29 | { BTRFS_BLOCK_GROUP_TREE_OBJECTID, "BLOCK_GROUP_TREE" },
|
^~~~~~~~~~~~~~~~~~[CAUSE]
To print tree names we have an array of root_name_map structure, which uses "char name[16];" to store the name string of a tree.
But the following trees have names exactly at 16 chars length:
- "BLOCK_GROUP_TREE"
- "RAID_STRIPE_TREE"
This means we will have no space for the terminating '\0', and can lead to unexpected access when printing the name.
[FIX]
Instead of "char name[16];" use "const char *" instead.
Since the name strings are all read-only data, and are all NULL terminated by default, there is not much need to bother the length at all.
--- fs/btrfs/print-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/print-tree.c +1 -1
@@ -14,7 +14,7 @@struct root_name_map {u64 id; -char name[16 ]; +const char *name; };static const struct root_name_map root_map[] = {
Greg Kroah-Hartman
maintainerPATCH 236/263 x86/paravirt: Fix incorrect virt spinlock setting on bare metal
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Yu <[email protected]>
commit e639222a51196c69c70b49b67098ce2f9919ed08 upstream.
The kernel can change spinlock behavior when running as a guest. But this guest-friendly behavior causes performance problems on bare metal.
The kernel uses a static key to switch between the two modes.
In theory, the static key is enabled by default (run in guest mode) and should be disabled for bare metal (and in some guests that want native behavior or paravirt spinlock).
A performance drop is reported when running encode/decode workload and BenchSEE cache sub-workload.
Bisect points to commit ce0a1b608bfc ("x86/paravirt: Silence unused native_pv_lock_init() function warning"). When CONFIG_PARAVIRT_SPINLOCKS is disabled the virt_spin_lock_key is incorrectly set to true on bare metal. The qspinlock degenerates to test-and-set spinlock, which decreases the performance on bare metal.
Set the default value of virt_spin_lock_key to false. If booting in a VM, enable this key. Later during the VM initialization, if other high-efficient spinlock is preferred (e.g. paravirt-spinlock), or the user wants the native qspinlock (via nopvspin boot commandline), the virt_spin_lock_key is disabled accordingly.
This results in the following decision matrix:
X86_FEATURE_HYPERVISOR Y Y Y N CONFIG_PARAVIRT_SPINLOCKS Y Y N Y/N PV spinlock Y N N Y/N
virt_spin_lock_key N Y/N Y N
--- arch/x86/include/asm/qspinlock.h | 12 +++++++----- arch/x86/kernel/paravirt.c | 7 +++---- 2 files changed, 10 insertions(+), 9 deletions(-)
arch/x86/include/asm/qspinlock.h +7 -5
@@ -66,13 +66,15 @@ static inline bool vcpu_is_preempted(lon#ifdef CONFIG_PARAVIRT /* -* virt_spin_lock_key - enables (by default) the virt_spin_lock() hijack. +* virt_spin_lock_key - disables by default the virt_spin_lock() hijack. * -* Native (and PV wanting native due to vCPU pinning) should disable this key. -* It is done in this backwards fashion to only have a single direction change, -* which removes ordering between native_pv_spin_init() and HV setup. +* Native (and PV wanting native due to vCPU pinning) should keep this key +* disabled. Native does not touch the key. +* +* When in a guest then native_pv_lock_init() enables the key first and +* KVM/XEN might conditionally disable it later in the boot process again. */ -DECLARE_STATIC_KEY_TRUE (virt_spin_lock_key); +DECLARE_STATIC_KEY_FALSE (virt_spin_lock_key);/* * Shortcut for the queued_spin_lock_slowpath() function that allows
arch/x86/kernel/paravirt.c +3 -4
@@ -51,13 +51,12 @@ DEFINE_ASM_FUNC(pv_native_irq_enable, "s DEFINE_ASM_FUNC(pv_native_read_cr2, "mov %cr2, %rax", .noinstr.text);#endif -DEFINE_STATIC_KEY_TRUE (virt_spin_lock_key); +DEFINE_STATIC_KEY_FALSE (virt_spin_lock_key);void __init native_pv_lock_init (void ) { -if (IS_ENABLED (CONFIG_PARAVIRT_SPINLOCKS ) && - !boot_cpu_has (X86_FEATURE_HYPERVISOR )) -static_branch_disable (&virt_spin_lock_key); +if (boot_cpu_has (X86_FEATURE_HYPERVISOR )) +static_branch_enable (&virt_spin_lock_key); }static void native_tlb_remove_table (struct mmu_gather *tlb,void *table)
Greg Kroah-Hartman
maintainerPATCH 237/263 x86/mtrr: Check if fixed MTRRs exist before saving them
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andi Kleen <[email protected]>
commit 919f18f961c03d6694aa726c514184f2311a4614 upstream.
MTRRs have an obsolete fixed variant for fine grained caching control of the 640K-1MB region that uses separate MSRs. This fixed variant has a separate capability bit in the MTRR capability MSR.
So far all x86 CPUs which support MTRR have this separate bit set, so it went unnoticed that mtrr_save_state() does not check the capability bit before accessing the fixed MTRR MSRs.
Though on a CPU that does not support the fixed MTRR capability this results in a #GP. The #GP itself is harmless because the RDMSR fault is handled gracefully, but results in a WARN_ON().
Add the missing capability check to prevent this.
--- arch/x86/kernel/cpu/mtrr/mtrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mtrr/mtrr.c +1 -1
@@ -609,7 +609,7 @@ void mtrr_save_state(void) {int first_cpu; -if (!mtrr_enabled ()) +if (!mtrr_enabled () || !mtrr_state.have_fixed)return ; first_cpu =cpumask_first (cpu_online_mask);
Greg Kroah-Hartman
maintainerPATCH 238/263 sched/smt: Introduce sched_smt_present_inc/dec() helper
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Yingliang <[email protected]>
commit 31b164e2e4af84d08d2498083676e7eeaa102493 upstream.
Introduce sched_smt_present_inc/dec() helper, so it can be called in normal or error path simply. No functional changed.
--- kernel/sched/core.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
kernel/sched/core.c +19 -7
@@ -9654,6 +9654,22 @@ static int cpuset_cpu_inactive(unsignedreturn 0 ; } +static inline void sched_smt_present_inc (int cpu) +{ +#ifdef CONFIG_SCHED_SMT +if (cpumask_weight (cpu_smt_mask (cpu)) ==2 ) +static_branch_inc_cpuslocked (&sched_smt_present); +#endif +} + +static inline void sched_smt_present_dec (int cpu) +{ +#ifdef CONFIG_SCHED_SMT +if (cpumask_weight (cpu_smt_mask (cpu)) ==2 ) +static_branch_dec_cpuslocked (&sched_smt_present); +#endif +} +int sched_cpu_activate (unsigned int cpu) {struct rq *rq =cpu_rq (cpu);
@@ -9665,13 +9681,10 @@ int sched_cpu_activate(unsigned int cpu)*/ balance_push_set (cpu, false); -#ifdef CONFIG_SCHED_SMT /* * When going up, increment the number of cores with SMT present. */ -if (cpumask_weight (cpu_smt_mask (cpu)) ==2 ) -static_branch_inc_cpuslocked (&sched_smt_present); -#endif +sched_smt_present_inc (cpu);set_cpu_active (cpu, true);if (sched_smp_initialized) {
@@ -9740,13 +9753,12 @@ int sched_cpu_deactivate(unsigned int cp }rq_unlock_irqrestore (rq, &rf); -#ifdef CONFIG_SCHED_SMT /* * When going down, decrement the number of cores with SMT present. */ -if (cpumask_weight (cpu_smt_mask (cpu)) ==2 ) -static_branch_dec_cpuslocked (&sched_smt_present); +sched_smt_present_dec (cpu); +#ifdef CONFIG_SCHED_SMT sched_core_cpu_deactivate (cpu);#endif
Greg Kroah-Hartman
maintainerPATCH 239/263 sched/smt: Fix unbalance sched_smt_present dec/inc
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Yingliang <[email protected]>
commit e22f910a26cc2a3ac9c66b8e935ef2a7dd881117 upstream.
I got the following warn report while doing stress test:
jump label: negative count!
WARNING: CPU: 3 PID: 38 at kernel/jump_label.c:263 static_key_slow_try_dec+0x9d/0xb0 Call Trace: <TASK> __static_key_slow_dec_cpuslocked+0x16/0x70 sched_cpu_deactivate+0x26e/0x2a0 cpuhp_invoke_callback+0x3ad/0x10d0 cpuhp_thread_fun+0x3f5/0x680 smpboot_thread_fn+0x56d/0x8d0 kthread+0x309/0x400 ret_from_fork+0x41/0x70 ret_from_fork_asm+0x1b/0x30 </TASK>
Because when cpuset_cpu_inactive() fails in sched_cpu_deactivate(), the cpu offline failed, but sched_smt_present is decremented before calling sched_cpu_deactivate(), it leads to unbalanced dec/inc, so fix it by incrementing sched_smt_present in the error path.
--- kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+)
kernel/sched/core.c +1 -0
@@ -9768,6 +9768,7 @@ int sched_cpu_deactivate(unsigned int cpsched_update_numa (cpu, false); ret =cpuset_cpu_inactive (cpu);if (ret) { +sched_smt_present_inc (cpu);balance_push_set (cpu, false);set_cpu_active (cpu, true);sched_update_numa (cpu, true);
Greg Kroah-Hartman
maintainerPATCH 240/263 sched/core: Introduce sched_set_rq_on/offline() helper
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Yingliang <[email protected]>
commit 2f027354122f58ee846468a6f6b48672fff92e9b upstream.
Introduce sched_set_rq_on/offline() helper, so it can be called in normal or error path simply. No functional changed.
--- kernel/sched/core.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-)
kernel/sched/core.c +26 -14
@@ -9604,6 +9604,30 @@ void set_rq_offline(struct rq *rq) } } +static inline void sched_set_rq_online (struct rq *rq,int cpu) +{ +struct rq_flags rf; + +rq_lock_irqsave (rq, &rf); +if (rq->rd) { +BUG_ON (!cpumask_test_cpu (cpu, rq->rd->span)); +set_rq_online (rq); + } +rq_unlock_irqrestore (rq, &rf); +} + +static inline void sched_set_rq_offline (struct rq *rq,int cpu) +{ +struct rq_flags rf; + +rq_lock_irqsave (rq, &rf); +if (rq->rd) { +BUG_ON (!cpumask_test_cpu (cpu, rq->rd->span)); +set_rq_offline (rq); + } +rq_unlock_irqrestore (rq, &rf); +} +/* * used to mark begin/end of suspend/resume: */
@@ -9673,7 +9697,6 @@ static inline void sched_smt_present_decint sched_cpu_activate (unsigned int cpu) {struct rq *rq =cpu_rq (cpu); -struct rq_flags rf;/* * Clear the balance_push callback and prepare to schedule
@@ -9702,12 +9725,7 @@ int sched_cpu_activate(unsigned int cpu)* 2) At runtime, if cpuset_cpu_active() fails to rebuild the * domains. */ -rq_lock_irqsave (rq, &rf); -if (rq->rd) { -BUG_ON (!cpumask_test_cpu (cpu, rq->rd->span)); -set_rq_online (rq); - } -rq_unlock_irqrestore (rq, &rf); +sched_set_rq_online (rq, cpu);return 0 ; }
@@ -9715,7 +9733,6 @@ int sched_cpu_activate(unsigned int cpu)int sched_cpu_deactivate (unsigned int cpu) {struct rq *rq =cpu_rq (cpu); -struct rq_flags rf;int ret;/*
@@ -9746,12 +9763,7 @@ int sched_cpu_deactivate(unsigned int cp*/ synchronize_rcu (); -rq_lock_irqsave (rq, &rf); -if (rq->rd) { -BUG_ON (!cpumask_test_cpu (cpu, rq->rd->span)); -set_rq_offline (rq); - } -rq_unlock_irqrestore (rq, &rf); +sched_set_rq_offline (rq, cpu);/* * When going down, decrement the number of cores with SMT present.
Greg Kroah-Hartman
maintainerPATCH 241/263 sched/core: Fix unbalance set_rq_online/offline() in sched_cpu_deactivate()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Yingliang <[email protected]>
commit fe7a11c78d2a9bdb8b50afc278a31ac177000948 upstream.
If cpuset_cpu_inactive() fails, set_rq_online() need be called to rollback.
--- kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+)
kernel/sched/core.c +1 -0
@@ -9781,6 +9781,7 @@ int sched_cpu_deactivate(unsigned int cp ret =cpuset_cpu_inactive (cpu);if (ret) {sched_smt_present_inc (cpu); +sched_set_rq_online (rq, cpu);balance_push_set (cpu, false);set_cpu_active (cpu, true);sched_update_numa (cpu, true);
Greg Kroah-Hartman
maintainerPATCH 242/263 drm/bridge: analogix_dp: properly handle zero sized AUX transactions
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lucas Stach <[email protected]>
commit e82290a2e0e8ec5e836ecad1ca025021b3855c2d upstream.
Address only transactions without any data are valid and should not be flagged as short transactions. Simply return the message size when no transaction errors occured.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +1 -4
@@ -1027,7 +1027,6 @@ ssize_t analogix_dp_transfer(struct analu32 status_reg;u8 *buffer = msg->buffer;unsigned int i; -int num_transferred =0 ;int ret;/* Buffer size of AUX CH is 16 bytes */
@@ -1079,7 +1078,6 @@ ssize_t analogix_dp_transfer(struct anal reg = buffer[i];writel (reg, dp->reg_base +ANALOGIX_DP_BUF_DATA_0 +4 * i); - num_transferred++; } }
@@ -1127,7 +1125,6 @@ ssize_t analogix_dp_transfer(struct anal reg =readl (dp->reg_base +ANALOGIX_DP_BUF_DATA_0 +4 * i); buffer[i] = (unsigned char )reg; - num_transferred++; } }
@@ -1144,7 +1141,7 @@ ssize_t analogix_dp_transfer(struct anal (msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ) msg->reply = DP_AUX_NATIVE_REPLY_ACK; -return num_transferred >0 ? num_transferred : -EBUSY ; +return msg->size; aux_error:/* if aux err happen, reset aux */
Greg Kroah-Hartman
maintainerPATCH 243/263 drm/dp_mst: Skip CSN if topology probing is not done yet
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Lin <[email protected]>
commit ddf983488c3e8d30d5c2e2b315ae7d9cd87096ed upstream.
[Why]
During resume, observe that we receive CSN event before we start topology probing. Handling CSN at this moment based on uncertain topology is unnecessary.
[How]
Add checking condition in drm_dp_mst_handle_up_req() to skip handling CSN if the topology is yet to be probed.
--- drivers/gpu/drm/display/drm_dp_mst_topology.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/display/drm_dp_mst_topology.c +11 -0
@@ -4069,6 +4069,7 @@ static int drm_dp_mst_handle_up_req(struif (up_req->msg.req_type ==DP_CONNECTION_STATUS_NOTIFY ) {const struct drm_dp_connection_status_notify *conn_stat = &up_req->msg.u.conn_stat; +bool handle_csn; drm_dbg_kms(mgr->dev, "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", conn_stat->port_number,
@@ -4077,6 +4078,16 @@ static int drm_dp_mst_handle_up_req(stru conn_stat->message_capability_status, conn_stat->input_port, conn_stat->peer_device_type); + +mutex_lock (&mgr->probe_lock); + handle_csn = mgr->mst_primary->link_address_sent; +mutex_unlock (&mgr->probe_lock); + +if (!handle_csn) { +drm_dbg_kms (mgr->dev,"Got CSN before finish topology probing. Skip it." ); +kfree (up_req); + goto out; + } }else if (up_req->msg.req_type ==DP_RESOURCE_STATUS_NOTIFY ) {const struct drm_dp_resource_status_notify *res_stat = &up_req->msg.u.resource_stat;
Greg Kroah-Hartman
maintainerPATCH 244/263 drm/lima: Mark simple_ondemand governor as softdep
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dragan Simic <[email protected]>
commit 0c94f58cef319ad054fd909b3bf4b7d09c03e11c upstream.
Lima DRM driver uses devfreq to perform DVFS, while using simple_ondemand devfreq governor by default. This causes driver initialization to fail on boot when simple_ondemand governor isn't built into the kernel statically, as a result of the missing module dependency and, consequently, the required governor module not being included in the initial ramdisk. Thus, let's mark simple_ondemand governor as a softdep for Lima, to have its kernel module included in the initial ramdisk.
This is a rather longstanding issue that has forced distributions to build devfreq governors statically into their kernels, [1][2] or may have forced some users to introduce unnecessary workarounds.
Having simple_ondemand marked as a softdep for Lima may not resolve this issue for all Linux distributions. In particular, it will remain unresolved for the distributions whose utilities for the initial ramdisk generation do not handle the available softdep information [3] properly yet. However, some Linux distributions already handle softdeps properly while generating their initial ramdisks, [4] and this is a prerequisite step in the right direction for the distributions that don't handle them properly yet.
[1] https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-pinephone/-/blob/6.7-megi/config?ref_type=heads#L5749
[2] https://gitlab.com/postmarketOS/pmaports/-/blob/7f64e287e7732c9eaa029653e73ca3d4ba1c8598/main/linux-postmarketos-allwinner/config-postmarketos-allwinner.aarch64#L4654
[3] https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=49d8e0b59052999de577ab732b719cfbeb89504d
[4] https://github.com/archlinux/mkinitcpio/commit/97ac4d37aae084a050be512f6d8f4489054668ad
--- drivers/gpu/drm/lima/lima_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/lima/lima_drv.c +1 -0
@@ -501,3 +501,4 @@ module_platform_driver(lima_platform_driMODULE_AUTHOR ("Lima Project Developers" );MODULE_DESCRIPTION ("Lima DRM Driver" );MODULE_LICENSE ("GPL v2" ); +MODULE_SOFTDEP ("pre: governor_simpleondemand" );
Greg Kroah-Hartman
maintainerPATCH 245/263 drm/mgag200: Set DDC timeout in milliseconds
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit ecde5db1598aecab54cc392282c15114f526f05f upstream.
Compute the i2c timeout in jiffies from a value in milliseconds. The original values of 2 jiffies equals 2 milliseconds if HZ has been configured to a value of 1000. This corresponds to 2.2 milliseconds used by most other DRM drivers. Update mgag200 accordingly.
--- drivers/gpu/drm/mgag200/mgag200_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_i2c.c +1 -1
@@ -114,7 +114,7 @@ int mgag200_i2c_init(struct mga_device * i2c->adapter.algo_data = &i2c->bit; i2c->bit.udelay =10 ; - i2c->bit.timeout =2 ; + i2c->bit.timeout =usecs_to_jiffies (2200 ); i2c->bit.data = i2c; i2c->bit.setsda = mga_gpio_setsda; i2c->bit.setscl = mga_gpio_setscl;
Greg Kroah-Hartman
maintainerPATCH 246/263 drm/mgag200: Bind I2C lifetime to DRM device
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit eb1ae34e48a09b7a1179c579aed042b032e408f4 upstream.
Managed cleanup with devm_add_action_or_reset() will release the I2C adapter when the underlying Linux device goes away. But the connector still refers to it, so this cleanup leaves behind a stale pointer in struct drm_connector.ddc.
Bind the lifetime of the I2C adapter to the connector's lifetime by using DRM's managed release. When the DRM device goes away (after the Linux device) DRM will first clean up the connector and then clean up the I2C adapter.
--- drivers/gpu/drm/mgag200/mgag200_i2c.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/mgag200/mgag200_i2c.c +4 -2
@@ -31,6 +31,8 @@#include <linux/i2c.h> #include <linux/pci.h> +#include <drm/drm_managed.h> +#include "mgag200_drv.h" static int mga_i2c_read_gpio (struct mga_device *mdev)
@@ -86,7 +88,7 @@ static int mga_gpio_getscl(void *data)return (mga_i2c_read_gpio (mdev) & i2c->clock) ?1 :0 ; } -static void mgag200_i2c_release (void *res) +static void mgag200_i2c_release (struct drm_device *dev,void *res) {struct mga_i2c_chan *i2c = res;
@@ -125,5 +127,5 @@ int mgag200_i2c_init(struct mga_device *if (ret)return ret; -return devm_add_action_or_reset (dev->dev, mgag200_i2c_release, i2c); +return drmm_add_action_or_reset (dev, mgag200_i2c_release, i2c); }
Greg Kroah-Hartman
maintainerPATCH 247/263 drm/radeon: Remove __counted_by from StateArray.states[]
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bill Wendling <[email protected]>
commit 2bac084468847cfe5bbc7166082b2a208514bb1c upstream.
Work for __counted_by on generic pointers in structures (not just flexible array members) has started landing in Clang 19 (current tip of tree). During the development of this feature, a restriction was added to __counted_by to prevent the flexible array member's element type from including a flexible array member itself such as:
struct foo {
int count;
char buf[];
};
struct bar {
int count;
struct foo data[] __counted_by(count);
};because the size of data cannot be calculated with the standard array size formula:
sizeof(struct foo) * count
This restriction was downgraded to a warning but due to CONFIG_WERROR, it can still break the build. The application of __counted_by on the states member of 'struct _StateArray' triggers this restriction, resulting in:
drivers/gpu/drm/radeon/pptable.h:442:5: error: 'counted_by' should not be applied to an array with element of unknown size because 'ATOM_PPLIB_STATE_V2' (aka 'struct _ATOM_PPLIB_STATE_V2') is a struct type with a flexible array member. This will be an error in a future compiler version [-Werror,-Wbounds-safety-counted-by-elt-type-unknown-size]
442 | ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~1 error generated.
Remove this use of __counted_by to fix the warning/error. However, rather than remove it altogether, leave it commented, as it may be possible to support this in future compiler releases.
--- drivers/gpu/drm/radeon/pptable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/pptable.h +1 -1
@@ -439,7 +439,7 @@ typedef struct _StateArray{//how many states we have UCHAR ucNumEntries; - ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries); +ATOM_PPLIB_STATE_V2 states[]/* __counted_by(ucNumEntries) */ ; }StateArray;
Greg Kroah-Hartman
maintainerPATCH 248/263 mptcp: fully established after ADD_ADDR echo on MPJ
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit d67c5649c1541dc93f202eeffc6f49220a4ed71d upstream.
Before this patch, receiving an ADD_ADDR echo on the just connected MP_JOIN subflow -- initiator side, after the MP_JOIN 3WHS -- was resulting in an MP_RESET. That's because only ACKs with a DSS or ADD_ADDRs without the echo bit were allowed.
Not allowing the ADD_ADDR echo after an MP_CAPABLE 3WHS makes sense, as we are not supposed to send an ADD_ADDR before because it requires to be in full established mode first. For the MP_JOIN 3WHS, that's different:
the ADD_ADDR can be sent on a previous subflow, and the ADD_ADDR echo can be received on the recently created one. The other peer will already be in fully established, so it is allowed to send that.
We can then relax the conditions here to accept the ADD_ADDR echo for MPJ subflows.
--- net/mptcp/options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mptcp/options.c +2 -1
@@ -958,7 +958,8 @@ static bool check_fully_established(struif (subflow->remote_key_valid && (((mp_opt->suboptions &OPTION_MPTCP_DSS ) && mp_opt->use_ack) || - ((mp_opt->suboptions &OPTION_MPTCP_ADD_ADDR ) && !mp_opt->echo))) { + ((mp_opt->suboptions &OPTION_MPTCP_ADD_ADDR ) && + (!mp_opt->echo || subflow->mp_join)))) {/* subflows are fully established as soon as we get any * additional ack, including ADD_ADDR. */
Greg Kroah-Hartman
maintainerPATCH 249/263 mptcp: pm: deny endp with signal + subflow + port
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit 8af1f11865f259c882cce71d32f85ee9004e2660 upstream.
As mentioned in the 'Fixes' commit, the port flag is only supported by the 'signal' flag, and not by the 'subflow' one. Then if both the 'signal' and 'subflow' flags are set, the problem is the same: the feature cannot work with the 'subflow' flag.
Technically, if both the 'signal' and 'subflow' flags are set, it will be possible to create the listening socket, but not to establish a subflow using this source port. So better to explicitly deny it, not to create some confusions because the expected behaviour is not possible.
--- net/mptcp/pm_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mptcp/pm_netlink.c +2 -2
@@ -1328,8 +1328,8 @@ int mptcp_pm_nl_add_addr_doit(struct sk_if (ret <0 )return ret; -if (addr.addr.port && !(addr.flags &MPTCP_PM_ADDR_FLAG_SIGNAL )) { -GENL_SET_ERR_MSG (info,"flags must have signal when using port" ); +if (addr.addr.port && !address_use_port (&addr)) { +GENL_SET_ERR_MSG (info,"flags must have signal and not subflow when using port" );return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 250/263 block: use the right type for stub rq_integrity_vec()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit 69b6517687a4b1fb250bd8c9c193a0a304c8ba17 upstream.
For !CONFIG_BLK_DEV_INTEGRITY, rq_integrity_vec() wasn't updated properly. Fix it up.
--- include/linux/blk-integrity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blk-integrity.h +1 -1
@@ -166,7 +166,7 @@ static inline int blk_integrity_rq(strucreturn 0 ; } -static inline struct bio_vec *rq_integrity_vec (struct request *rq) +static inline struct bio_vec rq_integrity_vec (struct request *rq) {/* the optimizer will remove all calls to this function */ return (struct bio_vec ){ };
Greg Kroah-Hartman
maintainerPATCH 251/263 Revert "drm/amd/display: Handle HPD_IRQ for internal link"
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sung-huai Wang <[email protected]>
commit a2919b25778b7479e477cf49af8c680017eafc24 upstream.
[How&Why]
This reverts commit 239b31bd5c3fef3698440bf6436b2068c6bb08a3.
Due to the it effects Replay resync.
--- drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c | 24 +++------- 1 file changed, 9 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c +9 -15
@@ -373,7 +373,6 @@ bool dp_handle_hpd_rx_irq(struct dc_linkunion device_service_irq device_service_clear = {0 };enum dc_status result;bool status = false; -bool allow_active = false;if (out_link_loss) *out_link_loss = false;
@@ -428,6 +427,12 @@ bool dp_handle_hpd_rx_irq(struct dc_linkreturn false; } +if (handle_hpd_irq_psr_sink (link)) +/* PSR-related error was detected and handled */ +return true; + +handle_hpd_irq_replay_sink (link); +/* If PSR-related error handled, Main link may be off, * so do not handle as a normal sink status change interrupt. */
@@ -449,8 +454,10 @@ bool dp_handle_hpd_rx_irq(struct dc_link* If we got sink count changed it means * Downstream port status changed, * then DM should call DC to do the detection. +* NOTE: Do not handle link loss on eDP since it is internal link */ -if (dp_parse_link_loss_status ( +if ((link->connector_signal !=SIGNAL_TYPE_EDP ) && +dp_parse_link_loss_status ( link, &hpd_irq_dpcd_data)) {/* Connectivity log: link loss */
@@ -459,11 +466,6 @@ bool dp_handle_hpd_rx_irq(struct dc_linksizeof (hpd_irq_dpcd_data), "Status: "); -if (link->psr_settings.psr_feature_enabled) -edp_set_psr_allow_active (link, &allow_active, true, false,NULL ); -else if (link->replay_settings.replay_allow_active) -edp_set_replay_allow_active (link, &allow_active, true, false,NULL ); -if (defer_handling && has_left_work) *has_left_work = true;else
@@ -476,14 +478,6 @@ bool dp_handle_hpd_rx_irq(struct dc_linkdp_trace_link_loss_increment (link); } -if (*out_link_loss == false) { -if (handle_hpd_irq_psr_sink (link)) -/* PSR-related error was detected and handled */ -return true; - -handle_hpd_irq_replay_sink (link); - } -if (link->type == dc_connection_sst_branch && hpd_irq_dpcd_data.bytes.sink_cnt.bits.SINK_COUNT != link->dpcd_sink_count)
Greg Kroah-Hartman
maintainerPATCH 252/263 Revert "drm/amd/display: Add NULL check for afb before dereferencing in amdgpu_dm_plane_handle_cursor_update"
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Lipski <[email protected]>
commit 778e3979c5dc9cbdb5d1b92afed427de6bc483b4 upstream.
[WHY]
This patch is a dupplicate implementation of 14bcf29b, which we are reverting due to a regression with kms_plane_cursor IGT tests.
This reverts commit 38e6f715b02b572f74677eb2f29d3b4bc6f1ddff.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +4 -12
@@ -1231,22 +1231,14 @@ void amdgpu_dm_plane_handle_cursor_updat {struct amdgpu_device *adev =drm_to_adev (plane->dev);struct amdgpu_framebuffer *afb =to_amdgpu_framebuffer (plane->state->fb); -struct drm_crtc *crtc; -struct dm_crtc_state *crtc_state; -struct amdgpu_crtc *amdgpu_crtc; -u64 address; +struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc; +struct dm_crtc_state *crtc_state = crtc ?to_dm_crtc_state (crtc->state) :NULL ; +struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); +uint64_t address = afb ? afb->address :0 ;struct dc_cursor_position position = {0 };struct dc_cursor_attributes attributes;int ret; -if (!afb) -return ; - - crtc = plane->state->crtc ? plane->state->crtc : old_plane_state->crtc; - crtc_state = crtc ?to_dm_crtc_state (crtc->state) :NULL ; - amdgpu_crtc =to_amdgpu_crtc (crtc); - address = afb->address; -if (!plane->state->fb && !old_plane_state->fb)return ;
Greg Kroah-Hartman
maintainerPATCH 253/263 btrfs: fix corruption after buffer fault in during direct IO append write
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
commit 939b656bc8ab203fdbde26ccac22bcb7f0985be5 upstream.
During an append (O_APPEND write flag) direct IO write if the input buffer was not previously faulted in, we can corrupt the file in a way that the final size is unexpected and it includes an unexpected hole.
The problem happens like this:
1) We have an empty file, with size 0, for example;
2) We do an O_APPEND direct IO with a length of 4096 bytes and the input buffer is not currently faulted in;
3) We enter btrfs_direct_write(), lock the inode and call generic_write_checks(), which calls generic_write_checks_count(), and that function sets the iocb position to 0 with the following code:
if (iocb->ki_flags & IOCB_APPEND) iocb->ki_pos = i_size_read(inode);
4) We call btrfs_dio_write() and enter into iomap, which will end up calling btrfs_dio_iomap_begin() and that calls btrfs_get_blocks_direct_write(), where we update the i_size of the inode to 4096 bytes;
5) After btrfs_dio_iomap_begin() returns, iomap will attempt to access the page of the write input buffer (at iomap_dio_bio_iter(), with a call to bio_iov_iter_get_pages()) and fail with -EFAULT, which gets returned to btrfs at btrfs_direct_write() via btrfs_dio_write();
6) At btrfs_direct_write() we get the -EFAULT error, unlock the inode, fault in the write buffer and then goto to the label 'relock';
7) We lock again the inode, do all the necessary checks again and call again generic_write_checks(), which calls generic_write_checks_count() again, and there we set the iocb's position to 4K, which is the current i_size of the inode, with the following code pointed above:
if (iocb->ki_flags & IOCB_APPEND)
iocb->ki_pos = i_size_read(inode);8) Then we go again to btrfs_dio_write() and enter iomap and the write succeeds, but it wrote to the file range [4K, 8K), leaving a hole in the [0, 4K) range and an i_size of 8K, which goes against the expectations of having the data written to the range [0, 4K) and get an i_size of 4K.
Fix this by not unlocking the inode before faulting in the input buffer, in case we get -EFAULT or an incomplete write, and not jumping to the 'relock' label after faulting in the buffer - instead jump to a location immediately before calling iomap, skipping all the write checks and relocking. This solves this problem and it's fine even in case the input buffer is memory mapped to the same file range, since only holding the range locked in the inode's io tree can cause a deadlock, it's safe to keep the inode lock (VFS lock), as was fixed and described in commit 51bd9563b678 ("btrfs: fix deadlock due to page faults during direct IO reads and writes").
A sample reproducer provided by a reporter is the following:
$ cat test.c #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif
#include <fcntl.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if (argc < 2) {
fprintf(stderr, "Usage: %s <test file>\n", argv[0]);
return 1;
} int fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC | O_DIRECT |
O_APPEND, 0644);
if (fd < 0) {
perror("creating test file");
return 1;
}
char *buf = mmap(NULL, 4096, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
ssize_t ret = write(fd, buf, 4096);
if (ret < 0) {
perror("pwritev2");
return 1;
}
struct stat stbuf;
ret = fstat(fd, &stbuf);
if (ret < 0) {
perror("stat");
return 1;
}
printf("size: %llu\n", (unsigned long long)stbuf.st_size);
return stbuf.st_size == 4096 ? 0 : 1;}
A test case for fstests will be sent soon.
--- fs/btrfs/ctree.h | 1 + fs/btrfs/file.c | 55 ++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 13 deletions(-)
fs/btrfs/ctree.h +1 -0
@@ -457,6 +457,7 @@ struct btrfs_file_private {void *filldir_buf;u64 last_index;struct extent_state *llseek_cached_state; +bool fsync_skip_inode_lock; };static inline u32 BTRFS_LEAF_DATA_SIZE (const struct btrfs_fs_info *info)
fs/btrfs/file.c +42 -13
106 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 254/263 idpf: fix memleak in vport interrupt configuration
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Kubiak <[email protected]>
commit 3cc88e8405b8d55e0ff035e31971aadd6baee2b6 upstream.
The initialization of vport interrupt consists of two functions:
1) idpf_vport_intr_init() where a generic configuration is done
2) idpf_vport_intr_req_irq() where the irq for each q_vector is requested.
The first function used to create a base name for each interrupt using "kasprintf()" call. Unfortunately, although that call allocated memory for a text buffer, that memory was never released.
Fix this by removing creating the interrupt base name in 1). Instead, always create a full interrupt name in the function 2), because there is no need to create a base name separately, considering that the function 2) is never called out of idpf_vport_intr_init() context.
--- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_txrx.c +8 -11
@@ -3614,13 +3614,15 @@ void idpf_vport_intr_update_itr_ena_irq(/** * idpf_vport_intr_req_irq - get MSI-X vectors from the OS for the vport * @vport: main vport structure -* @basename: name for the vector */ -static int idpf_vport_intr_req_irq (struct idpf_vport *vport,char *basename) +static int idpf_vport_intr_req_irq (struct idpf_vport *vport) {struct idpf_adapter *adapter = vport->adapter; +const char *drv_name, *if_name, *vec_name;int vector, err, irq_num, vidx; -const char *vec_name; + + drv_name =dev_driver_string (&adapter->pdev->dev); + if_name =netdev_name (vport->netdev);for (vector =0 ; vector < vport->num_q_vectors; vector++) {struct idpf_q_vector *q_vector = &vport->q_vectors[vector];
@@ -3637,8 +3639,8 @@ static int idpf_vport_intr_req_irq(strucelse continue ; - q_vector->name =kasprintf (GFP_KERNEL ,"%s-%s-%d" , - basename, vec_name, vidx); + q_vector->name =kasprintf (GFP_KERNEL ,"%s-%s-%s-%d" , drv_name, + if_name, vec_name, vidx); err =request_irq (irq_num, idpf_vport_intr_clean_queues,0 , q_vector->name, q_vector);
@@ -4148,7 +4150,6 @@ error:*/ int idpf_vport_intr_init (struct idpf_vport *vport) { -char *int_name;int err; err =idpf_vport_intr_init_vec_idx (vport);
@@ -4162,11 +4163,7 @@ int idpf_vport_intr_init(struct idpf_vpoif (err) goto unroll_vectors_alloc; - int_name =kasprintf (GFP_KERNEL ,"%s-%s" , -dev_driver_string (&vport->adapter->pdev->dev), - vport->netdev->name); - - err =idpf_vport_intr_req_irq (vport, int_name); + err =idpf_vport_intr_req_irq (vport);if (err) goto unroll_vectors_alloc;
Greg Kroah-Hartman
maintainerPATCH 255/263 drm/amd/display: Add null check in resource_log_pipe_topology_update
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Natanel Roizenman <[email protected]>
commit 899d92fd26fe780aad711322aa671f68058207a6 upstream.
[WHY]
When switching from "Extend" to "Second Display Only" we sometimes call resource_get_otg_master_for_stream on a stream for the eDP, which is disconnected. This leads to a null pointer dereference.
[HOW]
Added a null check in dc_resource.c/resource_log_pipe_topology_update.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 -0
@@ -2267,6 +2267,10 @@ void resource_log_pipe_topology_update(s otg_master =resource_get_otg_master_for_stream ( &state->res_ctx, state->streams[stream_idx]); + +if (!otg_master) +continue ; +resource_log_pipe_for_stream (dc, state, otg_master, stream_idx); }if (state->phantom_stream_count >0 ) {
Greg Kroah-Hartman
maintainerPATCH 256/263 drm/amd/display: Change ASSR disable sequence
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Swapnil Patel <[email protected]>
commit 2d696cc837eaf5394d79bfd2b0b0483c4778aa83 upstream.
[Why]
Currently disabling ASSR before stream is disabled causes visible display corruption.
[How]
Move disable ASSR command to after stream has been disabled.
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +1 -2
@@ -2313,8 +2313,6 @@ void link_set_dpms_off(struct pipe_ctx * dc->hwss.disable_audio_stream (pipe_ctx); -edp_set_panel_assr (link, pipe_ctx, &panel_mode_dp, false); -update_psp_stream_config (pipe_ctx, true); dc->hwss.blank_stream (pipe_ctx);
@@ -2368,6 +2366,7 @@ void link_set_dpms_off(struct pipe_ctx * dc->hwss.disable_stream (pipe_ctx);disable_link (pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); } +edp_set_panel_assr (link, pipe_ctx, &panel_mode_dp, false);if (pipe_ctx->stream->timing.flags.DSC) {if (dc_is_dp_signal (pipe_ctx->stream->signal))
Greg Kroah-Hartman
maintainerPATCH 257/263 drm/amd/display: Defer handling mst up request in resume
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Lin <[email protected]>
commit 202dc359addab29451d3d18243c3d957da5392c8 upstream.
[Why]
Like commit ec5fa9fcdeca ("drm/amd/display: Adjust the MST resume flow"), we want to avoid handling mst topology changes before restoring the old state. If we enable DP_UP_REQ_EN before calling drm_atomic_helper_resume(), have changce to handle CSN event first and fire hotplug event before restoring the cached state.
[How]
Disable mst branch sending up request event before we restoring the cached state. DP_UP_REQ_EN will be set later when we call drm_dp_mst_topology_mgr_resume().
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
@@ -2418,7 +2418,6 @@ static void resume_mst_branch_status(str ret =drm_dp_dpcd_writeb (mgr->aux,DP_MSTM_CTRL ,DP_MST_EN | -DP_UP_REQ_EN |DP_UPSTREAM_IS_SRC );if (ret <0 ) {drm_dbg_kms (mgr->dev,"mst write failed - undocked during suspend?\n" );
Re: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
Quoted 1 line · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
This patch seems to cause problems with my external screens not getting a signal after my laptop wakes up from sleep.
The problem occurs on my Lenovo P14s Gen 2 (type 21A0) connected to a lenovo usb-c dock (type 40AS) with two 4k display port screens connected. My Laptop screen wakes up normally, the two external displays are still detected by my system and shown in the kde system settings, but they show no image.
The problem only occurs after putting my system to sleep, not on first boot.
I didn't do a full git bisect, I only tested the full rc and then a build a kernel with this patch reverted, reverting only this patch solved the problem.
~kevin
Quoted 43 lines
------------------
From: Wayne Lin <[email protected]>
commit
202dc359addab29451d3d18243c3d957da5392c8upstream.[Why]
Like commitec5fa9fcdeca("drm/amd/display: Adjust the MST resume flow"), we want to avoid handling mst topology changes before restoring the old state. If we enableDP_UP_REQ_ENbefore callingdrm_atomic_helper_resume(), have changce to handle CSN event first and fire hotplug event before restoring the cached state.[How]
Disable mst branch sending up request event before we restoring the cached state.DP_UP_REQ_ENwill be set later when we calldrm_dp_mst_topology_mgr_resume().Cc Mario Limonciello <[email protected]>Cc Alex Deucher <[email protected]>Reviewed-by Hersen Wu <[email protected]>Signed-off-by Wayne Lin <[email protected]>Tested-by Daniel Wheeler <[email protected]>Signed-off-by Alex Deucher <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-1@@ -2418,7 +2418,6 @@ static void resume_mst_branch_status(str ret =drm_dp_dpcd_writeb (mgr->aux,DP_MSTM_CTRL ,DP_MST_EN | -DP_UP_REQ_EN |DP_UPSTREAM_IS_SRC );if (ret <0 ) {drm_dbg_kms (mgr->dev,"mst write failed - undocked during suspend?\n" );
Greg Kroah-Hartman
maintainerRe: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
Quoted 11 lines · Kevin Holm
Quoted 1 line · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
This patch seems to cause problems with my external screens not getting a signal after my laptop wakes up from sleep.
The problem occurs on my Lenovo P14s Gen 2 (type 21A0) connected to a lenovo usb-c dock (type 40AS) with two 4k display port screens connected. My Laptop screen wakes up normally, the two external displays are still detected by my system and shown in the kde system settings, but they show no image.
Quoted 4 lines
The problem only occurs after putting my system to sleep, not on first boot.
I didn't do a full git bisect, I only tested the full rc and then a build a kernel with this patch reverted, reverting only this patch solved the problem.
Is this also an issue in 6.11-rc3?
thanks,
greg k-h
RE: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Greg and Kevin,
Sorry for inconvenience, but this one should be reverted by another backport patch:
"drm/amd/display: Solve mst monitors blank out problem after resume"
Thanks,
Wayne Lin
Quoted 36 lines
-----Original Message-----
From: Greg Kroah-Hartman <[email protected]>
Sent: Tuesday, August 13, 2024 10:21 PM
To: Kevin Holm <[email protected]>
Cc: [email protected]; [email protected]; Limonciello, Mario <[email protected]>; Deucher, Alexander <[email protected]>; Wu, Hersen <[email protected]>; Lin, Wayne <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: Re: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resumeQuoted 3 lines · Kevin Holm
Quoted 1 line · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me
know.
Quoted 7 lines
This patch seems to cause problems with my external screens not getting a signal after my laptop wakes up from sleep.
The problem occurs on my Lenovo P14s Gen 2 (type 21A0) connected to a lenovo usb-c dock (type 40AS) with two 4k display port screens connected. My Laptop screen wakes up normally, the two external displays are still detected by my system and shown in the kde system
settings, but they show no image.
Quoted 5 lines
The problem only occurs after putting my system to sleep, not on first boot.
I didn't do a full git bisect, I only tested the full rc and then a build a kernel with this patch reverted, reverting only this patch solved the
problem.
Is this also an issue in 6.11-rc3?
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
Quoted 6 lines · Wayne
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Greg and Kevin,
Sorry for inconvenience, but this one should be reverted by another backport patch:
"drm/amd/display: Solve mst monitors blank out problem after resume"
What commit id in Linus's tree is that?
thanks,
greg k-h
Re: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
Quoted 9 lines · Greg Kroah-Hartman
Quoted 6 lines · Wayne
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Greg and Kevin,
Sorry for inconvenience, but this one should be reverted by another backport patch:
"drm/amd/display: Solve mst monitors blank out problem after resume"What commit id in Linus's tree is that?
From what I can tell it's:e33697141bac18 ("drm/amd/display: Solve mst monitors blank out problem after resume")
You've send out a message that it failed to apply to a few of the stable trees:
- 6.10: https://lore.kernel.org/stable/2024081212-vitally-baked-7f93@gregkh/
- 6.6 : https://lore.kernel.org/stable/2024081213-roast-humorless-fd20@gregkh/
- 6.1 : https://lore.kernel.org/stable/2024081213-sweep-hungry-2d10@gregkh/
To apply it on top of 6.10.5-rc1 these two patches need to be applied first:f63f86b5affcc2 ("drm/amd/display: Separate setting and programming of cursor") 1ff6631baeb1f5 ("drm/amd/display: Prevent IPX From Link Detect and Set Mode")
I don't know if that solves the problem I initially described as I'm currently on a different setup. What I can say is that it applying those three patches on top of 6.10.5-rc1 works without conflicts and compiles without errors.
~kevin
Quoted 3 lines
thanks,
greg k-h
Re: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
Quoted 20 lines · Kevin Holm
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Wayne
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Greg and Kevin,
Sorry for inconvenience, but this one should be reverted by another backport
patch:
Quoted 3 lines
Quoted 1 line
"drm/amd/display: Solve mst monitors blank out problem after resume"
What commit id in Linus's tree is that?
From what I can tell it's:
e33697141bac18("drm/amd/display: Solve mst monitors blank out problem after resume")You've send out a message that it failed to apply to a few of the stable trees:
- 6.10: https://lore.kernel.org/stable/2024081212-vitally-baked-7f93@gregkh/
- 6.6 : https://lore.kernel.org/stable/2024081213-roast-humorless-fd20@gregkh/
- 6.1 : https://lore.kernel.org/stable/2024081213-sweep-hungry-2d10@gregkh/
Quoted 6 lines
To apply it on top of 6.10.5-rc1 these two patches need to be applied first:
f63f86b5affcc2("drm/amd/display: Separate setting and programming of cursor")1ff6631baeb1f5("drm/amd/display: Prevent IPX From Link Detect and Set Mode")I don't know if that solves the problem I initially described as I'm currently on a different setup. What I can say is that it applying those three patches on
Applying the three patches I listed above, fixes the problem for my setup. My external 4k monitors now get a signal both on boot and when resuming from sleep.
~kevin
Quoted 8 lines
top of 6.10.5-rc1 works without conflicts and compiles without errors.
~kevin
Quoted 3 lines
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
Quoted 26 lines · Kevin Holm
Quoted 25 lines · Kevin Holm
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Wayne
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Greg and Kevin,
Sorry for inconvenience, but this one should be reverted by another
backport patch:
Quoted 3 lines
Quoted 1 line
"drm/amd/display: Solve mst monitors blank out problem after resume"
What commit id in Linus's tree is that?
From what I can tell it's:
e33697141bac18("drm/amd/display: Solve mst monitors blank out problem after resume")You've send out a message that it failed to apply to a few of the stable trees:
- 6.10: https://lore.kernel.org/stable/2024081212-vitally-baked-7f93@gregkh/
- 6.6 : https://lore.kernel.org/stable/2024081213-roast-humorless-fd20@gregkh/
- 6.1 : https://lore.kernel.org/stable/2024081213-sweep-hungry-2d10@gregkh/To apply it on top of 6.10.5-rc1 these two patches need to be applied first:
f63f86b5affcc2("drm/amd/display: Separate setting and programming of cursor")1ff6631baeb1f5("drm/amd/display: Prevent IPX From Link Detect and Set Mode")
Quoted 5 lines
Quoted 2 lines
I don't know if that solves the problem I initially described as I'm currently on a different setup. What I can say is that it applying those three patches on
Applying the three patches I listed above, fixes the problem for my setup. My external 4k monitors now get a signal both on boot and when resuming from sleep.
Thanks for the report, I'll drop this commit for now from the trees and then add back all of them for the next round of -rc releases for people to test.
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
In reply to Kevin HolmQuoted 26 lines · Kevin Holm
Quoted 25 lines · Kevin Holm
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Wayne
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Greg and Kevin,
Sorry for inconvenience, but this one should be reverted by another
backport patch:
Quoted 3 lines
Quoted 1 line
"drm/amd/display: Solve mst monitors blank out problem after resume"
What commit id in Linus's tree is that?
From what I can tell it's:
e33697141bac18("drm/amd/display: Solve mst monitors blank out problem after resume")You've send out a message that it failed to apply to a few of the stable trees:
- 6.10: https://lore.kernel.org/stable/2024081212-vitally-baked-7f93@gregkh/
- 6.6 : https://lore.kernel.org/stable/2024081213-roast-humorless-fd20@gregkh/
- 6.1 : https://lore.kernel.org/stable/2024081213-sweep-hungry-2d10@gregkh/To apply it on top of 6.10.5-rc1 these two patches need to be applied first:
f63f86b5affcc2("drm/amd/display: Separate setting and programming of cursor")1ff6631baeb1f5("drm/amd/display: Prevent IPX From Link Detect and Set Mode")
Quoted 5 lines
Quoted 2 lines
I don't know if that solves the problem I initially described as I'm currently on a different setup. What I can say is that it applying those three patches on
Applying the three patches I listed above, fixes the problem for my setup. My external 4k monitors now get a signal both on boot and when resuming from sleep.
Ok, that worked for 6.10.y, but the dependant patches did not apply to 6.6.y or 6.1.y, so I'll only pick this up for 6.10.y for now unless someone sends me a series of patches backported.
thanks,
greg k-h
Re: [PATCH 6.10 257/263] drm/amd/display: Defer handling mst up request in resume
In reply to Greg Kroah-HartmanQuoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Kevin Holm
Quoted 1 line · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
This patch seems to cause problems with my external screens not getting a signal after my laptop wakes up from sleep.
The problem occurs on my Lenovo P14s Gen 2 (type 21A0) connected to a lenovo usb-c dock (type 40AS) with two 4k display port screens connected. My Laptop screen wakes up normally, the two external displays are still detected by my system and shown in the kde system settings, but they show no image.
Quoted 6 lines
Quoted 4 lines
The problem only occurs after putting my system to sleep, not on first boot.
I didn't do a full git bisect, I only tested the full rc and then a build a kernel with this patch reverted, reverting only this patch solved the problem.
Is this also an issue in 6.11-rc3?
No, with 6.11-rc3 my monitors work as expected both on boot and when waking up from sleep.
~kevin
Quoted 3 lines
thanks,
greg k-h
Greg Kroah-Hartman
maintainerPATCH 258/263 mptcp: pm: reduce indentation blocks
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit c95eb32ced823a00be62202b43966b07b2f20b7f upstream.
That will simplify the following commits.
No functional changes intended.
Stable-dep-of: cd7c957f936f ("mptcp: pm: don't try to create sf if alloc failed")
--- net/mptcp/pm_netlink.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
net/mptcp/pm_netlink.c +11 -8
@@ -567,16 +567,19 @@ static void mptcp_pm_create_subflow_or_sif (msk->pm.addr_signal &BIT (MPTCP_ADD_ADDR_SIGNAL ))return ; -if (local) { -if (mptcp_pm_alloc_anno_list (msk, &local->addr)) { -__clear_bit (local->addr.id, msk->pm.id_avail_bitmap); - msk->pm.add_addr_signaled++; -mptcp_pm_announce_addr (msk, &local->addr, false); -mptcp_pm_nl_addr_send_ack (msk); - } - } +if (!local) + goto subflow; + +if (!mptcp_pm_alloc_anno_list (msk, &local->addr)) + goto subflow; + +__clear_bit (local->addr.id, msk->pm.id_avail_bitmap); + msk->pm.add_addr_signaled++; +mptcp_pm_announce_addr (msk, &local->addr, false); +mptcp_pm_nl_addr_send_ack (msk); } +subflow:/* check if should create a new subflow */ while (msk->pm.local_addr_used < local_addr_max && msk->pm.subflows < subflows_max) {
Greg Kroah-Hartman
maintainerPATCH 259/263 mptcp: pm: dont try to create sf if alloc failed
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit cd7c957f936f8cb80d03e5152f4013aae65bd986 upstream.
It sounds better to avoid wasting cycles and / or put extreme memory pressure on the system by trying to create new subflows if it was not possible to add a new item in the announce list.
While at it, a warning is now printed if the entry was already in the list as it should not happen with the in-kernel path-manager. With this PM, mptcp_pm_alloc_anno_list() should only fail in case of memory pressure.
--- net/mptcp/pm_netlink.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/mptcp/pm_netlink.c +6 -4
@@ -348,7 +348,7 @@ bool mptcp_pm_alloc_anno_list(struct mpt add_entry =mptcp_lookup_anno_list_by_saddr (msk, addr);if (add_entry) { -if (mptcp_pm_is_kernel (msk)) +if (WARN_ON_ONCE (mptcp_pm_is_kernel (msk)))return false; sk_reset_timer(sk, &add_entry->add_timer,
@@ -555,8 +555,6 @@ static void mptcp_pm_create_subflow_or_s/* check first for announce */ if (msk->pm.add_addr_signaled < add_addr_signal_max) { - local =select_signal_address (pernet, msk); -/* due to racing events on both ends we can reach here while * previous add address is still running: if we invoke now * mptcp_pm_announce_addr(), that will fail and the
@@ -567,11 +565,15 @@ static void mptcp_pm_create_subflow_or_sif (msk->pm.addr_signal &BIT (MPTCP_ADD_ADDR_SIGNAL ))return ; + local =select_signal_address (pernet, msk);if (!local) goto subflow; +/* If the alloc fails, we are on memory pressure, not worth +* continuing, and trying to create subflows. +*/ if (!mptcp_pm_alloc_anno_list (msk, &local->addr)) - goto subflow; +return ;__clear_bit (local->addr.id, msk->pm.id_avail_bitmap); msk->pm.add_addr_signaled++;
Greg Kroah-Hartman
maintainerPATCH 260/263 mptcp: pm: do not ignore subflow if signal flag is also set
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit 85df533a787bf07bf4367ce2a02b822ff1fba1a3 upstream.
Up to the 'Fixes' commit, having an endpoint with both the 'signal' and 'subflow' flags, resulted in the creation of a subflow and an address announcement using the address linked to this endpoint. After this commit, only the address announcement was done, ignoring the 'subflow' flag.
That's because the same bitmap is used for the two flags. It is OK to keep this single bitmap, the already selected local endpoint simply have to be re-used, but not via select_local_address() not to look at the just modified bitmap.
Note that it is unusual to set the two flags together: creating a new subflow using a new local address will implicitly advertise it to the other peer. So in theory, no need to advertise it explicitly as well. Maybe there are use-cases -- the subflow might not reach the other peer that way, we can ask the other peer to try initiating the new subflow without delay -- or very likely the user is confused, and put both flags "just to be sure at least the right one is set". Still, if it is allowed, the kernel should do what has been asked: using this endpoint to announce the address and to create a new subflow from it.
An alternative is to forbid the use of the two flags together, but that's probably too late, there are maybe use-cases, and it was working before. This patch will avoid people complaining subflows are not created using the endpoint they added with the 'subflow' and 'signal' flag.
Note that with the current patch, the subflow might not be created in some corner cases, e.g. if the 'subflows' limit was reached when sending the ADD_ADDR, but changed later on. It is probably not worth splitting id_avail_bitmap per target ('signal', 'subflow'), which will add another large field to the msk "just" to track (again) endpoints. Anyway, currently when the limits are changed, the kernel doesn't check if new subflows can be created or removed, because we would need to keep track of the received ADD_ADDR, and more. It sounds OK to assume that the limits should be properly configured before establishing new connections.
--- net/mptcp/pm_netlink.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
net/mptcp/pm_netlink.c +12 -4
@@ -512,8 +512,8 @@ __lookup_addr(struct pm_nl_pernet *pernestatic void mptcp_pm_create_subflow_or_signal_addr (struct mptcp_sock *msk) { +struct mptcp_pm_addr_entry *local, *signal_and_subflow =NULL ;struct sock *sk = (struct sock *)msk; -struct mptcp_pm_addr_entry *local;unsigned int add_addr_signal_max;unsigned int local_addr_max;struct pm_nl_pernet *pernet;
@@ -579,6 +579,9 @@ static void mptcp_pm_create_subflow_or_s msk->pm.add_addr_signaled++;mptcp_pm_announce_addr (msk, &local->addr, false);mptcp_pm_nl_addr_send_ack (msk); + +if (local->flags &MPTCP_PM_ADDR_FLAG_SUBFLOW ) + signal_and_subflow = local; } subflow:
@@ -589,9 +592,14 @@ subflow:bool fullmesh;int i, nr; - local =select_local_address (pernet, msk); -if (!local) -break ; +if (signal_and_subflow) { + local = signal_and_subflow; + signal_and_subflow =NULL ; + }else { + local =select_local_address (pernet, msk); +if (!local) +break ; + } fullmesh = !!(local->flags &MPTCP_PM_ADDR_FLAG_FULLMESH );
Greg Kroah-Hartman
maintainerPATCH 261/263 selftests: mptcp: join: ability to invert ADD_ADDR check
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit bec1f3b119ebc613d08dfbcdbaef01a79aa7de92 upstream.
In the following commit, the client will initiate the ADD_ADDR, instead of the server. We need to way to verify the ADD_ADDR have been correctly sent.
Note: the default expected counters for when the port number is given are never changed by the caller, no need to accept them as parameter then.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID.
--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 40 +++++++++++++++--------- 1 file changed, 26 insertions(+), 14 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +26 -14
@@ -1415,18 +1415,28 @@ chk_add_nr() local add_nr=$1 local echo_nr=$2 local port_nr=${3:-0} - local syn_nr=${4:-$port_nr} - local syn_ack_nr=${5:-$port_nr} - local ack_nr=${6:-$port_nr} - local mis_syn_nr=${7:-0} - local mis_ack_nr=${8:-0} + local ns_invert=${4:-""} + local syn_nr=$port_nr + local syn_ack_nr=$port_nr + local ack_nr=$port_nr + local mis_syn_nr=0 + local mis_ack_nr=0 + local ns_tx=$ns1 + local ns_rx=$ns2 + local extra_msg="" local count local timeout - timeout=$(ip netns exec $ns1 sysctl -n net.mptcp.add_addr_timeout) + if [[ $ns_invert = "invert" ]]; then + ns_tx=$ns2 + ns_rx=$ns1 + extra_msg="invert" + fi + + timeout=$(ip netns exec ${ns_tx} sysctl -n net.mptcp.add_addr_timeout) print_check "add" - count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtAddAddr") + count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtAddAddr") if [ -z "$count" ]; then print_skip # if the test configured a short timeout tolerate greater then expected
@@ -1438,7 +1448,7 @@ chk_add_nr() fi print_check "echo" - count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtEchoAdd") + count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtEchoAdd") if [ -z "$count" ]; then print_skip elif [ "$count" != "$echo_nr" ]; then
@@ -1449,7 +1459,7 @@ chk_add_nr() if [ $port_nr -gt 0 ]; then print_check "pt" - count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtPortAdd") + count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtPortAdd") if [ -z "$count" ]; then print_skip elif [ "$count" != "$port_nr" ]; then
@@ -1459,7 +1469,7 @@ chk_add_nr() fi print_check "syn" - count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinPortSynRx") + count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPJoinPortSynRx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$syn_nr" ]; then
@@ -1470,7 +1480,7 @@ chk_add_nr() fi print_check "synack" - count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinPortSynAckRx") + count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPJoinPortSynAckRx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$syn_ack_nr" ]; then
@@ -1481,7 +1491,7 @@ chk_add_nr() fi print_check "ack" - count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinPortAckRx") + count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPJoinPortAckRx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$ack_nr" ]; then
@@ -1492,7 +1502,7 @@ chk_add_nr() fi print_check "syn" - count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMismatchPortSynRx") + count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMismatchPortSynRx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$mis_syn_nr" ]; then
@@ -1503,7 +1513,7 @@ chk_add_nr() fi print_check "ack" - count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMismatchPortAckRx") + count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMismatchPortAckRx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$mis_ack_nr" ]; then
@@ -1513,6 +1523,8 @@ chk_add_nr() print_ok fi fi + + print_info "$extra_msg" } chk_add_tx_nr()
Greg Kroah-Hartman
maintainerPATCH 262/263 selftests: mptcp: join: test both signal & subflow
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit 4d2868b5d191c74262f7407972d68d1bf3245d6a upstream.
It should be quite uncommon to set both the subflow and the signal
flags: the initiator of the connection is typically the one creating new subflows, not the other peer, then no need to announce additional local addresses, and use it to create subflows.
But some people might be confused about the flags, and set both "just to be sure at least the right one is set". To verify the previous fix, and avoid future regressions, this specific case is now validated: the client announces a new address, and initiates a new subflow from the same address.
While working on this, another bug has been noticed, where the client reset the new subflow because an ADD_ADDR echo got received as the 3rd
ACK: this new test also explicitly checks that no RST have been sent by the client and server.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID.
--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +15 -0
@@ -1989,6 +1989,21 @@ signal_address_tests() chk_add_nr 1 1 fi + # uncommon: subflow and signal flags on the same endpoint + # or because the user wrongly picked both, but still expects the client + # to create additional subflows + if reset "subflow and signal together"; then + pm_nl_set_limits $ns1 0 2 + pm_nl_set_limits $ns2 0 2 + pm_nl_add_endpoint $ns2 10.0.3.2 flags signal,subflow + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr 1 1 1 + chk_add_nr 1 1 0 invert # only initiated by ns2 + chk_add_nr 0 0 0 # none initiated by ns1 + chk_rst_nr 0 0 invert # no RST sent by the client + chk_rst_nr 0 0 # no RST sent by the server + fi + # accept and use add_addr with additional subflows if reset "multiple subflows and signal"; then pm_nl_set_limits $ns1 0 3
Greg Kroah-Hartman
maintainerPATCH 263/263 btrfs: fix double inode unlock for direct IO sync writes
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
commit e0391e92f9ab4fb3dbdeb139c967dcfa7ac4b115 upstream.
If we do a direct IO sync write, at btrfs_sync_file(), and we need to skip inode logging or we get an error starting a transaction or an error when flushing delalloc, we end up unlocking the inode when we shouldn't under the 'out_release_extents' label, and then unlock it again at btrfs_direct_write().
Fix that by checking if we have to skip inode unlocking under that label.
--- fs/btrfs/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/btrfs/file.c +4 -1
@@ -2080,7 +2080,10 @@ out: out_release_extents:btrfs_release_log_ctx_extents (&ctx); -btrfs_inode_unlock (BTRFS_I (inode),BTRFS_ILOCK_MMAP ); +if (skip_ilock) +up_write (&BTRFS_I (inode)->i_mmap_lock); +else +btrfs_inode_unlock (BTRFS_I (inode),BTRFS_ILOCK_MMAP ); goto out; }
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.10.y
6.6 passes our testing, too:
(single reported failure is not kernel problem).
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.6.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.10.5-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.10.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.10.5-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git commit: b18fc76fca1a63141db3c822c1b169a1ca4bb08a
* git describe: v6.10.4-264-gb18fc76fca1a
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.10.y/build/v6.10.4-264-gb18fc76fca1a
## Test Regressions (compared to v6.10.3-124-g83c63da99a03)
## Metric Regressions (compared to v6.10.3-124-g83c63da99a03)
## Test Fixes (compared to v6.10.3-124-g83c63da99a03)
## Metric Fixes (compared to v6.10.3-124-g83c63da99a03)
## Test result summary
total: 257536, pass: 224323, fail: 4505, skip: 28188, xfail: 520
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 129 total, 127 passed, 2 failed
* arm64: 38 total, 37 passed, 1 failed
* i386: 28 total, 28 passed, 0 failed
* mips: 26 total, 24 passed, 2 failed
* parisc: 4 total, 3 passed, 1 failed
* powerpc: 36 total, 35 passed, 1 failed
* riscv: 19 total, 18 passed, 1 failed
* s390: 14 total, 12 passed, 2 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 7 total, 6 passed, 1 failed
* x86_64: 33 total, 33 passed, 0 failed
## Test suites summary
* boot
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-kcmp
* kselftest-kvm
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-mincore
* kselftest-mqueue
* kselftest-net
* kselftest-net-mptcp
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-tc-testing
* kselftest-timers
* kselftest-timesync-off
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-watchdog
* kselftest-x86
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-smoke
* ltp-smoketest
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Am 12.08.2024 um 18:00 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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.
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
Hi Greg
6.10.5-rc1 compiles, boots and runs here on x86_64 (AMD Ryzen 5 PRO 4650G, Slackware64-15.0)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.10.5-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.10.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.10.5-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.10.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.10:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 116 pass, 0 failLinux version: 6.10.5-rc1-gb18fc76fca1a
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.10.5-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.10.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
I see various allmodconfig build failures on v6.10.5.
Example from arm:
Building arm:allmodconfig ... failed
--------------
Error log:drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1581:13: error: 'is_dsc_common_config_possible' defined but not used [-Werror=unused-function]
1581 | static bool is_dsc_common_config_possible(struct dc_stream_state *stream,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1569:21: error: 'kbps_from_pbn' defined but not used [-Werror=unused-function]
1569 | static unsigned int kbps_from_pbn(unsigned int pbn)
The functions are built and used conditionally in mainline, behind CONFIG_DRM_AMD_DC_FP. The conditional is missing in v6.10.5 (and v6.10.6-rc1).
Guenter
Greg Kroah-Hartman
maintainerQuoted 19 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
I see various allmodconfig build failures on v6.10.5.
Example from arm:
Building arm:allmodconfig ... failed
--------------
Error log:drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1581:13: error: 'is_dsc_common_config_possible' defined but not used [-Werror=unused-function]
1581 | static bool is_dsc_common_config_possible(structdc_stream_state*stream,
Quoted 6 lines
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1569:21: error: 'kbps_from_pbn' defined but not used [-Werror=unused-function]
1569 | static unsigned intkbps_from_pbn(unsigned int pbn)The functions are built and used conditionally in mainline, behind
CONFIG_DRM_AMD_DC_FP. The conditional is missing in v6.10.5 (and v6.10.6-rc1).
Odd that other allmodconfig builds passed :(
I'll dig up where that conditional showed up, thanks for letting us know....
Ah, looks like it showed up in 00c391102abc ("drm/amd/display: Add misc DC changes for DCN401"), gotta love "fix a bunch of things" type of commits...
{sigh}
greg k-h
Greg Kroah-Hartman
maintainerQuoted 27 lines · Greg Kroah-Hartman
Quoted 19 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
I see various allmodconfig build failures on v6.10.5.
Example from arm:
Building arm:allmodconfig ... failed
--------------
Error log:drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1581:13: error: 'is_dsc_common_config_possible' defined but not used [-Werror=unused-function]
1581 | static bool is_dsc_common_config_possible(structdc_stream_state*stream,Quoted 6 lines
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1569:21: error: 'kbps_from_pbn' defined but not used [-Werror=unused-function]
1569 | static unsigned intkbps_from_pbn(unsigned int pbn)The functions are built and used conditionally in mainline, behind
CONFIG_DRM_AMD_DC_FP. The conditional is missing in v6.10.5 (and v6.10.6-rc1).
Quoted 8 lines
Odd that other allmodconfig builds passed :(
I'll dig up where that conditional showed up, thanks for letting us know....
Ah, looks like it showed up in
00c391102abc("drm/amd/display: Add misc DC changes for DCN401"), gotta love "fix a bunch of things" type of commits...
And that commit is crazy, and no way will it backport, so I'll just go do this "by hand". People who approved that commit need to revisit how to create changes properly...
greg k-h
Quoted 24 lines · Greg Kroah-Hartman
Quoted 23 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.10.5 release. There are 263 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, 14 Aug 2024 16:00:26 +0000. Anything received after that time might be too late.
I see various allmodconfig build failures on v6.10.5.
Example from arm:
Building arm:allmodconfig ... failed
--------------
Error log:drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1581:13: error: 'is_dsc_common_config_possible' defined but not used [-Werror=unused-function]
1581 | static bool is_dsc_common_config_possible(structdc_stream_state*stream,| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:1569:21: error: 'kbps_from_pbn' defined but not used [-Werror=unused-function]
1569 | static unsigned intkbps_from_pbn(unsigned int pbn)
Quoted 5 lines
Quoted 2 lines
The functions are built and used conditionally in mainline, behind
CONFIG_DRM_AMD_DC_FP. The conditional is missing in v6.10.5 (and v6.10.6-rc1).Odd that other allmodconfig builds passed :(
Yes, that is odd. Maybe they all build with clang nowadays ?
Quoted 7 lines
I'll dig up where that conditional showed up, thanks for letting us know....
Ah, looks like it showed up in
00c391102abc("drm/amd/display: Add misc DC changes for DCN401"), gotta love "fix a bunch of things" type of commits...
I found that as well, but as you noticed it is a mess.
Your partially applied patch introduced other problems - please see my other e-mail.
Guenter
Quoted 5 lines · Guenter Roeck
Quoted 2 lines · Greg Kroah-Hartman
Odd that other allmodconfig builds passed :(
Yes, that is odd. Maybe they all build with clang nowadays ?
I doubt that is the factor because our CI sees it and we obviously only use clang:
https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/10424364978
Cheers,
Nathan