lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMSo37XjHhBz1hc_se0Fj8=gnju-iOT52Nf60jwLJ1hPN_kUaQ@mail.gmail.com>
Date: Sat, 15 Jun 2024 01:48:30 +0800
From: Yongqin Liu <yongqin.liu@...aro.org>
To: Jose Ignacio Tornos Martinez <jtornosm@...hat.com>
Cc: amit.pundir@...aro.org, davem@...emloft.net, edumazet@...gle.com, 
	inventor500@...aldi.net, jstultz@...gle.com, kuba@...nel.org, 
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org, 
	netdev@...r.kernel.org, pabeni@...hat.com, stable@...r.kernel.org, 
	sumit.semwal@...aro.org
Subject: Re: [PATCH] net: usb: ax88179_178a: fix link status when link is set
 to down/up

Hello, Jose

On Thu, 13 Jun 2024 at 19:46, Yongqin Liu <yongqin.liu@...aro.org> wrote:
>
> Hi, Jose
>
> On Thu, 13 Jun 2024 at 17:59, Jose Ignacio Tornos Martinez
> <jtornosm@...hat.com> wrote:
> >
> > Hello again,
> >
> > There was a problem copying the patch, sorry, here the good one:
>
> Thanks very much for the work!
>
> I will test it tomorrow, and let you know the result then.
>

I tested with the ACK android15-6.6 and the android-mainline branches,
which have the issue reported,
after applying this patch, the network works again now.

Here is the console output from the mainline branch, in case you want to check:
https://gist.github.com/liuyq/bd3fdada41411bc89a0cd4acf9ec11cf

Thanks again for all the help!

Best regards,
Yongqin Liu



> >
> > $ git diff drivers/net/usb/ax88179_178a.c
> > diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
> > index 51c295e1e823..60357796be99 100644
> > --- a/drivers/net/usb/ax88179_178a.c
> > +++ b/drivers/net/usb/ax88179_178a.c
> > @@ -174,7 +174,6 @@ struct ax88179_data {
> >         u32 wol_supported;
> >         u32 wolopts;
> >         u8 disconnecting;
> > -       u8 initialized;
> >  };
> >
> >  struct ax88179_int_data {
> > @@ -327,7 +326,8 @@ static void ax88179_status(struct usbnet *dev, struct urb *urb)
> >
> >         if (netif_carrier_ok(dev->net) != link) {
> >                 usbnet_link_change(dev, link, 1);
> > -               netdev_info(dev->net, "ax88179 - Link status is: %d\n", link);
> > +               if (!link)
> > +                       netdev_info(dev->net, "ax88179 - Link status is: %d\n", link);
> >         }
> >  }
> >
> > @@ -1543,6 +1543,7 @@ static int ax88179_link_reset(struct usbnet *dev)
> >                          GMII_PHY_PHYSR, 2, &tmp16);
> >
> >         if (!(tmp16 & GMII_PHY_PHYSR_LINK)) {
> > +               netdev_info(dev->net, "ax88179 - Link status is: 0\n");
> >                 return 0;
> >         } else if (GMII_PHY_PHYSR_GIGA == (tmp16 & GMII_PHY_PHYSR_SMASK)) {
> >                 mode |= AX_MEDIUM_GIGAMODE | AX_MEDIUM_EN_125MHZ;
> > @@ -1580,6 +1581,8 @@ static int ax88179_link_reset(struct usbnet *dev)
> >
> >         netif_carrier_on(dev->net);
> >
> > +       netdev_info(dev->net, "ax88179 - Link status is: 1\n");
> > +
> >         return 0;
> >  }
> >
> > @@ -1678,12 +1681,21 @@ static int ax88179_reset(struct usbnet *dev)
> >
> >  static int ax88179_net_reset(struct usbnet *dev)
> >  {
> > -       struct ax88179_data *ax179_data = dev->driver_priv;
> > +       u16 tmp16;
> >
> > -       if (ax179_data->initialized)
> > +       ax88179_read_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID, GMII_PHY_PHYSR,
> > +                        2, &tmp16);
> > +       if (tmp16) {
> > +               ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
> > +                                2, 2, &tmp16);
> > +               if (!(tmp16 & AX_MEDIUM_RECEIVE_EN)) {
> > +                       tmp16 |= AX_MEDIUM_RECEIVE_EN;
> > +                       ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
> > +                                         2, 2, &tmp16);
> > +               }
> > +       } else {
> >                 ax88179_reset(dev);
> > -       else
> > -               ax179_data->initialized = 1;
> > +       }
> >
> >         return 0;
> >  }
> >
> > Best regards
> > José Ignacio
> >
>
>
> --
> Best Regards,
> Yongqin Liu
> ---------------------------------------------------------------
> #mailing list
> linaro-android@...ts.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-android



--
Best Regards,
Yongqin Liu
---------------------------------------------------------------
#mailing list
linaro-android@...ts.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-android

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