netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: Prashant <prashant@broadcom.com>, netdev@vger.kernel.org
Cc: Michael Chan <mchan@broadcom.com>
Subject: Re: [PATCH net] tg3: prevent ifup/ifdown during PCI error recovery
Date: Mon, 01 Sep 2014 14:22:22 +0200	[thread overview]
Message-ID: <540464FE.3090803@redhat.com> (raw)
In-Reply-To: <53FFBB2E.7010609@broadcom.com>

On 29.8.2014 01:28, Prashant wrote:
> Ivan, thanks for the patch. Minor comments.
>
>>
>> diff --git a/drivers/net/ethernet/broadcom/tg3.c
>> b/drivers/net/ethernet/broadcom/tg3.c
>> index 3ac5d23..8d9c774 100644
>> --- a/drivers/net/ethernet/broadcom/tg3.c
>> +++ b/drivers/net/ethernet/broadcom/tg3.c
>> @@ -11617,6 +11617,9 @@ static int tg3_open(struct net_device *dev)
>>       struct tg3 *tp = netdev_priv(dev);
>>       int err;
>>
>> +    if (tp->pcierr_recovery)
>> +        return -EAGAIN;
>> +
>
> Can have a netdev_err message here indicating the pcie error recovery
> that is taking place before returning.
Sure, done. V2 sent.

Ivan
>
>>       if (tp->fw_needed) {
>>           err = tg3_request_firmware(tp);
>>           if (tg3_asic_rev(tp) == ASIC_REV_57766) {
>> @@ -11674,6 +11677,9 @@ static int tg3_close(struct net_device *dev)
>>   {
>>       struct tg3 *tp = netdev_priv(dev);
>>
>> +    if (tp->pcierr_recovery)
>> +        return -EAGAIN;
>> +
>
> netdev_err message here too.
>
>>       tg3_ptp_fini(tp);
>>
>>       tg3_stop(tp);
>> @@ -17561,6 +17567,7 @@ static int tg3_init_one(struct pci_dev *pdev,
>>       tp->rx_mode = TG3_DEF_RX_MODE;
>>       tp->tx_mode = TG3_DEF_TX_MODE;
>>       tp->irq_sync = 1;
>> +    tp->pcierr_recovery = false;
>>
>>       if (tg3_debug > 0)
>>           tp->msg_enable = tg3_debug;
>> @@ -18071,6 +18078,8 @@ static pci_ers_result_t
>> tg3_io_error_detected(struct pci_dev *pdev,
>>
>>       rtnl_lock();
>>
>> +    tp->pcierr_recovery = true;
>> +
>>       /* We probably don't have netdev yet */
>>       if (!netdev || !netif_running(netdev))
>>           goto done;
>> @@ -18195,6 +18204,7 @@ static void tg3_io_resume(struct pci_dev *pdev)
>>       tg3_phy_start(tp);
>>
>>   done:
>> +    tp->pcierr_recovery = false;
>>       rtnl_unlock();
>>   }
>>
>> diff --git a/drivers/net/ethernet/broadcom/tg3.h
>> b/drivers/net/ethernet/broadcom/tg3.h
>> index 461acca..31c9f82 100644
>> --- a/drivers/net/ethernet/broadcom/tg3.h
>> +++ b/drivers/net/ethernet/broadcom/tg3.h
>> @@ -3407,6 +3407,7 @@ struct tg3 {
>>
>>       struct device            *hwmon_dev;
>>       bool                link_up;
>> +    bool                pcierr_recovery;
>>   };
>>
>>   /* Accessor macros for chip and asic attributes
>>

      reply	other threads:[~2014-09-01 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 13:01 [PATCH net] tg3: prevent ifup/ifdown during PCI error recovery Ivan Vecera
2014-08-28 23:28 ` Prashant
2014-09-01 12:22   ` Ivan Vecera [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=540464FE.3090803@redhat.com \
    --to=ivecera@redhat.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=prashant@broadcom.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;
as well as URLs for NNTP newsgroup(s).