Repository navigation
Build against dmgpio 2.0; number ioctls from DMDRVI_IOCTL_CUSTOM_BASE - #6
Merged
Merged
Conversation
dmgpio 2.0 numbers its ioctl commands from DMDRVI_IOCTL_CUSTOM_BASE (choco-technologies/dmgpio#37), so dmgpio_ioctl_cmd_set_pins_state - which drives a software chip select - has a new value. dmspi must be built against 2.0 and never loaded together with dmgpio 1.x, where the same number meant something else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgkwHQKqf6c4DzypSKzZT7
…the rest dmspi numbered its commands from 1, inside the standard dmdrvi range (DMDRVI_IOCTL_NET_* are 0x01..), and rejected anything >= its max with a logged -EINVAL. dmdevfs probes every node with DMDRVI_IOCTL_BLOCK_GET_INFO (0x100) and DMDRVI_IOCTL_MONITOR_GET_POLICY (0x200), so each SPI node logged two errors, and commands below 1 were not range-checked at all. dmspi_ioctl_cmd_t now starts at DMDRVI_IOCTL_CUSTOM_BASE (dmspi_types.h includes dmdrvi_ioctl.h; dmspi_port and spitest fetch the dmdrvi headers for it), and every command outside [get_role, max) returns -ENOTTY without a log line, as dmdrvi requires - the same change dmgpio, dmdma and dmtty got. The command values change: modules that send dmspi ioctls must be rebuilt, so this goes out as dmspi 2.0 (spitest in this repository is rebuilt with it). test_dmspi calls dmspi through the dmdrvi DIF like dmdevfs does, on the x86_64 loopback port: the block/monitor/network probes, 0, -1 and dmspi_ioctl_cmd_max give -ENOTTY; dmspi_ioctl_cmd_get_role is DMDRVI_IOCTL_CUSTOM_BASE and answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgkwHQKqf6c4DzypSKzZT7
3 of 4 tasks
choco-technologies/dmgpio#37 was released as dmgpio 1.1, not 2.0, so dmgpio@>=2.0 could not be resolved and CI had no dmgpio headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgkwHQKqf6c4DzypSKzZT7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of choco-technologies/dmod-ecosystem#17.
Summary
1. Build against dmgpio ≥ 1.1 (chip select)
dmgpio 1.1 numbers its ioctl commands from
DMDRVI_IOCTL_CUSTOM_BASE. As a resultdmgpio_ioctl_cmd_set_pins_state, which drives the software CS, has a new value.2. The same change for dmspi's own commands
dmspi had the same problems:
DMDRVI_IOCTL_NET_*= 0x01..).>= dmspi_ioctl_cmd_maxgot a logged-EINVAL. dmdevfs probes every node with0x100/0x200, so every SPI node logged two errors.This PR applies the change dmgpio, dmdma and dmtty already got:
dmspi_ioctl_cmd_tstarts atDMDRVI_IOCTL_CUSTOM_BASE.dmspi_types.hincludesdmdrvi_ioctl.h, anddmspi_portandspitestfetch the dmdrvi headers for it. dmdrvi is pinned to>= 2.0.[get_role, max)returns-ENOTTYwithout a log entry.docs/api-reference.mddescribes the numbering and the return value.spitestlives in this repo and is rebuilt with it. No other module sends dmspi ioctls; I checked the choco-technologies driver repositories.Test plan
chocotechnologies/dmod:1.0.4:dmspi_port):test_dmspipasses 6/6.0,-1anddmspi_ioctl_cmd_maxall give-ENOTTY.dmspi_ioctl_cmd_get_role == DMDRVI_IOCTL_CUSTOM_BASE, and it answersmaster.stm32f4/stm32f7builds of dmspi, dmspi_port, spitest and test_dmspi: no warnings.spitestloopback);🤖 Generated with Claude Code
https://claude.ai/code/session_01TgkwHQKqf6c4DzypSKzZT7