Thread (18 messages) flat view 18 messages, 3 authors, 2021-06-07

Re: [PATCH v2] net: phy: add Maxlinear GPY115/21x/24x driver

From: Liang Xu <lxu@maxlinear.com>
Date: 2021-06-03 15:32:46

On 3/6/2021 11:21 pm, Andrew Lunn wrote:
This email was sent from outside of MaxLinear.


On Thu, Jun 03, 2021 at 03:10:31PM +0000, Liang Xu wrote:
quoted
On 3/6/2021 5:17 pm, Russell King (Oracle) wrote:
quoted
quoted
+static int gpy_config_init(struct phy_device *phydev)
+{
+ int ret, fw_ver;
+
+ /* Show GPY PHY FW version in dmesg */
+ fw_ver = phy_read(phydev, PHY_FWV);
+ if (fw_ver < 0)
+ return fw_ver;
+
+ phydev_info(phydev, "Firmware Version: 0x%04X (%s)\n", fw_ver,
+ (fw_ver & PHY_FWV_REL_MASK) ? "release" : "test");
Does this need to print the firmware version each time config_init()
is called? Is it likely to change beyond? Would it be more sensible
to print it in the probe() method?
The firmware version can change in device with different firmware
loading mechanism.

I moved the print to probe and tested a few devices, found in some cases
it did not print the active version number.
That actually sounds like a real problem. If it is still in the
bootloader when the driver is probed, the driver should not be writing
any configuration registers until the real image is running. So it
sounds like you need a probe function which checks if the PHY has
finished booting, and if not, wait for the real firmware to start
running.

         Andrew
I think my word was misleading.

The device always has valid firmware running.

The firmware version can change because of switch of the firmware during 
running time.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help