On Mon, Sep 8, 2014 at 12:23 PM, sven falempin <[email protected]> wrote:
> On Mon, Sep 8, 2014 at 12:17 PM, Miod Vallat <[email protected]> wrote:
>>> My question is more about the driver itself, it did not change a lot
>>> since 1994 , while netbsd apparently move to a complete different
>>> driver :
>>> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/ppbus/?only_with_tag=HEAD
>>>
>>> Are those driving the same chipset family ?
>>> any info on that ?
>>
>> ppbus in NetBSD is a port of FreeBSD's ppbus which allows access to
>> non-printer devices connected to parallel ports, such as zip drives. It
>> has no relation with PCI-PCI bridges.
>
> indeed, these one looks better :
> http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/dev/pci/ppb.c?rev=1.52&content-type=text/plain&only_with_tag=HEAD
>
> --
Dear tech readers,
I add logs into ppb driver to look for a relation between the driver
and the disconnection.
( I run openBSD patched branch 5.5, the main board is an APU from pcengines. )
Let me explain what happen as i have some updates:
On a pci express i plug a pcie to pci bridge, on this bridge i plug
two network card , so far so good.
one card run the vr driver the other one the rl driver.
After more than 24 hours and less 36 hours ( i am still refining this
) both network cards stop replying to icmp.
dmesg said once:
rl0: watchdog timeout
and
vr1: restarting (yes the network card got more than on Ethernet, i use
the second for testing)
so i suspected the bridge, added some log to see if it was related to
some kind of event.
Now i only see vr1: restarting but behavior is the same, on a plus
side i figure i am losing the Ethernet negotiation and each time i
enter
<ifconfig vr1> the dmesg add <vr1: restarting>
I would like to get to the bottom of this, but i need guidance,
(for example is it possible to syslog from kernel, because those
printf has no time information)
meanwhile i will of course reproduce with the last snapshots
Best Regards,
Index: ppb.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ppb.c,v
retrieving revision 1.57
diff -u -p -r1.57 ppb.c
--- ppb.c 29 Jan 2014 18:30:39 -0000 1.57
+++ ppb.c 12 Sep 2014 13:49:57 -0000
@@ -328,6 +328,7 @@ ppbdetach(struct device *self, int flags
struct ppb_softc *sc = (struct ppb_softc *)self;
char *name;
int rv;
+ printf("[XXX] %s: ppbdetach %08X", sc->sc_dev.dv_xname, flags);
if (sc->sc_intrhand)
pci_intr_disestablish(sc->sc_pc, sc->sc_intrhand);
@@ -366,6 +367,7 @@ ppbactivate(struct device *self, int act
switch (act) {
case DVACT_SUSPEND:
+ printf("[XXX] %s: ppb activate suspend", sc->sc_dev.dv_xname);
rv = config_activate_children(self, act);
/* Save registers that may get lost. */
@@ -394,6 +396,7 @@ ppbactivate(struct device *self, int act
}
break;
case DVACT_RESUME:
+ printf("[XXX] %s: ppb activate resume %s",
sc->sc_dev.dv_xname, (pci_dopm) ? "true" : "false");
if (pci_dopm) {
/* Restore power. */
pci_set_powerstate(pc, tag, sc->sc_pmcsr_state);
@@ -461,6 +464,7 @@ ppbactivate(struct device *self, int act
rv = config_activate_children(self, act);
break;
case DVACT_POWERDOWN:
+ printf("[XXX] %s: ppb activate powerdown %s",
sc->sc_dev.dv_xname, (pci_dopm) ? "true" : "false");
rv = config_activate_children(self, act);
if (pci_dopm) {
@@ -474,6 +478,7 @@ ppbactivate(struct device *self, int act
}
break;
default:
+ printf("[XXX] %s: ppb activate default %d:%s",
sc->sc_dev.dv_xname, act, (pci_dopm) ? "true" : "false");
rv = config_activate_children(self, act);
break;
}
@@ -645,8 +650,12 @@ ppb_intr(void *arg)
* sure we will not try to forcibly detach re(4) when it isn't
* ready to deal with that.
*/
- if (cold)
+ if (cold) {
+ printf ("%s: the cold case",sc->sc_dev.dv_xname);
return (0);
+ } else {
+ printf ("%s: the Hot case", sc->sc_dev.dv_xname);
+ }
reg = pci_conf_read(sc->sc_pc, sc->sc_tag,
sc->sc_cap_off + PCI_PCIE_SLCSR);
@@ -682,6 +691,7 @@ ppb_hotplug_insert(void *arg1, void *arg
return;
/* XXX Powerup the card. */
+ printf ("%s: the powerup case",sc->sc_dev.dv_xname);
/* XXX Turn on LEDs. */
@@ -702,7 +712,9 @@ ppb_hotplug_fixup(struct pci_attach_args
{
pcireg_t bhlcr;
+
bhlcr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_BHLC_REG);
+ printf ("[XXX] : the fixup case %d", PCI_HDRTYPE_TYPE(bhlcr));
switch (PCI_HDRTYPE_TYPE(bhlcr)) {
case 0:
return ppb_hotplug_fixup_type0(pa->pa_pc,
@@ -789,9 +801,11 @@ ppb_hotplug_fixup_type1(pci_chipset_tag_
void
ppb_hotplug_rescan(void *arg1, void *arg2)
{
- struct ppb_softc *sc = arg1;
+ struct ppb_softc *sc = arg1;
struct pci_softc *psc = (struct pci_softc *)sc->sc_psc;
+ printf ("%s: the rescan case",sc->sc_dev.dv_xname);
+
if (psc) {
/* Assign resources. */
pci_enumerate_bus(psc, ppb_hotplug_fixup, NULL);
@@ -807,6 +821,7 @@ ppb_hotplug_remove(void *arg1, void *arg
struct ppb_softc *sc = arg1;
struct pci_softc *psc = (struct pci_softc *)sc->sc_psc;
+ printf ("%s: the remove case",sc->sc_dev.dv_xname);
if (psc) {
pci_detach_devices(psc, DETACH_FORCE);