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

RE: [microblaze-uclinux] xilinx_gpio driver patch




-----Original Message-----
From: owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of John Williams
Sent: Tuesday, July 31, 2007 6:28 PM
To: microblaze-uclinux@xxxxxxxxxxxxxx
Subject: Re: [microblaze-uclinux] xilinx_gpio driver patch

Hi Jeff,

Jeff Fellin wrote:
> When configuring my system with three Xilinx Gpio devices using
> drivers/char/xilinx_gpio, my system would hang during bootup. I isolated
the
> problem to the xilinx_gpio driver, on an error condition in xgpio_probe.
> When the second device was probed, the request_irq failed leaving the
> inst_list_sem locked, so when the third probe started it blocked on
> acquiring the lock. 

Just having a closer look, I think there is still a little more to be 
done here.  There are a couple of errors in the failure path out of the 
probe() function that we should fix.

* The !miscdev test (line 401) should set retval and goto failed3, 
instead of returning immediately (currently would do so with lock held).

* The test after the misc_register call (line 412-415) should not do the 
up_write - that should be handled by the failed3: exit path

Also, I'm wondering why your call to request_irq failed in the first 
place.  Have you doubled up multiple GPIO instances on the same IRQ, or 
something else?

What do you think?

John

==========
Reply
John,
After some digging this morning, I know why call to request_irq() failed. My
system configuration has the second GPIO using IRQ 12, which is what was
used in the Linux-2.4 version of the system. request_irq() fails the request
if the requested IRQ is > the maximum supported IRQ, defined in
include/asm-microblaze/irq.h has 11. So 12 is greater than 11 and fails. I
checked the code in the linux-2.4.x tree and the maximum irq value for a
microblaze system is 32. Hence why it worked in 2.4 and not in 2.6. The
question is should asm-microblaze/irq.h have NR_IRQ's changed to 32?

Jeff Fellin
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/