[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb31aabbf5104992b299682f5ba0e064@realtek.com>
Date: Wed, 15 Nov 2023 06:22:43 +0000
From: Justin Lai <justinlai0215@...ltek.com>
To: Andrew Lunn <andrew@...n.ch>
CC: "kuba@...nel.org" <kuba@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Ping-Ke Shih <pkshih@...ltek.com>,
Larry Chiu <larry.chiu@...ltek.com>
Subject: RE: [PATCH net-next v10 09/13] net:ethernet:realtek:rtase: Implement pci_driver suspend and resume function
> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Sunday, November 5, 2023 3:52 AM
> 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;
> Ping-Ke Shih <pkshih@...ltek.com>; Larry Chiu <larry.chiu@...ltek.com>
> Subject: Re: [PATCH net-next v10 09/13] net:ethernet:realtek:rtase: Implement
> pci_driver suspend and resume function
>
>
> External mail.
>
>
>
> > +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
Thanks for your reply, I will add error handling of rtase_init_ring()
Powered by blists - more mailing lists