From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Stephen Hemminger <shemminger@osdl.org>, netdev@vger.kernel.org
Subject: Re: sky2 problem on powerpc
Date: Tue, 05 Sep 2006 07:33:16 +1000 [thread overview]
Message-ID: <1157405596.22705.54.camel@localhost.localdomain> (raw)
In-Reply-To: <BA4B0E19-9989-4477-A623-9BD9F021E7F0@kernel.crashing.org>
On Mon, 2006-09-04 at 23:05 +0200, Segher Boessenkool wrote:
> > The patch has a couple of places where I reversed 2 assignments, they
> > are harmless, it was before I figured out that the chip will
> > (apparently) not access a descriptor before it's been told to do so
> > via
> > MMIO, and thus the order of the writes to the descriptors is
> > irrelevant
> > (I was also adding wmb's though I removed them).
>
> wmb() between writing the descriptors to main memory and writing
> an MMIO to the device to tell it to go fetch them? That's still
> required. The 970 you tested on won't care though ;-)
Won't it ? Anyway, you misunderstood, there is a wmb() already in the
right place
in sky2_put_idx() if I understand things correctly (but then I don't
know the chip hardware well) and the ones I originally added weren't
necessary.
> > There is a couple of places where we were doing a BE and not LE
> > conversion of a descriptor field (typically in the VLAN code). I'm not
> > sure what's up there but BE "felt" wrong. I have turned them into LE
> > conversions but then I haven't tested VLAN, and I might just
> > misudnerstand what's happening there so I'll let you decide what to do
> > about those.
>
> VLAN tags are big-endian on the wire, it might well be that these
> chips never swizzle that?
Maybe yes.
> > --- linux-work.orig/drivers/net/sky2.c 2006-09-04
> > 17:35:20.000000000 +1000
> > +++ linux-work/drivers/net/sky2.c 2006-09-04 17:41:50.000000000 +1000
> > @@ -811,8 +811,9 @@ static void rx_set_checksum(struct sky2_
> > struct sky2_rx_le *le;
> >
> > le = sky2_next_rx(sky2);
> > - le->addr = (ETH_HLEN << 16) | ETH_HLEN;
> > + le->addr = cpu_to_le32((ETH_HLEN << 16) | ETH_HLEN);
> > le->ctrl = 0;
> > + le->length = 0;
> > le->opcode = OP_TCPSTART | HW_OWNER;
>
> Is this le->length thing a separate bugfix? Or just overly
> protective coding (you write the field later again).
Overly protective coding when I was still looking for what the problem
was (wanted to have nice descriptors in memory without crap in them :)
I'll try without
> > + /* Don't let it byte swap descriptors in hardware. Clear the bit
> > + * in case a previous driver have set it
> > + */
> > + reg = sky2_pci_read32(hw, PCI_DEV_REG2);
> > + reg &= ~PCI_REV_DESC;
> > + sky2_pci_write32(hw, PCI_DEV_REG2, reg);
>
> Probably not needed, the chip gets a full reset at startup (or so
> I hope anyway, heh).
It is needed. I've verified that this bit resists to anything we do in
the driver. So if you load the old driver that sets it, unload it, then
load the fixed driver, you are toast... I'm also taking no risk in case
one has a firmware that sets this bit.
Ben.
next prev parent reply other threads:[~2006-09-04 21:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-04 5:24 sky2 problem on powerpc Benjamin Herrenschmidt
2006-09-04 7:21 ` Benjamin Herrenschmidt
2006-09-04 7:42 ` Benjamin Herrenschmidt
2006-09-04 21:05 ` Segher Boessenkool
2006-09-04 21:33 ` Benjamin Herrenschmidt [this message]
2006-09-05 3:41 ` Stephen Hemminger
2006-09-05 3:47 ` Benjamin Herrenschmidt
2006-09-05 4:15 ` Stephen Hemminger
2006-09-05 21:11 ` Benjamin Herrenschmidt
2006-09-05 21:36 ` Stephen Hemminger
2006-09-05 22:00 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1157405596.22705.54.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=netdev@vger.kernel.org \
--cc=segher@kernel.crashing.org \
--cc=shemminger@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).