From patchwork Fri Jun 5 10:06:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 49560 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 37D7E2157C for ; Fri, 5 Jun 2015 10:07:08 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf3722946wib.0 for ; Fri, 05 Jun 2015 03:07:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=/PH3xehMQIJ3gjZLBpA97D4d9xP6Iq3sBk1mX3alaTg=; b=TP9ASS3BZj8nFCOKAn6NNdsd8fZMYql5yELeh1NL+/hrEh7kxA7Al7wT8CQzHiuKb4 /1TEYyFrXtO6weNpvd6SPeMoTSHVPeQu+mizRwk9Uh+7SvnllZTo4kzVtvKwxWyrQRSb JdsmZx0jLCSrJvggoqWE6ZjQbC6dFcv9HIay8CE9wJYaBYdGjrAkQJDqZaORfC67+ulU BxPE/yh8WTqapsC0xB40jCiJhaGqmKcwPUXvRycy5Y4BrBVbNNJs2sSCTSG+jtg3fpZq IDLRYf0FdbeGjHTTzDecvxUUtaEbNcGewmWHvUZSeQKBUN/0I6GQ0IsRMjMVotJiGmMy o/og== X-Gm-Message-State: ALoCoQlCWBd/hX9aZcMgkQCVQRBoYiq6bc52Meo2sTINO7JtArteFhqyD1SNyFc+AoDnSs3qDOmC X-Received: by 10.152.26.134 with SMTP id l6mr2560349lag.10.1433498827415; Fri, 05 Jun 2015 03:07:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.7 with SMTP id v7ls317669laa.75.gmail; Fri, 05 Jun 2015 03:07:07 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr2620380lbb.76.1433498827270; Fri, 05 Jun 2015 03:07:07 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id q16si4417671laa.25.2015.06.05.03.07.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 03:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laar3 with SMTP id r3so1610001laa.3 for ; Fri, 05 Jun 2015 03:07:06 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr2599766lbc.73.1433498826803; Fri, 05 Jun 2015 03:07:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1291538lbb; Fri, 5 Jun 2015 03:07:06 -0700 (PDT) X-Received: by 10.112.161.197 with SMTP id xu5mr2544664lbb.69.1433498826405; Fri, 05 Jun 2015 03:07:06 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id l9si4383250laf.165.2015.06.05.03.07.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 03:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by laew7 with SMTP id w7so50650855lae.1 for ; Fri, 05 Jun 2015 03:07:06 -0700 (PDT) X-Received: by 10.153.11.163 with SMTP id ej3mr2546004lad.105.1433498826248; Fri, 05 Jun 2015 03:07:06 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id oy3sm1639842lbb.1.2015.06.05.03.07.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 03:07:05 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Yangbo Lu , Tim Kryger Subject: [PATCH] mmc: sdhci: Restore behavior while creating OCR mask Date: Fri, 5 Jun 2015 12:06:57 +0200 Message-Id: <1433498817-16679-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 3a48edc4bd68 ("mmc: sdhci: Use mmc core regulator infrastucture") changed the behavior for how to assign the ocr_avail mask for the mmc host. More precisely it started to mask the bits instead of assigning them. Restore the behavior, but also make it clear that an OCR mask created from an external regulator overrides the other ones. Fixes: 3a48edc4bd68 ("mmc: sdhci: Use mmc core regulator infrastucture") Cc: Tim Kryger Reported-by: Yangbo Lu Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1b4861d..706bb60 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3256,13 +3256,14 @@ int sdhci_add_host(struct sdhci_host *host) SDHCI_MAX_CURRENT_MULTIPLIER; } - /* If OCR set by external regulators, use it instead */ + /* If OCR set by host, use it instead. */ + if (host->ocr_mask) + ocr_avail = host->ocr_mask; + + /* If OCR set by external regulators, give it highest prio. */ if (mmc->ocr_avail) ocr_avail = mmc->ocr_avail; - if (host->ocr_mask) - ocr_avail &= host->ocr_mask; - mmc->ocr_avail = ocr_avail; mmc->ocr_avail_sdio = ocr_avail; if (host->ocr_avail_sdio)