Re: [PATCH] rtc-tegra: properly initialize spinlock

From: Sven-Thorsten Dietrich
Date: Fri Jul 22 2011 - 19:19:34 EST



On Jul 22, 2011, at 3:13 PM, Andrew Morton wrote:

> On Fri, 22 Jul 2011 10:35:56 +0200
> Uwe Kleine-K__nig <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
>
>> Using __SPIN_LOCK_UNLOCKED for a dynamically allocated lock is wrong and
>> breaks with PREEMPT_RT_FULL.
>
> Please define "breaks". Lockdep warnings? Deadlocks?

Narrr, I think its a compile-time problem with the static initializer.

Sven

>
>> diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
>> index 2fc31aa..75259fe 100644
>> --- a/drivers/rtc/rtc-tegra.c
>> +++ b/drivers/rtc/rtc-tegra.c
>> @@ -343,7 +343,7 @@ static int __devinit tegra_rtc_probe(struct platform_device *pdev)
>>
>> /* set context info. */
>> info->pdev = pdev;
>> - info->tegra_rtc_lock = __SPIN_LOCK_UNLOCKED(info->tegra_rtc_lock);
>> + spin_lock_init(&info->tegra_rtc_lock);
>>
>> platform_set_drvdata(pdev, info);
>>
>> --
>> 1.7.5.4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html

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