Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3798329ybi; Mon, 29 Jul 2019 12:50:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS8z8quLIhn2ClnVpcr6U2mYMKt4BYqrAoaJtnr4vz7PYAPikobe2fpH25zBWbV6WnpKD6 X-Received: by 2002:a17:90a:17c4:: with SMTP id q62mr115477055pja.104.1564429832689; Mon, 29 Jul 2019 12:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429832; cv=none; d=google.com; s=arc-20160816; b=XpuLI0yrowhgao1HwIBOGqogqjNYlfcLKlTYwU5oz7nA8re3tnOr0x4Kei2/F8vECk 10fbm8PP3SMPy8W7iRaO8VqTbY/vYiiAOYrij7oi9vo1rpHkauSB88Hb4kIWMuyl9J2W vaxaRjmx/UfBOz7++gZchp7wJMOrlUbkg1/Gj6tHyw5pu09IpJWbl+zTQzDjAUeQt1fX ul+nWDeOM33TzXScHzUjGRDD6ru6ApKeYI9KkES8vOogNUxHOW9ACtqGFTnraq8ZWjMd uAoTf/4Su/VstICilzwvmFK7ZUAeZKvGUtO3dXHgrrE6/y9tlI5fUXvsqvqjclQtUuCS Ygjw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BMziAQTcNeenxDDnfTiFlQESmrezOJKyFjyZwiUh7Hg=; b=Cdjo9IPlRwAvIeeL37pM6EepNPJw2+zKyM1yTkniAETQwNwAq9ZxWKWm8k8HfvA2wo 72Cj28+fLl8C8p+/ucpwBMMQqC7l1DdQnR4F/e0x/MmpLHmFySjzIyOKP47SiTkk1TxI qlws3H4ZNXo0mI0bKwcSY+xN1pJm6BvM5ZNytHvn+I9HcecdD4tU1RZlw38CulRbsvJj /WdAKiSeW1qsV7qFZjcqNuPDmIvsMDgXWRXZtpHxagtrxkol/QZmdmNsMgkP/Xt1Atu/ iOJy25IQtumBMSjHfKCOTVQs8QEDSH28sre4inMHT9ShrJxDh/cMhcwE4W/8TuTzc5qZ 2uMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kmcWQRMV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si25151903plp.1.2019.07.29.12.50.17; Mon, 29 Jul 2019 12:50:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=kmcWQRMV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390468AbfG2TtD (ORCPT + 99 others); Mon, 29 Jul 2019 15:49:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390281AbfG2TtC (ORCPT ); Mon, 29 Jul 2019 15:49:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1DEB32054F; Mon, 29 Jul 2019 19:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429741; bh=vaANCP3glYXdOd8WXkfUWMyFhWN+1pq/iZnNAFKtP3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kmcWQRMVTIijiKWzOmB0r+X/bTN5BHiPvooqjwoxlZnRzm/MAfB7wq/Ffy/vaNYzg BMjdiTV/v4/plX9H3iUYDmIPppeXAXozBb4V3IGzPdFawSa+t8U3lh9GInfcOdi2AX 68sZmWOio+V5pPOlUJTjOcnuY7IiNXmVsXjtnGMk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raul E Rangel , Adrian Hunter , Ulf Hansson , Sasha Levin Subject: [PATCH 5.2 073/215] mmc: sdhci: sdhci-pci-o2micro: Check if controller supports 8-bit width Date: Mon, 29 Jul 2019 21:21:09 +0200 Message-Id: <20190729190752.828870521@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit de23f0b757766d9fae59df97da6e8bdc5b231351 ] The O2 controller supports 8-bit EMMC access. JESD84-B51 section A.6.3.a defines the bus testing procedure that `mmc_select_bus_width()` implements. This is used to determine the actual bus width of the eMMC. Signed-off-by: Raul E Rangel Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-pci-o2micro.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c index dd21315922c8..9dc4548271b4 100644 --- a/drivers/mmc/host/sdhci-pci-o2micro.c +++ b/drivers/mmc/host/sdhci-pci-o2micro.c @@ -395,11 +395,21 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot) { struct sdhci_pci_chip *chip; struct sdhci_host *host; - u32 reg; + u32 reg, caps; int ret; chip = slot->chip; host = slot->host; + + caps = sdhci_readl(host, SDHCI_CAPABILITIES); + + /* + * mmc_select_bus_width() will test the bus to determine the actual bus + * width. + */ + if (caps & SDHCI_CAN_DO_8BIT) + host->mmc->caps |= MMC_CAP_8_BIT_DATA; + switch (chip->pdev->device) { case PCI_DEVICE_ID_O2_SDS0: case PCI_DEVICE_ID_O2_SEABIRD0: -- 2.20.1