From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: kuba@kernel.org
Cc: davem@davemloft.net, edumazet@google.com,
jarkko.palviainen@gmail.com, jtornosm@redhat.com,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
netdev@vger.kernel.org, pabeni@redhat.com,
stable@vger.kernel.org
Subject: Re: [PATCH] net: usb: ax88179_178a: avoid writing the mac address before first reading
Date: Mon, 15 Apr 2024 09:27:32 +0200 [thread overview]
Message-ID: <20240415072735.6135-1-jtornosm@redhat.com> (raw)
In-Reply-To: <20240411195129.69ff2bac@kernel.org>
Hello Jakub,
I have been trying to use netif_device_detach() and netif_device_attach()
as conditions, but maybe I am misunderstanding you, becasue I think the
detected problem is not related to suspend/resume process.
Let me try to explain better (if considered, I can complete the patch
explanation later):
The issue happened at the initialization stage. At that moment, during
normal rtnl_setlink call, the mac address is set and written in the device
registers, but since the reset was not commanded previously, the mac
address is not read from the device and without that, it always has the
random address that is pre-generated just in case.
After this, during open operation, the reset is commanded and the mac
address is read, but as the device registers were modified, it reads the
pregenerated random mac address and not the default mac address for the
device.
To fix, I am trying to protect this situtation, not allowing to write if
the reset and the default mac address for the device is not previously
read. I think it is easier in the driver because of the device condition.
Thank you
Best regards
José Ignacio
next prev parent reply other threads:[~2024-04-15 7:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 9:55 [PATCH] net: usb: ax88179_178a: avoid writing the mac address before first reading Jose Ignacio Tornos Martinez
2024-04-12 2:51 ` Jakub Kicinski
2024-04-15 7:27 ` Jose Ignacio Tornos Martinez [this message]
2024-04-15 17:48 ` Jakub Kicinski
2024-04-17 8:51 ` Jose Ignacio Tornos Martinez
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=20240415072735.6135-1-jtornosm@redhat.com \
--to=jtornosm@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jarkko.palviainen@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).