From: Pavel Skripkin <paskripkin@gmail.com>
To: David Kahurani <k.kahurani@gmail.com>
Cc: netdev@vger.kernel.org,
syzbot <syzbot+d3dbdf31fbe9d8f5f311@syzkaller.appspotmail.com>,
davem@davemloft.net, jgg@ziepe.ca, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Phillip Potter <phil@philpotter.co.uk>,
syzkaller-bugs@googlegroups.com, arnd@arndb.de,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] net: ax88179: add proper error handling of usb read errors
Date: Sat, 16 Apr 2022 14:53:44 +0300 [thread overview]
Message-ID: <18f52ad1-0928-389c-46fc-dd050b73a4cd@gmail.com> (raw)
In-Reply-To: <CAAZOf27Q-QQ51pGO1gFETNR0ASg6zmxF4HUFUVn77oL3Cs7LEg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1500 bytes --]
Hi David,
On 4/16/22 14:49, David Kahurani wrote:
>> > @@ -1303,8 +1448,12 @@ static void ax88179_get_mac_addr(struct usbnet *dev)
>> > netif_dbg(dev, ifup, dev->net,
>> > "MAC address read from device tree");
>> > } else {
>> > - ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
>> > - ETH_ALEN, mac);
>> > + ret = ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
>> > + ETH_ALEN, mac);
>> > +
>> > + if (ret)
>> > + netdev_dbg(dev->net, "Failed to read NODE_ID: %d", ret);
>> > +
>> > netif_dbg(dev, ifup, dev->net,
>> > "MAC address read from ASIX chip");
>> > }
>>
>>
>> This message sequence is confusing.
>>
>> In case of ax88179_read_cmd() failure mac read from device actually
>> failed, but message says, that it was successfully finished.
>
> I suppose the code should return in case of an error that way the next
> message does not get executed.
>
No, this will break the driver. This function should set mac address in
netdev structure and if read from device fails code calls
eth_hw_addr_set(dev->net, mac);
which will generate random mac addr. I.e. read failure is not critical
in that function
So, no need to return with an error, just don't print confusing messages :)
With regards,
Pavel Skripkin
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2022-04-16 11:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-16 7:48 [PATCH] net: ax88179: add proper error handling of usb read errors David Kahurani
2022-04-16 11:05 ` Pavel Skripkin
2022-04-16 11:10 ` Pavel Skripkin
2022-04-16 11:49 ` David Kahurani
2022-04-16 11:53 ` Pavel Skripkin [this message]
2022-04-16 11:57 ` Pavel Skripkin
2022-04-19 13:41 ` Paolo Abeni
-- strict thread matches above, loose matches on Subject: below --
2022-05-14 13:32 David Kahurani
2022-05-14 16:51 ` Pavel Skripkin
2022-05-14 18:54 ` Dan Carpenter
2022-05-14 18:57 ` Pavel Skripkin
2022-05-16 19:31 ` Jakub Kicinski
2022-04-04 15:10 David Kahurani
2022-04-04 15:31 ` Dan Carpenter
2022-04-13 12:36 ` David Kahurani
2022-04-13 15:32 ` Dan Carpenter
2022-04-14 7:31 ` Oliver Neukum
2022-04-14 8:21 ` Dan Carpenter
2022-04-14 9:13 ` Oliver Neukum
2022-04-04 16:50 ` Pavel Skripkin
2022-04-11 15:11 ` Andy Shevchenko
2022-04-05 9:44 ` Paolo Abeni
2022-04-05 20:44 ` kernel test robot
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=18f52ad1-0928-389c-46fc-dd050b73a4cd@gmail.com \
--to=paskripkin@gmail.com \
--cc=arnd@arndb.de \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=jgg@ziepe.ca \
--cc=k.kahurani@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=phil@philpotter.co.uk \
--cc=syzbot+d3dbdf31fbe9d8f5f311@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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).