Commit Graph

2044 Commits

Author SHA1 Message Date
Greg Kroah-Hartman fcc21a6112 Merge 11c7fa11fa ("net: stmmac: dwmac-loongson: Set correct {tx,rx}_fifo_size") into android16-6.12-lts
Steps on the way to 6.12.31

Resolves merge conflicts in:
	kernel/sched/fair.c

Change-Id: I545f90ce44822f1a0f940be224258533b6581077
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-07-02 07:08:57 +00:00
Greg Kroah-Hartman 108d81d25c Merge cd918ec241 ("orangefs: Do not truncate file size") into android16-6.12-lts
Steps on the way to 6.12.31

Change-Id: Ic4b1ed54cab9844c75f4824bb7ac3f28e37b3eb7
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-06-30 08:35:56 +00:00
Greg Kroah-Hartman 23a88a6ad8 Merge d133023c9a ("ocfs2: stop quota recovery before disabling quotas") into android16-6.12-lts
Steps on the way to 6.12.29

Change-Id: I52c3962ac2f0f7a3de8001ebcc8e66628283d9fb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-06-03 06:28:39 +00:00
Paul Burton 0b21e99cf6 clocksource: mips-gic-timer: Enable counter when CPUs start
[ Upstream commit 3128b0a2e0cf6e07aa78e5f8cf7dd9cd59dc8174 ]

In multi-cluster MIPS I6500 systems there is a GIC in each cluster,
each with its own counter. When a cluster powers up the counter will
be stopped, with the COUNTSTOP bit set in the GIC_CONFIG register.

In single cluster systems, it has been fine to clear COUNTSTOP once
in gic_clocksource_of_init() to start the counter. In multi-cluster
systems, this will only have started the counter in the boot cluster,
and any CPUs in other clusters will find their counter stopped which
will break the GIC clock_event_device.

Resolve this by having CPUs clear the COUNTSTOP bit when they come
online, using the existing gic_starting_cpu() CPU hotplug callback. This
will allow CPUs in secondary clusters to ensure that the cluster's GIC
counter is running as expected.

Signed-off-by: Paul Burton <paulburton@kernel.org>
Signed-off-by: Chao-ying Fu <cfu@wavecomp.com>
Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-29 11:02:41 +02:00
Nick Hu 7790a9449c clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug
[ Upstream commit 70c93b026ed07078e933583591aa9ca6701cd9da ]

Stop the timer when the cpu is going to be offline otherwise the
timer interrupt may be pending while performing power-down.

Suggested-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/lkml/20240829033904.477200-3-nick.hu@sifive.com/T/#u
Signed-off-by: Nick Hu <nick.hu@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20250219114135.27764-3-nick.hu@sifive.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-29 11:02:14 +02:00
Sebastian Andrzej Siewior ed45af6841 clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable()
commit 94cff94634e506a4a44684bee1875d2dbf782722 upstream.

On x86 during boot, clockevent_i8253_disable() can be invoked via
x86_late_time_init -> hpet_time_init() -> pit_timer_init() which happens
with enabled interrupts.

If some of the old i8253 hardware is actually used then lockdep will notice
that i8253_lock is used in hard interrupt context. This causes lockdep to
complain because it observed the lock being acquired with interrupts
enabled and in hard interrupt context.

Make clockevent_i8253_disable() acquire the lock with
raw_spinlock_irqsave() to cure this.

[ tglx: Massage change log and use guard() ]

Fixes: c8c4076723 ("x86/timer: Skip PIT initialization on modern chipsets")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250404133116.p-XRWJXf@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-18 08:24:54 +02:00
Greg Kroah-Hartman fbffc72bf0 Merge fba396b799 ("sparc/mm: avoid calling arch_enter/leave_lazy_mmu() in set_ptes") into android16-6.12-lts
Steps on the way to 6.12.24

Change-Id: I10efdb86ef7942f71b14841ff3628b4eaa3ae1e9
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-05-09 07:26:27 +00:00
Alexandre Torgue 9d6b789a8f clocksource/drivers/stm32-lptimer: Use wakeup capable instead of init wakeup
commit 96bf4b89a6ab22426ad83ef76e66c72a5a8daca0 upstream.

"wakeup-source" property describes a device which has wakeup capability
but should not force this device as a wakeup source.

Fixes: 48b41c5e2d ("clocksource: Add Low Power STM32 timers driver")
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Rule: add
Link: https://lore.kernel.org/stable/20250306083407.2374894-1-fabrice.gasnier%40foss.st.com
Link: https://lore.kernel.org/r/20250306102501.2980153-1-fabrice.gasnier@foss.st.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-20 10:15:39 +02:00
Greg Kroah-Hartman 4197297aa9 Merge 6.12.17 into android16-6.12
GKI (arm64) relevant 39 out of 154 changes, affecting 57 files +585/-415
  93745f5f23 arm64: mte: Do not allow PROT_MTE on MAP_HUGETLB user mappings [1 file, +6/-3]
  065215ef00 Bluetooth: qca: Update firmware-name to support board specific nvm [1 file, +85/-28]
  4a679448ef Bluetooth: qca: Fix poor RF performance for WCN6855 [1 file, +3/-2]
  3e0686bc60 Input: serio - define serio_pause_rx guard to pause and resume serio ports [1 file, +3/-0]
  1711fd7bd9 PCI: Make pcim_request_all_regions() a public function [2 files, +3/-1]
  969c54c82d PCI: Export pci_intx_unmanaged() and pcim_intx() [3 files, +34/-21]
  ed020100b6 PCI: Remove devres from pci_intx() [3 files, +4/-44]
  75334c9cd6 PCI: Restore original INTX_DISABLE bit by pcim_intx() [1 file, +19/-15]
  3284fbfa87 tracing: Switch trace.c code over to use guard() [1 file, +94/-172]
  1e6419b1a4 tracing: Have the error of __tracing_resize_ring_buffer() passed to user [1 file, +1/-7]
  e9fec6f42c USB: gadget: f_midi: f_midi_complete to call queue_work [1 file, +1/-1]
  4381a4fab3 vsock/virtio: fix variables initialization during resuming [1 file, +7/-3]
  3e4c56cf41 net/sched: cls_api: fix error handling causing NULL dereference [1 file, +1/-1]
  22b683217a sockmap, vsock: For connectible sockets allow only connected [1 file, +3/-0]
  478a46f112 vsock/bpf: Warn on socket without transport [2 files, +4/-1]
  997ef6117e tcp: adjust rcvq_space after updating scaling ratio [1 file, +9/-3]
  90c7f5cd59 flow_dissector: Fix handling of mixed port and port-range keys [1 file, +19/-12]
  cbd75b9136 flow_dissector: Fix port range key handling in BPF conversion [1 file, +10/-8]
  36d5616bc5 net: Add non-RCU dev_getbyhwaddr() helper [2 files, +36/-3]
  c4a0f11532 arp: switch to dev_getbyhwaddr() in arp_req_set_public() [1 file, +1/-1]
  cd34a07f74 tcp: drop secpath at the same time as we currently drop dst [4 files, +21/-7]
  ed0ca7d212 net: allow small head cache usage with large MAX_SKB_FRAGS values [3 files, +10/-6]
  972bafed67 bpf, test_run: Fix use-after-free issue in eth_skb_pkt_type() [1 file, +1/-4]
  1c81ba1913 bpf: unify VM_WRITE vs VM_MAYWRITE use in BPF map mmaping logic [2 files, +8/-6]
  d95607a5f2 bpf: avoid holding freeze_mutex during mmap operation [1 file, +10/-7]
  6798f428d8 bpf: Fix wrong copied_seq calculation [5 files, +77/-5]
  f91716d5fa bpf: Disable non stream socket for strparser [1 file, +4/-1]
  fac674d2bd bpf: Fix deadlock when freeing cgroup storage [1 file, +1/-1]
  f579afacd0 net: Add rx_skb of kfree_skb to raw_tp_null_args[]. [1 file, +2/-0]
  c1f3f3892d bpf: Fix softlockup in arena_map_free on 64k page kernel [1 file, +1/-1]
  d2d5fe4c64 nvme/ioctl: add missing space in err message [1 file, +1/-2]
  7b8894ef03 bpf: skip non exist keys in generic_map_lookup_batch [1 file, +5/-13]
  79151b47bf io_uring/rw: forbid multishot async reads [1 file, +11/-2]
  506b9b5e8c io_uring: prevent opcode speculation [1 file, +2/-0]
  6f3edf2d50 gpiolib: protect gpio_chip with SRCU in array_info paths in multi get/set [2 files, +35/-17]
  cd1c4113ba lib/iov_iter: fix import_iovec_ubuf iovec management [1 file, +2/-1]
  ff673b71f0 mm,madvise,hugetlb: check for 0-length range after end address adjustment [1 file, +10/-1]
  ada54b2e81 irqchip/gic-v3: Fix rk3399 workaround when secure interrupts are enabled [1 file, +40/-13]
  384c8291f7 tracing: Fix using ret variable in tracing_set_tracer() [1 file, +1/-2]

