x/exp/io/spi: SPI on mipsle uses wrong IOCTL #26026
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.10.3 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
I used
golang.org/x/exp/io/spi
to write to an SPI device on a MIPS (32 bit, little endian) target.The IOCTL used for writing the data (in
spi.(*devfsConn).Tx
) is wrong. The returned error message isinappropriate ioctl for device
.strace
printsioctl(3, _IOC(_IOC_READ, 0x6b, 0, 0x20), 0x8c33efc) = -1 ENOTTY (Not a tty)
instead ofioctl(3, SPI_IOC_MESSAGE(32), 0x8933f20) = 2
.If I'm not mistaken, the IOCTLs are offset on MIPS targets. See https://github.com/torvalds/linux/blob/master/arch/mips/include/uapi/asm/ioctl.h and https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/ioctl.h#L32
The text was updated successfully, but these errors were encountered: