Skip to content

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Jul 10, 2025

Pull request for series with
subject: ublk: cleanup for supporting batch IO command
version: 2
url: https://patchwork.kernel.org/project/linux-block/list/?series=979847

axboe added 11 commits July 7, 2025 19:42
* io_uring-6.16:
  io_uring/zcrx: fix pp destruction warnings
* block-6.16:
  block: reject bs > ps block devices when THP is disabled
  nbd: fix uaf in nbd_genl_connect() error path
  md/md-bitmap: fix GPF in bitmap_get_stats()
  md/raid1,raid10: strip REQ_NOWAIT from member bios
  raid10: cleanup memleak at raid10_make_request
  md/raid1: Fix stack memory use after return in raid1_reshape
* for-6.17/io_uring:
  io_uring/rw: cast rw->flags assignment to rwf_t
  io_uring: don't use int for ABI
  io_uring/rsrc: skip atomic refcount for uncloned buffers
  io_uring/mock: add trivial poll handler
  io_uring/mock: support for async read/write
  io_uring/mock: allow to choose FMODE_NOWAIT
  io_uring/mock: add sync read/write
  io_uring/mock: add cmd using vectored regbufs
  io_uring/mock: add basic infra for test mock files
  io_uring: remove errant ';' from IORING_CQE_F_TSTAMP_HW definition
  io_uring/netcmd: add tx timestamping cmd support
  io_uring: add mshot helper for posting CQE32
  io_uring/cmd: allow multishot polled commands
  io_uring/poll: introduce io_arm_apoll()
  io_uring/nop: add IORING_NOP_TW completion flag
  io_uring/uring_cmd: implement ->sqe_copy() to avoid unnecessary copies
  io_uring/uring_cmd: get rid of io_uring_cmd_prep_setup()
  io_uring: add struct io_cold_def->sqe_copy() method
  io_uring: add IO_URING_F_INLINE issue flag
  net: timestamp: add helper returning skb's tx tstamp
* for-6.17/block: (38 commits)
  block: remove pktcdvd driver
  ublk: introduce and use ublk_set_canceling helper
  ublk: speed up ublk server exit handling
  zram: pass buffer offset to zcomp_available_show()
  block: zram: replace scnprintf() with sysfs_emit() in *_show() functions
  bcache: switch from pages to folios in read_super()
  virtio: blk/scsi: use block layer helpers to calculate num of queues
  scsi: use block layer helpers to calculate num of queues
  nvme-pci: use block layer helpers to calculate num of queues
  blk-mq: add number of queue calc helper
  lib/group_cpus: Let group_cpu_evenly() return the number of initialized masks
  ublk: cache-align struct ublk_io
  ublk: remove ubq checks from ublk_{get,put}_req_ref()
  ublk: optimize UBLK_IO_UNREGISTER_IO_BUF on daemon task
  ublk: optimize UBLK_IO_REGISTER_IO_BUF on daemon task
  ublk: return early if blk_should_fake_timeout()
  ublk: allow UBLK_IO_(UN)REGISTER_IO_BUF on any task
  ublk: don't take ublk_queue in ublk_unregister_io_buf()
  ublk: consolidate UBLK_IO_FLAG_{ACTIVE,OWNED_BY_SRV} checks
  ublk: remove task variable from __ublk_ch_uring_cmd()
  ...
* for-6.17/block:
  nvme-pci: fix dma unmapping when using PRPs and not using the IOVA mapping
* for-6.17/block:
  Documentation: remove reference to pktcdvd in cdrom documentation
* io_uring-6.16:
  Revert "io_uring: gate REQ_F_ISREG on !S_ANON_INODE as well"
  io_uring/msg_ring: ensure io_kiocb freeing is deferred for RCU
* for-6.17/block:
  block: mtip32xx: Fix usage of dma_map_sg()
* for-6.17/block:
  drbd: add missing kref_get in handle_write_conflicts