Changes in 6.12.17
	arm64: mte: Do not allow PROT_MTE on MAP_HUGETLB user mappings
	drm/xe/oa: Separate batch submission from waiting for completion
	drm/xe/oa/uapi: Define and parse OA sync properties
	drm/xe/oa: Add input fence dependencies
	xe/oa: Fix query mode of operation for OAR/OAC
	btrfs: do not assume the full page range is not dirty in extent_writepage_io()
	btrfs: move the delalloc range bitmap search into extent_io.c
	btrfs: mark all dirty sectors as locked inside writepage_delalloc()
	btrfs: remove unused btrfs_folio_start_writer_lock()
	btrfs: unify to use writer locks for subpage locking
	btrfs: rename btrfs_folio_(set|start|end)_writer_lock()
	btrfs: use btrfs_inode in extent_writepage()
	btrfs: fix double accounting race when btrfs_run_delalloc_range() failed
	btrfs: fix double accounting race when extent_writepage_io() failed
	KVM: x86: Get vcpu->arch.apic_base directly and drop kvm_get_apic_base()
	KVM: x86: Inline kvm_get_apic_mode() in lapic.h
	KVM: nVMX: Defer SVI update to vmcs01 on EOI when L2 is active w/o VID
	drm/amd/display: Refactoring if and endif statements to enable DC_LOGGER
	drm/amd/display: update dcn351 used clock offset
	drm/amd/display: Correct register address in dcn35
	Bluetooth: qca: Update firmware-name to support board specific nvm
	Bluetooth: qca: Fix poor RF performance for WCN6855
	Input: serio - define serio_pause_rx guard to pause and resume serio ports
	Input: synaptics - fix crash when enabling pass-through port
	ASoC: renesas: rz-ssi: Terminate all the DMA transactions
	ASoC: renesas: rz-ssi: Add a check for negative sample_space
	PCI: Make pcim_request_all_regions() a public function
	PCI: Export pci_intx_unmanaged() and pcim_intx()
	PCI: Remove devres from pci_intx()
	PCI: Restore original INTX_DISABLE bit by pcim_intx()
	arm64: dts: mediatek: mt8183-pumpkin: add HDMI support
	arm64: dts: mediatek: mt8183: Disable DSI display output by default
	accel/ivpu: Limit FW version string length
	accel/ivpu: Add coredump support
	accel/ivpu: Add FW state dump on TDR
	accel/ivpu: Fix error handling in recovery/reset
	drm/amdkfd: Move gfx12 trap handler to separate file
	drm/amdkfd: Ensure consistent barrier state saved in gfx12 trap handler
	tracing: Switch trace.c code over to use guard()
	tracing: Have the error of __tracing_resize_ring_buffer() passed to user
	USB: gadget: f_midi: f_midi_complete to call queue_work
	sched_ext: Factor out move_task_between_dsqs() from scx_dispatch_from_dsq()
	sched_ext: Fix migration disabled handling in targeted dispatches
	ASoC: rockchip: i2s-tdm: fix shift config for SND_SOC_DAIFMT_DSP_[AB]
	ASoC: SOF: ipc4-topology: Harden loops for looking up ALH copiers
	powerpc/code-patching: Disable KASAN report during patching via temporary mm
	powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline
	ALSA: hda/realtek: Fixup ALC225 depop procedure
	powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC
	ASoC: imx-audmix: remove cpu_mclk which is from cpu dai device
	vsock/virtio: fix variables initialization during resuming
	geneve: Fix use-after-free in geneve_find_dev().
	ALSA: hda/cirrus: Correct the full scale volume set logic
	net/sched: cls_api: fix error handling causing NULL dereference
	ALSA: seq: Drop UMP events when no UMP-conversion is set
	s390/ism: add release function for struct device
	ibmvnic: Add stat for tx direct vs tx batched
	ibmvnic: Don't reference skb after sending to VIOS
	sockmap, vsock: For connectible sockets allow only connected
	vsock/bpf: Warn on socket without transport
	tcp: adjust rcvq_space after updating scaling ratio
	net: pse-pd: Avoid setting max_uA in regulator constraints
	net: pse-pd: Use power limit at driver side instead of current limit
	net: pse-pd: pd692x0: Fix power limit retrieval
	gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl().
	geneve: Suppress list corruption splat in geneve_destroy_tunnels().
	flow_dissector: Fix handling of mixed port and port-range keys
	flow_dissector: Fix port range key handling in BPF conversion
	net: Add non-RCU dev_getbyhwaddr() helper
	arp: switch to dev_getbyhwaddr() in arp_req_set_public()
	net: axienet: Set mac_managed_pm
	tcp: drop secpath at the same time as we currently drop dst
	net: allow small head cache usage with large MAX_SKB_FRAGS values
	bpf, test_run: Fix use-after-free issue in eth_skb_pkt_type()
	bpf: unify VM_WRITE vs VM_MAYWRITE use in BPF map mmaping logic
	bpf: avoid holding freeze_mutex during mmap operation
	strparser: Add read_sock callback
	bpf: Fix wrong copied_seq calculation
	bpf: Disable non stream socket for strparser
	bpf: Fix deadlock when freeing cgroup storage
	arm64: dts: rockchip: Fix lcdpwr_en pin for Cool Pi GenBook
	power: supply: da9150-fg: fix potential overflow
	power: supply: axp20x_battery: Fix fault handling for AXP717
	selftests/bpf: Add tests for raw_tp null handling
	net: Add rx_skb of kfree_skb to raw_tp_null_args[].
	bpf: Fix softlockup in arena_map_free on 64k page kernel
	arm64: dts: rockchip: adjust SMMU interrupt type on rk3588
	firmware: arm_scmi: imx: Correct tx size of scmi_imx_misc_ctrl_set
	md/raid*: Fix the set_queue_limits implementations
	firmware: imx: IMX_SCMI_MISC_DRV should depend on ARCH_MXC
	platform: cznic: CZNIC_PLATFORMS should depend on ARCH_MVEBU
	nouveau/svm: fix missing folio unlock + put after make_device_exclusive_range()
	drm/msm: Avoid rounding up to one jiffy
	drm/msm/dpu: skip watchdog timer programming through TOP on >= SM8450
	drm/msm/dpu: enable DPU_WB_INPUT_CTRL for DPU 5.x
	drm/msm/dpu: Don't leak bits_per_component into random DSC_ENC fields
	drm/msm/dsi/phy: Protect PHY_CMN_CLK_CFG0 updated from driver side
	drm/msm/dsi/phy: Protect PHY_CMN_CLK_CFG1 against clock driver
	drm/msm/dsi/phy: Do not overwite PHY_CMN_CLK_CFG1 when choosing bitclk source
	nvme: tcp: Fix compilation warning with W=1
	nvme-tcp: fix connect failure on receiving partial ICResp PDU
	nvme/ioctl: add missing space in err message
	bpf: skip non exist keys in generic_map_lookup_batch
	drm/nouveau/pmu: Fix gp10b firmware guard
	irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request
	drm: panel: jd9365da-h3: fix reset signal polarity
	drm/msm/dpu: Disable dither in phys encoder cleanup
	drm/i915: Make sure all planes in use by the joiner have their crtc included
	drm/i915/dp: Fix error handling during 128b/132b link training
	drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL
	drm/i915/gt: Use spin_lock_irqsave() in interruptible context
	io_uring/rw: forbid multishot async reads
	io_uring: prevent opcode speculation
	gpiolib: protect gpio_chip with SRCU in array_info paths in multi get/set
	tee: optee: Fix supplicant wait loop
	drop_monitor: fix incorrect initialization order
	mm/migrate_device: don't add folio to be freed to LRU in migrate_device_finalize()
	arm64: dts: rockchip: Fix broken tsadc pinctrl names for rk3588
	arm64: dts: rockchip: Move uart5 pin configuration to px30 ringneck SoM
	arm64: dts: rockchip: Disable DMA for uart5 on px30-ringneck
	soc: loongson: loongson2_guts: Add check for devm_kstrdup()
	s390/boot: Fix ESSA detection
	xfs: fix online repair probing when CONFIG_XFS_ONLINE_REPAIR=n
	lib/iov_iter: fix import_iovec_ubuf iovec management
	smb: client: fix chmod(2) regression with ATTR_READONLY
	nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()
	gve: set xdp redirect target only when it is available
	ASoC: SOF: stream-ipc: Check for cstream nullity in sof_ipc_msg_data()
	ASoC: fsl_micfil: Enable default case in micfil_set_quality()
	ALSA: hda: Add error check for snd_ctl_rename_id() in snd_hda_create_dig_out_ctls()
	ALSA: hda/conexant: Add quirk for HP ProBook 450 G4 mute LED
	ASoC: SOF: pcm: Clear the susbstream pointer to NULL on close
	acct: perform last write from workqueue
	acct: block access to kernel internal filesystems
	mm,madvise,hugetlb: check for 0-length range after end address adjustment
	mtd: spi-nor: sst: Fix SST write failure
	mtd: rawnand: cadence: fix error code in cadence_nand_init()
	mtd: rawnand: cadence: use dma_map_resource for sdma address
	mtd: rawnand: cadence: fix incorrect device in dma_unmap_single
	perf/x86/intel: Fix event constraints for LNC
	irqchip/gic-v3: Fix rk3399 workaround when secure interrupts are enabled
	smb: client: Add check for next_buffer in receive_encrypted_standard()
	EDAC/qcom: Correct interrupt enable register configuration
	ftrace: Correct preemption accounting for function tracing.
	ftrace: Fix accounting of adding subops to a manager ops
	ftrace: Do not add duplicate entries in subops manager ops
	tracing: Fix using ret variable in tracing_set_tracer()
	net: pse-pd: Fix deadlock in current limit functions
	sched_ext: Fix incorrect assumption about migration disabled tasks in task_can_run_on_remote_rq()
	selftests/mm: build with -O2
	arm64: dts: rockchip: change eth phy mode to rgmii-id for orangepi r1 plus lts
	drm/amdgpu/gfx9: manually control gfxoff for CS on RV
	drm/amdgpu: bump version for RV/PCO compute fix
	Linux 6.12.17

Change-Id: I5ee898299270b3b8a7d037d4b060ab803a3cc8db
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2025-03-05 08:42:08 +00:00
Artur Rojek 97621151f4 irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request
[ Upstream commit d7e3fd658248f257006227285095d190e70ee73a ]

The jcore-aic irqchip does not have separate interrupt numbers reserved for
cpu-local vs global interrupts. Therefore the device drivers need to
request the given interrupt as per CPU interrupt.

69a9dcbd2d ("clocksource/drivers/jcore: Use request_percpu_irq()")
converted the clocksource driver over to request_percpu_irq(), but failed
to do add all the required changes, resulting in a failure to register PIT
interrupts.

Fix this by:

 1) Explicitly mark the interrupt via irq_set_percpu_devid() in
    jcore_pit_init().

 2) Enable and disable the per CPU interrupt in the CPU hotplug callbacks.

 3) Pass the correct per-cpu cookie to the irq handler by using
    handle_percpu_devid_irq() instead of handle_percpu_irq() in
    handle_jcore_irq().

[ tglx: Massage change log ]

Fixes: 69a9dcbd2d ("clocksource/drivers/jcore: Use request_percpu_irq()")
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/all/20250216175545.35079-3-contact@artur-rojek.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-02-27 04:30:21 -08:00
Chun-Hung Wu 217dc21da7 ANDROID: GKI: Export clocksource_mmio_init
Export clocksource_mmio_init and clocksource_mmio_readl_up
to support building clocksource driver as module,
such as timer-mediatek.c.

Bug: 161675989
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Change-Id: I7df2f2ac62f2322c1d32686907cb0bd87639f6fc
(cherry picked from commit bd213d9a67050fdd380a1c1d94a5388f8041f28a)
(cherry picked from commit c0b208dbee699ab3fdf9625a3890974fcf911621)
(cherry picked from commit 1539e076d095e655afde0c2b5ab6c4d5553dc355)
2025-01-06 10:56:05 -08:00
Greg Kroah-Hartman eff3d84d46 Merge 6.12.7 into android16-6.12
GKI (arm64) relevant 43 out of 161 changes, affecting 62 files +519/-460
  5dbe6816c4 sched/fair: Fix NEXT_BUDDY [1 file, +2/-5]
  0ee98301f1 sched/fair: Fix sched_can_stop_tick() for fair tasks [1 file, +1/-1]
  0653fa6ee0 erofs: fix PSI memstall accounting [1 file, +2/-2]
  bdd68033d1 sched/dlserver: Fix dlserver double enqueue [3 files, +18/-2]
  baedaacee1 sched/dlserver: Fix dlserver time accounting [1 file, +9/-6]
  910798ecd3 erofs: add erofs_sb_free() helper [1 file, +19/-17]
  3e0d81efcb erofs: use `struct erofs_device_info` for the primary device [4 files, +22/-31]
  f067d3f69d erofs: reference `struct erofs_device_info` for erofs_map_dev [4 files, +15/-23]
  3042448109 erofs: use buffered I/O for file-backed mounts by default [3 files, +21/-10]
  d924c8afe6 netdev: fix repeated netlink messages in queue dump [1 file, +4/-7]
  b38e858ab0 netdev: fix repeated netlink messages in queue stats [1 file, +2/-2]
  57ed6505ba netdev-genl: avoid empty messages in queue dump [1 file, +2/-2]
  aa9e573145 net: mdiobus: fix an OF node reference leak [1 file, +10/-3]
  20bf32f482 irqchip/gic-v3: Work around insecure GIC integrations [1 file, +16/-1]
  ea78f77f78 KVM: arm64: Do not allow ID_AA64MMFR0_EL1.ASIDbits to be overridden [1 file, +2/-1]
  4f393ea1e2 net: tun: fix tun_napi_alloc_frags() [1 file, +1/-1]
  97701315e3 block: Revert "block: Fix potential deadlock while freezing queue and acquiring sysfs_lock" [3 files, +23/-26]
  7ccad1ee83 xhci: Turn NEC specific quirk for handling Stop Endpoint errors generic [1 file, +0/-2]
  47c8b6cf1d drm/modes: Avoid divide by zero harder in drm_mode_vrefresh() [1 file, +7/-4]
  c8395bfcd0 dma-buf: Fix __dma_buf_debugfs_list_del argument for !CONFIG_DEBUG_FS [1 file, +1/-1]
  b5792c162d block: avoid to reuse `hctx` not removed from cpuhp callback list [1 file, +10/-1]
  1828714c09 trace/ring-buffer: Do not use TP_printk() formatting for boot mapped buffers [1 file, +9/-0]
  6d91e90cfc zram: refuse to use zero sized block device as backing device [1 file, +6/-0]
  6fb92e9a52 zram: fix uninitialized ZRAM not releasing backing device [1 file, +4/-5]
  ad7c9f1f43 vmalloc: fix accounting with i915 [1 file, +4/-2]
  4234ca9884 mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy() [1 file, +4/-2]
  ec12f30fe5 ring-buffer: Fix overflow in __rb_map_vma [1 file, +5/-1]
  9667c91464 alloc_tag: fix set_codetag_empty() when !CONFIG_MEM_ALLOC_PROFILING_DEBUG [1 file, +6/-1]
  3985cd3047 tracing: Fix test_event_printk() to process entire print argument [1 file, +53/-29]
  71a613ceac tracing: Add missing helper functions in event pointer dereference check [1 file, +19/-2]
  683eccacc0 tracing: Add "%s" check in test_event_printk() [1 file, +89/-15]
  d3e73fe7ca tracing: Check "%s" dereference via the field and not the TP_printk format [5 files, +88/-217]
  06eb089489 io_uring: Fix registered ring file refcount leak [2 files, +2/-3]
  4f95a2186b io_uring: check if iowq is killed before queuing [1 file, +5/-1]
  2976661ed4 of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent() [1 file, +1/-0]
  e30e72844c of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one() [1 file, +1/-0]
  e0d9c581ac of: property: fw_devlink: Do not use interrupt-parent directly [1 file, +0/-2]
  501d686391 of: address: Preserve the flags portion on 1:1 dma-ranges mapping [1 file, +2/-1]
  c62318587c of: Fix error path in of_parse_phandle_with_args_map() [1 file, +10/-5]
  adc4b70fb6 of: Fix refcount leakage for OF node returned by __of_get_dma_parent() [1 file, +1/-1]
  a095090b70 mm: shmem: fix ShmemHugePages at swapout [1 file, +12/-10]
  a086c8d7f2 mm: convert partially_mapped set/clear operations to be atomic [2 files, +6/-14]
  2d129beb8d epoll: Add synchronous wakeup support for ep_poll_callback [2 files, +5/-1]

