All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] e1000e: i219 execute unit hang fix on every reset or power state transition
Date: Wed, 22 Apr 2015 07:39:17 -0700	[thread overview]
Message-ID: <5537B295.3060804@redhat.com> (raw)
In-Reply-To: <1429665301-10596-1-git-send-email-yanirx.lubetkin@intel.com>

On 04/21/2015 06:15 PM, Yanir Lubetkin wrote:
> after testing various cases, the conclusion is that the fix MUST be executed BEFORE
> any event that the HW is reset or transition to D3. to fix that I moved the execution
> to the relevant places but per Alexander Duyck's review, ensure now that the DMA is
> valid and was not freed before manipulating the ring.
>
> Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
> ---
>   drivers/net/ethernet/intel/e1000e/netdev.c | 16 ++++++++++------
>   1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 76b1a90..3f561f3 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -4043,6 +4043,8 @@ void e1000e_reset(struct e1000_adapter *adapter)
>   		}
>   	}
>
> +	if (hw->mac.type == e1000_pch_spt)
> +		e1000_flush_desc_rings(adapter);
>   	/* Allow time for pending master requests to run */
>   	mac->ops.reset_hw(hw);
>
> @@ -4215,10 +4217,6 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)
>   	spin_unlock(&adapter->stats64_lock);
>
>   	e1000e_flush_descriptors(adapter);
> -	if (hw->mac.type == e1000_pch_spt)
> -		e1000_flush_desc_rings(adapter);
> -	e1000_clean_tx_ring(adapter->tx_ring);
> -	e1000_clean_rx_ring(adapter->rx_ring);
>
>   	adapter->link_speed = 0;
>   	adapter->link_duplex = 0;
> @@ -4229,8 +4227,14 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)
>   	    e1000_lv_jumbo_workaround_ich8lan(hw, false))
>   		e_dbg("failed to disable jumbo frame workaround mode\n");
>
> -	if (reset && !pci_channel_offline(adapter->pdev))
> -		e1000e_reset(adapter);
> +        if (!pci_channel_offline(adapter->pdev)) {
> +                if(reset)
> +                        e1000e_reset(adapter);
> +                else if (hw->mac.type == e1000_pch_spt)
> +                        e1000_flush_desc_rings(adapter);
> +        }
> +	e1000_clean_tx_ring(adapter->tx_ring);
> +	e1000_clean_rx_ring(adapter->rx_ring);
>   }
>
>   void e1000e_reinit_locked(struct e1000_adapter *adapter)
>

I'm really not a fan of this as it really seems to confuse things.  Do 
you know if you need the full workaround or only part of it?  For 
example if the descriptor ring is empty flushing the descriptor rings 
shouldn't be necessary, so I suspect you probably only need to move the 
bits where you were setting E1000_FEXTNVM11_DISABLE_MULR_FIX into the 
e1000_reset_hw_ich8lan call itself and then you could probably just 
leave the rest of the workaround as is.

- Alex

  reply	other threads:[~2015-04-22 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22  1:15 [Intel-wired-lan] [PATCH] e1000e: i219 execute unit hang fix on every reset or power state transition Yanir Lubetkin
2015-04-22 14:39 ` Alexander Duyck [this message]
2015-04-22 14:56   ` Lubetkin, YanirX
2015-05-12  1:04 ` Brown, Aaron F

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=5537B295.3060804@redhat.com \
    --to=alexander.h.duyck@redhat.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.