From patchwork Fri Sep 28 12:20:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 147788 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp691033lji; Fri, 28 Sep 2018 05:21:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Y5UORWPqQNcvknEeRxLXtDAlT86DYRwz4PO6dStXi3rL7G4nRRnPgcmW3CKcq6rmPywtV X-Received: by 2002:a63:cd02:: with SMTP id i2-v6mr14411457pgg.93.1538137307487; Fri, 28 Sep 2018 05:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538137307; cv=none; d=google.com; s=arc-20160816; b=Gbd+1WAAeIsP5vjdxaRzyr72l7zHrz0YJ1WBw3cf+wLSru3Dbxh2T/QbZt/Rg4rnho r7GVVl1/V7HphTbzuFm1PQzCFJyDYu38nQHeICr4pCusjFVs2gz3Evr8+3w3kgBzwxyb xtOweuS7VZRy0tXimpN28g/Z7b55sGe3R2rNL9gymZMmAK6IrtF0HCIwIfGs+3VlXWG1 oJMcSLUFPYpFsE6JO28rs6OIe4ZdNNcftbI8sNArI+ZSBXtOek3hd0PHNyAW7crPRw6a OI/DzrqSydLPYZJSsJPXA1rd94bv1ERcxqE/BzLrKl6jzJa1qoGNg502+SDIfx0iJjby t1dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=D55j2WFrkpK9kmCL35xXC2dS03T2Mu1A1HChI6eevPA=; b=GdOQMs45ab9/5NBmvdO7dXlidSJOb8w579LOXgRqBtMDqHg5bnbST/dBotFOvANkvr 845NQehSiBf9Fy/Y4eBWGTMNXMAKf77xGTXm/v78uUgVG9dUrfUDU0U39Rx/S+BkKgO4 F3ENqyzplPy+SaEKxFm5ZH63yXHftoMdE13r38vCQ2hIUwBNgfkXNmgBjVHMG0yCXVCm HHzWAWYQ50D1+kgyRDZi4J9bwzQmzlvzfNezq8Hh8TkyRXrrlbkzyVDBTxz3VdD4WJrz 97Jjy1bmnmWK/FUCbUJFAF5W14WWpvCMU7HKFXBU+CYQKH4KXVbxH3sLrurc4sMGqjfQ 5iDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Xh8bOiYH; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25-v6si4728401pfh.207.2018.09.28.05.21.47; Fri, 28 Sep 2018 05:21:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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=@samsung.com header.s=mail20170921 header.b=Xh8bOiYH; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbeI1SpR (ORCPT + 3 others); Fri, 28 Sep 2018 14:45:17 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60283 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbeI1SpR (ORCPT ); Fri, 28 Sep 2018 14:45:17 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180928122143euoutp019d41a523ec14fe2f32650554def76d76~Yj7pK5wzU2437524375euoutp01U; Fri, 28 Sep 2018 12:21:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180928122143euoutp019d41a523ec14fe2f32650554def76d76~Yj7pK5wzU2437524375euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538137303; bh=D55j2WFrkpK9kmCL35xXC2dS03T2Mu1A1HChI6eevPA=; h=From:To:Cc:Subject:Date:References:From; b=Xh8bOiYHM0/jjlavO2sPdufgDLy/+p8uw2SCz9DvDAeWicAl8192yKcpfPWUjSNDX QfKdSnAe6zwSUE2teIas6irewHGMb6MW5iEciTK+JQfBiLi/PGtjwbXINAqx6lR5vY 1KcI4Fk56/4xq5Y/B4V9oXRMr9S1q4JY63gdFN8s= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180928122142eucas1p1e31993895d1a878c4dd8a6ca386f7325~Yj7ot85zZ0323503235eucas1p1L; Fri, 28 Sep 2018 12:21:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FE.CE.04294.6DC1EAB5; Fri, 28 Sep 2018 13:21:42 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180928122141eucas1p2feee237ecf064b6abddeda569f356c86~Yj7n71kOb1403914039eucas1p2i; Fri, 28 Sep 2018 12:21:41 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-7a-5bae1cd697fb Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 05.0F.04284.5DC1EAB5; Fri, 28 Sep 2018 13:21:41 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PFR004DRMBWR030@eusync1.samsung.com>; Fri, 28 Sep 2018 13:21:41 +0100 (BST) From: Marek Szyprowski To: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Jaehoon Chung , Ulf Hansson , Shawn Lin , Tony Lindgren , Linus Walleij , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , stable@vger.kernel.org Subject: [PATCH] mmc: slot-gpio: Fix debounce time to use miliseconds again Date: Fri, 28 Sep 2018 14:20:40 +0200 Message-id: <20180928122040.2221-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsWy7djP87rXZNZFGxx6yWWxccZ6Vosbv9pY Lc6f38BuMeXPciaLI//7GS1mnN/HZLH2yF12iztPgEoWbHzEaLH/ipfF8bXhDtwe375OYvHY tKqTzePOtT1sHn9n7Wfx6NuyitHj8ya5ALYoLpuU1JzMstQifbsErowV29ULjnFWXH14jLWB sYGji5GTQ0LARGLS/RWsXYxcHEICKxglWi/sZAZJCAl8ZpQ4fDUcpqh7w3IWiKJljBLrdq9i hHAamCRm/7jDBlLFJmAo0fW2C8jm4BARcJB4cd4JpIZZ4A2TxP+zD8CmCgt4S2zZ/pkVxGYR UJX4PeE5WC+vgI3E2xcNLBDb5CVWbzjADNIsITCBTaJ92mpGiISLxIG2O1C2sMSr41vYIWwZ ic6Og0wQDc2MEu0zZrFDOD2MElvn7GCDqLKWOHz8IthqZgE+iUnbpjODnCohwCvR0SYEUeIh Mf3oGVaI/2MlVn1bxDaBUWIBI8MqRvHU0uLc9NRio7zUcr3ixNzi0rx0veT83E2MwKg8/e/4 lx2Mu/4kHWIU4GBU4uFNeLQmWog1say4MvcQowQHs5II777qtdFCvCmJlVWpRfnxRaU5qcWH GKU5WJTEefm00qKFBNITS1KzU1MLUotgskwcnFINjKzZBhkzHW+EPfLIXsTwNvTp5r3FKtyV HRK72fbpTmH/1fano3SfaIp2WmC7NB9jTVGT3tx9VduZi+f6Bc1KPHPjnEdYzunjfu/5l0oz Cqc1du9J4LDdd81AL5DlRalCo0TtV9+bvApl2VOdCnTsI57k5bCnfWuvCF3Yd8maLW/l9Gsz Zn9TYinOSDTUYi4qTgQA6OtdQ8YCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmluLIzCtJLcpLzFFi42I5/e/4Zd2rMuuiDZqeSFhsnLGe1eLGrzZW i/PnN7BbTPmznMniyP9+RosZ5/cxWaw9cpfd4s4ToJIFGx8xWuy/4mVxfG24A7fHt6+TWDw2 repk87hzbQ+bx99Z+1k8+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK2PFdvWCY5wVVx8eY21g bODoYuTkkBAwkejesJyli5GLQ0hgCaPExcm7mUESQgJNTBLPFleD2GwChhJdb7vYuhg5OEQE HCRenHcCCTMLvGOSWPlBBcQWFvCW2LL9MyuIzSKgKvF7wnM2EJtXwEbi7YsGFohd8hKrNxxg nsDItYCRYRWjSGppcW56brGhXnFibnFpXrpecn7uJkZg0Gw79nPzDsZLG4MPMQpwMCrx8CY8 WhMtxJpYVlyZe4hRgoNZSYR3X/XaaCHelMTKqtSi/Pii0pzU4kOM0hwsSuK85w0qo4QE0hNL UrNTUwtSi2CyTBycUg2MoRY/Jvnp39xt4yky5bVU3/MyOxG7r22HrZ+3LUh/WDHz69RpG+a/ cLLT0jaomstda2LeEeok2Pzv6fSQZz/rPHIfbrz+xWD9DfvHy5o/L7sgtjV1/ayJ0y3m1zhO aqoW2zBnzxa/pK0b/72W+rvQKGhl+trodcwnfbIXXc+q9/jqH9fLWLTXVImlOCPRUIu5qDgR AInH+soWAgAA X-CMS-MailID: 20180928122141eucas1p2feee237ecf064b6abddeda569f356c86 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180928122141eucas1p2feee237ecf064b6abddeda569f356c86 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The debounce value passed to mmc_gpiod_request_cd() function is in microseconds, but msecs_to_jiffies() requires the value to be in miliseconds to properly calculate the delay, so adjust the value stored in cd_debounce_delay_ms context entry. Fixes: 1d71926bbd59 ("mmc: core: Fix debounce time to use microseconds") Fixes: bfd694d5e21c ("mmc: core: Add tunable delay before detecting card after card is inserted") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Marek Szyprowski --- This patch fixes eMMC card detection on Exynos5410-based Odroid XU board, broken since Linux next-20180928. --- drivers/mmc/core/slot-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index 2a833686784b..86803a3a04dc 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -271,7 +271,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, if (debounce) { ret = gpiod_set_debounce(desc, debounce); if (ret < 0) - ctx->cd_debounce_delay_ms = debounce; + ctx->cd_debounce_delay_ms = debounce / 1000; } if (gpio_invert)