Changes in 6.12.7
	net: sched: fix ordering of qlen adjustment
	net: stmmac: fix TSO DMA API usage causing oops
	firmware: arm_scmi: Fix i.MX build dependency
	firmware: arm_ffa: Fix the race around setting ffa_dev->properties
	RISC-V: KVM: Fix csr_write -> csr_set for HVIEN PMU overflow bit
	sched/fair: Fix NEXT_BUDDY
	sched/fair: Fix sched_can_stop_tick() for fair tasks
	sched/eevdf: More PELT vs DELAYED_DEQUEUE
	p2sb: Factor out p2sb_read_from_cache()
	p2sb: Introduce the global flag p2sb_hidden_by_bios
	p2sb: Move P2SB hide and unhide code to p2sb_scan_and_cache()
	p2sb: Do not scan and remove the P2SB device when it is unhidden
	i2c: pnx: Fix timeout in wait functions
	s390/ipl: Fix never less than zero warning
	erofs: fix PSI memstall accounting
	sched/dlserver: Fix dlserver double enqueue
	sched/dlserver: Fix dlserver time accounting
	s390/mm: Consider KMSAN modules metadata for paging levels
	erofs: add erofs_sb_free() helper
	erofs: use `struct erofs_device_info` for the primary device
	erofs: reference `struct erofs_device_info` for erofs_map_dev
	erofs: use buffered I/O for file-backed mounts by default
	xfs: sb_spino_align is not verified
	xfs: fix sparse inode limits on runt AG
	xfs: fix off-by-one error in fsmap's end_daddr usage
	xfs: fix sb_spino_align checks for large fsblock sizes
	xfs: fix zero byte checking in the superblock scrubber
	tools: hv: change permissions of NetworkManager configuration file
	cxl/pci: Fix potential bogus return value upon successful probing
	cxl/region: Fix region creation for greater than x2 switches
	net/smc: protect link down work from execute after lgr freed
	net/smc: check sndbuf_space again after NOSPACE flag is set in smc_poll
	net/smc: check iparea_offset and ipv6_prefixes_cnt when receiving proposal msg
	net/smc: check v2_ext_offset/eid_cnt/ism_gid_cnt when receiving proposal msg
	net/smc: check smcd_v2_ext_offset when receiving proposal msg
	net/smc: check return value of sock_recvmsg when draining clc data
	net: mscc: ocelot: fix incorrect IFH SRC_PORT field in ocelot_ifh_set_basic()
	netdevsim: prevent bad user input in nsim_dev_health_break_write()
	tools/net/ynl: fix sub-message key lookup for nested attributes
	ionic: Fix netdev notifier unregister on failure
	ionic: no double destroy workqueue
	ionic: use ee->offset when returning sprom data
	net: renesas: rswitch: rework ts tags management
	ksmbd: count all requests in req_running counter
	ksmbd: fix broken transfers when exceeding max simultaneous operations
	netdev: fix repeated netlink messages in queue dump
	netdev: fix repeated netlink messages in queue stats
	team: Fix feature exposure when no ports are present
	net: hinic: Fix cleanup in create_rxqs/txqs()
	net: ethernet: oa_tc6: fix infinite loop error when tx credits becomes 0
	net: ethernet: oa_tc6: fix tx skb race condition between reference pointers
	net: ethernet: bgmac-platform: fix an OF node reference leak
	net: netdevsim: fix nsim_pp_hold_write()
	can: m_can: set init flag earlier in probe
	can: m_can: fix missed interrupts with m_can_pci
	ipvs: Fix clamp() of ip_vs_conn_tab on small memory systems
	netfilter: ipset: Fix for recursive locking warning
	selftests: openvswitch: fix tcpdump execution
	net: dsa: restore dsa_software_vlan_untag() ability to operate on VLAN-untagged traffic
	netdev-genl: avoid empty messages in queue dump
	psample: adjust size if rate_as_probability is set
	net: mdiobus: fix an OF node reference leak
	mmc: sdhci-tegra: Remove SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC quirk
	mmc: mtk-sd: disable wakeup in .remove() and in the error path of .probe()
	irqchip/gic-v3: Work around insecure GIC integrations
	EDAC/amd64: Simplify ECC check on unified memory controllers
	KVM: arm64: Do not allow ID_AA64MMFR0_EL1.ASIDbits to be overridden
	KVM: x86: Cache CPUID.0xD XSTATE offsets+sizes during module init
	net: tun: fix tun_napi_alloc_frags()
	chelsio/chtls: prevent potential integer overflow on 32bit
	net: mctp: handle skb cleanup on sock_queue failures
	block: Revert "block: Fix potential deadlock while freezing queue and acquiring sysfs_lock"
	i2c: riic: Always round-up when calculating bus period
	efivarfs: Fix error on non-existent file
	hexagon: Disable constant extender optimization for LLVM prior to 19.1.0
	USB: serial: option: add TCL IK512 MBIM & ECM
	USB: serial: option: add MeiG Smart SLM770A
	USB: serial: option: add Netprisma LCUK54 modules for WWAN Ready
	USB: serial: option: add MediaTek T7XX compositions
	USB: serial: option: add Telit FE910C04 rmnet compositions
	xhci: Turn NEC specific quirk for handling Stop Endpoint errors generic
	thunderbolt: Add support for Intel Panther Lake-M/P
	thunderbolt: Improve redrive mode handling
	thunderbolt: Don't display nvm_version unless upgrade supported
	drm/display: use ERR_PTR on DP tunnel manager creation fail
	drm/amd: Update strapping for NBIO 2.5.0
	drm/modes: Avoid divide by zero harder in drm_mode_vrefresh()
	drm/amdgpu: fix amdgpu_coredump
	drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update
	udmabuf: udmabuf_create pin folio codestyle cleanup
	udmabuf: fix memory leak on last export_udmabuf() error path
	dma-buf: Fix __dma_buf_debugfs_list_del argument for !CONFIG_DEBUG_FS
	drm/panel: himax-hx83102: Add a check to prevent NULL pointer dereference
	drm/panel: novatek-nt35950: fix return value check in nt35950_probe()
	drm/panel: st7701: Add prepare_prev_first flag to drm_panel
	drm/panel: synaptics-r63353: Fix regulator unbalance
	i915/guc: Reset engine utilization buffer before registration
	i915/guc: Ensure busyness counter increases motonically
	i915/guc: Accumulate active runtime on gt reset
	drm/amdgpu: don't access invalid sched
	hwmon: (tmp513) Fix interpretation of values of Shunt Voltage and Limit Registers
	hwmon: (tmp513) Fix Current Register value interpretation
	hwmon: (tmp513) Fix interpretation of values of Temperature Result and Limit Registers
	block: avoid to reuse `hctx` not removed from cpuhp callback list
	trace/ring-buffer: Do not use TP_printk() formatting for boot mapped buffers
	drm/amdgpu/nbio7.11: fix IP version check
	drm/amdgpu/nbio7.7: fix IP version check
	drm/amdgpu/smu14.0.2: fix IP version check
	zram: refuse to use zero sized block device as backing device
	zram: fix uninitialized ZRAM not releasing backing device
	vmalloc: fix accounting with i915
	mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy()
	ring-buffer: Fix overflow in __rb_map_vma
	alloc_tag: fix set_codetag_empty() when !CONFIG_MEM_ALLOC_PROFILING_DEBUG
	btrfs: split bios to the fs sector size boundary
	btrfs: fix improper generation check in snapshot delete
	btrfs: tree-checker: reject inline extent items with 0 ref count
	s390/mm: Fix DirectMap accounting
	drm/amdgpu/nbio7.0: fix IP version check
	drm/amdgpu/gfx12: fix IP version check
	drm/amdgpu/mmhub4.1: fix IP version check
	fgraph: Still initialize idle shadow stacks when starting
	Drivers: hv: util: Avoid accessing a ringbuffer not initialized yet
	tools: hv: Fix a complier warning in the fcopy uio daemon
	x86/hyperv: Fix hv tsc page based sched_clock for hibernation
	KVM: x86: Play nice with protected guests in complete_hypercall_exit()
	smb: client: fix TCP timers deadlock after rmmod
	accel/ivpu: Fix general protection fault in ivpu_bo_list()
	accel/ivpu: Fix WARN in ivpu_ipc_send_receive_internal()
	tracing: Fix test_event_printk() to process entire print argument
	tracing: Add missing helper functions in event pointer dereference check
	tracing: Add "%s" check in test_event_printk()
	tracing: Check "%s" dereference via the field and not the TP_printk format
	selftests/memfd: run sysctl tests when PID namespace support is enabled
	selftests/bpf: Use asm constraint "m" for LoongArch
	io_uring: Fix registered ring file refcount leak
	io_uring: check if iowq is killed before queuing
	NFS/pnfs: Fix a live lock between recalled layouts and layoutget
	KVM: SVM: Allow guest writes to set MSR_AMD64_DE_CFG bits
	of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent()
	of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one()
	ocfs2: fix the space leak in LA when releasing LA
	nilfs2: fix buffer head leaks in calls to truncate_inode_pages()
	nilfs2: prevent use of deleted inode
	udmabuf: fix racy memfd sealing check
	udmabuf: also check for F_SEAL_FUTURE_WRITE
	of: property: fw_devlink: Do not use interrupt-parent directly
	of: address: Preserve the flags portion on 1:1 dma-ranges mapping
	of: Fix error path in of_parse_phandle_with_args_map()
	of: Fix refcount leakage for OF node returned by __of_get_dma_parent()
	ceph: give up on paths longer than PATH_MAX
	ceph: validate snapdirname option length when mounting
	ceph: improve error handling and short/overflow-read logic in __ceph_sync_read()
	ceph: fix memory leaks in __ceph_sync_read()
	ceph: fix memory leak in ceph_direct_read_write()
	mm: use aligned address in clear_gigantic_page()
	mm: use aligned address in copy_user_gigantic_page()
	mm: shmem: fix ShmemHugePages at swapout
	mm: convert partially_mapped set/clear operations to be atomic
	epoll: Add synchronous wakeup support for ep_poll_callback
	Linux 6.12.7

Change-Id: I139753dbdf8a7e4c9a1d0381d0f14830965acd1a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-12-30 10:50:02 +00:00
Naman Jain bacd0498de x86/hyperv: Fix hv tsc page based sched_clock for hibernation
commit bcc80dec91ee745b3d66f3e48f0ec2efdea97149 upstream.

read_hv_sched_clock_tsc() assumes that the Hyper-V clock counter is
bigger than the variable hv_sched_clock_offset, which is cached during
early boot, but depending on the timing this assumption may be false
when a hibernated VM starts again (the clock counter starts from 0
again) and is resuming back (Note: hv_init_tsc_clocksource() is not
called during hibernation/resume); consequently,
read_hv_sched_clock_tsc() may return a negative integer (which is
interpreted as a huge positive integer since the return type is u64)
and new kernel messages are prefixed with huge timestamps before
read_hv_sched_clock_tsc() grows big enough (which typically takes
several seconds).

Fix the issue by saving the Hyper-V clock counter just before the
suspend, and using it to correct the hv_sched_clock_offset in
resume. This makes hv tsc page based sched_clock continuous and ensures
that post resume, it starts from where it left off during suspend.
Override x86_platform.save_sched_clock_state and
x86_platform.restore_sched_clock_state routines to correct this as soon
as possible.

Note: if Invariant TSC is available, the issue doesn't happen because
1) we don't register read_hv_sched_clock_tsc() for sched clock:
See commit e5313f1c54 ("clocksource/drivers/hyper-v: Rework
clocksource and sched clock setup");
2) the common x86 code adjusts TSC similarly: see
__restore_processor_state() ->  tsc_verify_tsc_adjust(true) and
x86_platform.restore_sched_clock_state().

Cc: stable@vger.kernel.org
Fixes: 1349401ff1 ("clocksource/drivers/hyper-v: Suspend/resume Hyper-V clocksource for hibernation")
Co-developed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20240917053917.76787-1-namjain@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20240917053917.76787-1-namjain@linux.microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-27 14:02:15 +01:00
Chun-Hung Wu c82917ebd2 FROMLIST: clocksource/drivers/timer-of: Remove __init markings
Remove __init markings to allow timer drivers
can be compiled as modules.

Link: https://lore.kernel.org/lkml/20230421034649.15247-5-walter.chang@mediatek.com/T/
Bug: 161675989
Change-Id: I74c9d1b4bc6f49dc5a69b4502ca68cb8cc3cbf02
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
(cherry picked from commit 4625c2b6021552c168776cbc7562dfce7e486110)
(cherry picked from commit 5875d23eeb7cd7ec0dd30d677b9c9271a69c3bfd)
2024-12-17 15:09:52 -08:00
Greg Kroah-Hartman 2bab7bdb88 Merge da7df496b8 ("perf trace: Avoid garbage when not printing a syscall's arguments") into android16-6.12
Steps on the way to 6.12.2

Resolves merge conflicts in:
	fs/fuse/fuse_i.h

Change-Id: If765bb10099fb7efad53a0a4bcda888cd571ac97
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-12-13 02:48:11 -08:00
Javier Carrasco 3fc6fc23d0 clocksource/drivers/timer-ti-dm: Fix child node refcount handling
[ Upstream commit e5cfc0989d9a2849c51c720a16b90b2c061a1aeb ]

of_find_compatible_node() increments the node's refcount, and it must be
decremented again with a call to of_node_put() when the pointer is no
longer required to avoid leaking the resource.

Instead of adding the missing calls to of_node_put() in all execution
paths, use the cleanup attribute for 'arm_timer' by means of the
__free() macro, which automatically calls of_node_put() when the
variable goes out of scope.

