From patchwork Tue May 30 13:52:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 100714 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp223999qge; Tue, 30 May 2017 06:53:41 -0700 (PDT) X-Received: by 10.84.174.3 with SMTP id q3mr24296185plb.52.1496152421703; Tue, 30 May 2017 06:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496152421; cv=none; d=google.com; s=arc-20160816; b=bsvV+hJqN02Iop2tX9i78c29TabE6jrnFJIv0gi9czZRk34yzcZklzr8eGuApZjSrD O3rU+TH1Xd6AZzaQzU7tGrfAd6HUm2cH2o9ZksX+1HR10bAuP+sv+rXdqhFLhWeF+8pf akDUi4end1SYXh+78LwcEZSLyNyVrp/7uew7QVW0BHNgdafChky3rDW6YLroOI3tmw62 N8oMAOvTA2BxGOzWyM/xiid7++k/I+w5n4IPAwUeIF0n4j6niK30TaHHhzNU+rsonQ+T c34mC+STUSZ3KEGlGElmJSqLFkK30lLTAcUXjkRQHRajIesxcyOmr/KsEpzrnNOli9ar J+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=HcHJHGWRADw04ewEeKPjq/xdpOeHqqf6FE21hFyByds=; b=gM4vZREqLyGoLEBPcfBkBnV6OO3a97k8KnVPW5LqTXDHF+uBLMuE+MmnlMpdLfwTuK 8bR2YtNptgBoFzuZuTZgb5c7YM154zjWOafepX0GttcWjxEo9k6Ca6jaKb9LJ1XTfB35 sulS224kWAe6OmQCULPXreiQONH62FhI6sjQcd7JdtHPpiTdwDHi1QUtNBBrQ3zMLQM3 veLrZXqs4jZi+hd0J+65QWQMUu6ewMSroW3pQvq7oGo6vSwHKu+NJ76VL0bgQnwTLT8v d+knysh73MEpAMlvi93ZMUCwDtokg6oZZ5CPmPAX4P8CJVUYERff4Wk3Wa3XYH7/W2qE c69g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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 i63si12964718pge.202.2017.05.30.06.53.41; Tue, 30 May 2017 06:53: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; 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 S1751152AbdE3Nxk (ORCPT + 6 others); Tue, 30 May 2017 09:53:40 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34566 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbdE3Nxj (ORCPT ); Tue, 30 May 2017 09:53:39 -0400 Received: by mail-lf0-f50.google.com with SMTP id 99so49517505lfu.1 for ; Tue, 30 May 2017 06:53:38 -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; bh=HcHJHGWRADw04ewEeKPjq/xdpOeHqqf6FE21hFyByds=; b=LpBZSCqy8eWodzVgBhpUf2fFXpBuPIBuwcrfml9d4iBMyoIkDFpMaEca5UmRuiMCIS Nesh+lYCaaq5Y2l+nX2DqSepDDZh+ci7pB5y1Fg9PD8mjCkamnB8i9ckj8VKZ/Dqmhzf rWBgjtcFJ3+o51gHnUCq2GFHQbYBR6u4ij0x8= 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; bh=HcHJHGWRADw04ewEeKPjq/xdpOeHqqf6FE21hFyByds=; b=rXx4SCZ3QpABAyJKyxiVJH+4Flmpz55wfowqArfJporUED/hqwwCIq9PmF9bHRY9se bz1m2XwWUykhywnVqzCrSEeU9lP6R+6sCC9lyXI8luUHY2yuAIVitsnzdMQWn/HT/IyZ rdmmlq4LrZwKWSzqwnNym8Kc8hO0b4EwO9q8Pxnr6C8FY9VVPnV0QKeVK3G4hU77EW77 OdhV8KMeqlPZzJKtQg2vokN6MRhfgnRB2tynOrbHzHgVwiFGjXFFtJIvFaA+uxo6hS/J cXkIHTDdwTXiF6AfE3PPjL27Q4m4CRRPuCwlaU97Bl0tf+flc+imMUHCmD9Ym/1sIONG JBcQ== X-Gm-Message-State: AODbwcAixTAWWgFJ55DYWDk2qS/Ax8QAiS4kWekoHW6QUJ3jRo84oZho gbrIC6m6lgpQOiED X-Received: by 10.25.228.197 with SMTP id x66mr5005007lfi.145.1496152417774; Tue, 30 May 2017 06:53:37 -0700 (PDT) Received: from genomnajs.bredbandsbolaget.se (c-9d7e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.157]) by smtp.gmail.com with ESMTPSA id q12sm2718806lfe.5.2017.05.30.06.53.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 06:53:36 -0700 (PDT) From: Linus Walleij To: Tejun Heo , Bartlomiej Zolnierkiewicz Cc: linux-ide@vger.kernel.org, Linus Walleij , stable@vger.kernel.org, Andy Shevchenko Subject: [PATCH] Revert "ata: sata_mv: Convert to devm_ioremap_resource()" Date: Tue, 30 May 2017 15:52:56 +0200 Message-Id: <20170530135256.9966-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This reverts commit 368e5fbdfc60732643f34f538823ed4bc8829827. My NAS stopped to mount root when I went from some v4.10-rc1 to v4.12-rc3. Investigation of the bootlog yields this: sata_mv f1080000.sata: can't request region for resource [mem 0xf1080000-0xf1084fff] sata_mv: probe of f1080000.sata failed with error -16 Reverting this offending patch makes the sata_mv probe and my SATA drive can mount root again, hooray! Cc: stable@vger.kernel.org Cc: Andy Shevchenko Signed-off-by: Linus Walleij --- The problem is probably caused by overlapping resources in the device tree, for which ioremap() and ioremap_resource() have different semantics: the former allows it, the latter does not. A proper fix probably includes amending the device tree to not have overlapping resources. --- drivers/ata/sata_mv.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- 2.9.4 diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index b66bcda88320..3b2246dded74 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -4067,7 +4067,6 @@ static int mv_platform_probe(struct platform_device *pdev) struct ata_host *host; struct mv_host_priv *hpriv; struct resource *res; - void __iomem *mmio; int n_ports = 0, irq = 0; int rc; int port; @@ -4086,9 +4085,8 @@ static int mv_platform_probe(struct platform_device *pdev) * Get the register base first */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mmio = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(mmio)) - return PTR_ERR(mmio); + if (res == NULL) + return -EINVAL; /* allocate host */ if (pdev->dev.of_node) { @@ -4132,7 +4130,12 @@ static int mv_platform_probe(struct platform_device *pdev) hpriv->board_idx = chip_soc; host->iomap = NULL; - hpriv->base = mmio - SATAHC0_REG_BASE; + hpriv->base = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); + if (!hpriv->base) + return -ENOMEM; + + hpriv->base -= SATAHC0_REG_BASE; hpriv->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(hpriv->clk))