All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
@ 2012-07-12  2:12 ` Todd Poynor
  0 siblings, 0 replies; 10+ messages in thread
From: Todd Poynor @ 2012-07-12  2:12 UTC (permalink / raw)
  To: Ben Dooks, Kukjin Kim
  Cc: linux-arm-kernel, linux-samsung-soc, eunki_kim, Todd Poynor

Checking for adc->ts_pend already claimed should be done with the
lock held.

Change-Id: Ic9f15e26bd19934ab8c2885ce5df265933ac304a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
 arch/arm/plat-samsung/adc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 33ecd0c..b1e05cc 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client,
 		return -EINVAL;
 	}
 
-	if (client->is_ts && adc->ts_pend)
-		return -EAGAIN;
-
 	spin_lock_irqsave(&adc->lock, flags);
 
+	if (client->is_ts && adc->ts_pend) {
+		spin_unlock_irqrestore(&adc->lock, flags);
+		return -EAGAIN;
+	}
+
 	client->channel = channel;
 	client->nr_samples = nr_samples;
 
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
@ 2012-07-12  2:12 ` Todd Poynor
  0 siblings, 0 replies; 10+ messages in thread
From: Todd Poynor @ 2012-07-12  2:12 UTC (permalink / raw)
  To: linux-arm-kernel

Checking for adc->ts_pend already claimed should be done with the
lock held.

Change-Id: Ic9f15e26bd19934ab8c2885ce5df265933ac304a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
 arch/arm/plat-samsung/adc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 33ecd0c..b1e05cc 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -157,11 +157,13 @@ int s3c_adc_start(struct s3c_adc_client *client,
 		return -EINVAL;
 	}
 
-	if (client->is_ts && adc->ts_pend)
-		return -EAGAIN;
-
 	spin_lock_irqsave(&adc->lock, flags);
 
+	if (client->is_ts && adc->ts_pend) {
+		spin_unlock_irqrestore(&adc->lock, flags);
+		return -EAGAIN;
+	}
+
 	client->channel = channel;
 	client->nr_samples = nr_samples;
 
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
  2012-07-12  2:12 ` Todd Poynor
@ 2012-07-12 12:31   ` Ben Dooks
  -1 siblings, 0 replies; 10+ messages in thread
From: Ben Dooks @ 2012-07-12 12:31 UTC (permalink / raw)
  To: Todd Poynor
  Cc: eunki_kim, linux-samsung-soc, Kukjin Kim, linux-arm-kernel, Ben Dooks

On Wed, Jul 11, 2012 at 07:12:11PM -0700, Todd Poynor wrote:
> Checking for adc->ts_pend already claimed should be done with the
> lock held.
> 
> Change-Id: Ic9f15e26bd19934ab8c2885ce5df265933ac304a
> Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
@ 2012-07-12 12:31   ` Ben Dooks
  0 siblings, 0 replies; 10+ messages in thread
From: Ben Dooks @ 2012-07-12 12:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 11, 2012 at 07:12:11PM -0700, Todd Poynor wrote:
> Checking for adc->ts_pend already claimed should be done with the
> lock held.
> 
> Change-Id: Ic9f15e26bd19934ab8c2885ce5df265933ac304a
> Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
  2012-07-12 12:31   ` Ben Dooks
@ 2012-07-12 22:41     ` Kukjin Kim
  -1 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2012-07-12 22:41 UTC (permalink / raw)
  To: Ben Dooks
  Cc: linux-samsung-soc, eunki_kim, Kukjin Kim, Ben Dooks, Todd Poynor,
	linux-arm-kernel

On 07/12/12 21:31, Ben Dooks wrote:
> On Wed, Jul 11, 2012 at 07:12:11PM -0700, Todd Poynor wrote:
>> Checking for adc->ts_pend already claimed should be done with the
>> lock held.
>>
>> Change-Id: Ic9f15e26bd19934ab8c2885ce5df265933ac304a
>> Signed-off-by: Todd Poynor<toddpoynor@google.com>
> Acked-by: Ben Dooks<ben-linux@fluff.org>

Ben, thanks for your ack, will apply.

BTW, Todd, do you want to keep the 'Change-Id' in mainline?
If you don't mind, I'd like to remove it...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
@ 2012-07-12 22:41     ` Kukjin Kim
  0 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2012-07-12 22:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/12/12 21:31, Ben Dooks wrote:
