From patchwork Thu Mar 16 14:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 9628239 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 BF02160244 for ; Thu, 16 Mar 2017 14:05:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABD7928599 for ; Thu, 16 Mar 2017 14:05:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D4E228653; Thu, 16 Mar 2017 14:05:51 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3543128599 for ; Thu, 16 Mar 2017 14:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=3WP+Fhm17f8xC5vvZGF+xETa6MyAG2SGMux0jT1Yj5E=; b=ohK yEgciMohuuMrRJ2XOFIrPr7dphT/avNsfyCGc+Jl1T0Sm4JAngHPHT2DZS+k/pGf7OWCreZ+m8gGW VHUPNFXo5NGPdEybLdMiyDTInFz0ychJ9EUPVMqj/Wue+dVcEA37Zixl52wxgVZEpDlWGxSky331a kaPtb6sz3q+tKUMS+OM7lREeNHUCIkOmwroAM2CTF4MAIHMLQ2wBNLuw2IE5IHXq5Kjfd1gGY5UXy /so52vhBTjutEB814X7hKnvEeo70DBnLG7dHe975q9HIzJ7JJ4wXdpZElxA3dCEHJLikDCq8LJ4x1 fuBIpVa+lgcyKbw9pJLQEpQaBXdLXiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1coW2D-0004WE-8a; Thu, 16 Mar 2017 14:05:45 +0000 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1coW29-0004UU-C4 for linux-arm-kernel@lists.infradead.org; Thu, 16 Mar 2017 14:05:43 +0000 Received: by mail-wr0-x229.google.com with SMTP id g10so32750752wrg.2 for ; Thu, 16 Mar 2017 07:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Os6S9kjYtrP2uh0d7RoztoYOLVgtIJbL6lKTiSeGKF4=; b=YnGBovSjMP2kRe3bgLf3xbX6CQ666Yvi0AOTVoabPJ2pP00cIcyjp2igHrfA/HpAN2 /SFkWnsoQ/c+i4pVeMCD9rgX5i1msKMXdpY6g/51vl74x32lCC6OEtqfsxZbPK0gbPW0 GWl/wGiKJjHzEdhE5E6iszvGMcnzOsf5o/PR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Os6S9kjYtrP2uh0d7RoztoYOLVgtIJbL6lKTiSeGKF4=; b=q/397ub9+aBhDJ2UCzB7rDGxP6qk58wN+vrpiBFGHLuHRptxOGl0flZw3U//qLCABZ b//Y4EkK1zWrF1J7r0WIkAXZPErtB1ilqd4NHX4A1rk3EufjksGQZmFkcVZ+9fd2NQTb Vr4iq0mYjZNphkhzNWrSjnBypBQ9ADt2w53q6NUvLhmWMLL/emaB295C4VHjOg8WnQWF jUxp0AgLH/SIp8yJzDVAz9OhnHicEkacL0HnlkfhAJtwT/J5MELukqRcYe2i7QNuDCQl vy1EfsrD3L/tvV5OHnjVY1JZ3DIqUABJkKnBCTMOc9c6XOu6EP41vGpWuAMkFW+r8bp6 ieQQ== X-Gm-Message-State: AFeK/H12c8ktkiazaS/s+nrOKCGR27hy8+2ZQ0A+bherisZtoaV4CeEq5EWGiI9qw/LRkBvg X-Received: by 10.223.176.217 with SMTP id j25mr8922331wra.8.1489673119261; Thu, 16 Mar 2017 07:05:19 -0700 (PDT) Received: from localhost.localdomain (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.gmail.com with ESMTPSA id y43sm6320369wrd.0.2017.03.16.07.05.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Mar 2017 07:05:18 -0700 (PDT) From: Daniel Lezcano To: xuwei5@hisilicon.com Subject: [PATCH] ARM: dts: hi6220: Reset the mmc hosts Date: Thu, 16 Mar 2017 15:03:24 +0100 Message-Id: <1489673004-11075-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170316_070541_573446_509A0E98 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, guodong.xu@linaro.org, devicetree@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The MMC hosts could be left in an unconsistent or uninitialized state from the firmware. Instead of assuming, the firmware did the right things, let's reset the host controllers. This change fixes a bug when the mmc2/sdio is initialized leading to a hung task: [ 242.704294] INFO: task kworker/7:1:675 blocked for more than 120 seconds. [ 242.711129] Not tainted 4.9.0-rc8-00017-gcf0251f #3 [ 242.716571] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 242.724435] kworker/7:1 D 0 675 2 0x00000000 [ 242.729973] Workqueue: events_freezable mmc_rescan [ 242.734796] Call trace: [ 242.737269] [] __switch_to+0xa8/0xb4 [ 242.742437] [] __schedule+0x1c0/0x67c [ 242.747689] [] schedule+0x40/0xa0 [ 242.752594] [] schedule_timeout+0x1c4/0x35c [ 242.758366] [] wait_for_common+0xd0/0x15c [ 242.763964] [] wait_for_completion+0x28/0x34 [ 242.769825] [] mmc_wait_for_req_done+0x40/0x124 [ 242.775949] [] mmc_wait_for_req+0xc0/0xf8 [ 242.781549] [] mmc_wait_for_cmd+0x6c/0x84 [ 242.787149] [] mmc_io_rw_direct_host+0x9c/0x114 [ 242.793270] [] sdio_reset+0x34/0x7c [ 242.798347] [] mmc_rescan+0x2fc/0x360 [ ... ] Cc: stable@vger.kernel.org Signed-off-by: Daniel Lezcano --- arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi index 470461d..1e5129b 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi @@ -774,6 +774,7 @@ clocks = <&sys_ctrl 2>, <&sys_ctrl 1>; clock-names = "ciu", "biu"; resets = <&sys_ctrl PERIPH_RSTDIS0_MMC0>; + reset-names = "reset"; bus-width = <0x8>; vmmc-supply = <&ldo19>; pinctrl-names = "default"; @@ -797,6 +798,7 @@ clocks = <&sys_ctrl 4>, <&sys_ctrl 3>; clock-names = "ciu", "biu"; resets = <&sys_ctrl PERIPH_RSTDIS0_MMC1>; + reset-names = "reset"; vqmmc-supply = <&ldo7>; vmmc-supply = <&ldo10>; bus-width = <0x4>; @@ -815,6 +817,7 @@ clocks = <&sys_ctrl HI6220_MMC2_CIUCLK>, <&sys_ctrl HI6220_MMC2_CLK>; clock-names = "ciu", "biu"; resets = <&sys_ctrl PERIPH_RSTDIS0_MMC2>; + reset-names = "reset"; bus-width = <0x4>; broken-cd; pinctrl-names = "default", "idle";