[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be00cea5-3074-5a27-3e04-97c08ae60fd8@suse.com>
Date: Thu, 21 Oct 2021 11:55:00 +0200
From: Oliver Neukum <oneukum@...e.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
CC: netdev@...r.kernel.org, oneukum@...e.com, linux-usb@...r.kernel.org
Subject: Re: [PATCH net-next 04/12] net: usb: don't write directly to
netdev->dev_addr
On 20.10.21 17:56, Jakub Kicinski wrote:
> Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
> of VLANs...") introduced a rbtree for faster Ethernet address look
> up. To maintain netdev->dev_addr in this tree we need to make all
> the writes to it got through appropriate helpers.
>
> Manually fix all net/usb drivers without separate maintainers.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
Hi,
this looks good except for catc, which needs a more complicated fix.
Do you want me to do it and drop it from this patch?
Regards
Oliver
> --- a/drivers/net/usb/catc.c
> +++ b/drivers/net/usb/catc.c
> @@ -770,6 +770,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
> struct net_device *netdev;
> struct catc *catc;
> u8 broadcast[ETH_ALEN];
> + u8 addr[ETH_ALEN];
> int pktsz, ret;
>
> if (usb_set_interface(usbdev,
> @@ -870,7 +871,8 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
>
> dev_dbg(dev, "Getting MAC from SEEROM.\n");
>
> - catc_get_mac(catc, netdev->dev_addr);
> + catc_get_mac(catc, addr);
DMA on the stack.
> + eth_hw_addr_set(netdev, addr);
>
> dev_dbg(dev, "Setting MAC into registers.\n");
>
> @@ -899,8 +901,9 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
> } else {
> dev_dbg(dev, "Performing reset\n");
> catc_reset(catc);
> - catc_get_mac(catc, netdev->dev_addr);
> -
> + catc_get_mac(catc, addr);
DMA on the stack.
> + eth_hw_addr_set(netdev, addr);
> +
> dev_dbg(dev, "Setting RX Mode\n");
> catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast;
> catc->rxmode[1] = 0;
>
>
Powered by blists - more mailing lists