Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Lyle Coder
Hello, I am still not sure why you cannot use an IPI for this... on the CPU that you want to access this resource, send an IPI to all other CPUs, and add code in handling that IPI that they should spin and wait till you are done with accessing the chip... then let the other CPUs continue.

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Alan Cox
> [EMAIL PROTECTED] said: > > There is no such exported variable in the 'stable' kernel tree: > > Then there should be, and the RTC accesses in 2.2 are probably racy. > > In which case, feel free to provide Alan with a patch for 2.2.18. Andrea has some bits for this on the current/pending

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: > > [EMAIL PROTECTED] said: > > You want to patch /drivers/char/rtc.c ?? If you have a later kernel > > than me, it would be helpful. Just apply my patch than do the rtc.c. > > /me looks at his TODO list. > > Not really. Okay. I'll do it tonight.

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: > You want to patch /drivers/char/rtc.c ?? If you have a later kernel > than me, it would be helpful. Just apply my patch than do the rtc.c. /me looks at his TODO list. Not really. -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: > > [EMAIL PROTECTED] said: > > 2.2.17 should be able to do. > > Cool. drivers/char/rtc.c needs to use it too. Then you need to pester Alan > till he puts it in 2.2.18-pre-de-jour :) > You want to patch /drivers/char/rtc.c ?? If you have a

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: > 2.2.17 should be able to do. Cool. drivers/char/rtc.c needs to use it too. Then you need to pester Alan till he puts it in 2.2.18-pre-de-jour :) -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: > > [EMAIL PROTECTED] said: > > There is no such exported variable in the 'stable' kernel tree: > > Then there should be, and the RTC accesses in 2.2 are probably racy. > > In which case, feel free to provide Alan with a patch for 2.2.18. > > -- >

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Alan Cox
> > You need to put the spinlock in for every other use of the chip > > I can't control somebody else's use of `hwclock` or even some future > kernel module. You'll have to > What I do is have a daemon which wakes up at 1 second intervals > and writes 'time_t' to a spare group of CMOS

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: > There is no such exported variable in the 'stable' kernel tree: Then there should be, and the RTC accesses in 2.2 are probably racy. In which case, feel free to provide Alan with a patch for 2.2.18. -- dwmw2 - To unsubscribe from this list: send the line

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: > > [EMAIL PROTECTED] said: > > I can't control somebody else's use of `hwclock` or even some future > > kernel module. > > What you actually need to do is use the same spinlock as other users of the > RTC hardware do. > > extern spinlock_t

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: > I can't control somebody else's use of `hwclock` or even some future > kernel module. What you actually need to do is use the same spinlock as other users of the RTC hardware do. extern spinlock_t rtc_lock; It is exported to modules for this very reason. -- dwmw2

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread richardj_moore
I think you need to use the smp_call_funtion service and define the function to be a spin_until_notified function. Each other processor will call spin_until_notified when it receives the IPI for smp_call_function. You can do what you need, then change some global that's keeping all the other

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, Alan Cox wrote: > > spin_lock_irqsave(_lock, flags); > > Muck_With_The_RTC_Chip(); > > spin_unlock_irqrestore(_lock, flags); > > > > This protects only the local procedure. In the meantime, somebody > > else, using another CPU is mucking with the same RTC Chip.

Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
Hello, I need to clear the interrupts on a SMP machine! Before everybody jumps up and says 'idiot', let me assure you that I know about spin locks. Here's the problem: spin_lock_irqsave(_lock, flags); Muck_With_The_RTC_Chip(); spin_unlock_irqrestore(_lock, flags

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, Alan Cox wrote: spin_lock_irqsave(local_lock, flags); Muck_With_The_RTC_Chip(); spin_unlock_irqrestore(local_lock, flags); This protects only the local procedure. In the meantime, somebody else, using another CPU is mucking with the same RTC Chip.

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread richardj_moore
I think you need to use the smp_call_funtion service and define the function to be a spin_until_notified function. Each other processor will call spin_until_notified when it receives the IPI for smp_call_function. You can do what you need, then change some global that's keeping all the other

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: I can't control somebody else's use of `hwclock` or even some future kernel module. What you actually need to do is use the same spinlock as other users of the RTC hardware do. extern spinlock_t rtc_lock; It is exported to modules for this very reason. -- dwmw2

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: [EMAIL PROTECTED] said: I can't control somebody else's use of `hwclock` or even some future kernel module. What you actually need to do is use the same spinlock as other users of the RTC hardware do. extern spinlock_t rtc_lock; It

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: There is no such exported variable in the 'stable' kernel tree: Then there should be, and the RTC accesses in 2.2 are probably racy. In which case, feel free to provide Alan with a patch for 2.2.18. -- dwmw2 - To unsubscribe from this list: send the line

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Alan Cox
You need to put the spinlock in for every other use of the chip I can't control somebody else's use of `hwclock` or even some future kernel module. You'll have to What I do is have a daemon which wakes up at 1 second intervals and writes 'time_t' to a spare group of CMOS registers and

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: [EMAIL PROTECTED] said: There is no such exported variable in the 'stable' kernel tree: Then there should be, and the RTC accesses in 2.2 are probably racy. In which case, feel free to provide Alan with a patch for 2.2.18. -- dwmw2

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: 2.2.17 should be able to do. Cool. drivers/char/rtc.c needs to use it too. Then you need to pester Alan till he puts it in 2.2.18-pre-de-jour :) -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: [EMAIL PROTECTED] said: 2.2.17 should be able to do. Cool. drivers/char/rtc.c needs to use it too. Then you need to pester Alan till he puts it in 2.2.18-pre-de-jour :) You want to patch /drivers/char/rtc.c ?? If you have a later

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread David Woodhouse
[EMAIL PROTECTED] said: You want to patch /drivers/char/rtc.c ?? If you have a later kernel than me, it would be helpful. Just apply my patch than do the rtc.c. /me looks at his TODO list. Not really. -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Richard B. Johnson
On Wed, 18 Oct 2000, David Woodhouse wrote: [EMAIL PROTECTED] said: You want to patch /drivers/char/rtc.c ?? If you have a later kernel than me, it would be helpful. Just apply my patch than do the rtc.c. /me looks at his TODO list. Not really. Okay. I'll do it tonight. There are

Re: Clear interrupts on a SMP machine?

2000-10-18 Thread Lyle Coder
Hello, I am still not sure why you cannot use an IPI for this... on the CPU that you want to access this resource, send an IPI to all other CPUs, and add code in handling that IPI that they should spin and wait till you are done with accessing the chip... then let the other CPUs continue.