From patchwork Tue Jun 27 11:36: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: 106415 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp1098750qge; Tue, 27 Jun 2017 04:36:35 -0700 (PDT) X-Received: by 10.84.213.8 with SMTP id f8mr5338029pli.22.1498563395318; Tue, 27 Jun 2017 04:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498563395; cv=none; d=google.com; s=arc-20160816; b=surs/AMuQXBwU3sENmyqU+O+kefIhmwwyYha6IyMkk7pCeM93R00FPZbZX+bF4YmJG /fukP2iWtLwCgM2kdGw+NoS+gC3G5xe2aRoan8Jq13LZCFTWMWzwnfnFREcNmvRcnWNU X2qVl+DsuQ9r9MUzlcp2bugtSCjtf+CXqVerxg9yur3gOLLWiZ6EGCyBVE6j4KUjE1kW 7ZEGrqTHnCNdQ59iOsIQWiu7+kr8GLbF4VMHyprDgbIEIc1el5LOxNJ8Wsosi7YQUgRF StsimkNGdqFEaLhMZlt6oNhInJlgOUxP/kuGtBUlwq76jMUaMY5ICzkmQOxHkZvpEKcw HmiQ== 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=1H9HAQlQJv83Qd3vkgh5uJE7mqgHrQKbzPEuOprA0iA=; b=Wn4C6oVFWQ7O5PGp5ignJpaCaqWLYOUZTsAEXzG8Al+TZA6W4ZR1WOqRCvw3G+qAW7 Ojuur9K5UlCZs3bPwzW137Ws0v1ohNPTTHTZxpI5kXVLnGLZfcTBsiyL+d7osByxmNbc NY0UzKas+RKWnLLT7pH5XS3n/fGcsQQdavjujcZWF6BmWyL9XtX4AcOp1GZ8oPwUBUpS cYQqu2TFwtbnGZ2cTpzFeNi9XQG2qFxOQrDfQf+09iT2GmbZ/5M38rPZxC5Mdn1iRJkf QHz0vsxMJW8KKSJRkTGSpGLRCYFGhgUyYscmBpumeK+LKUEpmrtw5mzHTitnjJgoy/yM KPSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=kU3YSR5E; 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 y2si1791565pgo.132.2017.06.27.04.36.34; Tue, 27 Jun 2017 04:36:35 -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=kU3YSR5E; 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 S1752191AbdF0Lge (ORCPT + 6 others); Tue, 27 Jun 2017 07:36:34 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:35071 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751659AbdF0Lgd (ORCPT ); Tue, 27 Jun 2017 07:36:33 -0400 Received: by mail-pf0-f170.google.com with SMTP id c73so15306328pfk.2 for ; Tue, 27 Jun 2017 04:36:33 -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=1H9HAQlQJv83Qd3vkgh5uJE7mqgHrQKbzPEuOprA0iA=; b=kU3YSR5E9WC9bnocFYLp8yLmRLANKmy+46RDyrQitbdYhXdmcHRnTBbABRRx8BYMUt 8uoXV3tGAXfkyq2IZGyEJtoAS7SC69zaIqc9EHR8UOO4AvscIXg+zTHUffFItYDsZFlg TmxtEXrwvmYSuER36N+/wW4qFX266sLQU/9+I= 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=1H9HAQlQJv83Qd3vkgh5uJE7mqgHrQKbzPEuOprA0iA=; b=ROLwOfkBXtddVTiF4kITNJzJfiNLQVpB5gEHJzAkXkA/2vyS+Qf2mEB5TDKns3q3FW uUI2kCLHZ/0E2SEQmCRbnKfuhtt4pnESCnmZACXHKmx3epZJMo7tmilCNoGpGWd4HFZO 67NLo04IIJvkdtOWqV27yeKQ/7An2l7/orDCGt8WKNXKRIH1A2b8cuY7cu6QXn3pq+sb oeiTyQK/Y0xt93BdP5fNlrFW5BgW3UUFv4VRjaU16Q7RpVL2wqWK1Dtis3Pt3cTKuTxv DqQHYJFrTk5CjZnNn8pyndTdl/Xlh/66OZ8kEOUl5HMr3M+GW3fiORT/YMLoO1T3LR/b 6WMg== X-Gm-Message-State: AKS2vOzP1c1pP5WfExtVk1JaSaZo9BXjWmJeHbLwnDXm15CAAGYyPeZF OBjiU856S3yJkWiBdWCQ9A== X-Received: by 10.99.165.82 with SMTP id r18mr4787138pgu.65.1498563393171; Tue, 27 Jun 2017 04:36:33 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id b8sm6317506pfd.65.2017.06.27.04.36.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 04:36:32 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Hauke Mehrtens , Mark Brown Subject: [PATCH for-4.11 1/2] spi: double time out tolerance Date: Tue, 27 Jun 2017 17:06:24 +0530 Message-Id: <1498563385-1430-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498563385-1430-1-git-send-email-amit.pundir@linaro.org> References: <1498563385-1430-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: Hauke Mehrtens commit 833bfade96561216aa2129516a5926a0326860a2 upstream. The generic SPI code calculates how long the issued transfer would take and adds 100ms in addition to the timeout as tolerance. On my 500 MHz Lantiq Mips SoC I am getting timeouts from the SPI like this when the system boots up: m25p80 spi32766.4: SPI transfer timed out blk_update_request: I/O error, dev mtdblock3, sector 2 SQUASHFS error: squashfs_read_data failed to read block 0x6e After increasing the tolerance for the timeout to 200ms I haven't seen these SPI transfer time outs any more. The Lantiq SPI driver in use here has an extra work queue in between, which gets triggered when the controller send the last word and the hardware FIFOs used for reading and writing are only 8 words long. Signed-off-by: Hauke Mehrtens Signed-off-by: Mark Brown Signed-off-by: Amit Pundir --- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 90b5b2efafbf..b4a8bb7759b2 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1015,7 +1015,7 @@ static int spi_transfer_one_message(struct spi_master *master, ret = 0; ms = 8LL * 1000LL * xfer->len; do_div(ms, xfer->speed_hz); - ms += ms + 100; /* some tolerance */ + ms += ms + 200; /* some tolerance */ if (ms > UINT_MAX) ms = UINT_MAX; From patchwork Tue Jun 27 11:36:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106416 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp1098780qge; Tue, 27 Jun 2017 04:36:38 -0700 (PDT) X-Received: by 10.98.137.68 with SMTP id v65mr4261677pfd.9.1498563398032; Tue, 27 Jun 2017 04:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498563398; cv=none; d=google.com; s=arc-20160816; b=acPT04PnCpy25bXMZVAPLY1WZq9n9e1R390HuNBpXbgiAZwt4Q+RBRuGnChMw2DSfg XYTLDDIzpPpvALO/QOd0DI/7LMi6x0qXG/5bv+q0y5iyAM7seO/7RFbjmQT1Uc2q8qYc kzXPeQa0V0auop3lZSVQvmI+Oe3ctlTeBfPQDRUW3GQ+qeL+6GTmk9SS1cspevrfucEH 7BMLIivMZlFJPxppsgT3gqfLHbLxVjPXfpdLZjnyBDOV9d++pd9vHVdHf//BetN6PbrK pjPIl3cPOdf5aGHgag8Ay5l9j3JEydE+U/pg4NB8hedGRy4UbQCRz5vnwjzj4WJa0AtW 6vwg== 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=cuH4FbOZ7M+TNvqhkvVYLEPAfod0yYw3tSc9aF+H0tE=; b=RUd+0oLTZ8KLrjkf9DpHoOVoTgNn7vQ6uDgTczOyy9ym/gyAG4brLD0QeW0T31VYAj iM5d1j/n99JHqApHTHvXMaO3f3vIE7M5OjMG8Sv6k4+8UlRai2C9odxe9NZ70BYX8c7R gNJk9L8N+T+iEr2GRPQXQocFz/dW9/ZBXekOTiaQYNVa0NnbFpM0XMSUjXzPqy+d1YuG af2DuKs8jX8WhaXiZFPwLHySibbT+eGmLnf4OS7EP0j8re63AaQB8tXdcBJBSt9aFGFo storkjBA3b080Y30oJi43WG//63WGEdc8GBeReFFdnf4ZwHOvDSkAQ1o1W5MNgXJGc54 t3oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Osa5scnp; 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 y2si1791565pgo.132.2017.06.27.04.36.37; Tue, 27 Jun 2017 04:36: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=Osa5scnp; 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 S1752271AbdF0Lgh (ORCPT + 6 others); Tue, 27 Jun 2017 07:36:37 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:35475 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751659AbdF0Lgg (ORCPT ); Tue, 27 Jun 2017 07:36:36 -0400 Received: by mail-pg0-f53.google.com with SMTP id j186so14526362pge.2 for ; Tue, 27 Jun 2017 04:36:36 -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=cuH4FbOZ7M+TNvqhkvVYLEPAfod0yYw3tSc9aF+H0tE=; b=Osa5scnpUKK6NNC1czZmmTXGcwkoRKrjNbHmcYX0JzXxRUaRN5CM14/yEB5+nY/MQf D0IugC/VMi2vfV/+LmDw8QqR4A+Qx7152oCxN2jYGy7pisBegipmsDRqfq6cGBplTNdE oSqaABzvmJ9pHSqwA9lOoW6EVGwPskJOmBMwM= 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=cuH4FbOZ7M+TNvqhkvVYLEPAfod0yYw3tSc9aF+H0tE=; b=THXHw9VaYTb+3ivMsZe2ubHzvNoFC0VH1Qw545sgeXxLXMBasnSa0D6kNr1++PGPW7 2mnnuZYzyo3yAn36o6yECUWGjde7nTjGlxFKOfpZcFAaG0AXg0Z6ndwEMfDKbpJqi0x5 +dAHUriAGRh7Pkn2KJE7XRKFfWVAC9DCMV5430Cfj5PyGl/4nmqKk+yXChy0vY49onBD e8XivjAtmkD8tvrV73ZwHrGScei81XUE7KFr0AYFWVoR2quFrPeppWigfinhgh0GqBJ0 8yZwT7SSu8/PQHfaf7NCv1DFouIYtFBV6ttP7qAM1Lj6SDJozJDxNpVJagJAGbDP4qYG FaAA== X-Gm-Message-State: AKS2vOzGfPAh4jr+3lRepYMPJrqZQqL8qjDnYp2eZy6OcNuTVkJmMGSl KMvjuCnlO/37az8tUGfyHw== X-Received: by 10.99.49.20 with SMTP id x20mr4789430pgx.181.1498563396080; Tue, 27 Jun 2017 04:36:36 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id b8sm6317506pfd.65.2017.06.27.04.36.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 04:36:34 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Russell King , "David S . Miller" Subject: [PATCH for-4.11 2/2] net: phy: fix marvell phy status reading Date: Tue, 27 Jun 2017 17:06:25 +0530 Message-Id: <1498563385-1430-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498563385-1430-1-git-send-email-amit.pundir@linaro.org> References: <1498563385-1430-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: Russell King commit 898805e0cdf7fd860ec21bf661d3a0285a3defbd upstream. The Marvell driver incorrectly provides phydev->lp_advertising as the logical and of the link partner's advert and our advert. This is incorrect - this field is supposed to store the link parter's unmodified advertisment. This allows ethtool to report the correct link partner auto-negotiation status. Fixes: be937f1f89ca ("Marvell PHY m88e1111 driver fix") Signed-off-by: Russell King Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/phy/marvell.c | 2 -- 1 file changed, 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 9097e42bec2e..57297ba23987 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1127,8 +1127,6 @@ static int marvell_read_status_page(struct phy_device *phydev, int page) if (adv < 0) return adv; - lpa &= adv; - if (status & MII_M1011_PHY_STATUS_FULLDUPLEX) phydev->duplex = DUPLEX_FULL; else