From patchwork Wed May 15 10:53:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 164272 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp607201ili; Wed, 15 May 2019 04:06:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxDGDnC6YOd2NLXbRpN2x+9LyI7JzW8rpRCNw6GbnAGBJywvznx034UXQ/ysuxrfFIK58y X-Received: by 2002:a17:902:7e4f:: with SMTP id a15mr43703906pln.205.1557918388187; Wed, 15 May 2019 04:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557918388; cv=none; d=google.com; s=arc-20160816; b=nFF4zq/1/3O/Zh+/MA/2LFXZcpBNi6F6Jn79BJ2EtxOaNzYia2/hib3h4lZsIc7YQn qE//qoh0j+svQ/eK2l2rv1R83iS8vITHCh1fckfWvhfgIoewcXwTSAKcUi14NhuNn22F OTcEk90jKH5SuZpeUvvVSaq3v5SdrC+e3XDd7sh6bNGQnb1Xs/UAWTJJnU+rA6IOwjBm 1zMIxwyR0rbSc+Li3/bpONplniH/1PBi/L33ijdwFCvm89xidhvp0xZsmQkIKcF0mNY8 GGUwEqy6X1M5J1o0o92IIADuC2BhhZIpMYvd0NYKgmFO0t0TKwe2UPdAHksFu17E2Z+B cviw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v/ZtVOEPpFDZuxF7nRB5FpmyhFUiI+oAD0n+nbJ1UIQ=; b=b+P7LVxG2IDokMmyINH4MwIYnNobJO5g1kUhHxb01tC1e/UU3yU4ymhSthut7LJwLA TRuPM3WAiVJE5o1WM62S8P3xKOBQfxqRFB/4kHXgDkD/cH/cuS8sTjMRghh9m+t406Ai MrARftIEIsYyuvAMk2vnQ4ZhKzk8BWdMaXHF2/5pNQxSay0L6abhQstV/zjni4p6WPPr eWdxdijJIyzuByE5XsAshxSAEnj9gG8HI0Z5+uQLzjO+mzX24YXgCKRAK3BQ14TH0arG X6UtDRbWDR7ArnMswq+gLF5zcKZonvwA4pQdltQWoGMAH24iDyCa1t68Hb5WYLh0b0UU F4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JFrPqZIE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si1594777pgj.258.2019.05.15.04.06.26; Wed, 15 May 2019 04:06:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JFrPqZIE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727907AbfEOLEs (ORCPT + 14 others); Wed, 15 May 2019 07:04:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:34482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728501AbfEOLEr (ORCPT ); Wed, 15 May 2019 07:04:47 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 AA76120881; Wed, 15 May 2019 11:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918287; bh=nTbrl9azwyWAMVKJYg5a+5jWC/xxOt9b14id91UCd9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFrPqZIE4gkfXjhu2gS1yWXmx73ZxSkxImBmQ6WYhkPYBHJU9CPGWOn373WIgNjkg NTjPKdCiqhLznbNkuEO2eNszxrJjtFHVHsx1VdlKqCzLRHhkEl30Kpd70/djP1dDsb N+8/MiWAWwtZa17m2ju2s8vPbe7+WxU9ihNL97ZY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaofei Shen , Sneh Shah , Vinod Koul , Andrew Lunn , "David S. Miller" Subject: [PATCH 4.4 077/266] net: stmmac: move stmmac_check_ether_addr() to driver probe Date: Wed, 15 May 2019 12:53:04 +0200 Message-Id: <20190515090725.043029269@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vinod Koul [ Upstream commit b561af36b1841088552464cdc3f6371d92f17710 ] stmmac_check_ether_addr() checks the MAC address and assigns one in driver open(). In many cases when we create slave netdevice, the dev addr is inherited from master but the master dev addr maybe NULL at that time, so move this call to driver probe so that address is always valid. Signed-off-by: Xiaofei Shen Tested-by: Xiaofei Shen Signed-off-by: Sneh Shah Signed-off-by: Vinod Koul Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1792,8 +1792,6 @@ static int stmmac_open(struct net_device struct stmmac_priv *priv = netdev_priv(dev); int ret; - stmmac_check_ether_addr(priv); - if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI && priv->pcs != STMMAC_PCS_RTBI) { ret = stmmac_init_phy(dev); @@ -2929,6 +2927,8 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; + stmmac_check_ether_addr(priv); + ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | From patchwork Wed May 15 10:54:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 164273 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp613842ili; Wed, 15 May 2019 04:12:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMtBmARjWyYju/HfAXsjR/wf6GaG22HWYVauMGqs1jH6U8az/OwseiUzrEKGLAkGU44Vmh X-Received: by 2002:a63:ed16:: with SMTP id d22mr42620915pgi.35.1557918753066; Wed, 15 May 2019 04:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557918753; cv=none; d=google.com; s=arc-20160816; b=udjRcYJumJW5LrGJK5AOR26nZZ1PrqtRJRRwZ5WlizkzsGkP2/lnyHmtiyh58/lMrS cmfrD5LEL0ZJVauhDbxF8qEEKDKIdXKJ7dqUmIknH6Tb/EHbEKspN+qzrq2d2ng/8X9T V+9/2naD7pbD9VzrMHRqD4J0lHGukdZwhlwZoUV4M6ovuElRWV0odSo12lRoqkmHClgu H881F5VJTw5L4fhS8YGLJfkp05MCSHagxBJ9+caYZhINkd0b5qNywa/rGRkujCYbCwHe Kb5jmF89JD4elaOv+EMaGHArNUT/RQJhkdHmg4oaCcLjj5+U2WL436vz6qLclD72iYTn R2sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YSLj8SQdLKlekXkjBlppjsCWdmXRlVdUhhmZxTu/zBs=; b=wF/64UC1wOYuFVnO56NDbYtkFYqz1LhJ0j8xHMgrOj3RH3IHAlzDz5KVre4LFXigwv qyAKjGvQc9qX61Q1klmhdbXnT86lf7nLD2kHFdrbIdxP4DThaZtb9ud6gsG5I44P7Gv7 imrXMF0Q1EJTilWkHqvM1J91bXMDXUKXVghBLlX7oYDzEVzzChgSy0/Ma92ilhSn099u /DI9s4DzB2ZTVWf1IEQSkOnvuAZRUCIQoQtIXL0/0xzj3YBKkf2DYtZImXE551JT8NWP xWm69xVYEMwDRLvtLYcLnq/Ji/qF3lSu7j3O51REyBt4ANcOWAwNXQTlL7SwzzxnWP/E CdXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kNA4xfyO; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si1594777pgj.258.2019.05.15.04.12.31; Wed, 15 May 2019 04:12:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kNA4xfyO; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728852AbfEOLJ6 (ORCPT + 14 others); Wed, 15 May 2019 07:09:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:43228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729315AbfEOLJx (ORCPT ); Wed, 15 May 2019 07:09:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 9BF0C20843; Wed, 15 May 2019 11:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918592; bh=JbPRabLIMrTvWdkn5zLLgPu/FCNDuIM6k0f73dNLetE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNA4xfyOThsK3VpryKIMa7jh4tPXKqEnprUBb9JmyC43O5x61N2oeW3onxP64PUvC 2wkXzZ3jbgrdNo3yddpGMnmm4Xa4Cu8nOpghXv3gajrai+juinmlA3006K6lyZJUcR oMlAJdoWyumrmlu0roYlOJiLX62EZI8P+nvxU1EU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, yamada.masahiro@socionext.com, Ingo Molnar , Ben Hutchings Subject: [PATCH 4.4 190/266] locking/atomics, asm-generic: Move some macros from to a new file Date: Wed, 15 May 2019 12:54:57 +0200 Message-Id: <20190515090729.368808952@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will Deacon commit 8bd9cb51daac89337295b6f037b0486911e1b408 upstream. In preparation for implementing the asm-generic atomic bitops in terms of atomic_long_*(), we need to prevent implementations from pulling in . A common reason for this include is for the BITS_PER_BYTE definition, so move this and some other BIT() and masking macros into a new header file, . Signed-off-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com Link: https://lore.kernel.org/lkml/1529412794-17720-4-git-send-email-will.deacon@arm.com Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- include/linux/bitops.h | 22 +--------------------- include/linux/bits.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 include/linux/bits.h --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -1,29 +1,9 @@ #ifndef _LINUX_BITOPS_H #define _LINUX_BITOPS_H #include +#include -#ifdef __KERNEL__ -#define BIT(nr) (1UL << (nr)) -#define BIT_ULL(nr) (1ULL << (nr)) -#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) -#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) -#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) -#define BITS_PER_BYTE 8 #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) -#endif - -/* - * Create a contiguous bitmask starting at bit position @l and ending at - * position @h. For example - * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. - */ -#define GENMASK(h, l) \ - (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) - -#define GENMASK_ULL(h, l) \ - (((~0ULL) - (1ULL << (l)) + 1) & \ - (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) extern unsigned int __sw_hweight8(unsigned int w); extern unsigned int __sw_hweight16(unsigned int w); --- /dev/null +++ b/include/linux/bits.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LINUX_BITS_H +#define __LINUX_BITS_H +#include + +#define BIT(nr) (1UL << (nr)) +#define BIT_ULL(nr) (1ULL << (nr)) +#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) +#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) +#define BITS_PER_BYTE 8 + +/* + * Create a contiguous bitmask starting at bit position @l and ending at + * position @h. For example + * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. + */ +#define GENMASK(h, l) \ + (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) + +#define GENMASK_ULL(h, l) \ + (((~0ULL) - (1ULL << (l)) + 1) & \ + (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) + +#endif /* __LINUX_BITS_H */