Fixes: 25de4ce5ed ("clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241031-timer-ti-dm-systimer-of_node_put-v3-1-063ee822b73a@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-05 14:01:23 +01:00
Mark Brown bcede8bb50 clocksource/drivers:sp804: Make user selectable
[ Upstream commit 0309f714a0908e947af1c902cf6a330cb593e75e ]

The sp804 is currently only user selectable if COMPILE_TEST, this was
done by commit dfc82faad7 ("clocksource/drivers/sp804: Add
COMPILE_TEST to CONFIG_ARM_TIMER_SP804") in order to avoid it being
spuriously offered on platforms that won't have the hardware since it's
generally only seen on Arm based platforms.  This config is overly
restrictive, while platforms that rely on the SP804 do select it in
their Kconfig there are others such as the Arm fast models which have a
SP804 available but currently unused by Linux.  Relax the dependency to
allow it to be user selectable on arm and arm64 to avoid surprises and
in case someone comes up with a use for extra timer hardware.

Fixes: dfc82faad7 ("clocksource/drivers/sp804: Add COMPILE_TEST to CONFIG_ARM_TIMER_SP804")
Reported-by: Ross Burton <ross.burton@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241001-arm64-vexpress-sp804-v3-1-0a2d3f7883e4@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-05 14:01:23 +01:00
Matthias Maennich 8ab8a434ea Merge d58db3f3a0 ("Merge tag 'docs-6.12' of git://git.lwn.net/linux") into android-mainline
Steps on the way to 6.12-rc1

Bug: 367265496
Change-Id: If60ec1a650903bc7f1e176954ae2cc19590f580c
Signed-off-by: Matthias Maennich <maennich@google.com>
2024-09-25 09:06:53 +00:00
Matthias Maennich b5aeebd6f1 Merge c903327d32 ("Merge tag 'printk-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux") into android-mainline
Steps on the way to 6.12-rc1

Bug: 367265496
Change-Id: I0d94aa9be16f183bf187f91dc4916add32722775
Signed-off-by: Matthias Maennich <maennich@google.com>
2024-09-25 08:51:49 +00:00
Linus Torvalds fc1dc0d507 Merge tag 'x86-timers-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 timer updates from Thomas Gleixner:

 - Use the topology information of number of packages for making the
   decision about TSC trust instead of using the number of online nodes
   which is not reflecting the real topology.

 - Stop the PIT timer 0 when its not in use as to stop pointless
   emulation in the VMM.

 - Fix the PIT timer stop sequence for timer 0 so it truly stops both
   real hardware and buggy VMM emulations.

* tag 'x86-timers-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/tsc: Check for sockets instead of CPUs to make code match comment
  clockevents/drivers/i8253: Fix stop sequence for timer 0
  x86/i8253: Disable PIT timer 0 when not in use
  x86/tsc: Use topology_max_packages() to get package number
2024-09-17 15:27:01 +02:00
Linus Torvalds 9ea925c806 Merge tag 'timers-core-2024-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner:
 "Core:

   - Overhaul of posix-timers in preparation of removing the workaround
     for periodic timers which have signal delivery ignored.

   - Remove the historical extra jiffie in msleep()

     msleep() adds an extra jiffie to the timeout value to ensure
     minimal sleep time. The timer wheel ensures minimal sleep time
     since the large rewrite to a non-cascading wheel, but the extra
     jiffie in msleep() remained unnoticed. Remove it.

   - Make the timer slack handling correct for realtime tasks.

     The procfs interface is inconsistent and does neither reflect
     reality nor conforms to the man page. Show the correct 0 slack for
     real time tasks and enforce it at the core level instead of having
     inconsistent individual checks in various timer setup functions.

   - The usual set of updates and enhancements all over the place.

  Drivers:

   - Allow the ACPI PM timer to be turned off during suspend

   - No new drivers

   - The usual updates and enhancements in various drivers"

* tag 'timers-core-2024-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (43 commits)
  ntp: Make sure RTC is synchronized when time goes backwards
  treewide: Fix wrong singular form of jiffies in comments
  cpu: Use already existing usleep_range()
  timers: Rename next_expiry_recalc() to be unique
  platform/x86:intel/pmc: Fix comment for the pmc_core_acpi_pm_timer_suspend_resume function
  clocksource/drivers/jcore: Use request_percpu_irq()
  clocksource/drivers/cadence-ttc: Add missing clk_disable_unprepare in ttc_setup_clockevent
  clocksource/drivers/asm9260: Add missing clk_disable_unprepare in asm9260_timer_init
  clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init()
  clocksource/drivers/ingenic: Use devm_clk_get_enabled() helpers
  platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended
  clocksource: acpi_pm: Add external callback for suspend/resume
  clocksource/drivers/arm_arch_timer: Using for_each_available_child_of_node_scoped()
  dt-bindings: timer: rockchip: Add rk3576 compatible
  timers: Annotate possible non critical data race of next_expiry
  timers: Remove historical extra jiffie for timeout in msleep()
  hrtimer: Use and report correct timerslack values for realtime tasks
  hrtimer: Annotate hrtimer_cpu_base_.*_expiry() for sparse.
  timers: Add sparse annotation for timer_sync_wait_running().
  signal: Replace BUG_ON()s
  ...
2024-09-17 07:25:37 +02:00
Greg Kroah-Hartman 749cb9289d Merge 8d8d276ba2 ("Merge tag 'trace-v6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace") into android-mainline
Steps on the way to 6.11

Change-Id: I47a9b6ab0b0e8d53ab98d93312f03a40fabf1f35
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-09-11 17:04:28 +02:00
Thomas Gleixner 2f7eedca6c Merge branch 'linus' into timers/core
To update with the latest fixes.
2024-09-10 13:49:53 +02:00
Greg Kroah-Hartman c0af0e1249 Merge da3ea35007 ("Linux 6.11-rc7") into android-mainline
Steps on the way to 6.11

Change-Id: I94012b5e8ce92a2d727972d0967c3795ddafb75b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-09-10 10:47:15 +02:00
Linus Torvalds fb92a1ffc1 Merge tag 'hyperv-fixes-signed-20240908' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
Pull hyperv fixes from Wei Liu:

 - Add a documentation overview of Confidential Computing VM support
   (Michael Kelley)

 - Use lapic timer in a TDX VM without paravisor (Dexuan Cui)

 - Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency
   (Michael Kelley)

 - Fix a kexec crash due to VP assist page corruption (Anirudh
   Rayabharam)

 - Python3 compatibility fix for lsvmbus (Anthony Nandaa)

 - Misc fixes (Rachel Menge, Roman Kisel, zhang jiao, Hongbo Li)

* tag 'hyperv-fixes-signed-20240908' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  hv: vmbus: Constify struct kobj_type and struct attribute_group
  tools: hv: rm .*.cmd when make clean
  x86/hyperv: fix kexec crash due to VP assist page corruption
  Drivers: hv: vmbus: Fix the misplaced function description
  tools: hv: lsvmbus: change shebang to use python3
  x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency
  Documentation: hyperv: Add overview of Confidential Computing VM support
  clocksource: hyper-v: Use lapic timer in a TDX VM without paravisor
  Drivers: hv: Remove deprecated hv_fcopy declarations
2024-09-09 09:31:55 -07:00
Uros Bizjak 69a9dcbd2d clocksource/drivers/jcore: Use request_percpu_irq()
Use request_percpu_irq() instead of request_irq() to solve
the following sparse warning:

jcore-pit.c:173:40: warning: incorrect type in argument 5 (different address spaces)
jcore-pit.c:173:40:    expected void *dev
jcore-pit.c:173:40:    got struct jcore_pit [noderef] __percpu *static [assigned] [toplevel] jcore_pit_percpu

Compile tested only.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rich Felker <dalias@libc.org>
Link: https://lore.kernel.org/r/20240902104810.21080-1-ubizjak@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:21 +02:00
Gaosheng Cui 2e02da1d86 clocksource/drivers/cadence-ttc: Add missing clk_disable_unprepare in ttc_setup_clockevent
Add the missing clk_disable_unprepare() before return in
ttc_setup_clockevent().

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240803064253.331946-3-cuigaosheng1@huawei.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:21 +02:00
Gaosheng Cui 6cc11b65e5 clocksource/drivers/asm9260: Add missing clk_disable_unprepare in asm9260_timer_init
Add the missing clk_disable_unprepare() before return in
asm9260_timer_init().

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20240803064253.331946-2-cuigaosheng1@huawei.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:21 +02:00
Ankit Agrawal ca140a0dc0 clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init()
Add the missing iounmap() when clock frequency fails to get read by the
of_property_read_u32() call, or if the call to msm_timer_init() fails.

Fixes: 6e3321631a ("ARM: msm: Add DT support to msm_timer")
Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240713095713.GA430091@bnew-VirtualBox
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:21 +02:00
Huan Yang 414b2fb4bb clocksource/drivers/ingenic: Use devm_clk_get_enabled() helpers
The devm_clk_get_enabled() helpers:
    - call devm_clk_get()
    - call clk_prepare_enable() and register what is needed in order to
     call clk_disable_unprepare() when needed, as a managed resource.

This simplifies the code and avoids the calls to clk_disable_unprepare().

Signed-off-by: Huan Yang <link@vivo.com>
Link: https://lore.kernel.org/r/20240820094603.103598-1-link@vivo.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:20 +02:00
Marek Maslanka 56bd72e9cd clocksource: acpi_pm: Add external callback for suspend/resume
Provides the capability to register an external callback for the ACPI PM
timer, which is called during the suspend and resume processes.

Signed-off-by: Marek Maslanka <mmaslanka@google.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240812184150.1079924-1-mmaslanka@google.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:20 +02:00
Zhang Zekun a7456d7d1b clocksource/drivers/arm_arch_timer: Using for_each_available_child_of_node_scoped()
for_each_available_child_of_node_scoped() can put the device_node
automatically. So, using it to make the code logic more simple and
remove the device_node clean up code.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Link: https://lore.kernel.org/r/20240807074655.52157-1-zhangzekun11@huawei.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-06 14:49:20 +02:00
Jacky Bai 3d5c2f8e75 clocksource/drivers/imx-tpm: Fix next event not taking effect sometime
The value written into the TPM CnV can only be updated into the hardware
when the counter increases. Additional writes to the CnV write buffer are
ignored until the register has been updated. Therefore, we need to check
if the CnV has been updated before continuing. This may require waiting for
1 counter cycle in the worst case.

Cc: stable@vger.kernel.org
Fixes: 059ab7b82e ("clocksource/drivers/imx-tpm: Add imx tpm timer support")
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240725193355.1436005-2-Frank.Li@nxp.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-02 10:04:15 +02:00
Jacky Bai 5b8843fcd4 clocksource/drivers/imx-tpm: Fix return -ETIME when delta exceeds INT_MAX
In tpm_set_next_event(delta), return -ETIME by wrong cast to int when delta
is larger than INT_MAX.

For example:

tpm_set_next_event(delta = 0xffff_fffe)
{
        ...
        next = tpm_read_counter(); // assume next is 0x10
        next += delta; // next will 0xffff_fffe + 0x10 = 0x1_0000_000e
        now = tpm_read_counter();  // now is 0x10
        ...

        return (int)(next - now) <= 0 ? -ETIME : 0;
                     ^^^^^^^^^^
                     0x1_0000_000e - 0x10 = 0xffff_fffe, which is -2 when
                     cast to int. So return -ETIME.
}

To fix this, introduce a 'prev' variable and check if 'now - prev' is
larger than delta.

Cc: stable@vger.kernel.org
Fixes: 059ab7b82e ("clocksource/drivers/imx-tpm: Add imx tpm timer support")
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240725193355.1436005-1-Frank.Li@nxp.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-02 10:04:15 +02:00
Daniel Lezcano 471ef0b5a8 clocksource/drivers/timer-of: Remove percpu irq related code
GCC's named address space checks errors out with:

drivers/clocksource/timer-of.c: In function ‘timer_of_irq_exit’:
drivers/clocksource/timer-of.c:29:46: error: passing argument 2 of
‘free_percpu_irq’ from pointer to non-enclosed address space
  29 |                 free_percpu_irq(of_irq->irq, clkevt);
     |                                              ^~~~~~
In file included from drivers/clocksource/timer-of.c:8:
./include/linux/interrupt.h:201:43: note: expected ‘__seg_gs void *’
but argument is of type ‘struct clock_event_device *’
 201 | extern void free_percpu_irq(unsigned int, void __percpu *);
     |                                           ^~~~~~~~~~~~~~~
drivers/clocksource/timer-of.c: In function ‘timer_of_irq_init’:
drivers/clocksource/timer-of.c:74:51: error: passing argument 4 of
‘request_percpu_irq’ from pointer to non-enclosed address space
  74 |                                    np->full_name, clkevt) :
     |                                                   ^~~~~~
./include/linux/interrupt.h:190:56: note: expected ‘__seg_gs void *’
but argument is of type ‘struct clock_event_device *’
 190 |                    const char *devname, void __percpu *percpu_dev_id)

Sparse warns about:

timer-of.c:29:46: warning: incorrect type in argument 2 (different address spaces)
timer-of.c:29:46:    expected void [noderef] __percpu *
timer-of.c:29:46:    got struct clock_event_device *clkevt
timer-of.c:74:51: warning: incorrect type in argument 4 (different address spaces)
timer-of.c:74:51:    expected void [noderef] __percpu *percpu_dev_id
timer-of.c:74:51:    got struct clock_event_device *clkevt

It appears the code is incorrect as reported by Uros Bizjak:

"The referred code is questionable as it tries to reuse
the clkevent pointer once as percpu pointer and once as generic
pointer, which should be avoided."

This change removes the percpu related code as no drivers is using it.

[Daniel: Fixed the description]

Fixes: dc11bae785 ("clocksource/drivers: Add timer-of common init routine")
Reported-by: Uros Bizjak <ubizjak@gmail.com>
Tested-by: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/r/20240819100335.2394751-1-daniel.lezcano@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-09-02 10:04:15 +02:00
Lee Jones 9942878d42 Merge 86b405ad8d ("Merge tag 'landlock-6.11-rc1-houdini-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux") into android-mainline
Steps on the way to v6.11-rc1

Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I3015e19e792a4a36488938fa90826f95e9ece5fb
2024-08-29 12:57:33 +00:00
Lee Jones cbb34b12cb Merge b02c520fee ("Merge tag 'wq-for-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq") into android-mainline
Steps on the way to v6.11-rc1

Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Iba38b7882335a551f59e15a1575d81a73152e391
2024-08-07 12:31:51 +01:00
Will McVicker 4cf63363a7 Merge tag 'v6.10-rc1' into android-mainline
Linux 6.10-rc1

Change-Id: Idb352b80ec4035982950ab2aec3bf3fbf4323ec3
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Will McVicker <willmcvicker@google.com>
2024-08-05 09:42:59 -07:00
David Woodhouse 531b2ca0a9 clockevents/drivers/i8253: Fix stop sequence for timer 0
According to the data sheet, writing the MODE register should stop the
counter (and thus the interrupts). This appears to work on real hardware,
at least modern Intel and AMD systems. It should also work on Hyper-V.

However, on some buggy virtual machines the mode change doesn't have any
effect until the counter is subsequently loaded (or perhaps when the IRQ
next fires).

So, set MODE 0 and then load the counter, to ensure that those buggy VMs
do the right thing and the interrupts stop. And then write MODE 0 *again*
to stop the counter on compliant implementations too.

Apparently, Hyper-V keeps firing the IRQ *repeatedly* even in mode zero
when it should only happen once, but the second MODE write stops that too.

Userspace test program (mostly written by tglx):
=====
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <sys/io.h>

static __always_inline void __out##bwl(type value, uint16_t port)	\
{									\
	asm volatile("out" #bwl " %" #bw "0, %w1"			\
		     : : "a"(value), "Nd"(port));			\
}									\
									\
static __always_inline type __in##bwl(uint16_t port)			\
{									\
	type value;							\
	asm volatile("in" #bwl " %w1, %" #bw "0"			\
		     : "=a"(value) : "Nd"(port));			\
	return value;							\
}

BUILDIO(b, b, uint8_t)

 #define inb __inb
 #define outb __outb

 #define PIT_MODE	0x43
 #define PIT_CH0	0x40
 #define PIT_CH2	0x42

static int is8254;

static void dump_pit(void)
{
	if (is8254) {
		// Latch and output counter and status
		outb(0xC2, PIT_MODE);
		printf("%02x %02x %02x\n", inb(PIT_CH0), inb(PIT_CH0), inb(PIT_CH0));
	} else {
		// Latch and output counter
		outb(0x0, PIT_MODE);
		printf("%02x %02x\n", inb(PIT_CH0), inb(PIT_CH0));
	}
}

int main(int argc, char* argv[])
{
	int nr_counts = 2;

	if (argc > 1)
		nr_counts = atoi(argv[1]);

	if (argc > 2)
		is8254 = 1;

	if (ioperm(0x40, 4, 1) != 0)
		return 1;

	dump_pit();

	printf("Set oneshot\n");
	outb(0x38, PIT_MODE);
	outb(0x00, PIT_CH0);
	outb(0x0F, PIT_CH0);

	dump_pit();
	usleep(1000);
	dump_pit();

	printf("Set periodic\n");
	outb(0x34, PIT_MODE);
	outb(0x00, PIT_CH0);
	outb(0x0F, PIT_CH0);

	dump_pit();
	usleep(1000);
	dump_pit();
	dump_pit();
	usleep(100000);
	dump_pit();
	usleep(100000);
	dump_pit();

	printf("Set stop (%d counter writes)\n", nr_counts);
	outb(0x30, PIT_MODE);
	while (nr_counts--)
		outb(0xFF, PIT_CH0);

	dump_pit();
	usleep(100000);
	dump_pit();
	usleep(100000);
	dump_pit();

	printf("Set MODE 0\n");
	outb(0x30, PIT_MODE);

	dump_pit();
	usleep(100000);
	dump_pit();
	usleep(100000);
	dump_pit();

	return 0;
}
=====

Suggested-by: Sean Christopherson <seanjc@google.com>
Co-developed-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mhkelley@outlook.com>
Link: https://lore.kernel.org/all/20240802135555.564941-2-dwmw2@infradead.org
2024-08-02 18:27:05 +02:00
David Woodhouse 70e6b7d9ae x86/i8253: Disable PIT timer 0 when not in use
Leaving the PIT interrupt running can cause noticeable steal time for
virtual guests. The VMM generally has a timer which toggles the IRQ input
to the PIC and I/O APIC, which takes CPU time away from the guest. Even
on real hardware, running the counter may use power needlessly (albeit
not much).

Make sure it's turned off if it isn't going to be used.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mhkelley@outlook.com>
Link: https://lore.kernel.org/all/20240802135555.564941-1-dwmw2@infradead.org
2024-08-02 18:27:05 +02:00
Luca Ceresoli 9722c3b66e of: remove internal arguments from of_property_for_each_u32()
The of_property_for_each_u32() macro needs five parameters, two of which
are primarily meant as internal variables for the macro itself (in the
for() clause). Yet these two parameters are used by a few drivers, and this
can be considered misuse or at least bad practice.

Now that the kernel uses C11 to build, these two parameters can be avoided
by declaring them internally, thus changing this pattern:

  struct property *prop;
  const __be32 *p;
  u32 val;

  of_property_for_each_u32(np, "xyz", prop, p, val) { ... }

to this:

  u32 val;

  of_property_for_each_u32(np, "xyz", val) { ... }

However two variables cannot be declared in the for clause even with C11,
so declare one struct that contain the two variables we actually need. As
the variables inside this struct are not meant to be used by users of this
macro, give the struct instance the noticeable name "_it" so it is visible
during code reviews, helping to avoid new code to use it directly.

Most usages are trivially converted as they do not use those two
parameters, as expected. The non-trivial cases are:

 - drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
 - drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the
   checks had to be replicated in a different way, making code more verbose
   and somewhat uglier, but I refrained from a full rework to keep as much
   of the original code untouched having no hardware to test my changes

All the changes have been build tested. The few for which I have the
hardware have been runtime-tested too.

Reviewed-by: Andre Przywara <andre.przywara@arm.com> # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # drivers/gpio/gpio-brcmstb.c
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> # drivers/irqchip/irq-atmel-aic-common.c
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # drivers/iio/adc/ti_am335x_adc.c
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> # drivers/pwm/pwm-samsung.c
Acked-by: Richard Leitner <richard.leitner@linux.dev> # drivers/usb/misc/usb251xb.c
Acked-by: Mark Brown <broonie@kernel.org> # sound/soc/codecs/arizona.c
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> # sound/soc/codecs/arizona.c
Acked-by: Michael Ellerman <mpe@ellerman.id.au> # arch/powerpc/sysdev/xive/spapr.c
Acked-by: Stephen Boyd <sboyd@kernel.org> # clk
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20240724-of_property_for_each_u32-v3-1-bea82ce429e2@bootlin.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-07-25 06:53:47 -05:00
Greg Kroah-Hartman 016426d5af Merge 5901037324 ("Merge tag 'for-linus' of https://github.com/openrisc/linux") into android-mainline
Steps on the way to 6.10-rc1

