linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bob Cochran <ppc@mindchasers.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Question about fsl_pq_mdio_probe and dts file for p1010rdb...
Date: Tue, 07 Feb 2012 21:13:23 -0500	[thread overview]
Message-ID: <4F31DA43.2030504@mindchasers.com> (raw)
In-Reply-To: <1328555872-9616-1-git-send-email-timur@freescale.com>

Hello,

Using the mainline kernel & p1010rdb.dts, fsl_pq_mdio_probe returns busy 
on my P1010RDB when first probing the MDIO during kernel boot.  On the 
console, the error is reported as:

"fsl-pq_mdio: probe of ffe24000.mdio failed with error -16"


I have determined that the failure occurs in the 
for_each_child_of_node() loop shown below, which is part of the 
fsl_pq_mdio_probe routine.  It turns out that tbi->type is always <NULL> 
although tbi->name will be "tbi-phy" when scanning the last child node ( 
I have also attached the relevant portion of the p1010rdb.dtsi file 
below).   Since tbi-type is never "tbi-phy", the "if (tbi)" statement is 
always false, and err is subsequently set to EBUSY below.

Can someone please tell me whether this is an issue with the dts file, 
the of library, or the probe function?  Any direction on the right way 
to patch this would be appreciated.


// from fsl_pq_mdio.c:

for_each_child_of_node(np, tbi) {
                 if (!strncmp(tbi->type, "tbi-phy", 8))
                         break;
         }

         if (tbi) {
                 const u32 *prop = of_get_property(tbi, "reg", NULL);

                 if (prop)
                         tbiaddr = *prop;
         }

         if (tbiaddr == -1) {
                 err = -EBUSY;
                 goto err_free_irqs;
         } else {
                 out_be32(tbipa, tbiaddr);
         }


// from p1010rdb.dtsi:

mdio@24000 {
                 phy0: ethernet-phy@0 {
                         interrupts = <3 1 0 0>;
                         reg = <0x1>;
                 };

                 phy1: ethernet-phy@1 {
                         interrupts = <2 1 0 0>;
                         reg = <0x0>;
                 };

                 phy2: ethernet-phy@2 {
                         interrupts = <2 1 0 0>;
                         reg = <0x2>;
                 };

                 tbi-phy@3 {
                         device-type = "tbi-phy";
                         reg = <0x3>;
                 };
         };

      parent reply	other threads:[~2012-02-08  3:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 19:17 [PATCH] powerpc/fsl: add PAMUBYPENR register definition to fsl_guts.h Timur Tabi
2012-02-07 18:21 ` Kumar Gala
2012-02-07 19:25   ` Timur Tabi
2012-02-08  2:13 ` Bob Cochran [this message]

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=4F31DA43.2030504@mindchasers.com \
    --to=ppc@mindchasers.com \
    --cc=linuxppc-dev@lists.ozlabs.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).