public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tharunkumar.Pasumarthi@microchip.com
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v4 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch
Date: Sat, 11 Feb 2023 09:44:41 +0100	[thread overview]
Message-ID: <Y+dVeeSODu8w5ns9@kroah.com> (raw)
In-Reply-To: <PH7PR11MB59588BF687D7D2EDAC36E4899BDF9@PH7PR11MB5958.namprd11.prod.outlook.com>

On Sat, Feb 11, 2023 at 05:07:43AM +0000, Tharunkumar.Pasumarthi@microchip.com wrote:
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Thursday, February 9, 2023 2:25 PM
> > To: Tharunkumar Pasumarthi - I67821
> > <Tharunkumar.Pasumarthi@microchip.com>
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> > content is safe
> > 
> > > +     } while (data & EEPROM_CMD_EPC_BUSY_BIT);
> > 
> > That's a very busy "sit and spin" loop here, what happens if the read of the
> > bit never actually succeeds?  You just locked up the system with no way to
> > interrupt it :(
> > 
> > Please provide some sort of timeout, or way to break out of this.
> > 
> > > +
> > > +     if (data & EEPROM_CMD_EPC_TIMEOUT_BIT) {
> > > +             dev_err(&priv->pdev->dev, "EEPROM write timed out\n");
> > 
> > How can the timeout bit happen if the busy bit was still set?
> > 
> > And what can userspace do about this if it is reported?
> 
> Hi Greg,
> If EEPROM_CMD_EPC_BUSY_BIT is set for more than 30ms, it will be cleared automatically by the hardware logic and EEPROM_CMD_EPC_TIMEOUT_BIT bit will be set to indicate the timeout. User space application will inform user about timeout on EEPROM write/read when this error occurs.

Ok, if the bit being set will notify userspace of the issue, then why
also spam the kernel error log?

thanks,

greg k-h

  reply	other threads:[~2023-02-11  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09  4:42 [PATCH v4 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch Tharun Kumar P
2023-02-09  8:55 ` Greg KH
2023-02-11  5:07   ` Tharunkumar.Pasumarthi
2023-02-11  8:44     ` Greg KH [this message]
2023-02-11 13:43       ` Tharunkumar.Pasumarthi

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=Y+dVeeSODu8w5ns9@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Tharunkumar.Pasumarthi@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=arnd@arndb.de \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox