lkml.org 
[lkml]   [2009]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ARM: Add spi controller driver support for NUC900
On Thu, Nov 19, 2009 at 05:49:22PM +0800, Wan ZongShun wrote:
> 2009/11/19 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Thu, Nov 19, 2009 at 04:40:50PM +0800, Wan ZongShun wrote:
> >> 2009/11/19 Andrew Morton <akpm@linux-foundation.org>:
> >> > I don't know, because I don't know what operation the hardware needs to
> >> > stop it from generating interrupts.  Perhaps that's clk_disable()?
> >>
> >> The interrupt will be not occur as long as I run clk_disable().
> >>
> >> > Once you've stopped the source of interrupts then the code should wait
> >> > for the IRQ handler to complete if it's running on another CPU.  Yes,
> >> > free_irq() does that.
> >>
> >> So, regarding my system of single CPU, maybe I need put this
> >> 'clk_disable()' in the front of function of w90p910_spi_remove().
> >>
> >> right?
> >
> > Depending on the hardware, that's not the right answer.  If turning off
> > the clock also causes register accesses to the device to abort, it is
> > a very dangerous thing to do.
> >
> > It can also be dangerous if the clock is used to synchronise the interrupt
> > output - it can lead to the output being permanently asserted if the clock
> > is turned off with it asserted.
> >
> > Normally devices have an "interrupt enable" register.  You should disable
> > all interrupts from the device using this register after unregistering
> > the driver from the (SPI) subsystem.
>
> sir, so I need implement a API to disable spi device interrupt by
> "interrupt enable" register?
> but I did not find the operation in other ARM platform when they close
> your spi driver.
>
> or something I missed?

No, I think you need to reverse the effects of w90p910_enable_int()
by clearing the ENINT bit. I'm making the assumption that doing so
prevents interrupts being generated by the device.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-19 23:45    [W:0.079 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site