* for-6.17/io_uring:
  io_uring/zcrx: prepare fallback for larger pages
  io_uring/zcrx: assert area type in io_zcrx_iov_page
  io_uring/zcrx: allocate sgtable for umem areas
  io_uring/zcrx: introduce io_populate_area_dma
  io_uring/zcrx: return error from io_zcrx_map_area_*
  io_uring/zcrx: always pass page to io_zcrx_copy_chunk
* for-6.17/block:
  nbd: fix lockdep deadlock warning
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 10, 2025

Upstream branch: f4ca523
series: https://patchwork.kernel.org/project/linux-block/list/?series=979847
version: 2

* for-6.17/io_uring:
  io_uring/net: allow multishot receive per-invocation cap
  io_uring/net: move io_sr_msg->retry_flags to io_sr_msg->flags
  io_uring/net: use passed in 'len' in io_recv_buf_select()
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 10, 2025

Upstream branch: 232ed3c
series: https://patchwork.kernel.org/project/linux-block/list/?series=979847
version: 2

@blktests-ci blktests-ci bot force-pushed the series/978007=>for-next branch from bcd8367 to 1805f2e Compare July 10, 2025 18:52
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 11, 2025

Upstream branch: 232ed3c
series: https://patchwork.kernel.org/project/linux-block/list/?series=979847
version: 2

@blktests-ci blktests-ci bot force-pushed the series/978007=>for-next branch from 1805f2e to d6bc1d3 Compare July 11, 2025 01:14
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 11, 2025

Upstream branch: 232ed3c
series: https://patchwork.kernel.org/project/linux-block/list/?series=979847
version: 2

@blktests-ci blktests-ci bot force-pushed the series/978007=>for-next branch from d6bc1d3 to d9ed4b5 Compare July 11, 2025 07:07
* for-6.17/block:
  nvme-pci: don't allocate dma_vec for IOVA mappings
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 11, 2025

Upstream branch: d7d3914
series: https://patchwork.kernel.org/project/linux-block/list/?series=979847
version: 2

@blktests-ci blktests-ci bot force-pushed the series/978007=>for-next branch from d9ed4b5 to 7c9b271 Compare July 11, 2025 13:58
Ming Lei added 2 commits July 14, 2025 11:28
Pass 'ublk_thread *' to more common helpers, then we can avoid to store
this reference into 'struct ublk_io'.

Prepare for supporting to handle IO via different task context.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Remove ublk queue self-defined flags, and use the uapi flags directly.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 14, 2025

Upstream branch: 5d41d21
series: https://patchwork.kernel.org/project/linux-block/list/?series=981821
version: 3

Ming Lei added 3 commits July 14, 2025 11:28
Improve all kinds of flags naming by adding its host structure suffix for
making code more readable.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
…ommand

Add helper ublk_handle_uring_cmd() for handling ublk command, and make
ublk_handle_cqe() more readable.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
@blktests-ci blktests-ci bot added V3 and removed V2 labels Jul 14, 2025
@blktests-ci blktests-ci bot force-pushed the series/978007=>for-next branch from ffa63c6 to a69e939 Compare July 14, 2025 02:28
@blktests-ci
Copy link
Author

blktests-ci bot commented Jul 23, 2025

Upstream branch: a8fa173
series: https://patchwork.kernel.org/project/linux-block/list/?series=981821
version: 3

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-block/list/?series=981821
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: ublk: validate ublk server pid
Using index info to reconstruct a base tree...
M	drivers/block/ublk_drv.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/block/ublk_drv.c
No changes -- Patch already applied.
Applying: ublk: look up ublk task via its pid in timeout handler
Using index info to reconstruct a base tree...
M	drivers/block/ublk_drv.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/block/ublk_drv.c
No changes -- Patch already applied.
Applying: ublk: move fake timeout logic into __ublk_complete_rq()
Using index info to reconstruct a base tree...
M	drivers/block/ublk_drv.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/block/ublk_drv.c
CONFLICT (content): Merge conflict in drivers/block/ublk_drv.c
Patch failed at 0003 ublk: move fake timeout logic into __ublk_complete_rq()'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"'