> On Wed, Jul 11, 2012 at 07:12:11PM -0700, Todd Poynor wrote:
>> Checking for adc->ts_pend already claimed should be done with the
>> lock held.
>>
>> Change-Id: Ic9f15e26bd19934ab8c2885ce5df265933ac304a
>> Signed-off-by: Todd Poynor<toddpoynor@google.com>
> Acked-by: Ben Dooks<ben-linux@fluff.org>

Ben, thanks for your ack, will apply.

BTW, Todd, do you want to keep the 'Change-Id' in mainline?
If you don't mind, I'd like to remove it...

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
  2012-07-12 22:41     ` Kukjin Kim
@ 2012-07-13  1:35       ` Todd Poynor
  -1 siblings, 0 replies; 10+ messages in thread
From: Todd Poynor @ 2012-07-13  1:35 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Ben Dooks, eunki_kim, linux-samsung-soc, linux-arm-kernel, Ben Dooks

On Fri, Jul 13, 2012 at 07:41:11AM +0900, Kukjin Kim wrote:
> BTW, Todd, do you want to keep the 'Change-Id' in mainline?
> If you don't mind, I'd like to remove it...

Oops, I forgot to take it out, please do remove it, thanks.


Todd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
@ 2012-07-13  1:35       ` Todd Poynor
  0 siblings, 0 replies; 10+ messages in thread
From: Todd Poynor @ 2012-07-13  1:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 13, 2012 at 07:41:11AM +0900, Kukjin Kim wrote:
> BTW, Todd, do you want to keep the 'Change-Id' in mainline?
> If you don't mind, I'd like to remove it...

Oops, I forgot to take it out, please do remove it, thanks.


Todd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
  2012-07-13  1:35       ` Todd Poynor
@ 2012-07-13 11:28         ` Kukjin Kim
  -1 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2012-07-13 11:28 UTC (permalink / raw)
  To: 'Todd Poynor'
  Cc: 'Ben Dooks',
	eunki_kim, linux-samsung-soc, linux-arm-kernel,
	'Ben Dooks'

Todd Poynor wrote:
> 
> On Fri, Jul 13, 2012 at 07:41:11AM +0900, Kukjin Kim wrote:
> > BTW, Todd, do you want to keep the 'Change-Id' in mainline?
> > If you don't mind, I'd like to remove it...
> 
> Oops, I forgot to take it out, please do remove it, thanks.
> 
Sure, will remove when I apply this into -fixes.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] ARM: samsung: adc: fix race in s3c_adc_start
@ 2012-07-13 11:28         ` Kukjin Kim
  0 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2012-07-13 11:28 UTC (permalink / raw)
  To: linux-arm-kernel

Todd Poynor wrote:
> 
> On Fri, Jul 13, 2012 at 07:41:11AM +0900, Kukjin Kim wrote:
> > BTW, Todd, do you want to keep the 'Change-Id' in mainline?
> > If you don't mind, I'd like to remove it...
> 
> Oops, I forgot to take it out, please do remove it, thanks.
> 
Sure, will remove when I apply this into -fixes.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-13 11:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12  2:12 [PATCH] ARM: samsung: adc: fix race in s3c_adc_start Todd Poynor
2012-07-12  2:12 ` Todd Poynor
2012-07-12 12:31 ` Ben Dooks
2012-07-12 12:31   ` Ben Dooks
2012-07-12 22:41   ` Kukjin Kim
2012-07-12 22:41     ` Kukjin Kim
2012-07-13  1:35     ` Todd Poynor
2012-07-13  1:35       ` Todd Poynor
2012-07-13 11:28       ` Kukjin Kim
2012-07-13 11:28         ` Kukjin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.