Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-05 Thread Lars-Peter Clausen
On 04/05/2013 04:56 PM, Doug Anderson wrote: > Lars, > > On Fri, Apr 5, 2013 at 1:53 AM, Lars-Peter Clausen wrote: >> Since we sleep inside the protected section we need to use a mutex. > > Ah, good point. > >> It's not the timeout case I'm worried about, but the case where the transfer >> is

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-05 Thread Doug Anderson
Lars, On Fri, Apr 5, 2013 at 1:53 AM, Lars-Peter Clausen wrote: > Since we sleep inside the protected section we need to use a mutex. Ah, good point. > It's not the timeout case I'm worried about, but the case where the transfer > is interrupted by the user. Even though it is rather unlikely

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-05 Thread Lars-Peter Clausen
On 04/03/2013 07:06 PM, Doug Anderson wrote: > Lars, > > On Sat, Mar 16, 2013 at 7:41 AM, Lars-Peter Clausen wrote: >> I think you still need the mutex for serialization, otherwise the requests >> would just cancel each other out. Btw. what happens if you start a conversion >> while another is

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-05 Thread Lars-Peter Clausen
On 04/03/2013 07:06 PM, Doug Anderson wrote: Lars, On Sat, Mar 16, 2013 at 7:41 AM, Lars-Peter Clausen l...@metafoo.de wrote: I think you still need the mutex for serialization, otherwise the requests would just cancel each other out. Btw. what happens if you start a conversion while

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-05 Thread Doug Anderson
Lars, On Fri, Apr 5, 2013 at 1:53 AM, Lars-Peter Clausen l...@metafoo.de wrote: Since we sleep inside the protected section we need to use a mutex. Ah, good point. It's not the timeout case I'm worried about, but the case where the transfer is interrupted by the user. Even though it is

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-05 Thread Lars-Peter Clausen
On 04/05/2013 04:56 PM, Doug Anderson wrote: Lars, On Fri, Apr 5, 2013 at 1:53 AM, Lars-Peter Clausen l...@metafoo.de wrote: Since we sleep inside the protected section we need to use a mutex. Ah, good point. It's not the timeout case I'm worried about, but the case where the transfer

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-03 Thread Doug Anderson
Lars, On Sat, Mar 16, 2013 at 7:41 AM, Lars-Peter Clausen wrote: > I think you still need the mutex for serialization, otherwise the requests > would just cancel each other out. Btw. what happens if you start a conversion > while another is still in progress? Is it possible to abort a

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-04-03 Thread Doug Anderson
Lars, On Sat, Mar 16, 2013 at 7:41 AM, Lars-Peter Clausen l...@metafoo.de wrote: I think you still need the mutex for serialization, otherwise the requests would just cancel each other out. Btw. what happens if you start a conversion while another is still in progress? Is it possible to abort

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-16 Thread Lars-Peter Clausen
On 03/16/2013 01:37 AM, Doug Anderson wrote: > On Fri, Mar 15, 2013 at 2:53 PM, Lars-Peter Clausen wrote: >> What exactly is the spinlock protecting against here? Concurrent runs of >> exynos_adc_isr? This is probably not issue in the first place. >> >> What you want to protect against is that

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-16 Thread Lars-Peter Clausen
On 03/16/2013 01:37 AM, Doug Anderson wrote: On Fri, Mar 15, 2013 at 2:53 PM, Lars-Peter Clausen l...@metafoo.de wrote: What exactly is the spinlock protecting against here? Concurrent runs of exynos_adc_isr? This is probably not issue in the first place. What you want to protect against is

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-15 Thread Doug Anderson
On Fri, Mar 15, 2013 at 2:53 PM, Lars-Peter Clausen wrote: > What exactly is the spinlock protecting against here? Concurrent runs of > exynos_adc_isr? This is probably not issue in the first place. > > What you want to protect against is that completion is completed between the > call to

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-15 Thread Lars-Peter Clausen
On 03/15/2013 05:26 PM, Naveen Krishna Chatradhi wrote: > This patch does the following > 1. Handle the return values of wait_for_completion_interruptible_timeout > 2. Add spin locks to avoid race conditions during ISR. > > Signed-off-by: Naveen Krishna Chatradhi > Cc: Doug Anderson > Cc:

[RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-15 Thread Naveen Krishna Chatradhi
This patch does the following 1. Handle the return values of wait_for_completion_interruptible_timeout 2. Add spin locks to avoid race conditions during ISR. Signed-off-by: Naveen Krishna Chatradhi Cc: Doug Anderson Cc: Lars-Peter Clausen --- Discussion thread for this patch can be found at

[RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-15 Thread Naveen Krishna Chatradhi
This patch does the following 1. Handle the return values of wait_for_completion_interruptible_timeout 2. Add spin locks to avoid race conditions during ISR. Signed-off-by: Naveen Krishna Chatradhi ch.nav...@samsung.com Cc: Doug Anderson diand...@chromium.org Cc: Lars-Peter Clausen

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-15 Thread Lars-Peter Clausen
On 03/15/2013 05:26 PM, Naveen Krishna Chatradhi wrote: This patch does the following 1. Handle the return values of wait_for_completion_interruptible_timeout 2. Add spin locks to avoid race conditions during ISR. Signed-off-by: Naveen Krishna Chatradhi ch.nav...@samsung.com Cc: Doug

Re: [RFC: PATCH 2/2] iio: adc: exynos_adc: Handle timeout and race conditions

2013-03-15 Thread Doug Anderson
On Fri, Mar 15, 2013 at 2:53 PM, Lars-Peter Clausen l...@metafoo.de wrote: What exactly is the spinlock protecting against here? Concurrent runs of exynos_adc_isr? This is probably not issue in the first place. What you want to protect against is that completion is completed between the call