# Re: \[PATCH v4 3/5\] net: phy: qcom: at803x: Add Qualcomm IPQ5018 Internal PHY support

- From: George Moussalem \<hidden\>
- Date: 2025-06-09 12:53:28 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/06/3083393
- Thread: https://ratatoskr.run/netdev/2025/06/3083294/t.md

```text


On 6/9/25 16:24, Andrew Lunn wrote:
>> -#include <linux/phy.h>
>> -#include <linux/module.h>
>> -#include <linux/string.h>
>> -#include <linux/netdevice.h>
>> +#include <linux/bitfield.h>
>> +#include <linux/clk.h>
>> +#include <linux/clk-provider.h>
>>   #include <linux/etherdevice.h>
>>   #include <linux/ethtool_netlink.h>
>> -#include <linux/bitfield.h>
>> -#include <linux/regulator/of_regulator.h>
>> -#include <linux/regulator/driver.h>
>> -#include <linux/regulator/consumer.h>
>> +#include <linux/mfd/syscon.h>
>> +#include <linux/module.h>
>> +#include <linux/netdevice.h>
>>   #include <linux/of.h>
>> +#include <linux/phy.h>
>>   #include <linux/phylink.h>
>> +#include <linux/regmap.h>
>> +#include <linux/regulator/consumer.h>
>> +#include <linux/regulator/driver.h>
>> +#include <linux/regulator/of_regulator.h>
>> +#include <linux/reset.h>
>>   #include <linux/sfp.h>
>> +#include <linux/string.h>
>>   #include <dt-bindings/net/qca-ar803x.h>
>
> Please sort the headers in a separate patch. Cleanup and new features
> are logically different things, so should not be mixed.

Will do in v5, thanks.

>
>> +static void ipq5018_link_change_notify(struct phy_device *phydev)
>> +{
>> +	mdiobus_modify_changed(phydev->mdio.bus, phydev->mdio.addr,
>> +			       IPQ5018_PHY_FIFO_CONTROL, IPQ5018_PHY_FIFO_RESET,
>> +			       phydev->link ? IPQ5018_PHY_FIFO_RESET : 0);
>> +}
>
>
> link_change_notify is pretty much only used when the PHY is broken. So
> it would be good to add a comment what is happening here. Why does the
> FIFO need to be reset?

in the downstream QCA-SSDK, the phy is reset when the link state changes to 'up'. And as part of that sequence, the FIFO buffer is cleared. I don't have access to the documentation, unfortunately.

Link: https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk/-/blob/NHSS.QSDK.12.5/src/adpt/mp/adpt_mp_portctrl.c#L1150

>
> 	Andrew

George
```
