From patchwork Tue Jul 4 11:44:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106945 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp897689qge; Tue, 4 Jul 2017 04:44:39 -0700 (PDT) X-Received: by 10.98.144.209 with SMTP id q78mr14644294pfk.81.1499168678481; Tue, 04 Jul 2017 04:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499168678; cv=none; d=google.com; s=arc-20160816; b=sp5jLnLTcueIpLsqdmvR8ewP3VETd/Yoq2RlztvMhv+gDCA67dlNCoKKOoLR0JXkUS sHxx3Fnl6tEW/Aj41GIGyLN+l9/kmUQdML1bpn5eDUo4qP1CTGE1SIwJKygyoSyrBHcl KjHzvF1oDZjSj3V3YCThS3vtBHE6TbW6ad5LcV8Ai3PtU9k6IPGGlGtTcPzKDvKBe5ak faOdFmY64Hhi4ojLl99q0AQ20qT8TJBffxyu2gwXO8LLwV6RsvvlQKgMfBaLNFfw7q9E KIcvQ0tmjXc5eIObhBFZLix19U6wGk9QaOd8aCtORhZW/wGHm5CTWIZ17/IRKqpt/BsY 1RuA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WT6eQp1wQOtxqsiqXXZZhm2p1EXbW+ML1QxqZHXb45w=; b=udpGQ8rvKvub2+r1lGoF7FS9KMWCujRFnqNTwcTbrpImEoMgM/zIy/ybkfLLvx6qtR XMy4Pd8UEKj34IxPPFrHc5YTx65Nq6Y1BRy4fEkIFgM4YE4o27dXfIlYuYVNNG32CnFH s54nSgZaasPKN0Zpndw0CH9cepZcXw3Xq1+63HgLSTleHwRBGAfueGk4+FH63AQkq/AU zl8gA97IvYc3cHOFymbcBRpar6ktxChYzRI7G+tG+e4xOSTSf7DeVkXJe6yLMU0+WKJ8 QtGKOoZgAMEg5CN7R5YF4QAWi9AKfNnfHU8uvsJbWC4Dy+vkrWkzls393TJfTjxFd/Xj tshQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=MZKt7QG8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si14416295pfi.192.2017.07.04.04.44.38; Tue, 04 Jul 2017 04:44:38 -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=@linaro.org header.b=MZKt7QG8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752052AbdGDLoh (ORCPT + 6 others); Tue, 4 Jul 2017 07:44:37 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34200 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbdGDLoh (ORCPT ); Tue, 4 Jul 2017 07:44:37 -0400 Received: by mail-pf0-f169.google.com with SMTP id q85so950334pfq.1 for ; Tue, 04 Jul 2017 04:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WT6eQp1wQOtxqsiqXXZZhm2p1EXbW+ML1QxqZHXb45w=; b=MZKt7QG8oGA/5vpXbcITKdqqoKxvUvAJkj42lf3WYejhRLRd2g7nTJ0puqZNQf3WMk qU/XmShFIGRbF5zjAwUT4tI3otNr9iITSkvXkkCjEhm59ZMCo4VICLbkrde5L0szfGwP 3AwWMHSWfR+weFn/Ma4BP4AXHAn6SSTiAEjdQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WT6eQp1wQOtxqsiqXXZZhm2p1EXbW+ML1QxqZHXb45w=; b=PSK/5Mf+q0Jq9klCVDtCgme0Cq1JWf4XpxP3ZwyzmPJg3nbNp7L5WP1Yx13229ZGfy Ba6POmMS2GgmQDysTyAWjERdmliNmxRi2kyoaOGE73yV2XUVG4JrWJjM75MXmm9KI5Ex FcZ2MiUi0fCFKetwfzN/V+tCivoCGkxOwucSsqXMI70h05MKzmWdrUfvtEzSIH+UBjvf ozMKKhsD0qEw4p+IUcSiEQ1aBiZpbTWjYv1ejIzLMreoMdWU27+LVrZoOEi9jt8rnvZ4 q3DnITFU+H8ApCsATmauAGZVTB8jYyrgVJh35meAd6xeX10G1ZLQv/OBDiCiZuB6O8E5 VK+g== X-Gm-Message-State: AIVw111yko+7bwDS19g9x3OMMD3KqjReIlq9rM5kHQqPfOmGfcvZZlsJ z9sKdNfZdTTM7wxd X-Received: by 10.99.0.65 with SMTP id 62mr14996533pga.115.1499168676515; Tue, 04 Jul 2017 04:44:36 -0700 (PDT) Received: from localhost.localdomain ([106.51.234.165]) by smtp.gmail.com with ESMTPSA id t83sm39782750pfg.91.2017.07.04.04.44.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:44:35 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , "David S . Miller" Subject: [PATCH for-3.18 1/5] bgmac: fix device initialization on Northstar SoCs (condition typo) Date: Tue, 4 Jul 2017 17:14:20 +0530 Message-Id: <1499168664-25980-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> References: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rafał Miłecki commit 21697336d46b71dd031f29e426dda0b1e7f06cc0 upstream. On Northstar (Broadcom's ARM architecture) we need to manually enable all cores. Code for that is already in place, but the condition for it was wrong. Signed-off-by: Rafał Miłecki Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/ethernet/broadcom/bgmac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 05c6af6c418f..7f34d91acdb9 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -1412,6 +1412,7 @@ static void bgmac_mii_unregister(struct bgmac *bgmac) /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */ static int bgmac_probe(struct bcma_device *core) { + struct bcma_chipinfo *ci = &core->bus->chipinfo; struct net_device *net_dev; struct bgmac *bgmac; struct ssb_sprom *sprom = &core->bus->sprom; @@ -1474,8 +1475,8 @@ static int bgmac_probe(struct bcma_device *core) bgmac_chip_reset(bgmac); /* For Northstar, we have to take all GMAC core out of reset */ - if (core->id.id == BCMA_CHIP_ID_BCM4707 || - core->id.id == BCMA_CHIP_ID_BCM53018) { + if (ci->id == BCMA_CHIP_ID_BCM4707 || + ci->id == BCMA_CHIP_ID_BCM53018) { struct bcma_device *ns_core; int ns_gmac; From patchwork Tue Jul 4 11:44:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106946 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp897749qge; Tue, 4 Jul 2017 04:44:42 -0700 (PDT) X-Received: by 10.98.147.19 with SMTP id b19mr14850728pfe.145.1499168682740; Tue, 04 Jul 2017 04:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499168682; cv=none; d=google.com; s=arc-20160816; b=mt/rimzHaG3n1h+sC9JK26aLaob4gDkdaJ4jP7CnMq+ikDDmcZZ0h2OUEyHAPQX9xg 16v7BL7UXNfTmNqZu3bbXvLVQcTJsU93V84CPH/bHY9okb/8ti2lmRpC8uZdR1KALf1L WDo7D+ZoWtX+pqbiesJE+ziQumScOLXnoConwFf/5kkDavgyWGbatvV1+kSIxVela86Q QoFYloFi64nGVuiqmAKkK9xh+znV4TzTrhYOv92tPwKkd7dXYFSFDZ10m5n0uWKkAr33 8ReBBom0+j44896LORUoNBQHJA25SZzUpJC6nOJZevFnYXARzWYYJTDOzWi45/rpDlfB yctw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PJLSpsO8fwCL6ypS0E99+/SHl2JItQcRvQmx2mM0Eic=; b=dXPJ5Tv4wap+TpDL0OasmFLLdavWEgbbU9BdAKa6zqMJ2yJKYPjC00VljFSV/2Qlu0 PAYZnUA6aJ7yAfEYFXGpWqV/UO5qXC+tjafac38aOwXJvbamFA2vro/kNwNdBmWJobTJ k+DPgDIBxSbhK1td6qgHK109ZhxrFBtR/PepP9V10FSU0HZcbkCpyifgFbFrpsMp6bIM dV6/Wzt5dDOHvo8K26JvRFTDlwmG9WBRz0R3CL8TJdsJzhDADP0vA/zS44VqkeoE8xsO LNrfXMz+MUvbunsFJ+kKaJPGIKCHJAi+VKV8QV34C26gmIbcjoV/UDz7QW8i6V3Ir45d Y8Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=WF3Snln6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si14416295pfi.192.2017.07.04.04.44.42; Tue, 04 Jul 2017 04:44:42 -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=@linaro.org header.b=WF3Snln6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752067AbdGDLom (ORCPT + 6 others); Tue, 4 Jul 2017 07:44:42 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34216 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbdGDLol (ORCPT ); Tue, 4 Jul 2017 07:44:41 -0400 Received: by mail-pf0-f171.google.com with SMTP id q85so951045pfq.1 for ; Tue, 04 Jul 2017 04:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PJLSpsO8fwCL6ypS0E99+/SHl2JItQcRvQmx2mM0Eic=; b=WF3Snln6FeIianh2+KX8F4LOIZvsRym5UYb7MgTm0PJxkmQOTcn7sSsBoRVK/KS8Me qVkhLkUsWP4WMFQt77a+u8Guckf/NSMImSrRzsIJwvmtRYqRvjjN0gMO8wPaCOKFJsWY QvGcMtOuBx/Emqt1ELRhNOh8egUs/mxbeTAGU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PJLSpsO8fwCL6ypS0E99+/SHl2JItQcRvQmx2mM0Eic=; b=Mg9TkhY4GSTKBq0t+I7LMxo7GO0TEDHU8s04fmuX1Zfo0iWZNoo0X36wXgUuQuucmb O82IVQv++ybyRA1FfGgR9ZaUttXshjFOULAT2xi13wu68eS7klc5RofCSzDw12FlLsXG 5lCzFLhM1Uu5AHDD11ogcrUPlW8h7s8hRAnzR+fL9gM3ayoDIiWQh4vW0KuuHUR2uoR/ yjsukhzrCSKiH7zOGFWyKce2+KNq6C7qpHgbjmYZfuYd9aNq1E34YUF0YsCWSmhXqnq9 q8CDZ7xt5xXahqYiIXYQ8G0KSgOuD9c41dYFO2dYng7kk7zC2Bs/+vCxeO5mRjb51H1W tdIg== X-Gm-Message-State: AIVw111m1pzdLZpUx02JMjSLuPC11nP7kZgdIEWkdNupxNKeLB1tONYh CgcrA+Ki+L1DaqX5 X-Received: by 10.98.43.80 with SMTP id r77mr14741429pfr.92.1499168680738; Tue, 04 Jul 2017 04:44:40 -0700 (PDT) Received: from localhost.localdomain ([106.51.234.165]) by smtp.gmail.com with ESMTPSA id t83sm39782750pfg.91.2017.07.04.04.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:44:39 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Felix Fietkau , "David S . Miller" Subject: [PATCH for-3.18 2/5] bgmac: add check for oversized packets Date: Tue, 4 Jul 2017 17:14:21 +0530 Message-Id: <1499168664-25980-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> References: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Felix Fietkau commit 6a6c708469c9e10fd87adcc3abff164270538d62 upstream. In very rare cases, the MAC can catch an internal buffer that is bigger than it's supposed to be. Instead of crashing the kernel, simply pass the buffer back to the hardware Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/ethernet/broadcom/bgmac.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 7f34d91acdb9..54a7da860a2d 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -373,6 +373,13 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring, break; } + if (len > BGMAC_RX_ALLOC_SIZE) { + bgmac_err(bgmac, "Found oversized packet at slot %d, DMA issue!\n", + ring->start); + put_page(virt_to_head_page(buf)); + break; + } + /* Omit CRC. */ len -= ETH_FCS_LEN; From patchwork Tue Jul 4 11:44:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106947 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp897802qge; Tue, 4 Jul 2017 04:44:46 -0700 (PDT) X-Received: by 10.99.181.66 with SMTP id u2mr15228166pgo.83.1499168686571; Tue, 04 Jul 2017 04:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499168686; cv=none; d=google.com; s=arc-20160816; b=YYurud3FgWDq/Vi4KN7dOjGUZH/eZ3Izz/9oMdmYCQUvVxVwalh0ml7t+758FbKksW FMItqK6YqCnjNxHkFGrKPXPeNBFhclViBVwnzSjiYpRG2kl+KbXw0y7+xxS/IjtrKA6f LlPXRa+kwmkpFS7IpUOZWuPrlhWjR3rCE6bBc/ZbMBjVYKPBwpncVxqctJDeBDt4VOyZ SiQW6EnrgIAE6jhnsAxddR872PivBuOYcsnk6YUz1uBnlVzxmwe8h9WLwrqwOoKncR7Y vOBVpVwb5gp4me/m5rzqToqOvbvvKsh95TOlPlABoKqa6ZKHT4xhtp2cYW94UJRAk0EZ 0ddA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Ll5mQuVKYeHGae0PeLX7GB7g5hUv55r1yemAKf28CW0=; b=ouTBFMjBg1CAyoXPcslfHXdxyKVonaOJnBpwnXzOLaLYY3Lv/U/sK1Fm0tyvkG0veo 0EvZAtZwVa3rb1LmB2J4WJNbeDWd4zHDqUnQc90EMwETq/O1x7Kvci1a+zS4ViSh1CUZ sybqjY+MWhF73KiWXlMcg3OfFa+4b4XAeih2wAMmw65Wxt1bSNAg/kVzS2LE9gnaq+dn XApeaPubjq/sk+61REoJLCsrMFFqUt9rbBL0rojTJtZ5m27t7eFGPJRISdoGn80x22Yl BpMZ8vvXKTW2lKX8A1byDGfzK3RBrsiauUhRGeU1BufFqtRv1czUt9A7AO5KxZy1AlXi DRiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Juh3UCwf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si14416295pfi.192.2017.07.04.04.44.46; Tue, 04 Jul 2017 04:44:46 -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=@linaro.org header.b=Juh3UCwf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752099AbdGDLop (ORCPT + 6 others); Tue, 4 Jul 2017 07:44:45 -0400 Received: from mail-pg0-f44.google.com ([74.125.83.44]:34211 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbdGDLop (ORCPT ); Tue, 4 Jul 2017 07:44:45 -0400 Received: by mail-pg0-f44.google.com with SMTP id t186so109750283pgb.1 for ; Tue, 04 Jul 2017 04:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ll5mQuVKYeHGae0PeLX7GB7g5hUv55r1yemAKf28CW0=; b=Juh3UCwfj9dhsm/p0jN4TMh0CDEljtUi+fmZ0cdxj3Q8cagwVGUX4Iki8206NvSZg9 M5GwDHTy/Bq75IDyJJgwDuqFJVCjvfoHTkIlaeG0s6Je0DYnzb2DNxyYOUfUB1R2xbKI 9e+3mhN1dWVUiy7Cx0p0bReBFGRbrBRWw++Lg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ll5mQuVKYeHGae0PeLX7GB7g5hUv55r1yemAKf28CW0=; b=hg6FEujwLG2TqPqP/+LtsF/tAVWUPa5xHMn9lNiJydJ6p8XcnOLkN7yQU7iEu2nsYY Of1vjDje2wB3uar6WYLTO1iPQD+h0bdAcqGBBjDIv+12789oqH1ihPBnBtHtRio4BEu2 NGoeHt8TRdR0G8LfQ+hgViZIyAO0VFVWiggTM31wRVonVxBNy4KYIAsKsRcFx/Iu5g/G x4lj6tPRV49pr6z5Fdj2KQ54YKpVfw1HvSl9r9vP3yejgWFwoyDPpD2CoNjDDDcbHURk Fvtdmlj2dsvuAevP4PXpo6sH39wksIJn6lcia4QbievncDxVcA+s7MmPP9/T5YhidT4h McTw== X-Gm-Message-State: AIVw112od4Hychhyf7Ye7pTntJuRm4kAvtWG8Zk06NOf3UeDLrrHhxIx hxqXEn6ulFZsN6xRLe5CaQ== X-Received: by 10.98.84.199 with SMTP id i190mr14707257pfb.69.1499168684536; Tue, 04 Jul 2017 04:44:44 -0700 (PDT) Received: from localhost.localdomain ([106.51.234.165]) by smtp.gmail.com with ESMTPSA id t83sm39782750pfg.91.2017.07.04.04.44.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:44:43 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Felix Fietkau , "David S . Miller" Subject: [PATCH for-3.18 3/5] bgmac: reset & enable Ethernet core before using it Date: Tue, 4 Jul 2017 17:14:22 +0530 Message-Id: <1499168664-25980-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> References: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rafał Miłecki commit b4dfd8e92956b396d3438212bc9a0be6267b8b34 upstream. This fixes Ethernet on D-Link DIR-885L with BCM47094 SoC. Felix reported similar fix was needed for his BCM4709 device (Buffalo WXR-1900DHP?). I tested this for regressions on BCM4706, BCM4708A0 and BCM47081A0. Cc: Felix Fietkau Signed-off-by: Rafał Miłecki Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- To be cherry-picked on linux-4.4.y as well. drivers/net/ethernet/broadcom/bgmac.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 54a7da860a2d..2b58df0c4f48 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -1438,6 +1438,11 @@ static int bgmac_probe(struct bcma_device *core) dev_warn(&core->dev, "Using random MAC: %pM\n", mac); } + /* This (reset &) enable is not preset in specs or reference driver but + * Broadcom does it in arch PCI code when enabling fake PCI device. + */ + bcma_core_enable(core, 0); + /* Allocation and references */ net_dev = alloc_etherdev(sizeof(*bgmac)); if (!net_dev) From patchwork Tue Jul 4 11:44:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106948 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp897874qge; Tue, 4 Jul 2017 04:44:50 -0700 (PDT) X-Received: by 10.98.27.73 with SMTP id b70mr14690133pfb.42.1499168690654; Tue, 04 Jul 2017 04:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499168690; cv=none; d=google.com; s=arc-20160816; b=ffpc/nIqKXgo3PNiYsa6QapmwmCeSix1jD8w13GK85mwXJquggS3hYUUMegtHevvM1 TXReR7hfetEo92kpkjCUbFIRbhnZzo8+3lUKuRMpukQbukMNQTNLNx2A5GZm05z25ROn qvC0MpPvlw95rpzEPjcUOf2tvCLiMCdcDbGLuVkXBZqJ+/KScaYUhcSFYsApsJwCXtEO 8ZzYbXM6K4lDY7ytD9AjpELmfqK36gdhXLvtynWceTOzjErdwliKEVqok3Rqvs7FegFV Dw1S2EUMkqFECirP2gVXNKsLbAD6muCC1ygiTa6ZS+aWvHww0A8xVDKYZJKV982DPk5C 2HDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zLeAV6js01dIatCeo30cAABzLRqFOHAVuaeh8GxhRB0=; b=My9xjYaAWFS9U0Kok4iYAjW0Mn8kuPA5pNyRhnKL9eP3Kmjj3q9b6KsPNAFBlYwiPD dfYk7AL+3U9YW+Cxr8eImOM6l99YD+u2Srinu8MOfw1t/GLNiqWiMyGhi6uDqGweVUep a1/Wcor2UzfvUaaFe8eWrKmVhdyWpS7hJISJA/nwciJrmOpVIH3VUnSfI8+3a7CMhoJH 8rPObNPyc6zYHyu6o5v6qf2yqiZVFEEj4kIeYgqe32gi+/mplqVbJG4/D8iXub9wDlQf NrglCqCDsjqoUSYJNzik8KDDs19b/Pv7pkyhPFsNJtKXfD0HKUf4SXWDD819ieVyHTow 5HEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Wl5w/BSi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si14416295pfi.192.2017.07.04.04.44.50; Tue, 04 Jul 2017 04:44:50 -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=@linaro.org header.b=Wl5w/BSi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752108AbdGDLot (ORCPT + 6 others); Tue, 4 Jul 2017 07:44:49 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:33374 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbdGDLot (ORCPT ); Tue, 4 Jul 2017 07:44:49 -0400 Received: by mail-pf0-f170.google.com with SMTP id e7so114460988pfk.0 for ; Tue, 04 Jul 2017 04:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zLeAV6js01dIatCeo30cAABzLRqFOHAVuaeh8GxhRB0=; b=Wl5w/BSiDXEKW1lPPTQT5CIAiBFNp+brC/1nKc0JdglCmOfSL2iIdkQc/6RUUblsxp lOTOETYtYrHgbh0aCqhyBeYB1RogtW5pUrF0sB+vLXfu79gDf2m6jnevR5uAiyKuy37k e9ki3jELEtN2m/yctVrXd597zZ1yH6Hk6LkNQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zLeAV6js01dIatCeo30cAABzLRqFOHAVuaeh8GxhRB0=; b=ZW7z7MB15ZyvMT3ntg+zBP502rIUdFg/DSdFIjFmCCAu1vHIiHgdD8Nsiq3RsBqoeX IzyRDSwUq8tH3oDLfoaXdKgR2m8w7eV7c3I3t08mmy/0c2bv7BdGEM+X7M23AoIGyEEp CYyHl0gK55VSJ/zBnq3Jg2Xlin1htOcw4/nQi8acIT+h315vKuKlS+52wzVQmOYGXdkl vs+qGSw06h8CnlIGHSpvbyI5RUBwJKv5buRkX3enu9xz5gFXFWgCP0VgsLbSoLzy3OTM iVonelAIGLD0e8+pcHBUUTHqUbMwNm6gAsQLiJvGGSI/zWh9y9MHneOlanhI18cLs1Sx tqRQ== X-Gm-Message-State: AIVw113+ZLOWRpHH/NpmqieBPHf4dDGBsuNSNtvybEGGYc+ASSSJJZqM IJHHUYM3gHSjbYuM X-Received: by 10.98.113.65 with SMTP id m62mr14830617pfc.150.1499168688577; Tue, 04 Jul 2017 04:44:48 -0700 (PDT) Received: from localhost.localdomain ([106.51.234.165]) by smtp.gmail.com with ESMTPSA id t83sm39782750pfg.91.2017.07.04.04.44.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:44:47 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Yousong Zhou , "Maciej W . Rozycki" , linux-mips@linux-mips.org, Ralf Baechle Subject: [PATCH for-3.18 4/5] MIPS: UAPI: Ignore __arch_swab{16, 32, 64} when using MIPS16 Date: Tue, 4 Jul 2017 17:14:23 +0530 Message-Id: <1499168664-25980-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> References: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yousong Zhou commit 71a0a72456b48de972d7ed613b06a22a3aa9057f upstream. Some GCC versions (e.g. 4.8.3) can incorrectly inline a function with MIPS32 instructions into another function with MIPS16 code [1], causing the assembler to genereate incorrect binary code or fail right away complaining about unrecognized opcode. In the case of __arch_swab{16,32}, when inlined by the compiler with flags `-mips32r2 -mips16 -Os', the assembler can fail with the following error. {standard input}:79: Error: unrecognized opcode `wsbh $2,$2' For performance concerns and to workaround the issue already existing in older compilers, just ignore these 2 functions when compiling with mips16 enabled. [1] Inlining nomips16 function into mips16 function can result in undefined builtins, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55777 Signed-off-by: Yousong Zhou Cc: Maciej W. Rozycki Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11241/ Signed-off-by: Ralf Baechle Signed-off-by: Amit Pundir --- arch/mips/include/uapi/asm/swab.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/arch/mips/include/uapi/asm/swab.h b/arch/mips/include/uapi/asm/swab.h index 8f2d184dbe9f..23cd9b118c9e 100644 --- a/arch/mips/include/uapi/asm/swab.h +++ b/arch/mips/include/uapi/asm/swab.h @@ -13,8 +13,9 @@ #define __SWAB_64_THRU_32__ -#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ - defined(_MIPS_ARCH_LOONGSON3A) +#if !defined(__mips16) && \ + ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ + defined(_MIPS_ARCH_LOONGSON3A)) static inline __attribute_const__ __u16 __arch_swab16(__u16 x) { @@ -65,5 +66,5 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x) } #define __arch_swab64 __arch_swab64 #endif /* __mips64 */ -#endif /* MIPS R2 or newer or Loongson 3A */ +#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */ #endif /* _ASM_SWAB_H */ From patchwork Tue Jul 4 11:44:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106949 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp897916qge; Tue, 4 Jul 2017 04:44:53 -0700 (PDT) X-Received: by 10.84.232.72 with SMTP id f8mr15766194pln.87.1499168693902; Tue, 04 Jul 2017 04:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499168693; cv=none; d=google.com; s=arc-20160816; b=F2iNCh6Cmt9ohvdL9gLajQBICKPb71dvhJRgFfGVhc0YmAWidweVr4BLSfocvU1Mwm a7UYkcF4NseYFn4JzgHnL1p2pfUse0hzDJbI8fFbQwSay+N/Wu/DqXS7Ml1wnFvq2AKo rz+UisAACrBr5jS4ARr6kbgcjK06T5lyxN8t9Yb9tgrORozhNos4qE2bt+dMVkvGpfbJ rpeIHbOD9KZSVQpSlD7Cn8Sv+WFDEQi/VxuYFzoauqF29jkFJjoUmIkzmuu58zL0ATe5 myWX+TjDay3uQdPy5DKFzZS+kVyzO4y8/yOGbSCqjJaCt2KtCOmZczpthmbRi9OksC/M eTOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=4LZD4q28AIURnd64G402xvZ7zauhabTtSicZCcsJUoc=; b=DD8IC0LLI7a+urSvWAk9nqfXGk5Shy/PryiFggsJ4GVNcvpHpLH0mHSv4h3EYV5U2Y IDyAmIg5Uulae0necB2UvR/BYDopDvfszY5HKBthX9V3Hv9nwvNggRKa9/g73tDKu3j3 W6zbcBmXMVxwCXq34ky90gVLkiO7ka10yec48k4ecLauf1AqqFEODTsg9HweKYokSVGv FNwYPOsvnKscdwZYAMu+Rrm+I9rEBi6jzYPsdAmWQ3PpCzN31wsb1OADfmMWwppa69xI Zkyf31pB//6Cze7GGHLSkA2ZTN9zqsnPM/7RICdw7lwDXRdEUT8NjpeMI/WCo3Vxf5ce 7B0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=fQyXge4R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si14416295pfi.192.2017.07.04.04.44.53; Tue, 04 Jul 2017 04:44:53 -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=@linaro.org header.b=fQyXge4R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127AbdGDLox (ORCPT + 6 others); Tue, 4 Jul 2017 07:44:53 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:34238 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbdGDLow (ORCPT ); Tue, 4 Jul 2017 07:44:52 -0400 Received: by mail-pg0-f48.google.com with SMTP id t186so109751625pgb.1 for ; Tue, 04 Jul 2017 04:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4LZD4q28AIURnd64G402xvZ7zauhabTtSicZCcsJUoc=; b=fQyXge4RciZCIRHReGRNlBoEtT1pizXu//1NC2kMFwF4MVQIpNg+o+Uh+6ZvGZIROW HOZYnPSPPzvs1ixx4mMC31GRmyBCSOfDtkxoFCMFIwin2QbqTSyHePnKM2u8zI61fYJF V2+1a9M1r2Y/yM07xOLoa2776XyJegh3W/Zds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4LZD4q28AIURnd64G402xvZ7zauhabTtSicZCcsJUoc=; b=i0R/iq19bLrbwf2whNRLGK3+uq/Gcg7nEC5UJgnu6JUI2e9BQqWu/OOIIx0iYK9Pit anHtc1KrXFfHM0g44+PBxrxaNDiawZrx8R0rUdvGq/NZFCWytfrQicAhbLXwGEhs6J8G dj39tVhIcquxRTSdoKEiCsk9EGRNC8pNkcT/hivIuLafqX4sDFfvy3mo4gCU4MWxA3ev ITiWkU3nCDpN0F9LeBT+yXG2+es5qxemdT+HZDR96j5FN2BSxga1KSC0261xQLARwqxK wPXgwlNXMCmz78nQlE/RAq5qenaaz4eQfuKgAzpfo/NuTbjZ3Bw1OYJRJFme4nDCcGIA t4PA== X-Gm-Message-State: AIVw113TYpLfKSt+vnN9wlDJoP6P2DNCd872HanYiafwn4MW2VNZy7El qqomQjdf3scRGsaw X-Received: by 10.84.232.15 with SMTP id h15mr15950809plk.168.1499168692047; Tue, 04 Jul 2017 04:44:52 -0700 (PDT) Received: from localhost.localdomain ([106.51.234.165]) by smtp.gmail.com with ESMTPSA id t83sm39782750pfg.91.2017.07.04.04.44.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 04:44:50 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Jonas Gorski Subject: [PATCH for-3.18 5/5] usb: ehci-orion: fix probe for !GENERIC_PHY Date: Tue, 4 Jul 2017 17:14:24 +0530 Message-Id: <1499168664-25980-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> References: <1499168664-25980-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonas Gorski commit db1319e166c5e872c4be54eac4e47454133708cf upstream. Commit d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") added support for optional phys, but devm_phy_optional_get returns -ENOSYS if GENERIC_PHY is not enabled. This causes probe failures, even when there are no phys specified: [ 1.443365] orion-ehci f1058000.usb: init f1058000.usb fail, -38 [ 1.449403] orion-ehci: probe of f1058000.usb failed with error -38 Similar to dwc3, treat -ENOSYS as no phy. Fixes: d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") Signed-off-by: Jonas Gorski Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman Signed-off-by: Amit Pundir --- drivers/usb/host/ehci-orion.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 22e15cab8ea5..8de069abd15e 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c @@ -226,7 +226,8 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) priv->phy = devm_phy_optional_get(&pdev->dev, "usb"); if (IS_ERR(priv->phy)) { err = PTR_ERR(priv->phy); - goto err_phy_get; + if (err != -ENOSYS) + goto err_phy_get; } else { err = phy_init(priv->phy); if (err)