* 2 PCI devices behind PCI bridge on Yosemite board.
@ 2006-11-30 19:52 Leonid
2006-11-30 20:07 ` Scott Wood
0 siblings, 1 reply; 4+ messages in thread
From: Leonid @ 2006-11-30 19:52 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Balajee Premraj
Hi:
I need 2 PCI boards (ATMEL Dream Chip reference and Silicon Image 680
PCI-ATA) working simultaneously on AMCC PPC440EP Yosemite board. However
since Yosemite has only 1 PCI slot, I resorted to use PCI riser with
Intel S21152BB PCI bridge. This slot is connected to IRQ2 pin of
PPC440EP which is mapped to IRQ25 in Linux.
Both boards are identified by Linux kernel which sees 3 devices on this
slot (including bridge itself):
~ # cat /proc/bus/pci/devices
0060 8086b152 19 00000000 00000000 00000000
00000000 00000000 00000000 00000000 0
0000000 00000000 00000000 00000000 00000000
00000000 00000000
0120 14389707 19 0000fff1 00000000 00000000
00000000 00000000 00000000 00000000 0
0000010 00000000 00000000 00000000 00000000
00000000 00000000 Dreamchip
0130 10950680 19 0000ffe9 0000ffe5 0000ffd9
0000ffd5 0000ffc1 afffff00 00000000 0
0000008 00000004 00000008 00000004 00000010
00000100 00080000 SiI_IDE
There is HDD behind Silicon Image chip:
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=3Dxx
SiI680: IDE controller at PCI slot 0000:01:06.0
SiI680: chipset revision 2
SiI680: BASE CLOCK =3D=3D 133
SiI680: 100% native mode on irq 25
ide0: MMIO-DMA , BIOS settings: hda:pio, hdb:pio
ide1: MMIO-DMA , BIOS settings: hdc:pio, hdd:pio
hda: Maxtor 6L100P0, ATA DISK drive
ide0 at 0xd105cf80-0xd105cf87,0xd105cf8a on irq 25
hda: max request size: 64KiB
As can be seen both devices share the same interrupt 25 (I have compiled
kernel with IDEPCI_SHARE_IRQ option though I'm not sure it's important).
If Dreamchip card does nothing, I can successfully operate with HDD
behind Silicon Image including reading/writing files:
# fdisk -ul /dev/hda
Disk /dev/hda: 100.2 GB, 100256292864 bytes
255 heads, 63 sectors/track, 12188 cylinders, total 195813072 sectors
Units =3D sectors of 1 * 512 =3D 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 63 208844 104391 83 Linux
/dev/hda2 208845 2249099 1020127+ 82 Linux swap
/dev/hda3 2249100 195800219 96775560 83 Linux
Problem starts when I work with Dreamchip. Interrupt arrives from it and
kernel doesn't know what to do with this interrupt and it gets disabled.
Looks like interrupt doesn't get acknowledged properly.
I tried to register Dreamchip PCI device by 2 ways:
1) I request interrupt and provide as interrupt handler empty function:
irqreturn_t snd_dream_interrupt(int irq, void *dev_id, struct pt_regs
*regs)
{
return IRQ_NONE;
}
Kernel output when Dreamchip interrupts:
irq 25: nobody cared (try booting with the "irqpoll" option)
Call trace:
[c003ac40] __report_bad_irq+0x34/0xac
[c003af60] note_interrupt+0x2a8/0x334
[c003a644] __do_IRQ+0x198/0x1b0
[c0003908] do_IRQ+0x38/0x98
[c000253c] ret_from_except+0x0/0x18
handlers:
[<c01680fc>] (ide_intr+0x0/0x308)
[<c020a948>] (snd_dream_interrupt+0x0/0x8)
Disabling IRQ #25
2) Because I don't need interrupt from Dreamchip anyway, I tried don't
request interrupt upon Dreamchip PCI driver registration. Result was the
same though kernel output different:
irq 25: nobody cared (try booting with the "irqpoll" option)
Call trace:
[c003ac40] __report_bad_irq+0x34/0xac
[c003af60] note_interrupt+0x2a8/0x334
[c003a644] __do_IRQ+0x198/0x1b0
[c0003908] do_IRQ+0x38/0x98
[c000253c] ret_from_except+0x0/0x18
[c007780c] vfs_ioctl+0xf8/0x45c
[c0077bb0] sys_ioctl+0x40/0x74
[c0001e34] ret_from_syscall+0x0/0x48
handlers:
[<c01680fc>] (ide_intr+0x0/0x308)
Disabling IRQ #25
Any ideas what I have done wrong? Can I just tell to the bridge don't
interrupt CPU if Dreamchip is interrupting?
Thanks,
Leonid.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 2 PCI devices behind PCI bridge on Yosemite board.
2006-11-30 19:52 2 PCI devices behind PCI bridge on Yosemite board Leonid
@ 2006-11-30 20:07 ` Scott Wood
2006-11-30 20:18 ` Leonid
0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2006-11-30 20:07 UTC (permalink / raw)
To: Leonid; +Cc: Balajee Premraj, linuxppc-embedded
Leonid wrote:
> Problem starts when I work with Dreamchip. Interrupt arrives from it and
> kernel doesn't know what to do with this interrupt and it gets disabled.
> Looks like interrupt doesn't get acknowledged properly.
>
> I tried to register Dreamchip PCI device by 2 ways:
>
> 1) I request interrupt and provide as interrupt handler empty function:
>
> irqreturn_t snd_dream_interrupt(int irq, void *dev_id, struct pt_regs
> *regs)
> {
> return IRQ_NONE;
> }
You didn't deal with the source of the interrupt. Since it's apparently
level-triggered, the interrupt just comes right back.
> 2) Because I don't need interrupt from Dreamchip anyway, I tried don't
> request interrupt upon Dreamchip PCI driver registration. Result was the
> same though kernel output different:
Not requesting the IRQ doesn't stop the device from asserting it.
> Any ideas what I have done wrong? Can I just tell to the bridge don't
> interrupt CPU if Dreamchip is interrupting?
No, because both devices share the same physical IRQ line. The PIC
can't tell which device is asserting it. You need to either provide a
real IRQ handler for the Dreamchip, or tell the Dreamchip itself to mask
the IRQ.
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: 2 PCI devices behind PCI bridge on Yosemite board.
2006-11-30 20:07 ` Scott Wood
@ 2006-11-30 20:18 ` Leonid
2006-11-30 20:26 ` Scott Wood
0 siblings, 1 reply; 4+ messages in thread
From: Leonid @ 2006-11-30 20:18 UTC (permalink / raw)
To: Scott Wood; +Cc: Balajee Premraj, linuxppc-embedded
On Thursday, November 30, 2006 12:08 PM Scott Wood wrote:
> >=20
> > 1) I request interrupt and provide as interrupt handler empty
function:
> >=20
> > irqreturn_t snd_dream_interrupt(int irq, void *dev_id, struct
pt_regs
> > *regs)
> > {
> > return IRQ_NONE;
> > }
> You didn't deal with the source of the interrupt. Since it's
apparently=20
> level-triggered, the interrupt just comes right back.
> ... You need to either provide a=20
> real IRQ handler for the Dreamchip, or tell the Dreamchip itself to
mask=20
> the IRQ.
On Dreamchip board itself I couldn't find how to mask the interrupt, but
I'll search more. Can you recommend example for "real" IRQ handler for
Dreamchip? I just don't what the system crash. BTW, what will happen if
Dreamchip and Silicon Image will assert interrupt simultaneously?
Thanks,
Leonid.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 2 PCI devices behind PCI bridge on Yosemite board.
2006-11-30 20:18 ` Leonid
@ 2006-11-30 20:26 ` Scott Wood
0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2006-11-30 20:26 UTC (permalink / raw)
To: Leonid; +Cc: Balajee Premraj, linuxppc-embedded
Leonid wrote:
> On Dreamchip board itself I couldn't find how to mask the interrupt, but
> I'll search more. Can you recommend example for "real" IRQ handler for
> Dreamchip? I just don't what the system crash.
The IRQ handler must clear whatever event triggered the interrupt.
> BTW, what will happen if
> Dreamchip and Silicon Image will assert interrupt simultaneously?
Nothing special. Both handlers run every time either device interrupts;
if they both have events pending, then both handlers handle them.
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-11-30 20:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 19:52 2 PCI devices behind PCI bridge on Yosemite board Leonid
2006-11-30 20:07 ` Scott Wood
2006-11-30 20:18 ` Leonid
2006-11-30 20:26 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).