Skip to content

Scan partitions only on nodes reported as block devices - #64

Merged
JohnAmadis merged 1 commit into
mainfrom
fix/probe-nodes-once
Oct 1, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
fix/probe-nodes-once

Conversation

@JohnAmadis

Copy link
Copy Markdown
Contributor

scan_partitions() opened every node that became available - tty, gpio, dma streams, ... - to ask DMDRVI_IOCTL_BLOCK_GET_INFO, right after report_node_added() had already opened it to ask the very same question. Every node was therefore opened twice, report= was ignored (a node with report=none was still opened for its partition table), and drivers that open exclusively failed loudly: on stm32f746g-disco each probe of /dmdma1/3, the DMA2 stream leased by dmsdio, logged "dmdma: stream 3 already open".

scan_partitions() now only reads the table of a node that report_node_added() reported as "block". A node whose report= excludes block gets no partition nodes and is not opened for them.

The test driver counts the opens of its host node and child, and a new step checks that a plain node is opened once and a report=none node and its child not at all.

scan_partitions() opened every node that became available - tty, gpio,
dma streams, ... - to ask DMDRVI_IOCTL_BLOCK_GET_INFO, right after
report_node_added() had already opened it to ask the very same question.
Every node was therefore opened twice, report= was ignored (a node with
report=none was still opened for its partition table), and drivers that
open exclusively failed loudly: on stm32f746g-disco each probe of
/dmdma1/3, the DMA2 stream leased by dmsdio, logged "dmdma: stream 3
already open".

scan_partitions() now only reads the table of a node that
report_node_added() reported as "block". A node whose report= excludes
block gets no partition nodes and is not opened for them.

The test driver counts the opens of its host node and child, and a new
step checks that a plain node is opened once and a report=none node and
its child not at all.

This supersedes the report_mask check #65 added to scan_partitions():
report_node_added() only ever records classes the report= mask allows,
so a node it reported as block always passes that check too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis
JohnAmadis force-pushed the fix/probe-nodes-once branch from 64919e5 to 431f487 Compare October 1, 2026 06:14
@JohnAmadis
JohnAmadis merged commit ea6b258 into main Oct 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant