linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using patch-3.2-rt10, kernel won't compile with CONFIG_PREEMPT_RT_FULL=y
@ 2012-10-11 14:39 André Bachmann
  2012-10-11 15:39 ` Paul Gortmaker
  0 siblings, 1 reply; 4+ messages in thread
From: André Bachmann @ 2012-10-11 14:39 UTC (permalink / raw)
  To: linux-rt-users

Hi all,

here I have a TI Sitara AM335X with its latest SDK v05.05.00. I
installed it and I'm able to compile my kernels. Kernel 3.2.0 is
shipped with this SDK.

However, I want to use the official RT patches from
http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/older/. Since
kernel 3.2.0 is delivered with this SDK, I chose
http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/older/patch-3.2-rt10.patch.bz2
as the correct patch. With it, I patched my kernel sources - no errors
here. After that, I checked if there are any problems by compiling
this patched kernel. No problems, my board still boots fine.

Then I really wanted to use the new RT features, so I backed up the
default config file tisdk_am335x-evm_defconfig and changed the option
"CONFIG_PREEMPT_NONE=y" to "CONFIG_PREEMPT_RT_FULL=y". No further
changes.

If I now compile this, I get an error when compiling drivers/pwm/pwm.c:

...
CC drivers/pwm/pwm.o
drivers/pwm/pwm.c: In function 'pwm_set_frequency':
drivers/pwm/pwm.c:291:2: error: expected expression before 'do'
make[3]: *** [drivers/pwm/pwm.o] Error 1
make[2]: *** [drivers/pwm] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory
`/home/user/ti-sdk-am335x-evm-05.05.00.00/board-support/linux-3.2.0-psp04.06.00.08.sdk'
make: *** [linux] Error 2

This is the function near this line in pwm.c:

282 int pwm_set_frequency(struct pwm_device *p, unsigned long freq)
283 {
284 struct pwm_config c;
285
286 if (!freq)
287 return -EINVAL;
288
289 c.config_mask = BIT(PWM_CONFIG_PERIOD_TICKS),
290 c.period_ticks = pwm_ns_to_ticks(p, (NSEC_PER_SEC / freq)),
291 spin_lock(&p->pwm_lock);
292 p->period_ns = NSEC_PER_SEC / freq;
293 spin_unlock(&p->pwm_lock);
294 return pwm_config(p, &c);
295 }
296 EXPORT_SYMBOL(pwm_set_frequency);

So the error seems to be related with the call of spin_lock, which
surely gets changed by the RT patch. Has anyone a hint for me? I'm
quite new to this matter... :(
I appreciate any help!

André
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Using patch-3.2-rt10, kernel won't compile with CONFIG_PREEMPT_RT_FULL=y
  2012-10-11 14:39 Using patch-3.2-rt10, kernel won't compile with CONFIG_PREEMPT_RT_FULL=y André Bachmann
@ 2012-10-11 15:39 ` Paul Gortmaker
  2012-10-11 15:58   ` André Bachmann
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2012-10-11 15:39 UTC (permalink / raw)
  To: André Bachmann; +Cc: linux-rt-users

On Thu, Oct 11, 2012 at 10:39 AM, André Bachmann
<andrebachmann.dd@gmail.com> wrote:
> Hi all,
>
> here I have a TI Sitara AM335X with its latest SDK v05.05.00. I
> installed it and I'm able to compile my kernels. Kernel 3.2.0 is
> shipped with this SDK.
>
> However, I want to use the official RT patches from
> http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/older/. Since
> kernel 3.2.0 is delivered with this SDK, I chose
> http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/older/patch-3.2-rt10.patch.bz2
> as the correct patch. With it, I patched my kernel sources - no errors
> here. After that, I checked if there are any problems by compiling
> this patched kernel. No problems, my board still boots fine.
>
> Then I really wanted to use the new RT features, so I backed up the
> default config file tisdk_am335x-evm_defconfig and changed the option
> "CONFIG_PREEMPT_NONE=y" to "CONFIG_PREEMPT_RT_FULL=y". No further
> changes.
>
> If I now compile this, I get an error when compiling drivers/pwm/pwm.c:
>
> ...
> CC drivers/pwm/pwm.o
> drivers/pwm/pwm.c: In function 'pwm_set_frequency':
> drivers/pwm/pwm.c:291:2: error: expected expression before 'do'
> make[3]: *** [drivers/pwm/pwm.o] Error 1
> make[2]: *** [drivers/pwm] Error 2
> make[1]: *** [drivers] Error 2
> make[1]: Leaving directory
> `/home/user/ti-sdk-am335x-evm-05.05.00.00/board-support/linux-3.2.0-psp04.06.00.08.sdk'
> make: *** [linux] Error 2
>
> This is the function near this line in pwm.c:
>
> 282 int pwm_set_frequency(struct pwm_device *p, unsigned long freq)
> 283 {
> 284 struct pwm_config c;
> 285
> 286 if (!freq)
> 287 return -EINVAL;
> 288
> 289 c.config_mask = BIT(PWM_CONFIG_PERIOD_TICKS),
> 290 c.period_ticks = pwm_ns_to_ticks(p, (NSEC_PER_SEC / freq)),

Nothing to do with RT.  Whoever coded up this pwm.c file (presumably
a part of the non-upstream SDK?) should learn the difference between
"," and ";" on the above two lines.

Paul.
--

> 291 spin_lock(&p->pwm_lock);
> 292 p->period_ns = NSEC_PER_SEC / freq;
> 293 spin_unlock(&p->pwm_lock);
> 294 return pwm_config(p, &c);
> 295 }
> 296 EXPORT_SYMBOL(pwm_set_frequency);
>
> So the error seems to be related with the call of spin_lock, which
> surely gets changed by the RT patch. Has anyone a hint for me? I'm
> quite new to this matter... :(
> I appreciate any help!
>
> André
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Using patch-3.2-rt10, kernel won't compile with CONFIG_PREEMPT_RT_FULL=y
  2012-10-11 15:39 ` Paul Gortmaker
@ 2012-10-11 15:58   ` André Bachmann
  2012-10-11 20:20     ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: André Bachmann @ 2012-10-11 15:58 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-rt-users

2012/10/11 Paul Gortmaker <paul.gortmaker@windriver.com>:
> On Thu, Oct 11, 2012 at 10:39 AM, André Bachmann
> <andrebachmann.dd@gmail.com> wrote:
>> Hi all,
>>
>> here I have a TI Sitara AM335X with its latest SDK v05.05.00. I
>> installed it and I'm able to compile my kernels. Kernel 3.2.0 is
>> shipped with this SDK.
>>
>> However, I want to use the official RT patches from
>> http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/older/. Since
>> kernel 3.2.0 is delivered with this SDK, I chose
>> http://www.kernel.org/pub/linux/kernel/projects/rt/3.2/older/patch-3.2-rt10.patch.bz2
>> as the correct patch. With it, I patched my kernel sources - no errors
>> here. After that, I checked if there are any problems by compiling
>> this patched kernel. No problems, my board still boots fine.
>>
>> Then I really wanted to use the new RT features, so I backed up the
>> default config file tisdk_am335x-evm_defconfig and changed the option
>> "CONFIG_PREEMPT_NONE=y" to "CONFIG_PREEMPT_RT_FULL=y". No further
>> changes.
>>
>> If I now compile this, I get an error when compiling drivers/pwm/pwm.c:
>>
>> ...
>> CC drivers/pwm/pwm.o
>> drivers/pwm/pwm.c: In function 'pwm_set_frequency':
>> drivers/pwm/pwm.c:291:2: error: expected expression before 'do'
>> make[3]: *** [drivers/pwm/pwm.o] Error 1
>> make[2]: *** [drivers/pwm] Error 2
>> make[1]: *** [drivers] Error 2
>> make[1]: Leaving directory
>> `/home/user/ti-sdk-am335x-evm-05.05.00.00/board-support/linux-3.2.0-psp04.06.00.08.sdk'
>> make: *** [linux] Error 2
>>
>> This is the function near this line in pwm.c:
>>
>> 282 int pwm_set_frequency(struct pwm_device *p, unsigned long freq)
>> 283 {
>> 284 struct pwm_config c;
>> 285
>> 286 if (!freq)
>> 287 return -EINVAL;
>> 288
>> 289 c.config_mask = BIT(PWM_CONFIG_PERIOD_TICKS),
>> 290 c.period_ticks = pwm_ns_to_ticks(p, (NSEC_PER_SEC / freq)),
>
> Nothing to do with RT.  Whoever coded up this pwm.c file (presumably
> a part of the non-upstream SDK?) should learn the difference between
> "," and ";" on the above two lines.
>
> Paul.
> --

Well I must be completely blind to miss this. Thank you! Now the
kernel compiles successfully.
But now the question arises: Why I don't get this error when not using
"CONFIG_PREEMPT_RT_FULL=y"?

>
>> 291 spin_lock(&p->pwm_lock);
>> 292 p->period_ns = NSEC_PER_SEC / freq;
>> 293 spin_unlock(&p->pwm_lock);
>> 294 return pwm_config(p, &c);
>> 295 }
>> 296 EXPORT_SYMBOL(pwm_set_frequency);
>>
>> So the error seems to be related with the call of spin_lock, which
>> surely gets changed by the RT patch. Has anyone a hint for me? I'm
>> quite new to this matter... :(
>> I appreciate any help!
>>
>> André
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Using patch-3.2-rt10, kernel won't compile with CONFIG_PREEMPT_RT_FULL=y
  2012-10-11 15:58   ` André Bachmann
@ 2012-10-11 20:20     ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2012-10-11 20:20 UTC (permalink / raw)
  To: André Bachmann; +Cc: Paul Gortmaker, linux-rt-users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 426 bytes --]

On Thu, 11 Oct 2012, André Bachmann wrote:
> 2012/10/11 Paul Gortmaker <paul.gortmaker@windriver.com>:
> 
> Well I must be completely blind to miss this. Thank you! Now the
> kernel compiles successfully.
> But now the question arises: Why I don't get this error when not using
> "CONFIG_PREEMPT_RT_FULL=y"?

You have to look at the preprocessor output. It's probably covered up
by some magic macro expansion.

Thanks,

	tglx

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

end of thread, other threads:[~2012-10-11 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-11 14:39 Using patch-3.2-rt10, kernel won't compile with CONFIG_PREEMPT_RT_FULL=y André Bachmann
2012-10-11 15:39 ` Paul Gortmaker
2012-10-11 15:58   ` André Bachmann
2012-10-11 20:20     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).