linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@capflow.com>
To: linuxppc-dev@lists.linuxppc.org
Subject: possible bug in arch/ppc/8xx_io/fec.c
Date: Thu, 11 Oct 2001 17:07:34 +0200	[thread overview]
Message-ID: <3BC5B5B6.1070308@capflow.com> (raw)
In-Reply-To: 3BC58BE6.8000302@capflow.com


I think I found a bug in arch/ppc/8xx_io/fec.c. When I boot a 2.4.7
linux kernel on a FADS860T board, I get an oops in mii_link_interrupt.
After a few experiments, I found out the following.

My PHY chipset is a LXT970A. The FDS/MDINT pin, which is connected to
IRQ2 on the MPC860T, has 2 functions on the LXT970A. When bit 17.1 (bit
1 of the PHY register 17) is set, an active low output on this pin
indicates status change. When bit 17.1 is not set, the pin indicates
full-duplex status.

At boot time, bit 17.1 is not set, and thus the FDS/MDINT signal is low
when the network cable is disconnect. The PHY interrupt handler
(mii_link_interrupt) gets registered when fec_enet_init() is called, and
thus spurious interrupts are generated which causes the kernel to oops
because at that time the pointers used in the interrupt handler are not
yet initialized. The 17.1 bit is set only much later when the
phy->startup command is executed, which is when fec_enet_open() is called.

So, for the FADS860T to boot correctly, it needs the network cable to be
connected at boot time, and to be in full duplex mode. After bootup, as
soon as fec_enet_open() is called, things work fine again and the cable
can be disconnected.

What would be the best way to correct that bug ? I was thinking about
adding a phy->init command, which would be called right after PHY
detection, in mii_discover_phy3(), and to register the
mii_link_interrupt() interrupt handler only after PHY detection,
possibly in fec_enet_open().

All comments are welcome.

Laurent Pinchart


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

       reply	other threads:[~2001-10-11 15:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3BC58BE6.8000302@capflow.com>
2001-10-11 15:07 ` Laurent Pinchart [this message]
     [not found] ` <3BC5B2F6.8000705@capflow.com>
2001-10-11 17:13   ` FEC on MPC860T & race condition Dan Malek

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=3BC5B5B6.1070308@capflow.com \
    --to=laurent.pinchart@capflow.com \
    --cc=linuxppc-dev@lists.linuxppc.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).