Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1227812 > unrolled thread

spi-imx: wait_for_completion should timeout even in non-DMA transfer cases

Started byJean-Michel Hautbois <jean-michel.hautbois@veo-labs.com>
First post2015-09-18 14:40 +0200
Last post2015-09-21 11:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  spi-imx: wait_for_completion should timeout even in non-DMA transfer cases Jean-Michel Hautbois <jean-michel.hautbois@veo-labs.com> - 2015-09-18 14:40 +0200
    Re: spi-imx: wait_for_completion should timeout even in non-DMA  transfer cases Mark Brown <broonie@kernel.org> - 2015-09-20 02:40 +0200
      Re: spi-imx: wait_for_completion should timeout even in non-DMA  transfer cases Jean-Michel Hautbois <jean-michel.hautbois@veo-labs.com> - 2015-09-21 11:10 +0200

#1227812 — spi-imx: wait_for_completion should timeout even in non-DMA transfer cases

FromJean-Michel Hautbois <jean-michel.hautbois@veo-labs.com>
Date2015-09-18 14:40 +0200
Subjectspi-imx: wait_for_completion should timeout even in non-DMA transfer cases
Message-ID<qa37j-2Hb-9@gated-at.bofh.it>
Hi,

I am wondering why in spi-imx the spi_imx_pio_transfer() function is
calling wait_for_completion() and not wait_for_completion_timeout() as
in the spi_imx_dma_transfer() one.
I can't see a good reason for this, maybe should it be calculated
based on the spi clock and transfer->len, or at least be the same as
IMX_DMA_TIMEOUT which is 3 seconds ?
If you want it, I have a patch, just tell me if you are interested and
if you prefer a calculated timeout or even something else ?

Thanks,
JM
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1228793 — Re: spi-imx: wait_for_completion should timeout even in non-DMA transfer cases

FromMark Brown <broonie@kernel.org>
Date2015-09-20 02:40 +0200
SubjectRe: spi-imx: wait_for_completion should timeout even in non-DMA transfer cases
Message-ID<qaAPE-JA-15@gated-at.bofh.it>
In reply to#1227812

[Multipart message — attachments visible in raw view] — view raw

On Fri, Sep 18, 2015 at 02:38:27PM +0200, Jean-Michel Hautbois wrote:
> Hi,
> 
> I am wondering why in spi-imx the spi_imx_pio_transfer() function is
> calling wait_for_completion() and not wait_for_completion_timeout() as
> in the spi_imx_dma_transfer() one.
> I can't see a good reason for this, maybe should it be calculated
> based on the spi clock and transfer->len, or at least be the same as
> IMX_DMA_TIMEOUT which is 3 seconds ?
> If you want it, I have a patch, just tell me if you are interested and
> if you prefer a calculated timeout or even something else ?

A calculated timeout is probably best.

[toc] | [prev] | [next] | [standalone]


#1229133 — Re: spi-imx: wait_for_completion should timeout even in non-DMA transfer cases

FromJean-Michel Hautbois <jean-michel.hautbois@veo-labs.com>
Date2015-09-21 11:10 +0200
SubjectRe: spi-imx: wait_for_completion should timeout even in non-DMA transfer cases
Message-ID<qb5gL-297-23@gated-at.bofh.it>
In reply to#1228793
2015-09-19 19:56 GMT+02:00 Mark Brown <broonie@kernel.org>:
> On Fri, Sep 18, 2015 at 02:38:27PM +0200, Jean-Michel Hautbois wrote:
>> Hi,
>>
>> I am wondering why in spi-imx the spi_imx_pio_transfer() function is
>> calling wait_for_completion() and not wait_for_completion_timeout() as
>> in the spi_imx_dma_transfer() one.
>> I can't see a good reason for this, maybe should it be calculated
>> based on the spi clock and transfer->len, or at least be the same as
>> IMX_DMA_TIMEOUT which is 3 seconds ?
>> If you want it, I have a patch, just tell me if you are interested and
>> if you prefer a calculated timeout or even something else ?
>
> A calculated timeout is probably best.

Well, it depends...
If you have a 20MHz clock, then you can transfer a byte in 4µs.
As most of the time pio_transfer is used for 8 to 32 bytes max, it
would be irrelevant to use such a small timeout.
I can obviously do it, but not sure if using a small (say, 100ms)
timeout would not be better.

JM
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web