From patchwork Tue Jul 17 08:19:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142118 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3369001ljj; Tue, 17 Jul 2018 01:19:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKmv9A87skukrbpLHPkrEWKp2HvjhOun/pKRslfgpcsN95yEPIMmWxxe7/gt1TdFWDY18n X-Received: by 2002:a62:700a:: with SMTP id l10-v6mr664771pfc.71.1531815570657; Tue, 17 Jul 2018 01:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531815570; cv=none; d=google.com; s=arc-20160816; b=UOC8w9eqLY8bNzIHD9Yx1b7e5jYD+eyNHg39HIDVekBvT4DjcTSPSdzcHdRBLBCrlk yz/mRiN1FR+wdo9MaO5W+tJZsccyGXp0OylP6GASc1LTqxStvh6QL6OX/3t3V3hyIbj5 9B4VzRJJYUgQRWnGOPC8pZ9qe5mLb+GWV/kL08Syhwxw0GvG6/QjACQEMnd1Xa0i5JX4 pArSt3+swlG3r4VTpbsV9D4WLKLQfLlIGsBfNznxXDRyiOxnZ761SYOPX1t6omCcz4X7 EzIiE99F7yPzcJm3ZZACEa9yXUYf05f7FIpn6vpQZz1guYgbqFqsphp0V4zMwns00mcf J4DA== 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=7xRLEybNMjlvvNefoO6yHuidE/cF93NioAPk1EdA6lY=; b=jiFvK5iyPIH/pGZDWkD6rnyBRcI5A7p6PUIbB3SrutUIdCWnhaP3PocrOcm1E4FCFr JrE6s0dwqFJ6TCzIqugrgPhyGfaYmJJUHvla3a/QSdWB0nyTAQiB205XdkN+JEcTv8bL ce4oysXdJZnX7dt7SQkfSbcTw1PFXP4w1QxzrWlhCPsG6bCQ8HRsbOnY95cS2k2A9R91 qMfNLJ6MyEvcyCN/mS7cen6xzVAfRlqNLrQMMsZWWaGn/3nMURmDfEiSMsEh4JZqBRcN L7+hdbDm6KSjrKE+ixpMdCWKqYxSpLk74OSpcrFrtX4PW7TQBUUCMh5ZZ8+QTdTS6IjN 60dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zx8T8Cmx; 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 37-v6si391179pgy.118.2018.07.17.01.19.30; Tue, 17 Jul 2018 01:19:30 -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.s=google header.b=Zx8T8Cmx; 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 S1728067AbeGQIuy (ORCPT + 13 others); Tue, 17 Jul 2018 04:50:54 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:39163 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729720AbeGQIux (ORCPT ); Tue, 17 Jul 2018 04:50:53 -0400 Received: by mail-pl0-f66.google.com with SMTP id p23-v6so135173plo.6 for ; Tue, 17 Jul 2018 01:19:29 -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=7xRLEybNMjlvvNefoO6yHuidE/cF93NioAPk1EdA6lY=; b=Zx8T8CmxCITsgEKnb+xkRWsSd4TpfskmdCm++PMkQJLj0RYKOX9PsKS41PNy2lc5V+ 2qVPo42TToB3vD5x9Vly7ML7f9GQDc+wkEXu/5GAOtILOKqmD9rOjAP7R1WZcYxRrfVg taDr/LM6CXPRoG+PzIHBlYo4eoe2Vj6UoUQis= 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=7xRLEybNMjlvvNefoO6yHuidE/cF93NioAPk1EdA6lY=; b=ZlBk3D3Zj3Uy7F/H3pJgiTlEWdB4I/WH7eQP6EhoBuzwRKh9Pdlrihp/2+qa6vREuJ X+9xpFScp8PXONwmZ2smjFtFBn0cMoBAwp0NGMW3xr3NADykRHwB1I3XqtKOqQu1dS4y SPP4jwJ3UQ7cvs/N4H/U9iyskMyKy3G8eFNaoVRGWuu1iIcefJYVzmizc1mPDoMEVPFz PFideTLEpJCyZPoIGJ1Xj/4WoWwvhaopYUsVqHOQHqOP6jKuqjmP4S4pXll3lv3cE/NR 01asz0JcHwSkG3hsc0jFyA81hyxtUPfDNp0ENgzK/nfQ2kARqtLc6h0MFrbDqNAFiHO6 c2Pg== X-Gm-Message-State: AOUpUlH4RylpbT3jGMyCtFELlkZZH6KaQ9cw4PNvSqXtL8AueHqj7KWU 2CabNT26sBlWB22I0jWu9+S4Hw== X-Received: by 2002:a17:902:5617:: with SMTP id h23-v6mr658545pli.324.1531815568655; Tue, 17 Jul 2018 01:19:28 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id z2-v6sm740263pgv.12.2018.07.17.01.19.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:19:27 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Heiner Kallweit , Cyrille Pitchen Subject: [PATCH for-4.9.y 1/5] mtd: m25p80: consider max message size in m25p80_read Date: Tue, 17 Jul 2018 13:49:14 +0530 Message-Id: <1531815558-20002-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531815558-20002-1-git-send-email-amit.pundir@linaro.org> References: <1531815558-20002-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: Heiner Kallweit commit 9e276de6a367cde07c1a63522152985d4e5cca8b upstream. Consider a message size limit when calculating the maximum amount of data that can be read. The message size limit has been introduced with 4.9, so cc it to stable. Signed-off-by: Heiner Kallweit Signed-off-by: Cyrille Pitchen Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git drivers/mtd/devices/m25p80.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 9cf7fcd28034..16a7df2a0246 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -172,7 +172,8 @@ static ssize_t m25p80_read(struct spi_nor *nor, loff_t from, size_t len, t[1].rx_buf = buf; t[1].rx_nbits = m25p80_rx_nbits(nor); - t[1].len = min(len, spi_max_transfer_size(spi)); + t[1].len = min3(len, spi_max_transfer_size(spi), + spi_max_message_size(spi) - t[0].len); spi_message_add_tail(&t[1], &m); ret = spi_sync(spi, &m); From patchwork Tue Jul 17 08:19:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142119 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3369046ljj; Tue, 17 Jul 2018 01:19:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcZJh0gevPTs2T785M3buTr1CI5dsDwETPgOnJeJvItwQi1tF6bKLYiJfjU3N46eZ/JmW5m X-Received: by 2002:a63:5964:: with SMTP id j36-v6mr663659pgm.222.1531815574093; Tue, 17 Jul 2018 01:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531815574; cv=none; d=google.com; s=arc-20160816; b=zrVJ/TB1ECGno3JLAJNVsWvdiLCMOYu4QGMYKDRrhH3I0TMABjzp7JCxQIJMTtA9gT x2M6qJw1sf0oQlRY9x5KEKFfGDBRjwQFH1QLW7pFkYIu3MjNCb0MpfJOzT66CvReR/R4 IdVamRFURgV7xCixsVIOiQEZzES2txE9ERkFAEGXMWmxhs36MY50dbq15QnM2vvaX6FS 7kPVQHzs4SLZj2cKuwGm01hiKdLSHChRsBlWBHU1gyPxc4ppNwi+QBCUV4ObAdP/NpZF eJhHRiL5vI5TWtXLAiRnEVlWoTrtJM3c+h7tGgoz6g3lidDmqNvGRKK21LAMgGK08Z8m QJ6A== 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=8b+3EqX2oZIHwT/cEWUkKEK+RbYqm2NrXD+1TzXyh5M=; b=xmPdtipAtfV+FdyBuRryI/761gQac9VUSiLMczTRa0wPIBDY0bkPwH0oxbYHUF2l3b /9qqRoC8JNL1BeoVtKgQesbgWpBgu4SIZ8qzAxWGHv6e8QKx+pSyD6Eq84XM6OlINx6M EI8+DaTTs0uuwcXfkBztBL7sYjlKYozRcQiWxviP5Mj/HcnlXH8E1pmw2sxBYl3ifhKt aAd4i28pQ9Hp1h0sY1/oLHMnnZn2aDHOmDlECu9YXiEvlSw2jb0r553RUwO3Ad3BtBaK 6V8whqx+X0xiVo9wApHmpoPeNOFkzs1O4+5528RproZI5IyWkBYHGFXHD3E6s18/Z7KI 6haQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=diDEAlh6; 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 r65-v6si381493pfe.298.2018.07.17.01.19.33; Tue, 17 Jul 2018 01:19:34 -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.s=google header.b=diDEAlh6; 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 S1729720AbeGQIu5 (ORCPT + 13 others); Tue, 17 Jul 2018 04:50:57 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46005 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728843AbeGQIu5 (ORCPT ); Tue, 17 Jul 2018 04:50:57 -0400 Received: by mail-pf0-f196.google.com with SMTP id i26-v6so137584pfo.12 for ; Tue, 17 Jul 2018 01:19:32 -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=8b+3EqX2oZIHwT/cEWUkKEK+RbYqm2NrXD+1TzXyh5M=; b=diDEAlh6sY5+LuSJD60Q/GkvflFxUwcIv72gU3/YxmGTg9SCDc8xH4Ir2fq2WfFGKs 8wFsVfP2DOWerR6igL4q5KSZueAvvYTLN0LZWnplPtGqq9/ggsIvniDBcyoP7zEdF8Do N28zGAkND51tSWYO23GwYqWamMjDXQc1/CAAg= 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=8b+3EqX2oZIHwT/cEWUkKEK+RbYqm2NrXD+1TzXyh5M=; b=TUceNM/Hmq4oel2EScmK0Tdcis6Yxur+doqvrVBIrIaqbJJ45OCxSrdUIGkvMkMIy2 mfjs8zTzxnM5Ms4m4O057wFQOi/NHfLb+xOeRdBGCpDa2/HYfeDdmLoHKsH9d46D9kj2 DuZj+ncrnOzLnhiGvTkhR8aHNfjlWOpruEMlOM29e4H+V4rxH96+nqdz6IKM4aLfctuM N4RlXLaUJlQSz7wLTIzEMrZa2XKfyCqLEt5opNuJlU0BjxR2g61XuGWqiKQ8KfxXM0bN CNoJwgsLniz/AMi93HsayF0dir8+9DJu/JPxqbmiw/F0Pae6vz7etwtAhq3fRYf4miFB RN5g== X-Gm-Message-State: AOUpUlH90vfrXM0myu2Wy5FUFeqkOXGIENOBFPC+1+JwBx2i6vVywHY9 yxotsLFMkkNlqdKi+uBRO4NDrA== X-Received: by 2002:a62:5cc1:: with SMTP id q184-v6mr661910pfb.241.1531815571848; Tue, 17 Jul 2018 01:19:31 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id z2-v6sm740263pgv.12.2018.07.17.01.19.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:19:30 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Jonas Gorski , Mark Brown Subject: [PATCH for-4.9.y 2/5] spi/bcm63xx: make spi subsystem aware of message size limits Date: Tue, 17 Jul 2018 13:49:15 +0530 Message-Id: <1531815558-20002-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531815558-20002-1-git-send-email-amit.pundir@linaro.org> References: <1531815558-20002-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 0135c03df914f0481c61f097c78d37cece84f330 upstream. The bcm63xx SPI controller does not allow manual control of the CS lines and will toggle it automatically before and after sending data, so we are limited to messages that fit in the FIFO buffer. Since the CS lines aren't available as GPIOs either, we will need to make slave drivers aware of this limitation so they can handle them accordingly. Signed-off-by: Jonas Gorski Signed-off-by: Mark Brown Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git drivers/spi/spi-bcm63xx.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index fee747030ee6..caa733ec405c 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -428,6 +428,13 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } +static size_t bcm63xx_spi_max_length(struct spi_device *dev) +{ + struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); + + return bs->fifo_size; +} + static const unsigned long bcm6348_spi_reg_offsets[] = { [SPI_CMD] = SPI_6348_CMD, [SPI_INT_STATUS] = SPI_6348_INT_STATUS, @@ -541,6 +548,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) master->transfer_one_message = bcm63xx_spi_transfer_one; master->mode_bits = MODEBITS; master->bits_per_word_mask = SPI_BPW_MASK(8); + master->max_transfer_size = bcm63xx_spi_max_length; + master->max_message_size = bcm63xx_spi_max_length; master->auto_runtime_pm = true; bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT]; bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH]; From patchwork Tue Jul 17 08:19:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142120 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3369075ljj; Tue, 17 Jul 2018 01:19:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfYfuPlo098vTKBp/w/IuLqMDFCe5W+MlduQ9FG6CLqizEXINNpbV8c6Q7auGeVsHm7GCdJ X-Received: by 2002:a63:6441:: with SMTP id y62-v6mr640586pgb.240.1531815576070; Tue, 17 Jul 2018 01:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531815576; cv=none; d=google.com; s=arc-20160816; b=JoeT79zfSi3GopcmX94ERi1uaz1yacwha5SetAm3tiM8kP9ZT3/mjBhzoJM3WjGJii Z03aHS/58WoNQveBsUQx45Da+rbQuz2xNQ5lDrpiiOW9KXoPKwWPtozHe+eYqV+M1QJ0 f7j1Ok2D7eHM4GnmdZMHiNmkQNUVzHNWmmuam/wS4Lc2V9vW7jUoM8xONPrCNP7dojpF bxxDCCPhsyaa2MzprTix2OyWr0MqJaOrKSOCOG0uFCaT1fWj3c3wdCLL5zOO4kvffvMP 12778AZElwW+abjObDuJBjHao3RovjQEF3bDpMCiaEsHVoOu6iNinCEmhBo/bnvO8Lv6 WOtw== 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=7X5uKyAYRxqFHQf10/7gnDcSoFz1ez2/IgY9TUY05HM=; b=cVHjAl0yvt9A0PAMf+meCbsM8mtg+E3Ou2dStFK9yu47wQJxn21Tbljh+umdVRL7Nd 1ynjvL2FFLV4hIAvi1OMIlB3Zj0v892tHyHo4Ns1M3IIx1VHAVs6Dt0kexv0p8SCfHdg Atg0+oBI56QKyAWwazAx+StVxBAVM+iHEolb1kLCUbH6sJrmzHHW4A9a9hWQoZDjVKOo JMv92sYN0I0YqyMxgy3Q0aGdoDLw7TkpZ1l2iieqEnvPMye+96//onPz10PQnby27hO+ Ww/QJ8dmin2QmdTRDHBLey8ghkcMHwrORsyHHS3lblRQe1sGlhsHU7L9q+80ElV7qeS/ YH1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ph8z3T/W"; 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 r65-v6si381493pfe.298.2018.07.17.01.19.35; Tue, 17 Jul 2018 01:19:36 -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.s=google header.b="Ph8z3T/W"; 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 S1729729AbeGQIu7 (ORCPT + 13 others); Tue, 17 Jul 2018 04:50:59 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42487 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729722AbeGQIu7 (ORCPT ); Tue, 17 Jul 2018 04:50:59 -0400 Received: by mail-pg1-f196.google.com with SMTP id y4-v6so124238pgp.9 for ; Tue, 17 Jul 2018 01:19:34 -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=7X5uKyAYRxqFHQf10/7gnDcSoFz1ez2/IgY9TUY05HM=; b=Ph8z3T/WTWdQC6pfi3H5IqeyCwyW3M6YmNBzVDxSE939ukSm8Eweriu8lQubhwGeJc PlTagM17slaiF1PfnnGlDIvSAbZ/LGZxUlTE6stMfReBVsK01IkFc6HgpHbTzwF9yJcs QYOPtpRmTC7iJPlInlT4Orjo+zlWc92QuE10g= 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=7X5uKyAYRxqFHQf10/7gnDcSoFz1ez2/IgY9TUY05HM=; b=ggbk8nIjn4wEwT2uMSYqrjDGASId+g0oywt6qnnOPsCUj3tHqVwZ66o8/LowKGwPVi 9T1e/MBycJlcPuCxhil21LUGYBKp7Pw7ojYqHiRlV1Ci+rvkqvWQOS8Pp3RkprKJjMnC u+UH40GaSbj2YXDKd/bhCQ6JoU+YqhAfiPeP1/+0lyxFr/3ORrJl1lzZq3DQmLlhH6Z6 xUTfabxzOmhXd+EryEHMvkN+YZWcNzzTFbq/7NKTJElMm0E+eeNH27/uzpczXNUX6siO a7RoDZ6+VkBSjepGDyltN1mRZsGBF+sGeuQ/Kyl7tdBOWH51eFM4uw0SjbNKKf1yUbCz 4XVQ== X-Gm-Message-State: AOUpUlHBiyMebYtABp/XyF/Jq6NMkjb/oEJXLQSP8CeDl0fPYV7SiwH0 A2rzE36aVVhG067A53llBSJRbQ== X-Received: by 2002:a62:dc1d:: with SMTP id t29-v6mr689443pfg.244.1531815574586; Tue, 17 Jul 2018 01:19:34 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id z2-v6sm740263pgv.12.2018.07.17.01.19.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:19:33 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Jonas Gorski , Mark Brown Subject: [PATCH for-4.9.y 3/5] spi/bcm63xx: fix typo in bcm63xx_spi_max_length breaking compilation Date: Tue, 17 Jul 2018 13:49:16 +0530 Message-Id: <1531815558-20002-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531815558-20002-1-git-send-email-amit.pundir@linaro.org> References: <1531815558-20002-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: Jonas Gorski commit ccd0657c33b2c3701c5b14725284b7e671d3fb93 upstream. Fix compilation by renaming argument dev to spi as expected by the code. Fixes the following error: drivers/spi/spi-bcm63xx.c: In function ‘bcm63xx_spi_max_length’: drivers/spi/spi-bcm63xx.c:434:50: error: ‘spi’ undeclared (first use in this function) struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); ^~~ Fixes: 0135c03df914 ("spi/bcm63xx: make spi subsystem aware of message size limits") Signed-off-by: Jonas Gorski Signed-off-by: Mark Brown Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git drivers/spi/spi-bcm63xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index caa733ec405c..7ee4b04a4a11 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -428,7 +428,7 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static size_t bcm63xx_spi_max_length(struct spi_device *dev) +static size_t bcm63xx_spi_max_length(struct spi_device *spi) { struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); From patchwork Tue Jul 17 08:19:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142121 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3369111ljj; Tue, 17 Jul 2018 01:19:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4SIZJCPoEykAIlkG7wnCc3mU0NlkHZsDNZ2ZpY5mx2bJfdrnsSnS67u3dW+LlPw1JvP9z X-Received: by 2002:a63:89c7:: with SMTP id v190-v6mr637572pgd.194.1531815578670; Tue, 17 Jul 2018 01:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531815578; cv=none; d=google.com; s=arc-20160816; b=cjibnKs159lcgrlgzBob99uGQ5o0HcUJM709/8lNLBCJfIjq8LCEp15Zra7vcB4HcK PwttP/XfhWULHZ6BXLvNyrUxxep0uPfLJ4TflRtMfnCqG37z4WN4HoIpdHvtKFNxItvq FxiR812CB2YKN01RvKQgD6tk3oxGD7ZMZEmBLXdwOfey01PmxkAunCwDCzD0j1wtmK3Z C/XmPalZ3hx8de/WO8MT5TUGhFr3lSkmPyF7n+/+1tNTnfkk5tB7oklau4xxh2364RYK Kp38MxpxxD7Serolase8GH2dc98fR2odYoNs8c907IKYUkl6mqSLAv/qAVpdKxPMaKcc j43g== 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=YgTTjyz4zNtZqZ3gKBXLHZrAZxSliPgU/cj6qTUrzZ4=; b=r2fKXE6R4sALiRFHEPYmRCy5PmJetbvpLtIHtKwAcgk8wS3vMKb9L+u4yEd3nWxJgr BXZbbGNn8eE2hst0iFcFmZeEQjQRKmOFIculaqcITHdqShUV1PL87md9gbpKQarA4CoQ p2fLBmPSWICwvUNwVsIxREFPuJa/0niV1jJLzP0NVNw7pWXX4/W8RIeQ0iBm2+Bx4Fsl GdZzKECK3VTOaSAluKMq4jRs+cSMgT51AY2OfqavqU1VifUHh6mc2W7Pvx0U5GTVwNa0 BaHl7wPCo86gzHXYmMwLUZdiVvW9ZzcGq8sehVG/RRNV2lFLAdPquPuGh/eBTvtr0tDJ kwHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2RvWlKw; 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 r65-v6si381493pfe.298.2018.07.17.01.19.38; Tue, 17 Jul 2018 01:19: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.s=google header.b=K2RvWlKw; 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 S1729640AbeGQIvC (ORCPT + 13 others); Tue, 17 Jul 2018 04:51:02 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:46563 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729389AbeGQIvC (ORCPT ); Tue, 17 Jul 2018 04:51:02 -0400 Received: by mail-pl0-f65.google.com with SMTP id 30-v6so125181pld.13 for ; Tue, 17 Jul 2018 01:19: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; bh=YgTTjyz4zNtZqZ3gKBXLHZrAZxSliPgU/cj6qTUrzZ4=; b=K2RvWlKwZk33RSoXUTz9MBHb0EA9FvWm8sEnw9RoFv1YxW1jcOW/iww07VHQGLupvJ +7Imc98OsJHsxA7+clwEt5lyHf+D6HQImCE6sSKVS3zOQXHglILrXcqDeWJW4rfP/0D6 Vs68RtSPSj+u1knFczH6jT6/kfSErR2jTpp/4= 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=YgTTjyz4zNtZqZ3gKBXLHZrAZxSliPgU/cj6qTUrzZ4=; b=mB4kLexWn1uN4cCuDirsjYr00l6JHL4XsXnfkg1kCemF08TuG2JnqxIAS8OpkhefLp okiCUyr55LMMsanfdRCintb+MlcimXYSLWCO8I4wwL1jMALPOS+BeVv/+Pd/yJUk8rtG a/X04R5CrYU5KxOVzhmmysbF9GkM9LPOVoPteW219scFRnba7xqKKneQcFckH7RF1bKr UmoSSHn2s3tEdOihWInTlXzJdFNXKYhdBDwitFJvFM9wUZJ+qPTBA8bUIj0XQEIGxZrI NJfF0en/nDJaA5Eqh6zGAgCEdd4xBUq9/PVgyphIdDDBcbROXFEEIf7U86nblEVNCuW+ HsfQ== X-Gm-Message-State: AOUpUlFOAdMvlbiQuY99Zjq2m1K8fbX73fYO554bDQGt6zp6iA2gL5Jw o25WWMp3dX8bIDf85HkLE+J30g== X-Received: by 2002:a17:902:820a:: with SMTP id x10-v6mr650465pln.261.1531815577318; Tue, 17 Jul 2018 01:19:37 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id z2-v6sm740263pgv.12.2018.07.17.01.19.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:19:36 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Jonas Gorski , "David S . Miller" Subject: [PATCH for-4.9.y 4/5] bcm63xx_enet: correct clock usage Date: Tue, 17 Jul 2018 13:49:17 +0530 Message-Id: <1531815558-20002-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531815558-20002-1-git-send-email-amit.pundir@linaro.org> References: <1531815558-20002-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 9c86b846ce02f7e35d7234cf090b80553eba5389 upstream. Check the return code of prepare_enable and change one last instance of enable only to prepare_enable. Also properly disable and release the clock in error paths and on remove for enetsw. Signed-off-by: Jonas Gorski Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 08d91efceed0..3760a2be5dbc 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1790,7 +1790,9 @@ static int bcm_enet_probe(struct platform_device *pdev) ret = PTR_ERR(priv->mac_clk); goto out; } - clk_prepare_enable(priv->mac_clk); + ret = clk_prepare_enable(priv->mac_clk); + if (ret) + goto out_put_clk_mac; /* initialize default and fetch platform data */ priv->rx_ring_size = BCMENET_DEF_RX_DESC; @@ -1822,9 +1824,11 @@ static int bcm_enet_probe(struct platform_device *pdev) if (IS_ERR(priv->phy_clk)) { ret = PTR_ERR(priv->phy_clk); priv->phy_clk = NULL; - goto out_put_clk_mac; + goto out_disable_clk_mac; } - clk_prepare_enable(priv->phy_clk); + ret = clk_prepare_enable(priv->phy_clk); + if (ret) + goto out_put_clk_phy; } /* do minimal hardware init to be able to probe mii bus */ @@ -1915,13 +1919,16 @@ static int bcm_enet_probe(struct platform_device *pdev) out_uninit_hw: /* turn off mdc clock */ enet_writel(priv, 0, ENET_MIISC_REG); - if (priv->phy_clk) { + if (priv->phy_clk) clk_disable_unprepare(priv->phy_clk); + +out_put_clk_phy: + if (priv->phy_clk) clk_put(priv->phy_clk); - } -out_put_clk_mac: +out_disable_clk_mac: clk_disable_unprepare(priv->mac_clk); +out_put_clk_mac: clk_put(priv->mac_clk); out: free_netdev(dev); @@ -2766,7 +2773,9 @@ static int bcm_enetsw_probe(struct platform_device *pdev) ret = PTR_ERR(priv->mac_clk); goto out_unmap; } - clk_enable(priv->mac_clk); + ret = clk_prepare_enable(priv->mac_clk); + if (ret) + goto out_put_clk; priv->rx_chan = 0; priv->tx_chan = 1; @@ -2787,7 +2796,7 @@ static int bcm_enetsw_probe(struct platform_device *pdev) ret = register_netdev(dev); if (ret) - goto out_put_clk; + goto out_disable_clk; netif_carrier_off(dev); platform_set_drvdata(pdev, dev); @@ -2796,6 +2805,9 @@ static int bcm_enetsw_probe(struct platform_device *pdev) return 0; +out_disable_clk: + clk_disable_unprepare(priv->mac_clk); + out_put_clk: clk_put(priv->mac_clk); @@ -2827,6 +2839,9 @@ static int bcm_enetsw_remove(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); release_mem_region(res->start, resource_size(res)); + clk_disable_unprepare(priv->mac_clk); + clk_put(priv->mac_clk); + free_netdev(dev); return 0; } From patchwork Tue Jul 17 08:19:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 142122 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3369156ljj; Tue, 17 Jul 2018 01:19:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfvrq6OJQTgkLv1Hmuza2xlmIYF6ndHrrCi1NF06JS8dkEKZ1bVw9G9tVh9jhA3bcl/1Ve4 X-Received: by 2002:a62:23d1:: with SMTP id q78-v6mr661250pfj.179.1531815581567; Tue, 17 Jul 2018 01:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531815581; cv=none; d=google.com; s=arc-20160816; b=uVVARBAoqAv1KeDcOu8zcZ/MNfdxpPASVY6lXGEHH9ALiY3wO1CnEDe9nvRcCr5zMp lQrlqVZE/zibUDO+zOHjRbbEHvtoiT3yV+uvWswCSQ2s0e/4ILuDDR6Cnz0sPaf32Too CxVrebBqckfAWzd70SIwgo5z0HS5GVSBG+4JYBTaSdauSM0egZQP74StyZPDn35g8mmu WkHoint4cqgxKplWZ34nlpm77glYfxA91ygoC0MFzUyl3JEylWhH9Q1lwkTrVXX+LcNT +d6ocAuMbbCf41iRLN4qDE3Vu2gnjBN0C1w6Z2R4oaQb8ELaslpRnE59tl0nao8q+2k0 5NjQ== 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=GshohvMhDiL/WN0iCk7pjvbp+xlgmjSqDRZxOPduqZA=; b=r5+tpzPIQ01Mn3C9cCVuJJE7E5cSjit8KqJP6wiX20aTXBt/UgLkC4z6C3h9pmoWmX Kn8/iG01aTMy+Zvg/kPCM/GFew7euPwe0eL6BI6pjX3wdLuMDA8mQhUwEcWlA1GAJd08 QU6EeiBOjb8eRMuzAip2yf6kJm0Vty52t9AdwQlqQxekDPr38ldmfqGAV/dbzH3oMAe1 R/qAPQ/mp7XaMs1RI5D+4g2ChpkdsuS070n08119Nl06fhxuUdQO4O1SNeocvBr8elVe yRhNFR/1nCWyF61Ud9pmz9xn0G/pBcZpfCK7tWTtJD3gJeZpSHommvVlBEkUtCljuPto He7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8lNDjkF; 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 r65-v6si381493pfe.298.2018.07.17.01.19.41; Tue, 17 Jul 2018 01:19:41 -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.s=google header.b=H8lNDjkF; 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 S1729666AbeGQIvF (ORCPT + 13 others); Tue, 17 Jul 2018 04:51:05 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:36931 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729389AbeGQIvF (ORCPT ); Tue, 17 Jul 2018 04:51:05 -0400 Received: by mail-pl0-f68.google.com with SMTP id 31-v6so137379plc.4 for ; Tue, 17 Jul 2018 01:19:40 -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=GshohvMhDiL/WN0iCk7pjvbp+xlgmjSqDRZxOPduqZA=; b=H8lNDjkFzQdZt12352bzp7SRPU1CiY+N9R0AIJ/e8rFo/FytefzIFrImyrHzAwBEpI 1T8csGRHYYlCFAKV4LjU3BGQ4mTXZF/x/mqRomguO/ik8oHGxexVMWACTJWPlek0XBiD fOfIxELbV7djRsT1C5ryd1RlfEJ1TYpS4B4vE= 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=GshohvMhDiL/WN0iCk7pjvbp+xlgmjSqDRZxOPduqZA=; b=bJ8fQEXMq7REdapA+iq5cILrtQUh6FjKjgAJ+2r2WcY69CMYzoAVUSvcSagjv/JF6d uevkPija2X1dbKYvOxHaZF3HXT8ZCeTSN1N32VQTt98Lso18ZoXGhEKbj4pYrbxdcjv4 I2J+v6yiWthI5r6q4yYbBJYhYHtHrInTL3TDZV7Sp4w3xrGf8pDlDqWu0hgFufbc/WP4 7dGvs8UnQUsy4QyI1GRlLDkpTFjgVPYk9yyrkatCWNgIdlwWcVjlf2h5oXf9F/K6QzOc HKbogXFZENMnwM0YysMih3OP/HlKMUZ9Kv5XXFeIu54ZF7SM3MUzZsU4UMU1jC9rwlYQ jByQ== X-Gm-Message-State: AOUpUlHGN3rnrOSwK3JzDIEDltEGkc6Frhf99uKW5upshNddrJsiVEa/ HWXXQ4MP6JLhn3jCf+m0ZlZWgA== X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr662121plf.167.1531815580188; Tue, 17 Jul 2018 01:19:40 -0700 (PDT) Received: from localhost.localdomain ([106.51.22.240]) by smtp.gmail.com with ESMTPSA id z2-v6sm740263pgv.12.2018.07.17.01.19.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 01:19:39 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Jonas Gorski , "David S . Miller" Subject: [PATCH for-4.9.y 5/5] bcm63xx_enet: do not write to random DMA channel on BCM6345 Date: Tue, 17 Jul 2018 13:49:18 +0530 Message-Id: <1531815558-20002-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531815558-20002-1-git-send-email-amit.pundir@linaro.org> References: <1531815558-20002-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 d6213c1f2ad54a964b77471690264ed685718928 upstream. The DMA controller regs actually point to DMA channel 0, so the write to ENETDMA_CFG_REG will actually modify a random DMA channel. Since DMA controller registers do not exist on BCM6345, guard the write with the usual check for dma_has_sram. Signed-off-by: Jonas Gorski Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 3760a2be5dbc..c4078401b7de 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1063,7 +1063,8 @@ static int bcm_enet_open(struct net_device *dev) val = enet_readl(priv, ENET_CTL_REG); val |= ENET_CTL_ENABLE_MASK; enet_writel(priv, val, ENET_CTL_REG); - enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); + if (priv->dma_has_sram) + enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); enet_dmac_writel(priv, priv->dma_chan_en_mask, ENETDMAC_CHANCFG, priv->rx_chan);