Skip to content

rpi-4.9.y: spi driver reports bogus maximum frequency #2165

@skoehler

Description

@skoehler

A bug was reported for the MRAA library that the SPI frequency cannot be set higher than 500kHz:
eclipse/mraa#255

It turns out that this boils down to a potential problem with the Raspberry Pi's SPI driver. In response to the SPI_IOC_RD_MAX_SPEED_HZ ioctl, the kernel driver reports some frequency slightly above 500kHz. MRAA then rounds down any requested frequency to the reported maximum speed.

It is known that the Raspberry Pi support speeds of up to 125MHz. So the value reported by the driver should be incorrect. I suggest that the driver is fixed to report the actual maximum speed obtained when the divisor is equal to 2.

Meanwhile, MRAA has been patched to ignore the maximum speed reported by the Raspberry Pi driver. Yet, I though that I should report the bug here so that the kernel driver is actually fixed.

While I did not test it, the bug may also affect other branches such as rpi-4.10.y, rpi-4.11.y, rpi-4.12.y, and rpi-4.13.y.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for external inputWaiting for a comment from the originator of the issue, or a collaborator.Waiting for internal commentWaiting for comment from a member of the Raspberry Pi engineering team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions