All of lore.kernel.org
 help / color / mirror / Atom feed
From: csanchezdll@gmail.com (Carlos Sánchez de La Lama)
To: meta-freescale@yoctoproject.org
Cc: Luwei Zhou <b45643@freescale.com>, Jason Liu <r64343@freescale.com>
Subject: fec_main.c patch ENGR00275371 (2013-10-30) prevents use of MII ioctls
Date: Fri, 19 Feb 2016 16:16:51 +0100	[thread overview]
Message-ID: <7td1rs4tng.fsf@gmail.com> (raw)

Hi all,

I was trying so use MII ioctls (SIOCGMIIPHY & SIOG{G,M}MIIREG) to access
registers of the PHY attached to FEC MAC in an iMX6 using Freescale
BSP. I noticed they were failing, so after some debug I found that this
patch (author and commiter cc'ed):

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/net/ethernet/freescale/fec_main.c?h=imx_3.10.17_1.0.0_ga&id=8eeda5ac98beb9e43f5a76ae77af3251c0b97ec8

includes the following modification:

@@ -1656,8 +1677,11 @@ static int fec_enet_ioctl(struct net_device
*ndev, struct ifreq *rq, int cmd)
       if (!phydev)
          return -ENODEV;

-       if (cmd == SIOCSHWTSTAMP && fep->bufdesc_ex)
+       if (((cmd == SIOCSHWTSTAMP) || ((cmd >= PTP_ENBL_TXTS_IOCTL) &&
+          (cmd <= PTP_FLUSH_TIMESTAMP))) && fep->bufdesc_ex)
                return fec_ptp_ioctl(ndev, rq, cmd);
+       else if (fep->bufdesc_ex)
+               return -ENODEV;

        return phy_mii_ioctl(phydev, rq, cmd);
 }

which effectively prevents phy_mii_ioctl to be reached (the code will
always return through one of the if/else branches). The code in the repo
seems to be unchanged since that patch. 

After removing else branch on my local sources, I am able to use the
ioctls. 

BR

Carlos


                 reply	other threads:[~2016-02-19 15:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=7td1rs4tng.fsf@gmail.com \
    --to=csanchezdll@gmail.com \
    --cc=b45643@freescale.com \
    --cc=meta-freescale@yoctoproject.org \
    --cc=r64343@freescale.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.