All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neftin, Sasha <sasha.neftin@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v2] igc: Add PHY power management control
Date: Thu, 12 Dec 2019 20:00:13 +0200	[thread overview]
Message-ID: <f46101da-8d48-84a3-3229-653a36e6e1ae@intel.com> (raw)
In-Reply-To: <87imml5t8z.fsf@linux.intel.com>

On 12/12/2019 19:49, Vinicius Costa Gomes wrote:
> 
> Sasha Neftin <sasha.neftin@intel.com> writes:
> 
>> PHY power management control should provide a reliable and accurate
>> indication of PHY reset completion and decrease the delay time
>> after a PHY reset
>>
>> v1 -> v2: add hw_dbg print for a timeout
>>
>> Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
>> ---
>>   drivers/net/ethernet/intel/igc/igc_defines.h |  1 +
>>   drivers/net/ethernet/intel/igc/igc_phy.c     | 12 ++++++++++++
>>   drivers/net/ethernet/intel/igc/igc_regs.h    |  1 +
>>   3 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
>> index 2121fc34e300..71a4b0281c03 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_defines.h
>> +++ b/drivers/net/ethernet/intel/igc/igc_defines.h
>> @@ -460,6 +460,7 @@
>>   /* PHY Status Register */
>>   #define MII_SR_LINK_STATUS	0x0004 /* Link Status 1 = link */
>>   #define MII_SR_AUTONEG_COMPLETE	0x0020 /* Auto Neg Complete */
>> +#define IGC_PHY_RST_COMP	0x0100 /* Internal PHY reset completion */
>>   
>>   /* PHY 1000 MII Register/Bit Definitions */
>>   /* PHY Registers defined by IEEE */
>> diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
>> index f4b05af0dd2f..a5483368690a 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_phy.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_phy.c
>> @@ -173,6 +173,7 @@ s32 igc_check_downshift(struct igc_hw *hw)
>>   s32 igc_phy_hw_reset(struct igc_hw *hw)
>>   {
>>   	struct igc_phy_info *phy = &hw->phy;
>> +	u32 phpm = 0, timeout = 10000;
>>   	s32  ret_val;
>>   	u32 ctrl;
>>   
>> @@ -186,6 +187,8 @@ s32 igc_phy_hw_reset(struct igc_hw *hw)
>>   	if (ret_val)
>>   		goto out;
>>   
>> +	phpm = rd32(IGC_I225_PHPM);
>> +
>>   	ctrl = rd32(IGC_CTRL);
>>   	wr32(IGC_CTRL, ctrl | IGC_CTRL_PHY_RST);
>>   	wrfl();
>> @@ -195,6 +198,15 @@ s32 igc_phy_hw_reset(struct igc_hw *hw)
>>   	wr32(IGC_CTRL, ctrl);
>>   	wrfl();
>>   
>> +	do {
>> +		phpm = rd32(IGC_I225_PHPM);
>> +		timeout--;
>> +		udelay(1);
>> +	} while (!(phpm & IGC_PHY_RST_COMP) && timeout);
>> +
>> +	if (!timeout)
>> +		hw_dbg("Timeoui is expired after a phy reset\n");
> 
> nitpick: Timeoui -> Timeout
> 
thanks - I will send v3 and fix the typo

  reply	other threads:[~2019-12-12 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 17:36 [Intel-wired-lan] [PATCH v2] igc: Add PHY power management control Sasha Neftin
2019-12-12 17:49 ` Vinicius Costa Gomes
2019-12-12 18:00   ` Neftin, Sasha [this message]
2019-12-25 14:17     ` Neftin, Sasha
2019-12-26  8:13     ` Neftin, Sasha

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=f46101da-8d48-84a3-3229-653a36e6e1ae@intel.com \
    --to=sasha.neftin@intel.com \
    --cc=intel-wired-lan@osuosl.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 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.