Re: [PATCH] spi: bcm2835: fix overflow in calculation of transfer time

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

 



> On 29.07.2015, at 16:03, Mark Brown <broonie@xxxxxxxxxx> wrote:
> 
> On Wed, Jul 29, 2015 at 07:34:10AM +0000, kernel@xxxxxxxxxxxxxxxx wrote:
>> From: Martin Sperl <kernel@xxxxxxxxxxxxxxxx>
>> 
>> This resulted in the use of polling mode when other approaches
>> (dma or interrupts) would have been more appropriate.
> 
> Please describe the actual issue and how it's being fixed in the commit
> message.  In this case the fix appears to be converting the timeout
> variable to a long long which will make things better but obviously
> isn't a complete fix for overflows - presumably the ideal thing here is
> to handle saturation better?

Will change the description of the commit and resubmit.

As for saturation I guess that nobody will ever run a spi-transfer
of len=2049638230413 bytes (at which point it would wrap) which:

a) would take 4679 days to reach at 125MHz 
  (the max frequency of the bcm2835 SPI HW limit)
b) would not fit spi_transfer->len (defined as unsigned)

So handling saturation is not an issue when using "long long”
in the context of this device.

Martin--
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