conflict:

diff --cc drivers/block/ublk_drv.c
index 6561d2a561fa,73c6c8d3b117..000000000000
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@@ -2240,15 -2203,45 +2240,52 @@@ static int ublk_check_commit_and_fetch(
  		return -EINVAL;
  	}
  
++<<<<<<< HEAD
 +	return 0;
 +}
 +
 +static bool ublk_need_complete_req(const struct ublk_queue *ubq,
 +				   struct ublk_io *io)
 +{
++=======
+ 	if (ublk_support_auto_buf_reg(ubq)) {
+ 		int ret;
+ 
+ 		/*
+ 		 * `UBLK_F_AUTO_BUF_REG` only works iff `UBLK_IO_FETCH_REQ`
+ 		 * and `UBLK_IO_COMMIT_AND_FETCH_REQ` are issued from same
+ 		 * `io_ring_ctx`.
+ 		 *
+ 		 * If this uring_cmd's io_ring_ctx isn't same with the
+ 		 * one for registering the buffer, it is ublk server's
+ 		 * responsibility for unregistering the buffer, otherwise
+ 		 * this ublk request gets stuck.
+ 		 */
+ 		if (io->flags & UBLK_IO_FLAG_AUTO_BUF_REG) {
+ 			if (io->buf_ctx_handle == io_uring_cmd_ctx_handle(cmd))
+ 				io_buffer_unregister_bvec(cmd, io->buf_index,
+ 						issue_flags);
+ 			io->flags &= ~UBLK_IO_FLAG_AUTO_BUF_REG;
+ 		}
+ 
+ 		ret = ublk_set_auto_buf_reg(cmd);
+ 		if (ret)
+ 			return ret;
+ 	}
+ 
+ 	ublk_fill_io_cmd(io, cmd, ub_cmd->addr);
+ 
+ 	/* now this cmd slot is owned by ublk driver */
+ 	io->flags &= ~UBLK_IO_FLAG_OWNED_BY_SRV;
+ 	io->res = ub_cmd->result;
+ 
+ 	if (req_op(req) == REQ_OP_ZONE_APPEND)
+ 		req->__sector = ub_cmd->zone_append_lba;
+ 
++>>>>>>> ublk: move fake timeout logic into __ublk_complete_rq()
  	if (ublk_need_req_ref(ubq))
 -		ublk_sub_req_ref(io, req);
 -	else
 -		__ublk_complete_rq(req);
 -	return 0;
 +		return ublk_sub_req_ref(io);
 +	return true;
  }
  
  static bool ublk_get_data(const struct ublk_queue *ubq, struct ublk_io *io,

@blktests-ci blktests-ci bot force-pushed the for-next_base branch 7 times, most recently from 0fb21b4 to 26415c4 Compare August 1, 2025 12:39
blktests-ci bot pushed a commit that referenced this pull request Aug 2, 2025
Without the change `perf `hangs up on charaster devices. On my system
it's enough to run system-wide sampler for a few seconds to get the
hangup:

    $ perf record -a -g --call-graph=dwarf
    $ perf report
    # hung

`strace` shows that hangup happens on reading on a character device
`/dev/dri/renderD128`

    $ strace -y -f -p 2780484
    strace: Process 2780484 attached
    pread64(101</dev/dri/renderD128>, strace: Process 2780484 detached

It's call trace descends into `elfutils`:

    $ gdb -p 2780484
    (gdb) bt
    #0  0x00007f5e508f04b7 in __libc_pread64 (fd=101, buf=0x7fff9df7edb0, count=0, offset=0)
        at ../sysdeps/unix/sysv/linux/pread64.c:25
    #1  0x00007f5e52b79515 in read_file () from /<<NIX>>/elfutils-0.192/lib/libelf.so.1
    #2  0x00007f5e52b25666 in libdw_open_elf () from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #3  0x00007f5e52b25907 in __libdw_open_file () from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #4  0x00007f5e52b120a9 in dwfl_report_elf@@ELFUTILS_0.156 ()
       from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #5  0x000000000068bf20 in __report_module (al=al@entry=0x7fff9df80010, ip=ip@entry=139803237033216, ui=ui@entry=0x5369b5e0)
        at util/dso.h:537
    #6  0x000000000068c3d1 in report_module (ip=139803237033216, ui=0x5369b5e0) at util/unwind-libdw.c:114
    #7  frame_callback (state=0x535aef10, arg=0x5369b5e0) at util/unwind-libdw.c:242
    #8  0x00007f5e52b261d3 in dwfl_thread_getframes () from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #9  0x00007f5e52b25bdb in get_one_thread_cb () from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #10 0x00007f5e52b25faa in dwfl_getthreads () from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #11 0x00007f5e52b26514 in dwfl_getthread_frames () from /<<NIX>>/elfutils-0.192/lib/libdw.so.1
    #12 0x000000000068c6ce in unwind__get_entries (cb=cb@entry=0x5d4620 <unwind_entry>, arg=arg@entry=0x10cd5fa0,
        thread=thread@entry=0x1076a290, data=data@entry=0x7fff9df80540, max_stack=max_stack@entry=127,
        best_effort=best_effort@entry=false) at util/thread.h:152
    #13 0x00000000005dae95 in thread__resolve_callchain_unwind (evsel=0x106006d0, thread=0x1076a290, cursor=0x10cd5fa0,
        sample=0x7fff9df80540, max_stack=127, symbols=true) at util/machine.c:2939
    #14 thread__resolve_callchain_unwind (thread=0x1076a290, cursor=0x10cd5fa0, evsel=0x106006d0, sample=0x7fff9df80540,
        max_stack=127, symbols=true) at util/machine.c:2920
    #15 __thread__resolve_callchain (thread=0x1076a290, cursor=0x10cd5fa0, evsel=0x106006d0, evsel@entry=0x7fff9df80440,
        sample=0x7fff9df80540, parent=parent@entry=0x7fff9df804a0, root_al=root_al@entry=0x7fff9df80440, max_stack=127, symbols=true)
        at util/machine.c:2970
    #16 0x00000000005d0cb2 in thread__resolve_callchain (thread=<optimized out>, cursor=<optimized out>, evsel=0x7fff9df80440,
        sample=<optimized out>, parent=0x7fff9df804a0, root_al=0x7fff9df80440, max_stack=127) at util/machine.h:198
    #17 sample__resolve_callchain (sample=<optimized out>, cursor=<optimized out>, parent=parent@entry=0x7fff9df804a0,
        evsel=evsel@entry=0x106006d0, al=al@entry=0x7fff9df80440, max_stack=max_stack@entry=127) at util/callchain.c:1127
    #18 0x0000000000617e08 in hist_entry_iter__add (iter=iter@entry=0x7fff9df80480, al=al@entry=0x7fff9df80440, max_stack_depth=127,
        arg=arg@entry=0x7fff9df81ae0) at util/hist.c:1255
    #19 0x000000000045d2d0 in process_sample_event (tool=0x7fff9df81ae0, event=<optimized out>, sample=0x7fff9df80540,
        evsel=0x106006d0, machine=<optimized out>) at builtin-report.c:334
    #20 0x00000000005e3bb1 in perf_session__deliver_event (session=0x105ff2c0, event=0x7f5c7d735ca0, tool=0x7fff9df81ae0,
        file_offset=2914716832, file_path=0x105ffbf0 "perf.data") at util/session.c:1367
    #21 0x00000000005e8d93 in do_flush (oe=0x105ffa50, show_progress=false) at util/ordered-events.c:245
    #22 __ordered_events__flush (oe=0x105ffa50, how=OE_FLUSH__ROUND, timestamp=<optimized out>) at util/ordered-events.c:324
    #23 0x00000000005e1f64 in perf_session__process_user_event (session=0x105ff2c0, event=0x7f5c7d752b18, file_offset=2914835224,
        file_path=0x105ffbf0 "perf.data") at util/session.c:1419
    #24 0x00000000005e47c7 in reader__read_event (rd=rd@entry=0x7fff9df81260, session=session@entry=0x105ff2c0,
    --Type <RET> for more, q to quit, c to continue without paging--
    quit
        prog=prog@entry=0x7fff9df81220) at util/session.c:2132
    #25 0x00000000005e4b37 in reader__process_events (rd=0x7fff9df81260, session=0x105ff2c0, prog=0x7fff9df81220)
        at util/session.c:2181
    #26 __perf_session__process_events (session=0x105ff2c0) at util/session.c:2226
    #27 perf_session__process_events (session=session@entry=0x105ff2c0) at util/session.c:2390
    #28 0x0000000000460add in __cmd_report (rep=0x7fff9df81ae0) at builtin-report.c:1076
    #29 cmd_report (argc=<optimized out>, argv=<optimized out>) at builtin-report.c:1827
    #30 0x00000000004c5a40 in run_builtin (p=p@entry=0xd8f7f8 <commands+312>, argc=argc@entry=1, argv=argv@entry=0x7fff9df844b0)
        at perf.c:351
    #31 0x00000000004c5d63 in handle_internal_command (argc=argc@entry=1, argv=argv@entry=0x7fff9df844b0) at perf.c:404
    #32 0x0000000000442de3 in run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:448
    #33 main (argc=<optimized out>, argv=0x7fff9df844b0) at perf.c:556

The hangup happens because nothing in` perf` or `elfutils` checks if a
mapped file is easily readable.

The change conservatively skips all non-regular files.

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20250505174419.2814857-1-slyich@gmail.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
blktests-ci bot pushed a commit that referenced this pull request Aug 2, 2025
Symbolize stack traces by creating a live machine. Add this
functionality to dump_stack and switch dump_stack users to use
it. Switch TUI to use it. Add stack traces to the child test function
which can be useful to diagnose blocked code.

Example output:
```
$ perf test -vv PERF_RECORD_
...
  7: PERF_RECORD_* events & perf_sample fields:
  7: PERF_RECORD_* events & perf_sample fields                       : Running (1 active)
^C
Signal (2) while running tests.
Terminating tests with the same signal
Internal test harness failure. Completing any started tests:
:  7: PERF_RECORD_* events & perf_sample fields:

---- unexpected signal (2) ----
    #0 0x55788c6210a3 in child_test_sig_handler builtin-test.c:0
    #1 0x7fc12fe49df0 in __restore_rt libc_sigaction.c:0
    #2 0x7fc12fe99687 in __internal_syscall_cancel cancellation.c:64
    #3 0x7fc12fee5f7a in clock_nanosleep@GLIBC_2.2.5 clock_nanosleep.c:72
    #4 0x7fc12fef1393 in __nanosleep nanosleep.c:26
    #5 0x7fc12ff02d68 in __sleep sleep.c:55
    #6 0x55788c63196b in test__PERF_RECORD perf-record.c:0
    #7 0x55788c620fb0 in run_test_child builtin-test.c:0
    #8 0x55788c5bd18d in start_command run-command.c:127
    #9 0x55788c621ef3 in __cmd_test builtin-test.c:0
    #10 0x55788c6225bf in cmd_test ??:0
    #11 0x55788c5afbd0 in run_builtin perf.c:0
    #12 0x55788c5afeeb in handle_internal_command perf.c:0
    #13 0x55788c52b383 in main ??:0
    #14 0x7fc12fe33ca8 in __libc_start_call_main libc_start_call_main.h:74
    #15 0x7fc12fe33d65 in __libc_start_main@@GLIBC_2.34 libc-start.c:128
    #16 0x55788c52b9d1 in _start ??:0

---- unexpected signal (2) ----
    #0 0x55788c6210a3 in child_test_sig_handler builtin-test.c:0
    #1 0x7fc12fe49df0 in __restore_rt libc_sigaction.c:0
    #2 0x7fc12fea3a14 in pthread_sigmask@GLIBC_2.2.5 pthread_sigmask.c:45
    #3 0x7fc12fe49fd9 in __GI___sigprocmask sigprocmask.c:26
    #4 0x7fc12ff2601b in __longjmp_chk longjmp.c:36
    #5 0x55788c6210c0 in print_test_result.isra.0 builtin-test.c:0
    #6 0x7fc12fe49df0 in __restore_rt libc_sigaction.c:0
    #7 0x7fc12fe99687 in __internal_syscall_cancel cancellation.c:64
    #8 0x7fc12fee5f7a in clock_nanosleep@GLIBC_2.2.5 clock_nanosleep.c:72
    #9 0x7fc12fef1393 in __nanosleep nanosleep.c:26
    #10 0x7fc12ff02d68 in __sleep sleep.c:55
    #11 0x55788c63196b in test__PERF_RECORD perf-record.c:0
    #12 0x55788c620fb0 in run_test_child builtin-test.c:0
    #13 0x55788c5bd18d in start_command run-command.c:127
    #14 0x55788c621ef3 in __cmd_test builtin-test.c:0
    #15 0x55788c6225bf in cmd_test ??:0
    #16 0x55788c5afbd0 in run_builtin perf.c:0
    #17 0x55788c5afeeb in handle_internal_command perf.c:0
    #18 0x55788c52b383 in main ??:0
    #19 0x7fc12fe33ca8 in __libc_start_call_main libc_start_call_main.h:74
    #20 0x7fc12fe33d65 in __libc_start_main@@GLIBC_2.34 libc-start.c:128
    #21 0x55788c52b9d1 in _start ??:0
  7: PERF_RECORD_* events & perf_sample fields                       : Skip (permissions)
```

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250624210500.2121303-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
@blktests-ci blktests-ci bot force-pushed the for-next_base branch 3 times, most recently from 62f402e to ca24d57 Compare August 8, 2025 12:50
@blktests-ci blktests-ci bot force-pushed the for-next_base branch 2 times, most recently from 00ea552 to b23491c Compare August 11, 2025 16:52
@kawasaki kawasaki closed this Aug 12, 2025
@blktests-ci blktests-ci bot deleted the series/978007=>for-next branch August 20, 2025 12:05
blktests-ci bot pushed a commit that referenced this pull request Dec 28, 2025
Commit 1d2da79 ("pinctrl: renesas: rzg2l: Avoid configuring ISEL in
gpio_irq_{en,dis}able*()") dropped the configuration of ISEL from
struct irq_chip::{irq_enable, irq_disable} APIs and moved it to
struct gpio_chip::irq::{child_to_parent_hwirq,
child_irq_domain_ops::free} APIs to fix spurious IRQs.

After commit 1d2da79 ("pinctrl: renesas: rzg2l: Avoid configuring ISEL
in gpio_irq_{en,dis}able*()"), ISEL was no longer configured properly on
resume. This is because the pinctrl resume code used
struct irq_chip::irq_enable  (called from rzg2l_gpio_irq_restore()) to
reconfigure the wakeup interrupts. Some drivers (e.g. Ethernet) may also
reconfigure non-wakeup interrupts on resume through their own code,
eventually calling struct irq_chip::irq_enable.

Fix this by adding ISEL configuration back into the
struct irq_chip::irq_enable API and on resume path for wakeup interrupts.

As struct irq_chip::irq_enable needs now to lock to update the ISEL,
convert the struct rzg2l_pinctrl::lock to a raw spinlock and replace the
locking API calls with the raw variants. Otherwise the lockdep reports
invalid wait context when probing the adv7511 module on RZ/G2L:

 [ BUG: Invalid wait context ]
 6.17.0-rc5-next-20250911-00001-gfcfac22533c9 #18 Not tainted
 -----------------------------
 (udev-worker)/165 is trying to lock:
 ffff00000e3664a8 (&pctrl->lock){....}-{3:3}, at: rzg2l_gpio_irq_enable+0x38/0x78
 other info that might help us debug this:
 context-{5:5}
 3 locks held by (udev-worker)/165:
 #0: ffff00000e890108 (&dev->mutex){....}-{4:4}, at: __driver_attach+0x90/0x1ac
 #1: ffff000011c07240 (request_class){+.+.}-{4:4}, at: __setup_irq+0xb4/0x6dc
 #2: ffff000011c070c8 (lock_class){....}-{2:2}, at: __setup_irq+0xdc/0x6dc
 stack backtrace:
 CPU: 1 UID: 0 PID: 165 Comm: (udev-worker) Not tainted 6.17.0-rc5-next-20250911-00001-gfcfac22533c9 #18 PREEMPT
 Hardware name: Renesas SMARC EVK based on r9a07g044l2 (DT)
 Call trace:
 show_stack+0x18/0x24 (C)
 dump_stack_lvl+0x90/0xd0
 dump_stack+0x18/0x24
 __lock_acquire+0xa14/0x20b4
 lock_acquire+0x1c8/0x354
 _raw_spin_lock_irqsave+0x60/0x88
 rzg2l_gpio_irq_enable+0x38/0x78
 irq_enable+0x40/0x8c
 __irq_startup+0x78/0xa4
 irq_startup+0x108/0x16c
 __setup_irq+0x3c0/0x6dc
 request_threaded_irq+0xec/0x1ac
 devm_request_threaded_irq+0x80/0x134
 adv7511_probe+0x928/0x9a4 [adv7511]
 i2c_device_probe+0x22c/0x3dc
 really_probe+0xbc/0x2a0
 __driver_probe_device+0x78/0x12c
 driver_probe_device+0x40/0x164
 __driver_attach+0x9c/0x1ac
 bus_for_each_dev+0x74/0xd0
 driver_attach+0x24/0x30
 bus_add_driver+0xe4/0x208
 driver_register+0x60/0x128
 i2c_register_driver+0x48/0xd0
 adv7511_init+0x5c/0x1000 [adv7511]
 do_one_initcall+0x64/0x30c
 do_init_module+0x58/0x23c
 load_module+0x1bcc/0x1d40
 init_module_from_file+0x88/0xc4
 idempotent_init_module+0x188/0x27c
 __arm64_sys_finit_module+0x68/0xac
 invoke_syscall+0x48/0x110
 el0_svc_common.constprop.0+0xc0/0xe0
 do_el0_svc+0x1c/0x28
 el0_svc+0x4c/0x160
 el0t_64_sync_handler+0xa0/0xe4
 el0t_64_sync+0x198/0x19c

Having ISEL configuration back into the struct irq_chip::irq_enable API
should be safe with respect to spurious IRQs, as in the probe case IRQs
are enabled anyway in struct gpio_chip::irq::child_to_parent_hwirq. No
spurious IRQs were detected on suspend/resume, boot, ethernet link
insert/remove tests (executed on RZ/G3S). Boot, ethernet link
insert/remove tests were also executed successfully on RZ/G2L.

Fixes: 1d2da79 ("pinctrl: renesas: rzg2l: Avoid configuring ISEL in gpio_irq_{en,dis}able*(")
Cc: stable@vger.kernel.org
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20250912095308.3603704-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants