Re: [RFC][PATCH] at91_ide driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wednesday 14 January 2009 14:17:27 Alan Cox napisał(a):
> > +#ifdef AT91_GPIO_IRQ_HACK
> > +#define NR_TRIES 10
> > +	int ntries = 0;
> > +	int pin_val1, pin_val2;	
> > +	do {
> > +		pin_val1 = at91_get_gpio_value(AT91_PIN_PB20);
> > +		pin_val2 = at91_get_gpio_value(AT91_PIN_PB20);
> > +	} while (pin_val1 != pin_val2 && ntries++ < NR_TRIES);
> 
> You really don't want to put special board specific code in generic
> locations. In the libata case you don't need to and I think in the ide
> case you can avoid it too by wrapping the IRQ handler. Libata also
> supports polled mode.
I was thinking about that and don't know why I refused idea of 
wrapping irq handler.

> Now one other question - you use the 8/16bit set to flip between register
> write sizes. Can you explain exactly what guarantees you don't take an
> IRQ between setting the size and a write and having the IRQ handler or a
> timer run in the middle, call other IDE routines and mess up because of
> this.
> I see nothing guaranteeing atomicity here and I suspect you either need
> locks or (for single processor only) some carefully arranged scheme to
> 'stack' the 8/16bit select status.
I thought ide_port callbacks are serialized by IDE layer. I will use locks, I think.

Thanks
Stanislaw Gruszka
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux