|
12/30/2012 10:56 PM
post98334
|
I find excerpt of pcnet driver
/*
* pcn_intr:
*
* Interrupt service routine.
*/
static int
pcn_intr(void *arg)
{
struct pcn_softc *sc = arg;
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
uint32_t csr0;
int wantinit, handled = 0;
for (wantinit = 0; wantinit == 0;) {
csr0 = pcn_csr_read(sc, LE_CSR0);
if ((csr0 & LE_C0_INTR) == 0)
break;
#if NRND > 0
if (RND_ENABLED(&sc->rnd_source))
rnd_add_uint32(&sc->rnd_source, csr0);
#endif
/* ACK the bits and re-enable interrupts. */
pcn_csr_write(sc, LE_CSR0, csr0 &
(LE_C0_INEA|LE_C0_BABL|LE_C0_MISS|LE_C0_MERR|LE_C0_RINT|
LE_C0_TINT|LE_C0_IDON));
handled = 1;
if (csr0 & LE_C0_RINT) {
PCN_EVCNT_INCR(&sc->sc_ev_rxintr);
wantinit = pcn_rxintr(sc);
}
if (csr0 & LE_C0_TINT) {
PCN_EVCNT_INCR(&sc->sc_ev_txintr);
pcn_txintr(sc);
}
if (csr0 & LE_C0_ERR) {
if (csr0 & LE_C0_BABL) {
PCN_EVCNT_INCR(&sc->sc_ev_babl);
ifp->if_oerrors++;
}
if (csr0 & LE_C0_MISS) {
PCN_EVCNT_INCR(&sc->sc_ev_miss);
ifp->if_ierrors++;
}
if (csr0 & LE_C0_MERR) {
PCN_EVCNT_INCR(&sc->sc_ev_merr);
printf("%s: memory error\n",
sc->sc_dev.dv_xname);
wantinit = 1;
break;
}
}
if ((csr0 & LE_C0_RXON) == 0) {
printf("%s: receiver disabled\n",
sc->sc_dev.dv_xname);
ifp->if_ierrors++;
wantinit = 1;
}
if ((csr0 & LE_C0_TXON) == 0) {
printf("%s: transmitter disabled\n",
sc->sc_dev.dv_xname);
ifp->if_oerrors++;
wantinit = 1;
}
}
if (handled) {
if (wantinit)
pcn_init(ifp);
/* Try to get more packets going. */
#ifdef __QNXNTO__
NW_SIGLOCK(&ifp->if_snd_ex, iopkt_selfp);
#endif
pcn_start(ifp);
}
return (handled);
}
*******************************************************
There is place in driver when "pcnet memory error" occur
if (csr0 & LE_C0_MERR) {
PCN_EVCNT_INCR(&sc->sc_ev_merr);
printf("%s: memory error\n",
sc->sc_dev.dv_xname);
wantinit = 1;
break;
}
|
|
|
|
|
|
12/31/2012 6:12 AM
post98335
|
Oleg Gopov wrote:
> I find excerpt of pcnet driver
>
> /*
> * pcn_intr:
> *
> * Interrupt service routine.
> */
> static int
> pcn_intr(void *arg)
> {
> struct pcn_softc *sc = arg;
> struct ifnet *ifp = &sc->sc_ethercom.ec_if;
> uint32_t csr0;
> int wantinit, handled = 0;
>
> for (wantinit = 0; wantinit == 0;) {
> csr0 = pcn_csr_read(sc, LE_CSR0);
> if ((csr0 & LE_C0_INTR) == 0)
> break;
>
> #if NRND > 0
> if (RND_ENABLED(&sc->rnd_source))
> rnd_add_uint32(&sc->rnd_source, csr0);
> #endif
>
> /* ACK the bits and re-enable interrupts. */
> pcn_csr_write(sc, LE_CSR0, csr0 &
> (LE_C0_INEA|LE_C0_BABL|LE_C0_MISS|LE_C0_MERR|LE_C0_RINT|
> LE_C0_TINT|LE_C0_IDON));
>
> handled = 1;
>
> if (csr0 & LE_C0_RINT) {
> PCN_EVCNT_INCR(&sc->sc_ev_rxintr);
> wantinit = pcn_rxintr(sc);
> }
>
> if (csr0 & LE_C0_TINT) {
> PCN_EVCNT_INCR(&sc->sc_ev_txintr);
> pcn_txintr(sc);
> }
>
> if (csr0 & LE_C0_ERR) {
> if (csr0 & LE_C0_BABL) {
> PCN_EVCNT_INCR(&sc->sc_ev_babl);
> ifp->if_oerrors++;
> }
> if (csr0 & LE_C0_MISS) {
> PCN_EVCNT_INCR(&sc->sc_ev_miss);
> ifp->if_ierrors++;
> }
> if (csr0 & LE_C0_MERR) {
> PCN_EVCNT_INCR(&sc->sc_ev_merr);
> printf("%s: memory error\n",
> sc->sc_dev.dv_xname);
> wantinit = 1;
> break;
> }
> }
>
> if ((csr0 & LE_C0_RXON) == 0) {
> printf("%s: receiver disabled\n",
> sc->sc_dev.dv_xname);
> ifp->if_ierrors++;
> wantinit = 1;
> }
>
> if ((csr0 & LE_C0_TXON) == 0) {
> printf("%s: transmitter disabled\n",
> sc->sc_dev.dv_xname);
> ifp->if_oerrors++;
> wantinit = 1;
> }
> }
>
> if (handled) {
> if (wantinit)
> pcn_init(ifp);
>
> /* Try to get more packets going. */
> #ifdef __QNXNTO__
> NW_SIGLOCK(&ifp->if_snd_ex, iopkt_selfp);
> #endif
> pcn_start(ifp);
> }
>
> return (handled);
> }
>
>
>
>
> *******************************************************
> There is place in driver when "pcnet memory error" occur
>
> if (csr0 & LE_C0_MERR) {
> PCN_EVCNT_INCR(&sc->sc_ev_merr);
> printf("%s: memory error\n",
> sc->sc_dev.dv_xname);
> wantinit = 1;
> break;
> }
>
LINUX:
if (csr0 & LE_C0_MERR) {
printk("%s: *Bus master arbitration failure*, status
%4.4x.\n",
dev->name, csr0);
/* Restart the chip. */
WRITERDP(lp, LE_C0_STRT);
}
>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98334
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
12/31/2012 6:33 AM
post98336
|
Oleg Gopov wrote:
LINUX:
if (csr0 & LE_C0_MERR) {
printk("%s: *Bus master arbitration failure*, status
%4.4x.\n",
dev->name, csr0);
/* Restart the chip. */
WRITERDP(lp, LE_C0_STRT);
}
Reasons: an other PCI device blocks the PCI bus or the bus request for
more than 50us or the PCI slot doesn't support bus mastering !
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98334
> To cancel your subscription to this discussion, please e-maildrivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/03/2013 8:59 PM
post98367
|
Hello Armin. Happy New Year. Thanks for answers.
I locate a problem. My Application work with pci-to-vme bridge Tundra Universe II.
"pcnet memory error" occur when I try read/write to no-exist address on vme bus. (my applicatoin act as pci target)
|
|
|
|
|
|
01/04/2013 3:35 AM
post98369
|
Hello Oleg,
all the best in 2013 !
is the bridge "Tundra Iniverse II" fully supported ?
--Armin
Oleg Gopov wrote:
> Hello Armin. Happy New Year. Thanks for answers.
>
>
> I locate a problem. My Application work with pci-to-vme bridge Tundra Universe II.
> "pcnet memory error" occur when I try read/write to no-exist address on vme bus. (my applicatoin act as pci target)
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98367
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/04/2013 5:55 AM
post98372
|
> is the bridge "Tundra Iniverse II" fully supported ?
No , I wrote myself this driver.
|
|
|
|
|
|
01/05/2013 10:03 AM
post98397
|
> Reasons: an other PCI device blocks the PCI bus or the bus request for
> more than 50us or the PCI slot doesn't support bus mastering !
I want to mention , that BIOS distribute to PCNET NIC -> IRQ 7, PCI2VME BRIDGE - IRQ 11.
One moment bothers me, how write/read action to pci2vme bridge cause interrupt generation on my nic driver. I don't
understant.
|
|
|
|
|
|
01/05/2013 10:05 AM
post98398
|
Because "pcnet memory error" generate in interrupt handler of pcnet driver. I am right?????????
|
|
|
|
|
|
01/05/2013 12:15 PM
post98399
|
Oleg Gopov wrote:
>> Reasons: an other PCI device blocks the PCI bus or the bus request for
>> more than 50us or the PCI slot doesn't support bus mastering !
> I want to mention , that BIOS distribute to PCNET NIC -> IRQ 7,
... and the IRQ 7 isn't shared by an other device ?
> PCI2VME BRIDGE - IRQ 11.
That means all VME device are trigering the IRQ 11 ?
>
> One moment bothers me, how write/read action to pci2vme bridge cause interrupt generation on my nic driver. I don't
understant.
Is it really the pci2vme bridge or is it an other PCI device ??
--Armin
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98397
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/05/2013 9:20 PM
post98400
|
> ... and the IRQ 7 isn't shared by an other device ?
There is no devices , that shared IRQ 7
> That means all VME device are trigering the IRQ 11 ?
I think YES.
> Is it really the pci2vme bridge or is it an other PCI device ??
Yes. It is realy pci2vme bridge - Tundra Universe II.
|
|
|
|
|
|
01/06/2013 7:12 AM
post98401
|
Oleg,
I hope you are not using QNX6.5 ... it well known for its esoteric PCI
problems !
Oleg Gopov wrote:
>> ... and the IRQ 7 isn't shared by an other device ?
> There is no devices , that shared IRQ 7
>> That means all VME device are trigering the IRQ 11 ?
> I think YES.
>
>> Is it really the pci2vme bridge or is it an other PCI device ??
> Yes. It is realy pci2vme bridge - Tundra Universe II.
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98400
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/06/2013 8:09 AM
post98402
|
>
> Oleg,
>
> I hope you are not using QNX6.5 ... it well known for its esoteric PCI
> problems !
>
I point in the first post , that I use 6.4.0 version
|
|
|
|
|
|
01/07/2013 4:33 AM
post98409
|
Oleg Gopov wrote:
>> Oleg,
>>
>> I hope you are not using QNX6.5 ... it well known for its esoteric PCI
>> problems !
>>
> I point in the first post , that I use 6.4.0 version
OK.
Could this be helpful?
http://community.qnx.com/sf/discussion/do/listPosts/projects.bsp/discussion.bsp.topc3672?_pagenum=1
>
>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98402
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/08/2013 9:27 AM
post98437
|
Thanks Armin. I will study info under links you suggest and surely write results to this post.
|
|
|
|
|
|
01/08/2013 9:45 AM
post98438
|
> OK.
> Could this be helpful?
> http://community.qnx.com/sf/discussion/do/listPosts/projects.bsp/discussion.
> bsp.topc3672?_pagenum=1
One thing I may write that this post is not my case. Our system work for years and we don't have problems with
allocating Tundra base address. All more difficult. Only one board (vp7) with only one NIC (amd pcnet32) cause problem
as I wrote on the first post.
|
|
|
|
|
|
01/07/2013 4:13 AM
post98408
|
You know it ?
http://www.tldp.org/HOWTO/VME-HOWTO.html#toc4
Oleg Gopov wrote:
>> ... and the IRQ 7 isn't shared by an other device ?
> There is no devices , that shared IRQ 7
>> That means all VME device are trigering the IRQ 11 ?
> I think YES.
>
>> Is it really the pci2vme bridge or is it an other PCI device ??
> Yes. It is realy pci2vme bridge - Tundra Universe II.
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98400
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/08/2013 6:11 PM
post98448
|
> You know it ?
>
> http://www.tldp.org/HOWTO/VME-HOWTO.html#toc4
>
I already learn this linux driver for vme bridge. I try some things after holidays and write to this topic.
|
|
|
|
|
|
01/14/2013 10:49 PM
post98560
|
Hello Armin. Our investigation is continue))))))))))))
Please, what you say???????
> Reasons: an other PCI device blocks the PCI bus or the bus request for
> more than 50us or the PCI slot doesn't support bus mastering !
Where you take 50us from???????????? What is the time??????????????
|
|
|
|
|
|
01/15/2013 6:00 AM
post98564
|
Oleg Gopov wrote:
> Hello Armin. Our investigation is continue))))))))))))
> Please, what you say???????
>
>> Reasons: an other PCI device blocks the PCI bus or the bus request for
>> more than 50us or the PCI slot doesn't support bus mastering !
> Where you take 50us from????????????
Should be specified by the PCI standard.
> What is the time??????????????
tineout for requesting as a master the bus.
Do you have a corrupted keyboard ??????????????????????????????
>
>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98560
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
01/15/2013 7:26 AM
post98566
|
> Do you have a corrupted keyboard ??????????????????????????????
Keyboard work properly.
|
|
|
|
|
|
01/15/2013 10:11 AM
post98571
|
Armin, I prepare some sweets)))))))
Please see to attachment.
Armin, what you say??????????
|
|
|
|
|
|
01/15/2013 10:41 AM
post98574
|
Oleg Gopov wrote:
> Armin, I prepare some sweets)))))))
>
> Please see to attachment.
>
> Armin, what you say??????????
Interesting !
Are there any hardware related delays or was the IRQ 9 disabled for lots
of us ?
Is the IRQ 2 used ? If yes, you shouldn't use IRQ 9 ...
--Armin
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98571
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
|
|
|
|
|
|
01/15/2013 12:50 PM
post98585
|
> or was the IRQ 9 disabled for lots
> of us ?
How I can figure out this????????
> Is the IRQ 2 used ? If yes, you shouldn't use IRQ 9 ...
No. I don't use IRQ 2.
|
|
|
|
|
|
12/23/2012 8:22 AM
post98308
|
Oleg Gopov wrote:
>> You have a corrupted board sharing the same IRQ with io-usb -> that's
>> the best wayto loose interrupts.
>> io-usb is known for blocking/disabling its (shared) interrupt for a
>> longer time !
>>
>> --Armin
>>
> But, Armin. How You conclude this??? You find out issue in tracebuffer.kev file??????????
Yes ... you can see that io-usb is sharing the same interrupt ... that
means in all cases of an active interrupt is the ISR of io-usb active!!!!
> I analyze tracelog and see that io-usb thread eat processor time only ~ 30us. Nothing criminal in that.
Handling - that means disabling/enabling - of interrupts are normally
done in the ISR! Should be critical enough .... even if there is no data
traffic.
--Armin
>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98305
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|
11/29/2012 4:00 AM
post97602
|
Oleg,
UDP is a unsecure protocol ... that means when the driver is loosing
interrupts it will loose packets.
This can happen if the interrupt is shared by other devices and one of
these device driver is disabling the shared interrupt for a longer time.
We had a similar problem with a CAN communication ( similar to UDP
communication) and there was interrupt disabled for ~8ms !!
Best Regards
Armin Steinhoff
http://www.steinhoff-automation.com
Oleg Gopov wrote:
> I see nicinfo output - > pcnet32 network adapter work in half-duplex. How I can lost packets??? I don't understand.
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post97593
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>
|
|
|
|
|
|