netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "mark.einon@gmail.com" <mark.einon@gmail.com>
To: Avi Weiss <thnkslprpt@gmail.com>
Cc: "Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Michael Grzeschik" <mgr@kernel.org>,
	"Kees Cook" <kees@kernel.org>,
	"Jacob Keller" <jacob.e.keller@intel.com>,
	"Uwe Kleine-König (The Capable Hub)"
	<u.kleine-koenig@baylibre.com>, "Alan Cox" <alan@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@suse.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] et131x: propagate EEPROM readiness errors
Date: Sun, 09 Aug 2026 15:35:41 +0100	[thread overview]
Message-ID: <b31153a6435579a7ea3c61b3ac49d325075e87a2.camel@gmail.com> (raw)
In-Reply-To: <20260808194347.813242-1-thnkslprpt@gmail.com>

On Sat, 2026-08-08 at 22:43 +0300, Avi Weiss wrote:
> eeprom_wait_ready() returns a negative error when the LBCIF status
> cannot be read or the device does not become ready for some other
> reason.
> 
> eeprom_write() propagates this error before starting a write, but
> currently returns 0 when the same readiness check fails after the
> write begins.
> 
> This behavior was introduced when the EEPROM code was refactored to
> use Linux error-return conventions (from 0 = failure to 0 = success).
> 
> Return the error so callers do not treat a failed EEPROM write as
> successful and the function contract is maintained.
> 
> Fixes: b802ce0c705f ("Staging: et131x: tidy eeprom code up")
> Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>

Good spot, thanks Avi.

Acked-by: Mark Einon <mark.einon@gmail.com>

Mark.

> ---
>  drivers/net/ethernet/agere/et131x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/agere/et131x.c
> b/drivers/net/ethernet/agere/et131x.c
> index 1b465a167672..4b6a579e9c66 100644
> --- a/drivers/net/ethernet/agere/et131x.c
> +++ b/drivers/net/ethernet/agere/et131x.c
> @@ -567,7 +567,7 @@ static int eeprom_write(struct et131x_adapter
> *adapter, u32 addr, u8 data)
>  		 */
>  		err = eeprom_wait_ready(pdev, &status);
>  		if (err < 0)
> -			return 0;
> +			return err;
>  
>  		/* Check bit 3 of the LBCIF Status Register.  If 
> equal to 1,
>  		 * an error has occurred.Don't break here if we are
> revision
> 
> base-commit: dd057113ac7ba5bdd2aed3d9405305911152f911

      reply	other threads:[~2026-08-09 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08 19:43 [PATCH net] et131x: propagate EEPROM readiness errors Avi Weiss
2026-08-09 14:35 ` mark.einon [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=b31153a6435579a7ea3c61b3ac49d325075e87a2.camel@gmail.com \
    --to=mark.einon@gmail.com \
    --cc=alan@linux.intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@suse.de \
    --cc=jacob.e.keller@intel.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgr@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thnkslprpt@gmail.com \
    --cc=u.kleine-koenig@baylibre.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).