Re: [PATCH] spi: sun4i: allow transfers to set transmission speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mark,

2015-11-08 10:35 GMT+01:00 Mark Brown <broonie@xxxxxxxxxx>:
> On Sat, Nov 07, 2015 at 11:41:05PM +0100, Marcus Weseloh wrote:
>
>> +     /* Transfer speed setup with fallback to board max_speed_hz */
>> +     if (tfr->speed_hz > 0 && tfr->speed_hz <= spi->max_speed_hz)
>> +             speed = tfr->speed_hz;
>> +     else
>> +             speed = spi->max_speed_hz;
>
> This is not needed, the core will always ensure that the transfer speed
> is set per on each transfer.

Ah, so we could always use tfr->speed_hz and completely ignore the
spi->max_speed_hz for the clock calculations, correct?

I did notice however, that the SPI system doesn't validate the
speed_hz value. So if I leave out the above quoted sanity checking,
then tfr->speed_hz could also contain values like -400, which trips up
the spi system in such a way that I could only repair with a reboot. I
was testing this with spidev... so maybe spidev should be patched to
check the speed value for validity?

Cheers,
  Marcus
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux