Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2006 18:21:28 -0700
From:      "David Christensen" <davidch@broadcom.com>
To:        "Oleg Bulyzhin" <oleg@FreeBSD.org>
Cc:        brad@openbsd.org, Gleb Smirnoff <glebius@FreeBSD.org>, net@FreeBSD.org
Subject:   RE: bge(4) one packet wedge
Message-ID:  <09BFF2FA5EAB4A45B6655E151BBDD90301D43136@NT-IRVA-0750.brcm.ad.broadcom.com>
In-Reply-To: <20060824010423.GA27699@lath.rinet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > Could you please answer few questions?
> > >=20
> > > 1) I've found status tag is returned in status block even if=20
> > > bit 9 of Misc.
> > >    Host Control Register is not set, is it ok?
> >=20
> > Which controller are you using?  This bit is reserved on the 5700
> > (which didn't support tagged status mode) but all other controllers
> > should support it and all of the Broadcom drivers will always
> > enable it.
>=20
> I tested it on bcm5701 & bcm5721
>=20
> >=20
> > >=20
> > > 2) Status tag is returned in bits 0-7 of status tag field of=20
> > > status block,
> > >    as long as i know it should be returned in bits 31-24,=20
> is it ok?
> >=20
> > Not sure what you mean by this.  If you're seeing it in bits 31-24
> > of the status block then there may be an endian issue on=20
> your system.
> > Check that byte/word swapping is set correctly.
> >=20
> > >=20
> > > 3) If i try to return processed tag (at the end of ISR) in=20
> > > Mailbox 0 register:
> > >    CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24);
> > >    it would lead to disabled interrupts.
> > >    I've thought this should not happen cause in_isr bits=20
> > > (0-23) are cleared.
> >=20
> > Writing a non-zero value to bits 23:0 will cause the interrupt to
> > be disabled:
> >=20
> > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1);
> >=20
> > Writing all zeros to bits 23:0 will enable interrupts.
> >=20
> > CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, status_tag << 24);
> >=20
> > The tag value written to bits 31:24 does not affect the interrupt
> > state.
>=20
> Yes, this is i'm talking about:
> CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0x01000000) would lead to _disabled_
> interrupts.
> Tested on bcm5701 & bcm5721.

Here's how it's done in Linux:

static void tg3_disable_ints(struct tg3 *tp)
{
	tw32(TG3PCI_MISC_HOST_CTRL,
	     (tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT));
	tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
0x00000001);
}

static void tg3_enable_ints(struct tg3 *tp)
{
	tp->irq_sync =3D 0;
	wmb();

	tw32(TG3PCI_MISC_HOST_CTRL,
	     (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT));
	tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
		       (tp->last_tag << 24));
	if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)
		tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
			       (tp->last_tag << 24));
	tg3_cond_int(tp);
}

>=20
> P.S. bcm5705 does not support tagged status mode, am i right?

No, the 5705 should support tagged status mode, only the 5788 doesn't
support it.  The 5705 and 5788 are very closely related though.

> --=20
> Oleg.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09BFF2FA5EAB4A45B6655E151BBDD90301D43136>