From patchwork Wed Jun 30 10:24:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 468683 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp205386jao; Wed, 30 Jun 2021 03:26:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww7tzJzlJU80KCbizm42+WJZUlr0YdDPT0o8ETdUfpK7aFizvIvvBE4Z9nGllMKVkYKJX+ X-Received: by 2002:aa7:d592:: with SMTP id r18mr11568751edq.269.1625048775868; Wed, 30 Jun 2021 03:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625048775; cv=none; d=google.com; s=arc-20160816; b=L1eJE4QS2YWgIGYwtnt0mOLq7/JJv4ed2BsepDBF5EWsNesOQp7k+SF+XCa8E8ZxTs i1jvhUmPmohc6gatFRLfZ8sBMFoJDZMlLTIZyAThR2iEGIQ3DYGa/U16r25/eVqIUN5U /f8StP68QqvGYF61BXB0PNPndK1ETzhqbTeJebSCebV+c5GZU+IzISZ5O9yI3OoFhSrs hJEXTLsrhFm4nqNP2TSawNyXLRFstxKjTjqGLm/hKpP1sQgSknMouiTNTVaAoycx3J2N IsmAy7xVvzROuzcDkFSBUe1oFWciZmnsVAgLzMRwsBWBC7ff2bN+OPHGrc65h4yqjvDX +HRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/ffutUjzPFN7qPAJQtcSJsb+UgAvwvkfMxMfZtqu4kw=; b=GkkxnmxisolOt0+H50C/j/tW6EYXKV+xH1LVqqF0uG2qs6cIF4L8D10YH1Bnut6p12 tZLKun+/NuG8yx30AfANQhmmLX90wAIk5uVans8LGgff8Pvqh1Jxz4H+Hl0Rn1WaILMN YEeQDNiZy0rcIPp5R9DvjKp7KkLaGbO+23iH1BQqbNkKJLAXc4jFMEsc9iz6+eDk5VeF UcXNLTFWfC2iqptvkMKbj02i27gQgZ+41f49MSsMikwzhvvbtnBIXIK2PkoKw14gdcPa NT4ILG7OhHj+vAIidUpSHj0faVnMj9f3UslDNIIUOormN6f1CvR5RavuTYOwfWzYdlwR TDvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zBhmFUTM; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-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. [23.128.96.18]) by mx.google.com with ESMTP id em22si17297030ejc.705.2021.06.30.03.26.15; Wed, 30 Jun 2021 03:26:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zBhmFUTM; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-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 S233959AbhF3K2m (ORCPT + 4 others); Wed, 30 Jun 2021 06:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbhF3K2m (ORCPT ); Wed, 30 Jun 2021 06:28:42 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31792C061756 for ; Wed, 30 Jun 2021 03:26:13 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id k10so4081666lfv.13 for ; Wed, 30 Jun 2021 03:26:13 -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:mime-version :content-transfer-encoding; bh=/ffutUjzPFN7qPAJQtcSJsb+UgAvwvkfMxMfZtqu4kw=; b=zBhmFUTMbYq22xJ9DpkTAuY9UTNoNpjfAr0+9TA96iShE2YjQV2YiNHe5pr3KHy9is Jklc816Ov0rrOZY2pZaDXogiA7ik6AK+WSmb6QkINnbZigm/RjDPzr7mB69l9t/jMkY6 NeUVs98OAk7PmNvNFsDj3hqFaZJxjdhRBIFIT5KXbZKMUAo8eTyjg771faxGKgEyBvwY rkGf1QEjnlU9DX3WKEhAAkbnWyAYuoLvn+72zBwlvPnfJI9H9F9vIDPH3N/14g+1hjO9 2BtKI+FoLdfJ1o9eiXkDkGv6X9khbWKqKNISYNxZhh2SYDsPmtLEnY3yGj0CEiaeeXqQ 9LEw== 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:mime-version :content-transfer-encoding; bh=/ffutUjzPFN7qPAJQtcSJsb+UgAvwvkfMxMfZtqu4kw=; b=LpHyBB2kYyZZcuXtYLC/E2wzld3of7iJeD7JIYtCJKirCkBWB/nT11GIqDXfkh68bz lOIm18VV66Q//7CwufVLTKbit9QdC9kHLrlWjh2uU0BYD9BdpdSuPsBGcc2uUNGvVuHn q4gWARucCutJH2Ae5D2uax076pP4StyWyjvHEDcpC1ws0hv8FDYEF2iYJch6oSLeXgRZ FsuWBh4LJrXxmsuzEvqXz1y44KWOeBpK8NHutc6TIkwFIr6HbZZcugoFeI8W8qqWqooL F/vD+wRxmOHUuNs5uWo8OTuR7webH3eD2Z7ht9KNSucGlO4uLvnlpPSV5cCze7Esp/Ht xwPA== X-Gm-Message-State: AOAM533c7UTdZ7g2jwbRmy2l99PsUwJ9VcfR/lttEvRjdC1IkQht5mNc MJPaOwFcvVj9wh4wSyg9s3pmzsieBPPnVA== X-Received: by 2002:a19:8c03:: with SMTP id o3mr25937182lfd.499.1625048771412; Wed, 30 Jun 2021 03:26:11 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id bn23sm2167999ljb.48.2021.06.30.03.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 03:26:11 -0700 (PDT) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Linus Walleij , Russell King , Yann Gautier , Ludovic Barre Subject: [PATCH v2] mmc: mmci: De-assert reset on probe Date: Wed, 30 Jun 2021 12:24:08 +0200 Message-Id: <20210630102408.3543024-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org If we find a reset handle when probing the MMCI block, make sure the reset is de-asserted. It could happen that a hardware has reset asserted at boot. Cc: Russell King Cc: Yann Gautier Cc: Ludovic Barre Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Drop the else {} clause: reset_control_deassert() handles NULL just fine. --- drivers/mmc/host/mmci.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.31.1 Tested-by: Yann Gautier diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 984d35055156..3765e2f4ad98 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2126,6 +2126,9 @@ static int mmci_probe(struct amba_device *dev, ret = PTR_ERR(host->rst); goto clk_disable; } + ret = reset_control_deassert(host->rst); + if (ret) + dev_err(mmc_dev(mmc), "failed to de-assert reset\n"); /* Get regulators and the supported OCR mask */ ret = mmc_regulator_get_supply(mmc);