[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yw/19QZJeZE7yy+8@lunn.ch>
Date: Thu, 1 Sep 2022 01:59:49 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: netdev@...r.kernel.org, mengyuanlou@...-swift.com
Subject: Re: [PATCH net-next v2 01/16] net: txgbe: Store PCI info
> > > + /* if there's flash existing */
> > > + if (!(rd32(hw, TXGBE_SPI_STATUS) &
> > > + TXGBE_SPI_STATUS_FLASH_BYPASS)) {
> > > + /* wait hw load flash done */
> > > + for (i = 0; i < TXGBE_MAX_FLASH_LOAD_POLL_TIME; i++) {
> > > + reg = rd32(hw, TXGBE_SPI_ILDR_STATUS);
> > > + if (!(reg & check_bit)) {
> > > + /* done */
> > > + break;
> > > + }
> > > + msleep(200);
> > > + }
> >
> > This is what iopoll.h is for. Any sort of loop waiting for something to
> happen
> > should use one of the helpers in there.
> >
>
> The description of functions in iopoll.h states that maximum sleep time
> should be less than 20ms, is it okay to call it here for 200ms.
Should be fine.
You could always reduce the sleep and just poll 10 times more. What
you are doing, reading one register, is cheap.
Andrew
Powered by blists - more mailing lists