From: Sascha Hauer <s.hauer@pengutronix.de>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][6.2] Revert "usb: gadget: u_ether: Do not make UDC parent of the net device"
Date: Thu, 9 Feb 2023 12:16:19 +0100 [thread overview]
Message-ID: <20230209111619.GP10447@pengutronix.de> (raw)
In-Reply-To: <20230209105626.10597-1-paul@crapouillou.net>
On Thu, Feb 09, 2023 at 10:56:26AM +0000, Paul Cercueil wrote:
> This reverts commit 321b59870f850a10dbb211ecd2bd87b41497ea6f.
>
> This commit broke USB networking on Ingenic SoCs and maybe elsewhere.
> The actual reason is unknown; and while a proper fix would be better,
> we're sitting at -rc7 now, so a revert is justified - and we can work on
> re-introducing this change for 6.3.
>
> Fixes: 321b59870f85 ("usb: gadget: u_ether: Do not make UDC parent of the net device")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/usb/gadget/function/u_ether.c | 4 ++++
> 1 file changed, 4 insertions(+)
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha
>
> diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
> index 8f12f3f8f6ee..e06022873df1 100644
> --- a/drivers/usb/gadget/function/u_ether.c
> +++ b/drivers/usb/gadget/function/u_ether.c
> @@ -798,6 +798,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
> net->max_mtu = GETHER_MAX_MTU_SIZE;
>
> dev->gadget = g;
> + SET_NETDEV_DEV(net, &g->dev);
> SET_NETDEV_DEVTYPE(net, &gadget_type);
>
> status = register_netdev(net);
> @@ -872,6 +873,8 @@ int gether_register_netdev(struct net_device *net)
> struct usb_gadget *g;
> int status;
>
> + if (!net->dev.parent)
> + return -EINVAL;
> dev = netdev_priv(net);
> g = dev->gadget;
>
> @@ -902,6 +905,7 @@ void gether_set_gadget(struct net_device *net, struct usb_gadget *g)
>
> dev = netdev_priv(net);
> dev->gadget = g;
> + SET_NETDEV_DEV(net, &g->dev);
> }
> EXPORT_SYMBOL_GPL(gether_set_gadget);
>
> --
> 2.39.1
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2023-02-09 11:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 10:56 [PATCH][6.2] Revert "usb: gadget: u_ether: Do not make UDC parent of the net device" Paul Cercueil
2023-02-09 11:16 ` Sascha Hauer [this message]
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=20230209111619.GP10447@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=paul@crapouillou.net \
/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