I noticed that it was possible to create a DigitalIO from some pin while the pin was already in use by an SPI instance:
>>> spi = busio.SPI(board.IO0, board.IO1, board.IO2)
>>> import digitalio
>>> pin = digitalio.DigitalInOut(board.IO0)
>>> pin
<DigitalInOut>
tested on a kaluga with a 6.1-ish firmware
I can confirm this bug to be present on other peripherals and not just related to spi.
Almost certainly related to #3643
Actually, looks like I misread - the reset problem will cause conflicts pins that have been released, but it shouldn't allow pins in the claimed array to be claimed again. This could be an issue with the bit shifting in the pin claiming system.
@microDev1 can you point out specific modules where you have also had this problem? Turns out this was just that the SPI module didn't have pin claiming in it. The other Busio modules have it, as does DigitalIO and AnalogIO, but if you've encountered it elsewhere I can fold a fix into my PR.
@hierophect I am able to see this on basically all of the io modules.

Update... Pin claiming seems to work until IO7 after which pins aren't claimed properly.
@microDev1 found it, it was a variable size issue with in pin claiming mask operations.
Most helpful comment
@microDev1 found it, it was a variable size issue with in pin claiming mask operations.