Change-Id: Ief35eb5990650571b9392125774142343f7c5500
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Signed-off-by: André Draszik <draszik@google.com>
2024-07-17 18:27:38 +01:00
Chris Packham 4bdc3eaa10 clocksource/drivers/realtek: Add timer driver for rtl-otto platforms
The timer/counter block on the Realtek SoCs provides up to 5 timers. It
also includes a watchdog timer which is handled by the
realtek_otto_wdt.c driver.

One timer will be used per CPU as a local clock event generator. An
additional timer will be used as an overal stable clocksource.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20240710043524.1535151-8-chris.packham@alliedtelesis.co.nz
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-07-12 16:07:06 +02:00
Jiaxun Yang 5e4bfd66ec clocksource/drivers/mips-gic-timer: Correct sched_clock width
Counter width of GIC is configurable and can be read from a
register.

Use width value from the register for sched_clock.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Link: https://lore.kernel.org/r/20240612-mips-clks-v2-7-a57e6f49f3db@flygoat.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-07-12 16:07:05 +02:00
Jiaxun Yang cc9b2c590e clocksource/drivers/mips-gic-timer: Refine rating computation
It is a good clocksource which usually go as fast as CPU core
and have a low access latency, so raise the base of rating
from Good to desired when we know that it has a stable frequency.

Increase frequency addend dividend to 10000000 (10MHz) to
reasonably accommodate multi GHz level clock, also cap rating
within current level.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Link: https://lore.kernel.org/r/20240612-mips-clks-v2-6-a57e6f49f3db@flygoat.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-07-12 16:07:05 +02:00
Niklas Söderlund db19d3aa77 clocksource/drivers/sh_cmt: Address race condition for clock events
There is a race condition in the CMT interrupt handler. In the interrupt
handler the driver sets a driver private flag, FLAG_IRQCONTEXT. This
flag is used to indicate any call to set_next_event() should not be
directly propagated to the device, but instead cached. This is done as
the interrupt handler itself reprograms the device when needed before it
completes and this avoids this operation to take place twice.

It is unclear why this design was chosen, my suspicion is to allow the
struct clock_event_device.event_handler callback, which is called while
the FLAG_IRQCONTEXT is set, can update the next event without having to
write to the device twice.

Unfortunately there is a race between when the FLAG_IRQCONTEXT flag is
set and later cleared where the interrupt handler have already started to
write the next event to the device. If set_next_event() is called in
this window the value is only cached in the driver but not written. This
leads to the board to misbehave, or worse lockup and produce a splat.

   rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
   rcu:     0-...!: (0 ticks this GP) idle=f5e0/0/0x0 softirq=519/519 fqs=0 (false positive?)
   rcu:     (detected by 1, t=6502 jiffies, g=-595, q=77 ncpus=2)
   Sending NMI from CPU 1 to CPUs 0:
   NMI backtrace for cpu 0
   CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.10.0-rc5-arm64-renesas-00019-g74a6f86eaf1c-dirty #20
   Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT)
   pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
   pc : tick_check_broadcast_expired+0xc/0x40
   lr : cpu_idle_poll.isra.0+0x8c/0x168
   sp : ffff800081c63d70
   x29: ffff800081c63d70 x28: 00000000580000c8 x27: 00000000bfee5610
   x26: 0000000000000027 x25: 0000000000000000 x24: 0000000000000000
   x23: ffff00007fbb9100 x22: ffff8000818f1008 x21: ffff8000800ef07c
   x20: ffff800081c79ec0 x19: ffff800081c70c28 x18: 0000000000000000
   x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffc2c717d8
   x14: 0000000000000000 x13: ffff000009c18080 x12: ffff8000825f7fc0
   x11: 0000000000000000 x10: ffff8000818f3cd4 x9 : 0000000000000028
   x8 : ffff800081c79ec0 x7 : ffff800081c73000 x6 : 0000000000000000
   x5 : 0000000000000000 x4 : ffff7ffffe286000 x3 : 0000000000000000
   x2 : ffff7ffffe286000 x1 : ffff800082972900 x0 : ffff8000818f1008
   Call trace:
    tick_check_broadcast_expired+0xc/0x40
    do_idle+0x9c/0x280
    cpu_startup_entry+0x34/0x40
    kernel_init+0x0/0x11c
    do_one_initcall+0x0/0x260
    __primary_switched+0x80/0x88
   rcu: rcu_preempt kthread timer wakeup didn't happen for 6501 jiffies! g-595 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402
   rcu:     Possible timer handling issue on cpu=0 timer-softirq=262
   rcu: rcu_preempt kthread starved for 6502 jiffies! g-595 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0
   rcu:     Unless rcu_preempt kthread gets sufficient CPU time, OOM is now expected behavior.
   rcu: RCU grace-period kthread stack dump:
   task:rcu_preempt     state:I stack:0     pid:15    tgid:15    ppid:2      flags:0x00000008
   Call trace:
    __switch_to+0xbc/0x100
    __schedule+0x358/0xbe0
    schedule+0x48/0x148
    schedule_timeout+0xc4/0x138
    rcu_gp_fqs_loop+0x12c/0x764
    rcu_gp_kthread+0x208/0x298
    kthread+0x10c/0x110
    ret_from_fork+0x10/0x20

The design have been part of the driver since it was first merged in
early 2009. It becomes increasingly harder to trigger the issue the
older kernel version one tries. It only takes a few boots on v6.10-rc5,
while hundreds of boots are needed to trigger it on v5.10.

Close the race condition by using the CMT channel lock for the two
competing sections. The channel lock was added to the driver after its
initial design.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20240702190230.3825292-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-07-12 16:07:05 +02:00
Li kunyu f3539a6a69 clocksource/driver/arm_global_timer: Remove unnecessary ‘0’ values from err
The 'err' variable is initialized whatever the code path, it is
pointless to initialize it when it is declared.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
Link: https://lore.kernel.org/r/20240705052159.22235-1-kunyu@nfschina.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-07-12 16:07:05 +02:00
Li kunyu 7cbbcbd4b5 clocksource/drivers/arm_arch_timer: Remove unnecessary ‘0’ values from irq
The irq variable is initialized whatever the code path, it is poinless
to initialize when declaring it.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
Link: https://lore.kernel.org/r/20240705040729.21961-1-kunyu@nfschina.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2024-07-12 16:07:05 +02:00
Dexuan Cui 7f828d5fff clocksource: hyper-v: Use lapic timer in a TDX VM without paravisor
In a TDX VM without paravisor, currently the default timer is the Hyper-V
timer, which depends on the slow VM Reference Counter MSR: the Hyper-V TSC
page is not enabled in such a VM because the VM uses Invariant TSC as a
better clocksource and it's challenging to mark the Hyper-V TSC page shared
in very early boot.

Lower the rating of the Hyper-V timer so the local APIC timer becomes the
the default timer in such a VM, and print a warning in case Invariant TSC
is unavailable in such a VM. This change should cause no perceivable
performance difference.

Cc: stable@vger.kernel.org # 6.6+
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20240621061614.8339-1-decui@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20240621061614.8339-1-decui@microsoft.com>
2024-06-24 07:06:29 +00:00
Linus Torvalds 0bfbc914d9 Merge tag 'riscv-for-linus-6.10-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V updates from Palmer Dabbelt:

 - Add byte/half-word compare-and-exchange, emulated via LR/SC loops

 - Support for Rust

 - Support for Zihintpause in hwprobe

 - Add PR_RISCV_SET_ICACHE_FLUSH_CTX prctl()

 - Support lockless lockrefs

* tag 'riscv-for-linus-6.10-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (42 commits)
  riscv: defconfig: Enable CONFIG_CLK_SOPHGO_CV1800
  riscv: select ARCH_HAS_FAST_MULTIPLIER
  riscv: mm: still create swiotlb buffer for kmalloc() bouncing if required
  riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init
  riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled
  riscv: mm: Always use an ASID to flush mm contexts
  riscv: mm: Preserve global TLB entries when switching contexts
  riscv: mm: Make asid_bits a local variable
  riscv: mm: Use a fixed layout for the MM context ID
  riscv: mm: Introduce cntx2asid/cntx2version helper macros
  riscv: Avoid TLB flush loops when affected by SiFive CIP-1200
  riscv: Apply SiFive CIP-1200 workaround to single-ASID sfence.vma
  riscv: mm: Combine the SMP and UP TLB flush code
  riscv: Only send remote fences when some other CPU is online
  riscv: mm: Broadcast kernel TLB flushes only when needed
  riscv: Use IPIs for remote cache/TLB flushes by default
  riscv: Factor out page table TLB synchronization
  riscv: Flush the instruction cache during SMP bringup
  riscv: hwprobe: export Zihintpause ISA extension
  riscv: misaligned: remove CONFIG_RISCV_M_MODE specific code
  ...
2024-05-22 09:56:00 -07:00