From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8EBBC43387 for ; Fri, 11 Jan 2019 14:38:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79FDB206B6 for ; Fri, 11 Jan 2019 14:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217496; bh=hEptycDe6vBTW9ZhMq1B0bjq4FCQ1jbc7CaCLsOmy7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vmctYLLZD+eyXXUCKfAwsyEE5fSrlTn2k7Pngu4SBCMhasnbUQMTuLGeYvUHuOnGR A++Ynh8xgNiQh6L/dcQzoCNgOwO2YLU9hzlA2kccSUUhZVaIYvw0aQeydbWB4sPzYy Jawarr89U8dUZ3t6nuZyQYJ3jvpQbJEKsHJSFJzI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390807AbfAKOiP (ORCPT ); Fri, 11 Jan 2019 09:38:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:58780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390777AbfAKOiM (ORCPT ); Fri, 11 Jan 2019 09:38:12 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDEF12063F; Fri, 11 Jan 2019 14:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217491; bh=hEptycDe6vBTW9ZhMq1B0bjq4FCQ1jbc7CaCLsOmy7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlrZ955HDtpqlcMbSGIXkfpoBOsueGajE7K5BrOFdKE6kCx6XvL6CMC+wEJyeK/0L 290y6NEVuQ2/DRBMrysdPKMk4HYMF9xsgZQnF1oRxZhHDKzA7KKpb3G4wDMlkxmmas qMCFZqb3yn6fYjsptKq090BaPucqCLAtTT4Eu14g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Martinsen , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 063/148] lan78xx: Resolve issue with changing MAC address Date: Fri, 11 Jan 2019 15:14:01 +0100 Message-Id: <20190111131116.774392797@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131114.337122649@linuxfoundation.org> References: <20190111131114.337122649@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 15515aaaa69659c502003926a2067ee76176148a ] Current state for the lan78xx driver does not allow for changing the MAC address of the interface, without either removing the module (if you compiled it that way) or rebooting the machine. If you attempt to change the MAC address, ifconfig will show the new address, however, the system/interface will not respond to any traffic using that configuration. A few short-term options to work around this are to unload the module and reload it with the new MAC address, change the interface to "promisc", or reboot with the correct configuration to change the MAC. This patch enables the ability to change the MAC address via fairly normal means... ifdown modify entry in /etc/network/interfaces OR a similar method ifup Then test via any network communication, such as ICMP requests to gateway. My only test platform for this patch has been a raspberry pi model 3b+. Signed-off-by: Jason Martinsen ----- Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/lan78xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index c3c9ba44e2a1..8d140495da79 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -2335,6 +2335,10 @@ static int lan78xx_set_mac_addr(struct net_device *netdev, void *p) ret = lan78xx_write_reg(dev, RX_ADDRL, addr_lo); ret = lan78xx_write_reg(dev, RX_ADDRH, addr_hi); + /* Added to support MAC address changes */ + ret = lan78xx_write_reg(dev, MAF_LO(0), addr_lo); + ret = lan78xx_write_reg(dev, MAF_HI(0), addr_hi | MAF_HI_VALID_); + return 0; } -- 2.19.1