From: hayeswang <hayeswang@realtek.com>
To: "'Florian Fainelli'" <f.fainelli@gmail.com>
Cc: "'netdev'" <netdev@vger.kernel.org>, <nic_swsd@realtek.com>,
<linux-kernel@vger.kernel.org>,
"'linux-usb'" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH net-next 07/14] r8152: combine PHY reset with set_speed
Date: Wed, 19 Feb 2014 10:41:54 +0800 [thread overview]
Message-ID: <3532474F0A1E449C8ABAC51A6F690258@realtek.com.tw> (raw)
In-Reply-To: <201402190209.s1J29EVG032292@rtits1.realtek.com>
Florian Fainelli [mailto:f.fainelli@gmail.com]
> Sent: Wednesday, February 19, 2014 1:19 AM
> To: Hayes Wang
> Cc: netdev; nic_swsd@realtek.com;
> linux-kernel@vger.kernel.org; linux-usb
> Subject: Re: [PATCH net-next 07/14] r8152: combine PHY reset
> with set_speed
[...]
> > +static void rtl_phy_reset(struct r8152 *tp)
> > +{
> > + u16 data;
> > + int i;
> > +
> > + clear_bit(PHY_RESET, &tp->flags);
> > +
> > + data = r8152_mdio_read(tp, MII_BMCR);
> > +
> > + /* don't reset again before the previous one complete */
> > + if (data & BMCR_RESET)
> > + return;
> > +
> > + data |= BMCR_RESET;
> > + r8152_mdio_write(tp, MII_BMCR, data);
> > +
> > + for (i = 0; i < 50; i++) {
> > + msleep(20);
> > + if ((r8152_mdio_read(tp, MII_BMCR) &
> BMCR_RESET) == 0)
> > + break;
> > + }
> > +}
>
> If you implemented libphy in the driver you would not have to
> duplicate that and you could use "phy_init_hw()" or
> genphy_soft_reset() to perform the BMCR-based software reset.
Thanks for you suggestion. I would study about those.
Best Regards,
Hayes
next prev parent reply other threads:[~2014-02-19 2:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 13:48 [PATCH net-next 00/14] r8152: improvement and new features Hayes Wang
2014-02-18 13:48 ` [PATCH net-next 01/14] r8152: move some functions Hayes Wang
2014-02-18 13:48 ` [PATCH net-next 02/14] r8152: add three functions Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 03/14] r8152: replace some types from int to bool Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 04/14] r8152: load the default MAC address Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 05/14] r8152: reduce the frequency of spin_lock Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 06/14] r8152: clear BMCR_PDOWN Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 07/14] r8152: combine PHY reset with set_speed Hayes Wang
2014-02-18 17:19 ` Florian Fainelli
[not found] ` <201402190209.s1J29EVG032292@rtits1.realtek.com>
2014-02-19 2:41 ` hayeswang [this message]
2014-02-18 13:49 ` [PATCH net-next 08/14] r8152: move some functions from probe to open Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 09/14] r8152: support WOL Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 10/14] r8152: support runtime suspend Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 11/14] r8152: disable teredo for RTL8152 Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 12/14] r8152: replace netif_rx with netif_receive_skb Hayes Wang
2014-02-18 23:28 ` Francois Romieu
2014-02-19 3:01 ` [PATCH net-next 12/14] r8152: replace netif_rx withnetif_receive_skb hayeswang
2014-02-19 7:46 ` Francois Romieu
2014-02-19 12:45 ` [PATCH net-next 12/14] r8152: replace netif_rxwithnetif_receive_skb hayeswang
2014-02-18 13:49 ` [PATCH net-next 13/14] r8152: set disable_hub_initiated_lpm Hayes Wang
2014-02-18 13:49 ` [PATCH net-next 14/14] r8152: support get_msglevel and set_msglevel Hayes Wang
2014-02-18 21:41 ` [PATCH net-next 00/14] r8152: improvement and new features David Miller
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=3532474F0A1E449C8ABAC51A6F690258@realtek.com.tw \
--to=hayeswang@realtek.com \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®