android_kernel_msm-6.1_noth.../drivers
Mukesh Ojha 4d99e41ce1 FROMGIT: PM / devfreq: Synchronize devfreq_monitor_[start/stop]
There is a chance if a frequent switch of the governor
done in a loop result in timer list corruption where
timer cancel being done from two place one from
cancel_delayed_work_sync() and followed by expire_timers()
can be seen from the traces[1].

while true
do
        echo "simple_ondemand" > /sys/class/devfreq/1d84000.ufshc/governor
        echo "performance" > /sys/class/devfreq/1d84000.ufshc/governor
done

It looks to be issue with devfreq driver where
device_monitor_[start/stop] need to synchronized so that
delayed work should get corrupted while it is either
being queued or running or being cancelled.

Let's use polling flag and devfreq lock to synchronize the
queueing the timer instance twice and work data being
corrupted.

[1]
...
..
<idle>-0    [003]   9436.209662:  timer_cancel   timer=0xffffff80444f0428
<idle>-0    [003]   9436.209664:  timer_expire_entry   timer=0xffffff80444f0428  now=0x10022da1c  function=__typeid__ZTSFvP10timer_listE_global_addr  baseclk=0x10022da1c
<idle>-0    [003]   9436.209718:  timer_expire_exit   timer=0xffffff80444f0428
kworker/u16:6-14217    [003]   9436.209863:  timer_start   timer=0xffffff80444f0428  function=__typeid__ZTSFvP10timer_listE_global_addr  expires=0x10022da2b  now=0x10022da1c  flags=182452227
vendor.xxxyyy.ha-1593    [004]   9436.209888:  timer_cancel   timer=0xffffff80444f0428
vendor.xxxyyy.ha-1593    [004]   9436.216390:  timer_init   timer=0xffffff80444f0428
vendor.xxxyyy.ha-1593    [004]   9436.216392:  timer_start   timer=0xffffff80444f0428  function=__typeid__ZTSFvP10timer_listE_global_addr  expires=0x10022da2c  now=0x10022da1d  flags=186646532
vendor.xxxyyy.ha-1593    [005]   9436.220992:  timer_cancel   timer=0xffffff80444f0428
xxxyyyTraceManag-7795    [004]   9436.261641:  timer_cancel   timer=0xffffff80444f0428

[2]

 9436.261653][    C4] Unable to handle kernel paging request at virtual address dead00000000012a
[ 9436.261664][    C4] Mem abort info:
[ 9436.261666][    C4]   ESR = 0x96000044
[ 9436.261669][    C4]   EC = 0x25: DABT (current EL), IL = 32 bits
[ 9436.261671][    C4]   SET = 0, FnV = 0
[ 9436.261673][    C4]   EA = 0, S1PTW = 0
[ 9436.261675][    C4] Data abort info:
[ 9436.261677][    C4]   ISV = 0, ISS = 0x00000044
[ 9436.261680][    C4]   CM = 0, WnR = 1
[ 9436.261682][    C4] [dead00000000012a] address between user and kernel address ranges
[ 9436.261685][    C4] Internal error: Oops: 96000044 [#1] PREEMPT SMP
[ 9436.261701][    C4] Skip md ftrace buffer dump for: 0x3a982d0
...

[ 9436.262138][    C4] CPU: 4 PID: 7795 Comm: TraceManag Tainted: G S      W  O      5.10.149-android12-9-o-g17f915d29d0c #1
[ 9436.262141][    C4] Hardware name: Qualcomm Technologies, Inc.  (DT)
[ 9436.262144][    C4] pstate: 22400085 (nzCv daIf +PAN -UAO +TCO BTYPE=--)
[ 9436.262161][    C4] pc : expire_timers+0x9c/0x438
[ 9436.262164][    C4] lr : expire_timers+0x2a4/0x438
[ 9436.262168][    C4] sp : ffffffc010023dd0
[ 9436.262171][    C4] x29: ffffffc010023df0 x28: ffffffd0636fdc18
[ 9436.262178][    C4] x27: ffffffd063569dd0 x26: ffffffd063536008
[ 9436.262182][    C4] x25: 0000000000000001 x24: ffffff88f7c69280
[ 9436.262185][    C4] x23: 00000000000000e0 x22: dead000000000122
[ 9436.262188][    C4] x21: 000000010022da29 x20: ffffff8af72b4e80
[ 9436.262191][    C4] x19: ffffffc010023e50 x18: ffffffc010025038
[ 9436.262195][    C4] x17: 0000000000000240 x16: 0000000000000201
[ 9436.262199][    C4] x15: ffffffffffffffff x14: ffffff889f3c3100
[ 9436.262203][    C4] x13: ffffff889f3c3100 x12: 00000000049f56b8
[ 9436.262207][    C4] x11: 00000000049f56b8 x10: 00000000ffffffff
[ 9436.262212][    C4] x9 : ffffffc010023e50 x8 : dead000000000122
[ 9436.262216][    C4] x7 : ffffffffffffffff x6 : ffffffc0100239d8
[ 9436.262220][    C4] x5 : 0000000000000000 x4 : 0000000000000101
[ 9436.262223][    C4] x3 : 0000000000000080 x2 : ffffff889edc155c
[ 9436.262227][    C4] x1 : ffffff8001005200 x0 : ffffff80444f0428
[ 9436.262232][    C4] Call trace:
[ 9436.262236][    C4]  expire_timers+0x9c/0x438
[ 9436.262240][    C4]  __run_timers+0x1f0/0x330
[ 9436.262245][    C4]  run_timer_softirq+0x28/0x58
[ 9436.262255][    C4]  efi_header_end+0x168/0x5ec
[ 9436.262265][    C4]  __irq_exit_rcu+0x108/0x124
[ 9436.262274][    C4]  __handle_domain_irq+0x118/0x1e4
[ 9436.262282][    C4]  gic_handle_irq.30369+0x6c/0x2bc
[ 9436.262286][    C4]  el0_irq_naked+0x60/0x6c

Bug: 317188938
Change-Id: I9a22325f6abbf28217c8f37b093cf77509b0139a
Link: https://lore.kernel.org/all/1700860318-4025-1-git-send-email-quic_mojha@quicinc.com/
Reported-by: Joyyoung Huang <huangzaiyang@oppo.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
(cherry picked from commit aed5ed595960c6d301dcd4ed31aeaa7a8054c0c6
 https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq-next)
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
2024-01-03 23:14:47 +00:00
..
accessibility
acpi Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
amba amba: bus: fix refcount leak 2023-09-13 09:42:56 +02:00
android ANDROID: vendor_hooks: Add hooks for rt_mutex steal 2023-12-25 15:22:46 +08:00
ata Revert "ata,scsi: do not issue START STOP UNIT on resume" 2023-11-02 07:06:05 +00:00
atm
auxdisplay
base Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
bcma
block This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
bluetooth This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
bus bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up 2023-10-06 14:56:48 +02:00
cdrom
char Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
clk Merge branch 'android14-6.1' into branch 'android14-6.1-lts' 2023-10-31 17:20:05 +00:00
clocksource This is the 6.1.54 stable release 2023-10-17 12:03:09 +00:00
comedi
connector
counter
cpufreq This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
cpuidle Merge branch 'android14-6.1' into branch 'android14-6.1-lts' 2023-10-31 17:20:05 +00:00
crypto This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
cxl cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws() 2023-08-03 10:24:04 +02:00
dax This is the 6.1.39 stable release 2023-09-02 19:41:42 +00:00
dca
devfreq FROMGIT: PM / devfreq: Synchronize devfreq_monitor_[start/stop] 2024-01-03 23:14:47 +00:00
dio
dma This is the 6.1.54 stable release 2023-10-17 12:03:09 +00:00
dma-buf Merge 6.1.55 into android14-6.1-lts 2023-10-26 18:58:32 +00:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-13 09:42:45 +02:00
eisa
extcon extcon: cht_wc: add POWER_SUPPLY dependency 2023-09-13 09:42:53 +02:00
firewire Revert "scsi: sd: Differentiate system and runtime start/stop management" 2023-11-02 07:06:05 +00:00
firmware Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
fpga
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-13 09:42:54 +02:00
gnss
gpio This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
gpu Merge "Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1'" into android14-6.1 2023-11-30 10:20:44 +00:00
greybus
hid BACKPORT: HID: input: map battery system charging 2023-12-01 19:04:48 +00:00
hsi
hte
hv This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
hwmon This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
hwspinlock hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation 2023-09-19 12:28:05 +02:00
hwtracing This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
i2c Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
i3c i3c: master: svc: fix probe failure when no i3c device exist 2023-09-13 09:43:01 +02:00
idle intel_idle: add Emerald Rapids Xeon support 2023-10-10 22:00:44 +02:00
iio iio: accel: adxl313: Fix adxl313_i2c_id[] table 2023-09-13 09:42:52 +02:00
infiniband This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
input Merge "Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1'" into android14-6.1 2023-11-30 10:20:44 +00:00
interconnect interconnect: Teach lockdep about icc_bw_lock order 2023-09-23 11:11:13 +02:00
iommu Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
ipack
irqchip This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:27:26 +02:00
leds leds: Drop BUG_ON check for LED_COLOR_ID_MULTI 2023-10-10 22:00:40 +02:00
macintosh
mailbox This is the 6.1.54 stable release 2023-10-17 12:03:09 +00:00
mcb
md UPSTREAM: dm verity: don't perform FEC for failed readahead IO 2023-12-21 22:46:28 +00:00
media Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
memory memory: brcmstb_dpfe: fix testing array offset after use 2023-07-19 16:21:24 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-07-19 16:21:08 +02:00
message
mfd Merge 6.1.40 into android14-6.1-lts 2023-09-05 16:35:01 +00:00
misc Merge branch 'android14-6.1' into branch 'android14-6.1-lts' 2023-10-31 17:20:05 +00:00
mmc Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
most
mtd ubi: Refuse attaching if mtd's erasesize is 0 2023-10-10 22:00:39 +02:00
mux
net This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
nfc
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-13 09:43:02 +02:00
nubus
nvdimm nvdimm: Fix dereference after free in register_nvdimm_pmu() 2023-09-13 09:42:47 +02:00
nvme Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
nvmem nvmem: rmem: Use NVMEM_DEVID_AUTO 2023-07-19 16:21:57 +02:00
of This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
opp OPP: Fix passing 0 to PTR_ERR in _opp_attach_genpd() 2023-09-13 09:42:28 +02:00
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-06 14:56:51 +02:00
parport
pci This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
pcmcia pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db() 2023-08-23 17:52:24 +02:00
peci
perf perf/imx_ddr: speed up overflow frequency of cycle 2023-09-23 11:11:00 +02:00
phy phy/rockchip: inno-hdmi: do not power on rk3328 post pll on reg write 2023-09-13 09:42:58 +02:00
pinctrl pinctrl: cherryview: fix address_space_handler() argument 2023-09-19 12:27:57 +02:00
platform platform/x86: asus-wmi: Support 2023 ROG X16 tablet mode 2023-10-06 14:56:53 +02:00
pnp
power Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
powercap powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-07-19 16:21:00 +02:00
pps
ps3
ptp ptp: ocp: Fix error handling in ptp_ocp_device_init 2023-10-10 22:00:42 +02:00
pwm pwm: lpc32xx: Remove handling of PWM channels 2023-09-19 12:28:00 +02:00
rapidio
ras
regulator regulator/core: regulator_register: set device->class earlier 2023-10-10 22:00:41 +02:00
remoteproc
reset
rpmsg rpmsg: glink: Add check for kstrdup 2023-09-13 09:42:58 +02:00
rtc rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff 2023-09-06 21:27:00 +01:00
s390 scsi: zfcp: Fix a double put in zfcp_port_enqueue() 2023-10-10 22:00:38 +02:00
sbus
scsi Revert "ata,scsi: do not issue START STOP UNIT on resume" 2023-11-02 07:06:05 +00:00
sh
siox
slimbus
soc Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
soundwire soundwire: fix enumeration completion 2023-08-03 10:24:15 +02:00
spi This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
spmi
ssb
staging This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
target This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
tc
tee
thermal Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
thunderbolt thunderbolt: Fix a backport error for display flickering issue 2023-09-02 09:16:20 +02:00
tty UPSTREAM: serial: 8250_port: Check IRQ data before use 2023-11-16 21:07:48 +00:00
ufs Merge tag 'android14-6.1.57_r00' into branch 'android14-6.1' 2023-11-27 16:18:59 +00:00
uio
usb UPSTREAM: USB: gadget: core: adjust uevent timing on gadget unbind 2024-01-02 21:26:12 +00:00
vdpa Merge 6.1.47 into android14-6.1-lts 2023-09-13 19:35:46 +00:00
vfio Merge 6.1.56 into android14-6.1-lts 2023-10-27 09:17:04 +00:00
vhost This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
video Revert "video/aperture: Only remove sysfb on the default vga pci device" 2023-11-01 14:38:59 +00:00
virt ANDROID: virt: gunyah: Zero state_data after vcpu_run 2023-12-14 15:39:09 -08:00
virtio This is the 6.1.53 stable release 2023-09-18 09:57:37 +00:00
vlynq
w1 w1: fix loop in w1_fini() 2023-07-19 16:21:48 +02:00
watchdog watchdog: intel-mid_wdt: add MODULE_ALIAS() to allow auto-load 2023-09-19 12:28:00 +02:00
xen This is the 6.1.57 stable release 2023-11-02 07:05:54 +00:00
zorro
Kconfig
Makefile