[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0af3a54f-09da-4a8b-b385-c6968334ace4@lunn.ch>
Date: Sat, 4 Nov 2023 20:52:27 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Justin Lai <justinlai0215@...ltek.com>
Cc: kuba@...nel.org, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, pkshih@...ltek.com, larry.chiu@...ltek.com
Subject: Re: [PATCH net-next v10 09/13] net:ethernet:realtek:rtase: Implement
pci_driver suspend and resume function
> +static int rtase_resume(struct pci_dev *pdev)
> +{
> + struct net_device *dev = pci_get_drvdata(pdev);
> + struct rtase_private *tp = netdev_priv(dev);
> + int ret;
> +
> + pci_set_power_state(pdev, PCI_D0);
> + pci_restore_state(pdev);
> + pci_enable_wake(pdev, PCI_D0, 0);
> +
> + /* restore last modified mac address */
> + rtase_rar_set(tp, dev->dev_addr);
> +
> + if (!netif_running(dev))
> + goto out;
> +
> + rtase_wait_for_quiescence(dev);
> + netif_device_attach(dev);
> +
> + rtase_tx_clear(tp);
> + rtase_rx_clear(tp);
> +
> + ret = rtase_init_ring(dev);
> + if (ret)
> + netdev_alert(dev, "unable to init ring\n");
If you fail to init the ring, is it safe to keep going?
Andrew
Powered by blists - more mailing lists