From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] net: ravb: Fix NULL pointer access
Date: Wed, 16 Sep 2020 23:30:17 +0200 [thread overview]
Message-ID: <e786bdb3-e5c9-c214-5249-9f12714fd266@gmail.com> (raw)
In-Reply-To: <TYBPR01MB530979323BFA3681AC59F83686210@TYBPR01MB5309.jpnprd01.prod.outlook.com>
On 9/16/20 5:43 PM, Biju Das wrote:
> Hi Marek,
Hi,
[...]
>>> +++ b/drivers/net/ravb.c
>>> @@ -438,7 +438,8 @@ static int ravb_config(struct udevice *dev)
>>>
>>> writel(mask, eth->iobase + RAVB_REG_ECMR);
>>>
>>> -phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19);
>>> +if (phy->drv->writeext)
>>> +phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19);
>>
>> Shouldn't we rather move this into the PHY driver altogether ?
>
> If I fix, the phydriver with empty function, compiler will complain about unused parameter right?
> What about other phy's which doesn't have this callback.
I mean, should we not move this entire code which configures something
in a Micrel PHY, and is specific to Micrel PHY, into the Micrel PHY
driver and remove the whole call of writeext from this ethernet driver ?
>> I _think_ this might be specific to some Micrel PHY.
> As mentioned in the commit message, it is seen with Realtek phy(rtl8211e) and crash seen on Hihope RZ/G2M board.
Right, because that writeext seems to be micrel-phy specific.
next prev parent reply other threads:[~2020-09-16 21:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 14:10 [PATCH] net: ravb: Fix NULL pointer access Biju Das
2020-09-15 14:23 ` Michal Simek
2020-09-16 13:53 ` Marek Vasut
2020-09-16 15:43 ` Biju Das
2020-09-16 21:30 ` Marek Vasut [this message]
2020-09-18 15:26 ` Biju Das
2020-09-19 2:48 ` Marek Vasut
2020-09-19 11:14 ` Biju Das
2020-09-19 12:44 ` Marek Vasut
2020-09-19 18:14 ` Biju Das
2020-09-19 19:12 ` Marek Vasut
2020-09-20 7:34 ` Biju Das
2020-09-21 16:26 ` Marek Vasut
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=e786bdb3-e5c9-c214-5249-9f12714fd266@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/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