From patchwork Mon Jun 26 08:01: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: 106310 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103110qge; Mon, 26 Jun 2017 01:01:41 -0700 (PDT) X-Received: by 10.84.132.104 with SMTP id 95mr22596844ple.228.1498464101749; Mon, 26 Jun 2017 01:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464101; cv=none; d=google.com; s=arc-20160816; b=fTLcXr1ac/uX/qNkt1xkLgaMHMBquzsAa+IL8h3fgusThUIfsBeCTEzx9ZkFP1wgWZ mXCVaczDIjswiwmhC9Ltys12cV1flhIXv753gnVm9/UDVM+n0pyYgnTYU94cJPBauIXj H4ZzV6SDAfWvp2/oJ4F+KF8RHp1FmabXp2ycQ7NWBWvCEy5SkNOZhcCeuHfM0fnot87e VGyynz97to0wzJIcXcmXxy94xCAIYsuGeg7brKPD5JcR/lVggcvdMdgsHO1gvFlbnxrW EhNQW//s9QgpygrdSmcQ5jkg3cE7eX1WwTzIaXjDd3ol1QsYObwDfNvvRZyARWvcmyp6 BF8w== 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=ncm/bd4hE5HMt4rr46HJNlF/RefUPQ/Rf7IHTB1BPls=; b=LH8nxdU7LvKJR/2tPC9QDLkM8SVPQTM8EmhIya83Yte0989yzAILsl861ggi5pxH2x 9keVGDehSzZLFblt5ciawShJ7pwxx60XFVkbN4YIo/fhjMEWdaten1nCHFwHVhOaZ0Ig aHH1AeqwcqlSDDUIBmo+jLUokoWR7rV6rLWAjtPVo3BxnRltQ5hxE4ku488j3W0MAy7j xr1arNzYC9UB9LTVmoNguPeNlG/2HdWiP6fhahv59D4SZcKWFwI3KPOQb3zheGEfKj57 BLbYF2mFCouQAvqtvuDOxLjXcs7be9btrf/vOsZ8BLhzdWNwR1fHa3oOolrIM/xZzS3r sFIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=GyNaXOdV; 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 102si8959663pld.125.2017.06.26.01.01.41; Mon, 26 Jun 2017 01:01: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.b=GyNaXOdV; 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 S1751383AbdFZIBl (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:41 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33699 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBk (ORCPT ); Mon, 26 Jun 2017 04:01:40 -0400 Received: by mail-pf0-f173.google.com with SMTP id e7so51445600pfk.0 for ; Mon, 26 Jun 2017 01:01: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=ncm/bd4hE5HMt4rr46HJNlF/RefUPQ/Rf7IHTB1BPls=; b=GyNaXOdVRQR1a/yWN+Mjx8VC02KdOoK7c5quH/0Co56iBdS3WK8A2UqLL15t4JuyIJ cWLRdIXBacBReLDYbs0khP6wsTGc2Fy+2bbUoweycAM5/eR+WhTWndpSkrzKwaFU3kVi u1OX+GvXsEX5iDn2pfB2Hf4kD/4ZQ2l6SCSiM= 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=ncm/bd4hE5HMt4rr46HJNlF/RefUPQ/Rf7IHTB1BPls=; b=StNSxT+7mcEu9r2rPXR0pjTyN3vrPRFe0X8soeZwJauS6XueyXV/DNejHrSs/REsMC RB9js2+j6G6BKjZLcCp0A1RWQek6GzqMv0QXwwA+VANiCXgIKpT2FJtNHJU+HtjVzmvK MGh5Aj3OUg+zOF9twJz25KD+sSfyUdnA5LH0E7wyR/beu/Z29OwUycXMRQf5WZics45W zYNcIfVkw5loNfdY4yh4eFKtGiTxnStMUipX/7oUhu703cLfY4w1YfVfOb4c6QEeZi6a vyZrc/95MS4Q/774yT6pAnAaMt3HLAWlQltAKE7iIoijtTDAfxW/ttN3GoA0Ey4bWtI+ W73w== X-Gm-Message-State: AKS2vOxYWwo3BTQmSVCyXn4YLu3mC+XjAzEe/RMMpUTFEmAYTxZBlO18 7tY8lH+pKmN8MUuxJZ5MPw== X-Received: by 10.98.28.71 with SMTP id c68mr20271040pfc.116.1498464099665; Mon, 26 Jun 2017 01:01:39 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:38 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Tobias Wolf , Sergei Shtylyov , linux-mips@linux-mips.org, Ralf Baechle Subject: [PATCH for-4.9 1/7] of: Add check to of_scan_flat_dt() before accessing initial_boot_params Date: Mon, 26 Jun 2017 13:31:25 +0530 Message-Id: <1498464091-26753-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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: Tobias Wolf commit 3ec754410cb3e931a6c4920b1a150f21a94a2bf4 upstream. An empty __dtb_start to __dtb_end section might result in initial_boot_params being null for arch/mips/ralink. This showed that the boot process hangs indefinitely in of_scan_flat_dt(). Signed-off-by: Tobias Wolf Cc: Sergei Shtylyov Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14605/ Signed-off-by: Ralf Baechle Signed-off-by: Amit Pundir --- drivers/of/fdt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 6a43fd3d0576..502f5547a1f2 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -741,9 +741,12 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, const char *pathp; int offset, rc = 0, depth = -1; - for (offset = fdt_next_node(blob, -1, &depth); - offset >= 0 && depth >= 0 && !rc; - offset = fdt_next_node(blob, offset, &depth)) { + if (!blob) + return 0; + + for (offset = fdt_next_node(blob, -1, &depth); + offset >= 0 && depth >= 0 && !rc; + offset = fdt_next_node(blob, offset, &depth)) { pathp = fdt_get_name(blob, offset, NULL); if (*pathp == '/') From patchwork Mon Jun 26 08:01:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106311 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103133qge; Mon, 26 Jun 2017 01:01:44 -0700 (PDT) X-Received: by 10.84.236.76 with SMTP id h12mr22987871pln.10.1498464104737; Mon, 26 Jun 2017 01:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464104; cv=none; d=google.com; s=arc-20160816; b=bBFa/oUU5IVhFCZSY1JlKJAL5san4uZjFkZy+8r+8gpyk0VSBd9XqO6wJ4R04n6kdf GCFp0YQbMuTrzwNNsR93Q7drU85qeg76bMfm2KoXsUkf8ceNho7T2+bO72zgG5JhavMH hCsrh8wmOQJcyLOpJek4DDG0+1ypsC0hQdkivY89YC21tywsAIFu5/weZsKu+da3shT+ sYhKb8dTPTgxOS5iCPHsPFVX0FPsJ6cBEHPt/kgw2pd28YUlQ5xRHYhwLRjMWdcFBiWb +4gsXw47s1juDMCKxjVRYXPgNx9e4FOxeEFI7/rYewd0xT3BCWYZ/53CAMxgIpVl1yJ6 jviQ== 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=pFE+mO75YvwPDmvbpPM+vYBOvHEDngDYvXgHkBRkeg8=; b=Jl+0Wah0LPw993sy5qpxsglyuuPH7BFVT6mYHWTL3j6GdD2QpAYZIXtnMhMUGkWesO yY4npnZjogsMzlvfOgORyTstuLZNUh9XeDpXfD+699hysYf24NSduhM+ZsS7YMGxyqjW 6ivpvwyuCg2tE4F8H9oGfz2F4d71qxnERtXlA/c+azrWT40P6I0M/FMuEpYx6k3sYX5q eln3aYS3+lIcUkmpNOjN6GCkdPmXtYxIN4dask19LnYhjVRRPMLZaWmF6k82X3rI3XqS hoDbZttEoX/YxSNNGjo8/3SW7Ebz7Xupz33M07tmz87QPxSaKJGMVvcSlh1tVoX1JJTl pe6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=MX0J6Gog; 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 102si8959663pld.125.2017.06.26.01.01.44; Mon, 26 Jun 2017 01:01:44 -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=MX0J6Gog; 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 S1751388AbdFZIBo (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:44 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:34284 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBn (ORCPT ); Mon, 26 Jun 2017 04:01:43 -0400 Received: by mail-pg0-f46.google.com with SMTP id t186so5465384pgb.1 for ; Mon, 26 Jun 2017 01:01:43 -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=pFE+mO75YvwPDmvbpPM+vYBOvHEDngDYvXgHkBRkeg8=; b=MX0J6GogoprVkII6R6GDUV94OKDVZaZibVvndDhQ+Yo4M6GmggM689hr36BTmlfXPt PazKdbaGvV1zdtOMuALtOxnlG8RvWlLJ+v7YI+R4DgN5hisHNppORHLtwxgQLIiShWSy nj985pK1VgXJdlZhcwLqYAkMpbeZVs6bHJWDs= 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=pFE+mO75YvwPDmvbpPM+vYBOvHEDngDYvXgHkBRkeg8=; b=sOeaZVK4KcRCUg3DbGNwsiVJWXmPcq0pYLT1WkK2h8jiH7NwLDI+0WixYW03gcysaM K3puX+EWeOV9TjE4sUCRWOEDQAlew7wXgy2G3NohQ4ST7HvcwavLW2vQxG6bPK9AzC25 Tggw7PyOeG9DkwdtwdcdxA3Q4rXPRSF1NK6y2OWG5C6t/KGN2oLx5n8BfO693Y7U+rEU TCeRusGhq37J7Pr1YEBi7UBOMjD8wsza+wJkDzHPOiNFOSgySaGSpaZlpnfyegYtssFK 73fe3quOs3/V8fDtAMNPv/ixP/J3SnetJHKV68ahsK2p+GHeqTUpp4+kfgql5Ox4Q1M9 gCVg== X-Gm-Message-State: AKS2vOwoRxA7OWontFP7xYciwj3cuYHm5rmsOocj3q2t3tdJk0800MOf Na1O4xF8SkGjysfA X-Received: by 10.84.218.71 with SMTP id f7mr22075044plm.282.1498464102685; Mon, 26 Jun 2017 01:01:42 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:41 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , =?utf-8?q?Jo=C3=ABl_Esponde?= , Cyrille Pitchen Subject: [PATCH for-4.9 2/7] mtd: spi-nor: fix spansion quad enable Date: Mon, 26 Jun 2017 13:31:26 +0530 Message-Id: <1498464091-26753-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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: Joël Esponde commit 807c16253319ee6ccf8873ae64f070f7eb532cd5 upstream. With the S25FL127S nor flash part, each writing to the configuration register takes hundreds of ms. During that time, no more accesses to the flash should be done (even reads). This commit adds a wait loop after the register writing until the flash finishes its work. This issue could make rootfs mounting fail when the latter was done too much closely to this quad enable bit setting step. And in this case, a driver as UBIFS may try to recover the filesystem and may broke it completely. Signed-off-by: Joël Esponde Signed-off-by: Cyrille Pitchen Signed-off-by: Amit Pundir --- drivers/mtd/spi-nor/spi-nor.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index d0fc165d7d66..21dde5249085 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1255,6 +1255,13 @@ static int spansion_quad_enable(struct spi_nor *nor) return -EINVAL; } + ret = spi_nor_wait_till_ready(nor); + if (ret) { + dev_err(nor->dev, + "timeout while writing configuration register\n"); + return ret; + } + /* read back and check it */ ret = read_cr(nor); if (!(ret > 0 && (ret & CR_QUAD_EN_SPAN))) { From patchwork Mon Jun 26 08:01:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106312 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103163qge; Mon, 26 Jun 2017 01:01:48 -0700 (PDT) X-Received: by 10.99.100.5 with SMTP id y5mr13131229pgb.92.1498464107942; Mon, 26 Jun 2017 01:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464107; cv=none; d=google.com; s=arc-20160816; b=LSNFsOHa3pVqY4acrJth5k8I8VQMods4cFJx6fesEamPXXxzJEbYPiZbx3b/vq8Frd sxY8JH3eBCK5r1Rup35ky2fCPT7NWwkawmbwr/WbkZKcbeQ93VGRwEVAUqhhYHAG1RGV zaKbfYJLOgMHUHAw2B20XVm070K50v8IU9Y15BbtyvSmVY9WLl4+lMNs3Fddkfhl2ctZ tOCbqMlMZcxQG01ghfuROphitr5SV54jed5/EOuBu+M+hvkb3Mj4SbwpMUhP6iCR4PZ2 /zSomIiLnMK+eqO2j0AxAhElpxJ2CGQx8HvEEqgyzshVhTzYdyg2QbdHZGNCeJkefOxu rNjQ== 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=F5AEzZiMUWOn7ZjU+PY2jqvVarSj7C65kOY4QdfBaa8=; b=pXHQB2Lgyuxau3GevSfMg6N2ZALzEdzoCYqeubjlpFs0xS5DjLvSp/+vaEqVqAo+/J zh4bQ/y4GgCTdlMZftyTtbnLQbizxDWofCjfG+S4sBX0GAiy3+Y/UplWw1kiEq5suYIN alPGS10ZBrlTYy9iz4TtPPIn7A6//mp3YHLqehLhTieeUEnTLxhviMzxiE0+jBiXp4is Z8KuAfZgQrTcoorXM3kDI9L3lraBrjjHGi6/uRowGu1UQ+Kdmgk/hCMwtuaBt1z1Xt9w AZDEMBH5cjBn2syQoLPxObYBVebUYROxYTEfDC/P63c4cKz09xPue7HEY7gGjKqlT5id gevQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=N5+1d9Fj; 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 102si8959663pld.125.2017.06.26.01.01.47; Mon, 26 Jun 2017 01:01:47 -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=N5+1d9Fj; 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 S1751389AbdFZIBr (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:47 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35725 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBq (ORCPT ); Mon, 26 Jun 2017 04:01:46 -0400 Received: by mail-pf0-f182.google.com with SMTP id c73so51415207pfk.2 for ; Mon, 26 Jun 2017 01:01:46 -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=F5AEzZiMUWOn7ZjU+PY2jqvVarSj7C65kOY4QdfBaa8=; b=N5+1d9FjiBhkL580ngH2cckkHAzn+UbNvZKKYpC1Fd4kwm50f1P5Xed/3onlrCJXaS AQC1+et4DwbDp+yJECl+s4ZfBX5lc+sByJ6XenBveiVQxIKZjVhMe15ZugGeJgu63lm3 togTGhbzuHNEtoHTAb+y0fXxx6SL0/VZwAz8E= 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=F5AEzZiMUWOn7ZjU+PY2jqvVarSj7C65kOY4QdfBaa8=; b=GwU2wPer5pAv4XMpv3O74P1FCx3+i+BYB46cMg+75zx5GkxpFW1aNAOzD1uUUecIXw KNCA5uKhrmqdXIhYt5j/3C2bKbzqt76yfFmVNYS+u8NIU0wdPZCQH9dxurJYYkxYIj6T fqOPFXw02beCSLcpGbifFlhOrzQrjYUEzpA+2Ds+7EuGHg0xsYBzBq+4GQ73thPOBlOF RHtPTyu39wThK9MuxXQM85vmNsGxkChyP+odMZqde16+NdoDN2PqcLUx21dr9JRjH9Uk UI8zIMUv9NfUpyD6MUcrxxyjYfY4b7njYBSAUmMyg7CW8oPlZ7caHXxfXHEFboNNaBZU kaDw== X-Gm-Message-State: AKS2vOyXKTRV2SEkwr6xqzGL1to5zxg29PvElH1biYP9uH+jnZrLqhHB HvKLF3DqzuEPca/8 X-Received: by 10.84.208.236 with SMTP id c41mr21809957plj.95.1498464105676; Mon, 26 Jun 2017 01:01:45 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:44 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Stanislaw Gruszka , Vishal Thanki , Kalle Valo Subject: [PATCH for-4.9 3/7] rt2x00: avoid introducing a USB dependency in the rt2x00lib module Date: Mon, 26 Jun 2017 13:31:27 +0530 Message-Id: <1498464091-26753-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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: Stanislaw Gruszka commit 6232c17438ed01f43665197db5a98a4a4f77ef47 upstream. As reported by Felix: Though protected by an ifdef, introducing an usb symbol dependency in the rt2x00lib module is a major inconvenience for distributions that package kernel modules split into individual packages. Get rid of this unnecessary dependency by calling the usb related function from a more suitable place. Cc: Vishal Thanki Reported-by: Felix Fietkau Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Signed-off-by: Amit Pundir --- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 23 ++++++++--------------- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 5 +++++ 2 files changed, 13 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index b7273be9303d..c8d9075339cf 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1422,21 +1422,6 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) cancel_work_sync(&rt2x00dev->intf_work); cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); cancel_work_sync(&rt2x00dev->sleep_work); -#if IS_ENABLED(CONFIG_RT2X00_LIB_USB) - if (rt2x00_is_usb(rt2x00dev)) { - usb_kill_anchored_urbs(rt2x00dev->anchor); - hrtimer_cancel(&rt2x00dev->txstatus_timer); - cancel_work_sync(&rt2x00dev->rxdone_work); - cancel_work_sync(&rt2x00dev->txdone_work); - } -#endif - if (rt2x00dev->workqueue) - destroy_workqueue(rt2x00dev->workqueue); - - /* - * Free the tx status fifo. - */ - kfifo_free(&rt2x00dev->txstatus_fifo); /* * Kill the tx status tasklet. @@ -1452,6 +1437,14 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) */ rt2x00lib_uninitialize(rt2x00dev); + if (rt2x00dev->workqueue) + destroy_workqueue(rt2x00dev->workqueue); + + /* + * Free the tx status fifo. + */ + kfifo_free(&rt2x00dev->txstatus_fifo); + /* * Free extra components */ diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index 662705e31136..631df690adbe 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -740,6 +740,11 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev) { struct data_queue *queue; + usb_kill_anchored_urbs(rt2x00dev->anchor); + hrtimer_cancel(&rt2x00dev->txstatus_timer); + cancel_work_sync(&rt2x00dev->rxdone_work); + cancel_work_sync(&rt2x00dev->txdone_work); + queue_for_each(rt2x00dev, queue) rt2x00usb_free_entries(queue); } From patchwork Mon Jun 26 08:01:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106313 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103178qge; Mon, 26 Jun 2017 01:01:50 -0700 (PDT) X-Received: by 10.98.155.148 with SMTP id e20mr17762466pfk.149.1498464110708; Mon, 26 Jun 2017 01:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464110; cv=none; d=google.com; s=arc-20160816; b=u2MbaJFDyyAaw3Mg1gL5mHo+TOzJB2rh/MhmrXw8XZ1wkgvARJzG8fMs+xHsHaoCKj R8D2xllJhOinkTTZDkLTPxKEnHytZZIkniImtejQ1OhS/lmBdKgAMw0LVt7iAtgX+eA5 CVpQ4eqzc2xmJ/VYMsM6jiJHb23wySPwtzjIrrHjD5LOoGg4ppyXLArY2DXziaO6SPGZ EKYyYy5rwWHz73w4B13LMXkjCRKIXz8AC2ebs1iLprRAtil4rCCXpUUZHbjpg6M4a4Fy 0w1jqmTs1LWl7tVTgYjQ0HIXQWLNV3YQ1fMfn/4jd1QSW0aeOL/qZ1FiFAl2Jg0ZKRGO 80QQ== 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=cTnD2cB7+oyI8DVI4p4hqokyCE1fEdliLNmjKLKDzbU=; b=xXd04Zoi+hQPcqyRUDV1fOfUags762nNAiYDtD5GQJzYo20z4liHBGRX7HZFvRGAt5 IDeE9S8mkf3Yyebl2SwxTCY+mTi8Y8Z2/wCFF2h4X9iqRAXFSd24vnAFhUx271Atq5XO ZAMN7X6zMdrSq1hG8EOdMLZ6czVX03Oc+hnyRxkY0+1II+4rQqphDqIsDCPKKc84hq+p uajNKLA11O4vSKEbKEgVPHoopMjmlj2ZRrYypj5C2/eeEkLd5pyRlhlFH/4Xdi0sbAAl wDqJ/7rMEyLxXCrHV2wEek8tkMN/BHB3xcgFbIQ/hV5moXeQeEOMx6Z21g32Vj5qtyUv tJXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=bDrpL3dX; 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 102si8959663pld.125.2017.06.26.01.01.50; Mon, 26 Jun 2017 01:01: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=bDrpL3dX; 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 S1751390AbdFZIBu (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:50 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:35161 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBt (ORCPT ); Mon, 26 Jun 2017 04:01:49 -0400 Received: by mail-pg0-f47.google.com with SMTP id j186so15349706pge.2 for ; Mon, 26 Jun 2017 01:01: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=cTnD2cB7+oyI8DVI4p4hqokyCE1fEdliLNmjKLKDzbU=; b=bDrpL3dX4is60LfIrz45t5ojiQ4UY2+Z9lnqtdcZE/BjxWPJZyk3dTrb0c7H2VJWN/ pCT3ilRrnyZ0Ci7MkqqxD3AvOMdBpW9zOzH/JVbzMxi3ziL+kJ9gxQIOXYbGvPnZCAaT lx5pnVB7GxSK0WN/pkEyrIFPVlXMpg0LjsYVU= 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=cTnD2cB7+oyI8DVI4p4hqokyCE1fEdliLNmjKLKDzbU=; b=lXvTS63sYrVhPKQsZaZCIlCoXJ5uoRw8ZfJ8qKOujYw9LmoOXhjK1B1xzu8yyo1VEV haquxW0q4nvXovdHY6DtlTIRiUqwBYaVGfb4e/eLckk+zFQtIxcYbC+nIHO66zcmTW70 gmUKdGOY4RVUwzximiD6jdNKh0yvGqdNELwbzd6lgNoy/YBDkv9adnlgobp7XKz1Z/Dr vOLwVBGhGA3tjnJsdyedmbhIcRGmT/6jTlyzS5UxEolvuUnt3xT2ei6jOR8oadbS9poR +50owoM3svpukPziHqX6cyD/dt/f8drzEjHJ1kVq6s1x/69sFKUm1vwJO59wrmzzay30 uQfg== X-Gm-Message-State: AKS2vOxXWh77TFdxTisNZ0oCrUkrpl4OTCXyAExtwkhQrSwZ4v7NmwqT uY92+qUThqfwT23p X-Received: by 10.84.217.26 with SMTP id o26mr22934296pli.223.1498464108753; Mon, 26 Jun 2017 01:01:48 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:47 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Yendapally Reddy Dhananjaya Reddy , Jon Mason , "David S . Miller" Subject: [PATCH for-4.9 4/7] net: phy: Initialize mdio clock at probe function Date: Mon, 26 Jun 2017 13:31:28 +0530 Message-Id: <1498464091-26753-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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: Yendapally Reddy Dhananjaya Reddy commit bb1a619735b4660f21bce3e728b937640024b4ad upstream. USB PHYs need the MDIO clock divisor enabled earlier to work. Initialize mdio clock divisor in probe function. The ext bus bit available in the same register will be used by mdio mux to enable external mdio. Signed-off-by: Yendapally Reddy Dhananjaya Reddy Fixes: ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver") Reviewed-by: Florian Fainelli Signed-off-by: Jon Mason Signed-off-by: David S. Miller Signed-off-by: Amit Pundir --- drivers/net/phy/mdio-bcm-iproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c index c0b4e65267af..46fe1ae919a3 100644 --- a/drivers/net/phy/mdio-bcm-iproc.c +++ b/drivers/net/phy/mdio-bcm-iproc.c @@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg) if (rc) return rc; - iproc_mdio_config_clk(priv->base); - /* Prepare the read operation */ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) | (reg << MII_DATA_RA_SHIFT) | @@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id, if (rc) return rc; - iproc_mdio_config_clk(priv->base); - /* Prepare the write operation */ cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) | (reg << MII_DATA_RA_SHIFT) | @@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev) bus->read = iproc_mdio_read; bus->write = iproc_mdio_write; + iproc_mdio_config_clk(priv->base); + rc = of_mdiobus_register(bus, pdev->dev.of_node); if (rc) { dev_err(&pdev->dev, "MDIO bus registration failed\n"); From patchwork Mon Jun 26 08:01:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106314 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103200qge; Mon, 26 Jun 2017 01:01:53 -0700 (PDT) X-Received: by 10.84.218.206 with SMTP id g14mr21696413plm.290.1498464113883; Mon, 26 Jun 2017 01:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464113; cv=none; d=google.com; s=arc-20160816; b=qVwSjq6khj02lKp/H5tHvQum5+1fKNKQxjv0Ep2VHCNs/HkdE1O1WyOLcOClrLdTed lUkTtsEZx8XaA2GWaAqrL9428ymLS1Nr9ioz8iwvOklz6syUwLcw4AJ4uCSGZZtZYpzr 2ki/RH4ImqNX9Lo9ZWfG2v8HBXVrN8RY/9FFbTUBIUWeKzb4Z+i17E+vdFfHfvX7YcmN q6caSF4neEW8YNVwi5pKBmj/K/rTMpV9JA/QzcMolYeAfC6hxVvtGqrDuNF5bVUg8UUF Wefl1gaHlR7HDDSbI0IrIDdAcTcn85a6YAQG1ByI+zRXjCfpH600LkrHPdkY8EYKfOsZ xNhQ== 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=q8yHvBGBJbKosLm4h+QZlpTOMgJroSG2EwSzSh+ZvTo=; b=ZWQfCy65I659M/9SU8SUJm7fm5TFqkRfE2/JfNHuKECtaD3UF2YzPWO30yHqjqpcFJ nJlj1tad/dayjSgik0GumtEWuodX7QJixV2QJ3pMk9LU1bR8RDKhSgu1AxvBfGSe3Afg c17yMVeaIf4+wIwt9+7IKc/qFDFX04GmDR80938+9P2TYNSufUuvmqR2y6RaGZrQ+3SE 0flbQMfobLdewJyG7enHTh7qs63d91FWKln1hdv291f774QHcW0bQkEXbXTfcwgFK2pK blcMaDrgKAj8/YMiwR5up5tMWY9Ck+ysWwkhroblhEiv8MtkzUxksyZnaBR7LbQuUBq+ /9ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=KkqEpks7; 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 102si8959663pld.125.2017.06.26.01.01.53; Mon, 26 Jun 2017 01:01: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=KkqEpks7; 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 S1751391AbdFZIBx (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:53 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:34315 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBw (ORCPT ); Mon, 26 Jun 2017 04:01:52 -0400 Received: by mail-pg0-f43.google.com with SMTP id t186so5466886pgb.1 for ; Mon, 26 Jun 2017 01:01: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=q8yHvBGBJbKosLm4h+QZlpTOMgJroSG2EwSzSh+ZvTo=; b=KkqEpks757b7f20rHqRdZ38LWPxqqqEkf6upNfnIZSPr24pXQJYaeV+tGmdxmexbM/ qHXKsnJlFesC/yvr5ZEHQdGuQrVe3riVVLIoLxVKDNqswYfgd3DUzc+J/fM1l3O894q1 YJIhPr9gPV5/rewCeSeTpElTo4zkE1aUtfjAY= 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=q8yHvBGBJbKosLm4h+QZlpTOMgJroSG2EwSzSh+ZvTo=; b=j3JVz3N51399Tal1D3Y0WcHPSa/PkZbVQLXXYk19PhVhSloeuxGPoDwXGj0qcK7Xe4 4OBDvMP9zhunnK5N4vUNx+WYfC0nFBnhQ7k5MTwaomiBsVk/p+xV3BaVyNm7bdK7OIOR kDsYMRVD1t/9uQcTwiaviznKHnux3EqKz9/tXwOOIfvmC+ZBJ3KP3fObMR+r1YpHJ8Ji mQmMUWjWTpVhjruK5URBQXskGc6JB6Lvy7migUkqM8uqxyNWAwhCTHOfiDdjg5xBZ+n6 zL4OatzFwvN2vPplcLoU7KWevDNdA/dIAwgmA8+Yrs61LT69LXp3KJsLQjfZUWpl4rLm 5Zxw== X-Gm-Message-State: AKS2vOxFoWuZ4wn9Bf8Jf0Whv7ANb2nrGGRKJSigtnoiDWsP1sy4sukF qrekALwbQQ1NmAX49PZtUQ== X-Received: by 10.84.171.193 with SMTP id l59mr22892528plb.139.1498464111861; Mon, 26 Jun 2017 01:01:51 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:50 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Matthias Reichl , Martin Sperl , Vinod Koul Subject: [PATCH for-4.9 5/7] dmaengine: bcm2835: Fix cyclic DMA period splitting Date: Mon, 26 Jun 2017 13:31:29 +0530 Message-Id: <1498464091-26753-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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: Matthias Reichl commit 2201ac6129fa162ac24da089a034bb0971648ebb upstream. The code responsible for splitting periods into chunks that can be handled by the DMA controller missed to update total_len, the number of bytes processed in the current period, when there are more chunks to follow. Therefore total_len was stuck at 0 and the code didn't work at all. This resulted in a wrong control block layout and audio issues because the cyclic DMA callback wasn't executing on period boundaries. Fix this by adding the missing total_len update. Signed-off-by: Matthias Reichl Signed-off-by: Martin Sperl Tested-by: Clive Messer Reviewed-by: Eric Anholt Signed-off-by: Vinod Koul Signed-off-by: Amit Pundir --- drivers/dma/bcm2835-dma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index e18dc596cf24..6204cc32d09c 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -251,8 +251,11 @@ static void bcm2835_dma_create_cb_set_length( */ /* have we filled in period_length yet? */ - if (*total_len + control_block->length < period_len) + if (*total_len + control_block->length < period_len) { + /* update number of bytes in this period so far */ + *total_len += control_block->length; return; + } /* calculate the length that remains to reach period_length */ control_block->length = period_len - *total_len; From patchwork Mon Jun 26 08:01:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106315 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103215qge; Mon, 26 Jun 2017 01:01:57 -0700 (PDT) X-Received: by 10.99.158.18 with SMTP id s18mr20229623pgd.113.1498464116943; Mon, 26 Jun 2017 01:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464116; cv=none; d=google.com; s=arc-20160816; b=n02N8LnzuhaeHm4TJh4nC4QSH+T0Kd1dk+Kb8Z+q9vL9UlirawZZs7J25Qyzak6ebV M9bOS79UI4bgYLhmBfBR77SY3yd0avKtVD84f4JR79bwxiXhvDjbljnPbH2Z6Zc1RY42 JIO9hXVjIGfc47bEsTIYElWcdXDfztgGuy6UbLq0rknGJ2eGOUVeJyVP53z3cIkt4/fY 43p0hy5vTh2SkZMNm4XvcQ9D9rCPxx+c/guOdVW/T/RSzQhK7p9U48uxWUbQ26hK37xZ KLlvhJvfnh/ZHb5Qrm04R0wrOc15pGrBSJQLYfGvS1e+q8OPzdFw8SMQbooZAmRyKntD 8J3w== 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=exOszOhYRtNreMyjMjJxQ9YXyNjs2oVaBGzQrrgfz2c=; b=W6Wv/ikEqfpsQLpa2IIWmwnrAW1iT+VdOk4vL0EJ7dVKu/Q285YWVswfB0Egnesxnd VSBAzVmWMYCfZIzpMNnFpEn2hAQxBlQtiNF5GGw21qX3xJ0MHN3gNPHCMFYi1Mpo5umc sJyCFSDwHDhWcOJbDGfGkA02rGJn9p4yAsUvnnyPgdSMuheiXZzGZOoTcvmwfj7cEvzi Y5omFejYsvXE8rBnRWRmqKpc+yBHtEO8f3n1GHQq+7YEdYCxWrR23cSCi4B+f6CyR9Jb J8lLBo+5iZI6kDEqmp2oN5L3Ldu8dpjTMX/6f18MBz+s+nJ/b46fA1W4aRT6ZObOf5LR LsXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=CmrBXNCF; 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 102si8959663pld.125.2017.06.26.01.01.56; Mon, 26 Jun 2017 01:01:56 -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=CmrBXNCF; 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 S1751392AbdFZIB4 (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:56 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:33758 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBz (ORCPT ); Mon, 26 Jun 2017 04:01:55 -0400 Received: by mail-pf0-f181.google.com with SMTP id e7so51448525pfk.0 for ; Mon, 26 Jun 2017 01:01:55 -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=exOszOhYRtNreMyjMjJxQ9YXyNjs2oVaBGzQrrgfz2c=; b=CmrBXNCFXscwKj124A289/r0eTIrcg2b+IZ9ZlAxRqCtqyGWtZOrSkh75mG0FUoNvy CEnVit8hUfOJbYgPPYQ11jiPIYJLxI4/NhAhlKczpwShUAWKcjt6B5QUvl8LMmYlVYFK 3hBSfyzoqPREIf2mwk+2j1+GMAg+OlBNv94Jc= 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=exOszOhYRtNreMyjMjJxQ9YXyNjs2oVaBGzQrrgfz2c=; b=mG+rgBve4sfRkTYR5IshB1tfjmbXyB+7Bc81KBTUIUi92GV2p9WSBLtUR/FMF5Xncp feF/x2gVwZMn0ViowaLLk3h1Jk4BMYBaukfe/hAe8c3Oo5edbpNo7fGWLnXoWOKJgO3l EmLMMpIQQpiU/c3hUjDNPwxn3SILRM1S573zKtC1H/JxgTROeIA1JKUR2KjaLjDR5HH3 50xPxzHQCS1TmWQ7XG72qEfGg4irMTHoVXGLlTyTeeoJG0uZvr0xtAnRStvOjJa58ZHz dhPM8ITjMp/9pj5Br2Pd+K2U4MJNdNiVxb1GAso55CMmTNyzNb5FeNvBNp5XXgGFzFOh bIWQ== X-Gm-Message-State: AKS2vOyw1qLobSDTyXAf9rl57i9JkvYx5G48MvDRr66YRoJanv9PBnNZ +ZhX/lqsO9anjGhPUyXgxA== X-Received: by 10.84.173.129 with SMTP id p1mr22817415plb.143.1498464114956; Mon, 26 Jun 2017 01:01:54 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:53 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Hauke Mehrtens , Mark Brown Subject: [PATCH for-4.9 6/7] spi: double time out tolerance Date: Mon, 26 Jun 2017 13:31:30 +0530 Message-Id: <1498464091-26753-7-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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 838783c3fed0..24d4492d0168 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1004,7 +1004,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 Mon Jun 26 08:01:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106316 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103232qge; Mon, 26 Jun 2017 01:02:00 -0700 (PDT) X-Received: by 10.101.88.13 with SMTP id g13mr20043131pgr.180.1498464120750; Mon, 26 Jun 2017 01:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464120; cv=none; d=google.com; s=arc-20160816; b=yKtoHKs2kwNtgB+RG26oGFprqimEuvS4PFZmMxclix+R++QsBa+PVOxuMzs8n+jpsC cNSlP3fhY5Ar7hnjSt3Ribk/S1Z++VUL87dwC31aiErYZtku3BtSAezRL1LE18YdTXUT ECkVkfUobiT+smsgRTn2Bmk5PRIMfyQJA7eBeGl54rqLYUTpkhJYRWAdBXmH4HPk8hxS gwq37DhNZm0v0rbXQd3ZBnax3DAStbnwvlkEaxboqCruN7yXB4/ocrQhQSiGb5cCE8Wc Qt/xxL9hDA8XMz6DB5rCAIqSBL8ne5ihSHORYie9iraYnlP9evMNQ5UX4jqRlxO2xSmP PbPQ== 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=5PIAAvqHSmNOvesCESAH3YIh5T/ueYUywOa+EHgnm54=; b=e1Vl0xdAXGw6QN9IFh5ofCzFwW1WwVuaOh46Ju+ri3OadHKk9Clhx2Fe2ap4FaMjKX xwEE6BSLyErhMhFevYWII+bEVEncehkFFWinxWz7S5NadomDfpN3L4xqB4hz+Ntrt/fT 8kQUnFh3+cob54zgVBjrFxI017A9257Fm+Xzg4c5cA7vSYFO69LIy507oeBGFSDHlH7s yTZvhe545tnSsql2C3CpPgPzrejFY0QKyCix4LmfaAlzhkDT+UO8xizKLj+W8aOH/SdI izjJ0Hpd/Qxo24YQt/eUUO1BbZoZPx6g0DJ/N93nmlQr8FkfHlAyYx27LDRwrhZQDhRv mfKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=guUgv93c; 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 102si8959663pld.125.2017.06.26.01.02.00; Mon, 26 Jun 2017 01:02:00 -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=guUgv93c; 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 S1751406AbdFZICA (ORCPT + 6 others); Mon, 26 Jun 2017 04:02:00 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34777 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIB7 (ORCPT ); Mon, 26 Jun 2017 04:01:59 -0400 Received: by mail-pf0-f182.google.com with SMTP id s66so51370913pfs.1 for ; Mon, 26 Jun 2017 01:01:59 -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=5PIAAvqHSmNOvesCESAH3YIh5T/ueYUywOa+EHgnm54=; b=guUgv93cV9zyMtwSBeA8HvC/bwW+fRvjibaJHzW8Wd6MI4bjNLPjQR5mXDiJqfEOa6 /EAgxU4WJvu1HO/uZTfUYZ9AnO4yG63So3tZ2St96cFAHIuVg11fSxTHaXYbI91xGSUk LHQp+sxUWdZr+xqM0c44exgvCtPEsDhXHSaBs= 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=5PIAAvqHSmNOvesCESAH3YIh5T/ueYUywOa+EHgnm54=; b=k4ZtcWQaeN4YUT2P+d+VPrfzIVieBmejzrj2eFbwl1iSHi8ijHKArbp0QPXPL6NARZ ypx/TlnKxkQujhL6vaCqHc35T8ssq/EU2RIaBzEt/p5ZnLA/agr9P7fYXf8gv0WtKE2e G+XHRHhmEYpoynfGzwZv0+hlLO/ABw7mU4bQc+1MYPpntNIPWP59o4GPi6dLQqlC9o/E X8fbfYRRWIRKVr9OVsYsqgwbBi54hTyRTuAYyY8NaPbDcg6lpbl2aWFOPnGiGeNS+lKy 5vgCwSV650eA4fM3zDLLjYwaD4UgqAoRHK43erAg9MeBc8zpNW1FN4+KWwwmCgisSYf8 Prnw== X-Gm-Message-State: AKS2vOxvmYblD7ZbaVAirOgemEkbRQLh8YUe30dpY2bMGS669LUIxzoA H171jlPM7884XqCk X-Received: by 10.99.125.25 with SMTP id y25mr20403159pgc.38.1498464117823; Mon, 26 Jun 2017 01:01:57 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:56 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Russell King , "David S . Miller" Subject: [PATCH for-4.9 7/7] net: phy: fix marvell phy status reading Date: Mon, 26 Jun 2017 13:31:31 +0530 Message-Id: <1498464091-26753-8-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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 d6a541bde331..2f70f80de27f 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1114,8 +1114,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