From patchwork Tue Oct 18 15:37:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zach Brown X-Patchwork-Id: 9382401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 08AA8607D0 for ; Tue, 18 Oct 2016 15:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE21929643 for ; Tue, 18 Oct 2016 15:38:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2B6929658; Tue, 18 Oct 2016 15:38:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3731E29643 for ; Tue, 18 Oct 2016 15:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936594AbcJRPhU (ORCPT ); Tue, 18 Oct 2016 11:37:20 -0400 Received: from skprod3.natinst.com ([130.164.80.24]:34781 "EHLO ni.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935772AbcJRPhR (ORCPT ); Tue, 18 Oct 2016 11:37:17 -0400 Received: from us-aus-exch2.ni.corp.natinst.com (us-aus-exch2.ni.corp.natinst.com [130.164.68.12]) by us-aus-skprod3.natinst.com (8.15.0.59/8.15.0.59) with ESMTPS id u9IFb73P003331 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 18 Oct 2016 10:37:07 -0500 Received: from us-aus-exch3.ni.corp.natinst.com (130.164.68.13) by us-aus-exch2.ni.corp.natinst.com (130.164.68.12) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 18 Oct 2016 10:37:07 -0500 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exch3.ni.corp.natinst.com (130.164.68.13) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 18 Oct 2016 10:37:07 -0500 Received: from us-aus-mgwout1.amer.corp.natinst.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Tue, 18 Oct 2016 10:37:07 -0500 Received: from zach-desktop.amer.corp.natinst.com ([130.164.14.198]) by us-aus-mgwout1.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6 HF1218) with ESMTP id 2016101810370714-84940 ; Tue, 18 Oct 2016 10:37:07 -0500 From: Zach Brown To: CC: , , , , , , Subject: [PATCH 2/2] sdhci: Prevent SD from doing high-speed timing when broken-highspeed property is set Date: Tue, 18 Oct 2016 10:37:06 -0500 Message-ID: <1476805026-677-3-git-send-email-zach.brown@ni.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476805026-677-1-git-send-email-zach.brown@ni.com> References: <1476805026-677-1-git-send-email-zach.brown@ni.com> X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 10/18/2016 10:37:07 AM, Serialize by Router on US-AUS-MGWOut1/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 10/18/2016 10:37:07 AM, Serialize complete at 10/18/2016 10:37:07 AM MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-18_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610180259 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the broken-highspeed property is set the sdhci driver will not go into highspeed mode even if the controller and card appear to otherwise support highspeed mode. This is useful in cases where the controller and card support highspeed, but the board configuration or some other issue make highspeed impossible. For example, we send the SDIO lines through a fpga so we need the data to change on the falling edge of the clock or there will be issues with hold time. Signed-off-by: Zach Brown Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1e25b01..4ec44fd 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -3269,7 +3270,8 @@ int sdhci_setup_host(struct sdhci_host *host) if (host->quirks2 & SDHCI_QUIRK2_HOST_NO_CMD23) mmc->caps &= ~MMC_CAP_CMD23; - if (host->caps & SDHCI_CAN_DO_HISPD) + if ((host->caps & SDHCI_CAN_DO_HISPD) && + !(of_property_read_bool(mmc_dev(mmc)->of_node, "broken-highspeed"))) mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&