[PATCH v2] ramips: fix at803x patch again
René van Dorst
opensource at vdorst.com
Sun Jun 6 11:44:43 PDT 2021
Quoting DENG Qingfang <dqfext at gmail.com>:
> Commit 8222f8e1b9be overrides AR8031's PHY features, making its SFP
> link status detection unavailable. To fix that, do not override it in
> ramips patch.
>
> Commit 6d4ef6792612 also moves .config_aneg to AR8035 by mistake, fix
> that as well.
>
> Reported-by: CHEN Minqiang <ptpt52 at gmail.com>
> Fixes: 8222f8e1b9be ("ath79: fix link mode support list on UniFi AC")
> Fixes: 6d4ef6792612 ("kernel: bump 5.4 to 5.4.113")
> Signed-off-by: DENG Qingfang <dqfext at gmail.com>
> ---
> v1 -> v2: do not override .features
>
> .../ramips/patches-5.10/710-at803x.patch | 13 ++++++++++--
> .../linux/ramips/patches-5.4/991-at803x.patch | 21 ++++++++++++-------
> 2 files changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/target/linux/ramips/patches-5.10/710-at803x.patch
> b/target/linux/ramips/patches-5.10/710-at803x.patch
> index dab62b7607..1afc266740 100644
> --- a/target/linux/ramips/patches-5.10/710-at803x.patch
> +++ b/target/linux/ramips/patches-5.10/710-at803x.patch
> @@ -9,8 +9,8 @@ Content-Transfer-Encoding: 8bit
>
> Signed-off-by: René van Dorst <opensource at vdorst.com>
> ---
> - drivers/net/phy/at803x.c | 91 ++++++++++++++++++++++++++++++++++++++++
> - 1 file changed, 91 insertions(+)
> + drivers/net/phy/at803x.c | 86 +++++++++++++++++++++++++++++++++++++++-
> + 1 file changed, 85 insertions(+), 1 deletion(-)
>
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -147,3 +147,12 @@ Signed-off-by: René van Dorst <opensource at vdorst.com>
> .flags = PHY_POLL_CABLE_TEST,
> .probe = at803x_probe,
> .remove = at803x_remove,
> +@@ -1119,7 +1203,7 @@ static struct phy_driver at803x_driver[]
> + .get_wol = at803x_get_wol,
> + .suspend = at803x_suspend,
> + .resume = at803x_resume,
> +- .features = PHY_GBIT_FEATURES,
> ++ /* PHY_GBIT_FEATURES */
> + .read_status = at803x_read_status,
> + .aneg_done = at803x_aneg_done,
> + .ack_interrupt = &at803x_ack_interrupt,
> diff --git a/target/linux/ramips/patches-5.4/991-at803x.patch
> b/target/linux/ramips/patches-5.4/991-at803x.patch
> index 95411211b2..9148687113 100644
> --- a/target/linux/ramips/patches-5.4/991-at803x.patch
> +++ b/target/linux/ramips/patches-5.4/991-at803x.patch
> @@ -9,8 +9,8 @@ Content-Transfer-Encoding: 8bit
>
> Signed-off-by: René van Dorst <opensource at vdorst.com>
> ---
> - drivers/net/phy/at803x.c | 91 ++++++++++++++++++++++++++++++++++++++++
> - 1 file changed, 91 insertions(+)
> + drivers/net/phy/at803x.c | 93 +++++++++++++++++++++++++++++++++++++++-
> + 1 file changed, 92 insertions(+), 1 deletion(-)
>
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -146,11 +146,18 @@ Signed-off-by: René van Dorst <opensource at vdorst.com>
> static struct phy_driver at803x_driver[] = {
> {
> /* ATHEROS 8035 */
> -@@ -461,6 +551,7 @@ static struct phy_driver at803x_driver[]
> +@@ -485,12 +575,13 @@ static struct phy_driver at803x_driver[]
> + .name = "Atheros 8031 ethernet",
> + .phy_id_mask = AT803X_PHY_ID_MASK,
> + .probe = at803x_probe,
> ++ .config_aneg = at803x_config_aneg,
> + .config_init = at803x_config_init,
> + .set_wol = at803x_set_wol,
> + .get_wol = at803x_get_wol,
> .suspend = at803x_suspend,
> .resume = at803x_resume,
> - /* PHY_GBIT_FEATURES */
> -+ .config_aneg = at803x_config_aneg,
> +- .features = PHY_GBIT_FEATURES,
> ++ /* PHY_GBIT_FEATURES */
> .read_status = at803x_read_status,
> - .ack_interrupt = at803x_ack_interrupt,
> - .config_intr = at803x_config_intr,
> + .aneg_done = at803x_aneg_done,
> + .ack_interrupt = &at803x_ack_interrupt,
> --
> 2.25.1
Hi Qingfang,
Thank for fixing.
But I can't apply this patch clean on top of the current master
04a260911ca0f10a0e37c487c220e1aae3623dda.
Which commit/branch are you using?
# patch -p1 < p.patch
patching file target/linux/ramips/patches-5.10/710-at803x.patch
Hunk #2 FAILED at 147.
1 out of 2 hunks FAILED -- saving rejects to file
target/linux/ramips/patches-5.10/710-at803x.patch.rej
patching file target/linux/ramips/patches-5.4/991-at803x.patch
Hunk #2 FAILED at 146.
1 out of 2 hunks FAILED -- saving rejects to file
target/linux/ramips/patches-5.4/991-at803x.patch.rej
# cat target/linux/ramips/patches-5.10/710-at803x.patch.rej
--- target/linux/ramips/patches-5.10/710-at803x.patch
+++ target/linux/ramips/patches-5.10/710-at803x.patch
@@ -147,3 +147,12 @@ Signed-off-by: René van Dorst <opensource at vdorst.com>
.flags = PHY_POLL_CABLE_TEST,
.probe = at803x_probe,
.remove = at803x_remove,
+@@ -1119,7 +1203,7 @@ static struct phy_driver at803x_driver[]
+ .get_wol = at803x_get_wol,
+ .suspend = at803x_suspend,
+ .resume = at803x_resume,
+- .features = PHY_GBIT_FEATURES,
++ /* PHY_GBIT_FEATURES */
+ .read_status = at803x_read_status,
+ .aneg_done = at803x_aneg_done,
+ .ack_interrupt = &at803x_ack_interrupt,
Greats,
René
More information about the openwrt-devel
mailing list