Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932066AbbBPFsp (ORCPT ); Mon, 16 Feb 2015 00:48:45 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:38287 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751272AbbBPFsl (ORCPT ); Mon, 16 Feb 2015 00:48:41 -0500 X-AuditID: cbfee68f-f791c6d000004834-bf-54e184b65aed Message-id: <54E184B6.90808@samsung.com> Date: Mon, 16 Feb 2015 14:48:38 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-version: 1.0 To: Javier Martinez Canillas , Addy Ke Cc: Ulf Hansson , Olof Johansson , Alim Akhtar , Andrzej Hajda , Douglas Anderson , =?UTF-8?B?SGVpa28gU3TDvGJuZXI=?= , cf@rock-chips.com, lintao@rock-chips.com, huangtao@rock-chips.com, Linux Kernel , "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-rockchip@lists.infradead.org Subject: Re: [PATCH v4 0/3] about data busy References: <1423828368-18456-1-git-send-email-addy.ke@rock-chips.com> <1423894668-8886-1-git-send-email-addy.ke@rock-chips.com> In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsWyRsSkUHdby8MQg3NPLS1urTvHarHs/3cm i6W3qi1aO16xWZxddpDN4v+j16wWWxZ8Z7a49nsGm8WcD3EWmx5fY7W4vGsOm8WR//2MFp8e /Ge2OHX9M5vF8bXhDvwesxsusnj8nd3K7LFz1l12jzvX9rB5bF5S73HlRBOrx99Z+1k8+ras YvTYfm0es8fnTXIBXFFcNimpOZllqUX6dglcGfuXihZ8UKx4cpOrgfGVVBcjJ4eEgInEpUOb mSFsMYkL99azdTFycQgJLGWUeHJtG2sXIwdY0acpShDxRYwS617vYYV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HZ33wOJsAjoS278dZwKxRQXCJCbefMwKUS8o8WPyPRYQWwQo /u7jV7ChzAJzWSSubJ8PlhAW0Jbo3fWBHWLbSUaJ2RdfgE3lFAiWONs7jwXkVGYBdYkpU3JB wswC8hKb17xlnsAoMAvJjlkIVbOQVC1gZF7FKJpakFxQnJSea6RXnJhbXJqXrpecn7uJEZxK nknvYFzVYHGIUYCDUYmH94PKwxAh1sSy4srcQ4wSHMxKIrzHwoBCvCmJlVWpRfnxRaU5qcWH GE2BITCRWUo0OR+Y5vJK4g2NTcyMLI3MDS2MjM2VxHmV7NtChATSE0tSs1NTC1KLYPqYODil GhidP9ka7U9+HZexJ9fVui41WOe2rPzfRVuZqlXfi7qKX7J2tDmxQOHZfZeLF7YWrOYxqD03 a6eFoMLB/mNH7j1nWb7NucOIc/vKho4bK57+FCl/PGH9goVJxzpTHXtLFoWWRHf+2rrx9dSC LnfXDwZ7/+Yuqq1qvvzXfoLfH60j+/cXMb70ffZJiaU4I9FQi7moOBEAgxssETsDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4482 Lines: 104 On 02/15/2015 08:41 PM, Javier Martinez Canillas wrote: > Hello Addy, > > On Sat, Feb 14, 2015 at 7:17 AM, Addy Ke wrote: >> patch 1: This patch can fix bug that controller is still data busy after >> reset all blocks. After this patch, I still get data busy in >> set_ios(). >> >> patch 2: This patch fix bug 'Timeout sending command'. After patch1 and >> patch2, there is no mmc errors after: >> cd /sys/bus/platform/drivers/dwmmc_rockchip >> for i in $(seq 1 10000); do >> echo "========================" $i >> echo ff0c0000.dwmmc > unbind >> sleep .5 >> echo ff0c0000.dwmmc > bind >> sleep 2 >> done >> >> patch3: This patch fix bug that there is data busy before sdio send CMD53. >> But This patch is necessary for sd and mmc too. >> > > I faced the same 'Timeout sending command' error when trying to enable > support for the SDIO wifi chip attached to mmc@12210000 (mmc1) on an > Exynos5420 Peach Pit Chromebook. On booting the kernel log shows: > > mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 status 0x80202000) > > 0x202000 == SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT so your patch > #2 dw_mci_setup_bus() avoids the mmc comand to time out. However, it > has a side effect since with your series the uSD that in mmc@12220000 > (mmc2) fails to be detected and the kernel log shows: > > [ 5.466432] Waiting for root device /dev/mmcblk1p4... > [ 240.169436] INFO: task kworker/u16:1:50 blocked for more than 120 seconds. > [ 240.174844] Not tainted > 3.19.0-next-20150211-00006-g045d4aba96ce-dirty #476 > [ 240.182302] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > disables this message. > [ 240.190109] kworker/u16:1 D c04c2710 0 50 2 0x00000000 > [ 240.196446] Workqueue: kmmcd mmc_rescan > [ 240.200249] [] (__schedule) from [] (schedule+0x34/0x98) > [ 240.207290] [] (schedule) from [] > (schedule_timeout+0x120/0x16c) > [ 240.215009] [] (schedule_timeout) from [] > (wait_for_common+0xb0/0x154) > [ 240.223251] [] (wait_for_common) from [] > (mmc_wait_for_req+0xa0/0x140) > [ 240.231492] [] (mmc_wait_for_req) from [] > (mmc_wait_for_cmd+0x88/0xa8) > [ 240.239735] [] (mmc_wait_for_cmd) from [] > (mmc_go_idle+0x78/0xf8) > [ 240.247540] [] (mmc_go_idle) from [] > (mmc_rescan+0x254/0x300) > [ 240.255003] [] (mmc_rescan) from [] > (process_one_work+0x120/0x324) > [ 240.262897] [] (process_one_work) from [] > (worker_thread+0x138/0x464) > [ 240.271048] [] (worker_thread) from [] > (kthread+0xd8/0xf4) > [ 240.278254] [] (kthread) from [] > (ret_from_fork+0x14/0x34) > > > By enabling debug I see that the card is detected in dw_mci_get_cd() though. > > Alim suggested [0] that dw_mci_wait_busy() should be called in > mci_send_cmd() instead dw_mci_setup_bus() because the controller hangs > when when sending update clock cmd in different cases. > > I modified [1] your patch #2 to do what Alim suggested and only with > that patch on top of linux-next I have neither the the "Timeout > sending command" error nor the uSD not getting detected errors. Linux > mounts the rootfs from the uSD and the wifi SDIO device is enumerated > and listed in /sys/bus/sdio/devices/ it needs to check when clock value only update. As Javier and Alim are mentioned, if check whether card is busy or not in setup_bus(), should be processed unnecessary checking. (According to TRM, before disabling clock, check whether card is busy or not.) if my thinking is right, chekcing is located more exactly before mci_writel(host, CLKENA, 0). And i recommend if CLK_GATE is enabled, clkgate_delay sets to the bigger value than 3. I'm not sure Javier's issue is same thing..I will check more this. Best Regards, Jaehoon Chung > > Does that also solve your issue? > > Best regards, > Javier > > [0]: https://lkml.org/lkml/2015/2/10/353 > [1]: http://paste.debian.net/plain/148794 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/