Subject: Re: [PATCH][ATM] iphase: BUG: sleeping function called from invalid context

From: "Jorge Boncompte [DTI2]" <[email-masked]>
Date: Sun, 15 Jun 2008 15:00:48 +0200

Chas Williams (CONTRACTOR) escribió:
> In message <[email-masked]>,"Jorge Boncompte [DTI2]" writes:
>> 	iphase driver calls ioremap under spinlock_irqsave in his
>> initialization function. The spinlock seems to be there just for the 
>> sole purpose of preventing initializing multiple cards at once. So I 
>> think that removing it should be fine.
> 
> the lock is necessary to prevent multiple cards from modifying iadev_count
> at the wrong time since iadev_count is incremented and decremented.
> it might be simpler to just make a local copy of iadev_count and just
> always increment iadev_count.  if you fail to init a particular card,
> you will just leave a hole in ia_dev[].  something like the attached.

	I thought that device initialization inside a driver is serialized. isn't it?

> also, ia_remove_one() is broken since it assumes that the cards will be
> removed in the same order that they were installed.
> 
> even better would be to rewrite this to avoid the iadev[] array entirely
> and use a linked list.
> 

	I have a patch that removes iadev and iadev_count enterely that i did not sent because i thought it wouldn't be 
considered a bug fix. I'll sent it this week.

	Thanks for your review,

	-Jorge
-- 
==============================================================
Jorge Boncompte - Ingenieria y Gestion de RED
DTI2 - Desarrollo de la Tecnologia de las Comunicaciones
--------------------------------------------------------------
C/ Abogado Enriquez Barrios, 5   14004 CORDOBA (SPAIN)
Tlf: +34 957 761395 / FAX: +34 957 450380
==============================================================
- Sin pistachos no hay Rock & Roll...
- Without wicker a basket cannot be made.
==============================================================