From patchwork Mon Jun 11 06:48:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 138199 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3694376lji; Sun, 10 Jun 2018 23:48:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK2plVuYFfv7NSxxIrBi+8cTQ1j0kCaEluhdVDJ5c0eecAWjNoRVA0FYwRkKKeqDvlNxT9A X-Received: by 2002:a62:e117:: with SMTP id q23-v6mr16325407pfh.75.1528699738962; Sun, 10 Jun 2018 23:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528699738; cv=none; d=google.com; s=arc-20160816; b=C9d+SWqoHRnMkMi5guCONmMGbhddlS6E6w1SoXvRQ91lhakTzf+S7Fh25TmayGUgqo MKAFMss1Egw8hmVAqCvJGpqp3nZYKON5hUBkDCvfYvxTsZ+CpO2Ny2ldUF4KsViWnMjk Hzyerij4ORE44L8MtF6AjKXFV7YgmqBxjj3S7lLIH0+ttwGCg+tFd+WaRWWnybBdY0d4 7Nh+3YLb1EXeMVP3DjlJMZENLOyHqNYsr168XXfzFCzJrhERzo1mNkZWg7T/Jg3GpJ7M BZE2bWa3wK4o7z+L3fyCB2Sq0wlhDe4iuFiKFNxsTgdt/wcNJgWGzjS7X79fC3IA1fhh PrQw== 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 :arc-authentication-results; bh=h2CB82VhNmO6Z3rt6u9gBd4klwynIrh26aQpCYKEHaQ=; b=ANIcrRzkDIXpZP55jeuuvJLGsTlOY9dgaBcJzvLafm70RV0/j6pHLB/4l3g69D/rRd zpFBcE/rQuMIl4yYLj527+v1VHUqohRw8PrqFKTW9km/xXAlkTMPHZ8U5nOuyFAR/fXK rZ1KN+NeYcYmfSInW4EXhTyEjNrnLsesqHvAcgAF1WZEszCCiidKRPs4oI85NS9WeSZp PBTz4P8lsGuCpj705PlpM4yE0giOS9Ow8AR8TEjVrOtGaeiVrbdP4KxLqY+bkPWxLjJm Iuy8zitei5NxJdOctjF7kKSTXnqPLQTxaSqmJm6krju/g4YExlF2Kj++wac5VmPkdnuC iJyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=GUwZwVJK; 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=fail (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 t17-v6si27750583pfa.170.2018.06.10.23.48.58; Sun, 10 Jun 2018 23:48:58 -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=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=GUwZwVJK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753983AbeFKGs5 (ORCPT + 3 others); Mon, 11 Jun 2018 02:48:57 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40396 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753981AbeFKGsy (ORCPT ); Mon, 11 Jun 2018 02:48:54 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180611064851euoutp01b8ef5be2fc106b626231396c7d8c848d~3CE552vgJ2691026910euoutp01s; Mon, 11 Jun 2018 06:48:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180611064851euoutp01b8ef5be2fc106b626231396c7d8c848d~3CE552vgJ2691026910euoutp01s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528699731; bh=BKa8PEqEi190SSRgKJti/d9D7+AIfxLElC+ygh4w6qs=; h=From:To:Cc:Subject:Date:References:From; b=GUwZwVJKR7hXgdxiCOBlqph0z5piLa1dbSGWBiGpJB1BvuWZyKTJqSSkcT+dtAWG0 8IDP7uR/BovgXy1QXSiNwRBtpZcT6C/YpJ71biAorJ6X/NipC/T4AW1KAt+7BdqB4u MuoOhio08fvbX98i5B3UJBdmVJ0tu5xyXMsMtv1s= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180611064849eucas1p25a9b3525ed5088bf5d9a1cb920d039a9~3CE4Pk7hT3148031480eucas1p2Q; Mon, 11 Jun 2018 06:48:49 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 9A.AA.17380.15B1E1B5; Mon, 11 Jun 2018 07:48:49 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180611064849eucas1p134abe313b17ba05cb1e046f3d2f0780f~3CE3kwbXc1273612736eucas1p1N; Mon, 11 Jun 2018 06:48:49 +0000 (GMT) X-AuditID: cbfec7f4-713ff700000043e4-5c-5b1e1b51d97d Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4E.D1.04183.05B1E1B5; Mon, 11 Jun 2018 07:48:48 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PA500JHFC99WD10@eusync4.samsung.com>; Mon, 11 Jun 2018 07:48:48 +0100 (BST) From: Marek Szyprowski To: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Jaehoon Chung , Ulf Hansson , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] mmc: dw_mmc-exynos: fix potential external abort in resume_noirq() Date: Mon, 11 Jun 2018 08:48:38 +0200 Message-id: <20180611064838.11383-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOIsWRmVeSWpSXmKPExsWy7djPc7qB0nLRBm+fKVtsnLGe1eLGrzZW i/PnN7BbHPnfz2gx4/w+Jou1R+6yWxxfG+7A7rFpVSebx51re9g8+rasYvT4vEkugCWKyyYl NSezLLVI3y6BK+PF1A0sBTc4K16dus7WwLiQo4uRk0NCwERiz65l7F2MXBxCAisYJebv+MwI 4XxmlLiz6DCQwwFW1TjZBiK+jFFiweNdUB0NTBL7ry5jAhnFJmAo0fW2iw2kQUTAQeLFeSeQ GmaBB4wSR5+8YgGpERYIlXj/6wWYzSKgKjGhs48NxOYVsJXoe9jOAnGSvMTqDQeYQZolBJ6y ShzY8BMq4SLRuOseI4QtLPHq+BZ2CFtG4vLkbhaIhmZGifYZs9ghnB5Gia1zdrBBVFlLHD5+ kRXEZhbgk5i0bTozxG+8Eh1tQhAlHhJ332wHWyYkECsx80AjywSgbxkZVjGKp5YW56anFhvl pZbrFSfmFpfmpesl5+duYgRG1+l/x7/sYNz1J+kQowAHoxIPr0K6bLQQa2JZcWXuIUYJDmYl EV6P59LRQrwpiZVVqUX58UWlOanFhxilOViUxHnjNOqihATSE0tSs1NTC1KLYLJMHJxSDYwu XwMk6rtFOCStLhdY/9+vHHXwoPLCQwXWlyIiFizTeLVqh+OCNxXLJixd9+NIv0WBpPf7zz8v dsy/O1XvQ87Sg3+0PS4Fu/++7qSVwv/+/awHD37Lfvge/ng+694loj/10pOzs+eJKDkFXTU+ Wckb+Z/7aJriHsNN/srMMUUXpJLnniqae5pJiaU4I9FQi7moOBEAUOOFKaoCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t/xa7oB0nLRBtc+GltsnLGe1eLGrzZW i/PnN7BbHPnfz2gx4/w+Jou1R+6yWxxfG+7A7rFpVSebx51re9g8+rasYvT4vEkugCWKyyYl NSezLLVI3y6BK+PF1A0sBTc4K16dus7WwLiQo4uRg0NCwESicbJNFyMXh5DAEkaJKdsXsUA4 TUwSv37eYO5i5ORgEzCU6HrbxQbSICLgIPHivBNIDbPAA0aJRRsns4LUCAuESrz/9YIFxGYR UJWY0NnHBmLzCthK9D1sB4tLCMhLrN5wgHkCI9cCRoZVjCKppcW56bnFRnrFibnFpXnpesn5 uZsYgf7fduznlh2MXe+CDzEKcDAq8fAqpMtGC7EmlhVX5h5ilOBgVhLh9XguHS3Em5JYWZVa lB9fVJqTWnyIUZqDRUmc97xBZZSQQHpiSWp2ampBahFMlomDU6qBcZYr16vTvXFfeve86bic Ec5x5qFb0oecOsEV7NFT9vNtqxR1WFBhdYkromHbgjUfjT4Z1qbcYzK/YqU1fbn5xNXr+CbP bpc4sMdwrov/yrbvm6vTj52+viBmt3Rj7sOGl8uEKj/pxnrnLsv/G2jIxv37edKNP4F185fd 3RYtkTFFtHtpo8aaZUosxRmJhlrMRcWJACLVMgH7AQAA X-CMS-MailID: 20180611064849eucas1p134abe313b17ba05cb1e046f3d2f0780f X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180611064849eucas1p134abe313b17ba05cb1e046f3d2f0780f References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org dw_mci_exynos_resume_noirq() performs DWMMC register access without ensuring that respective clocks are enabled. This might cause external abort on some systems (observed on Exynos5433 based boards). Fix this by adding needed prepare_enable/disable_unprepare calls. Signed-off-by: Marek Szyprowski --- drivers/mmc/host/dw_mmc-exynos.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 3164681108ae..6125b68726b0 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -193,6 +193,9 @@ static int dw_mci_exynos_resume_noirq(struct device *dev) struct dw_mci_exynos_priv_data *priv = host->priv; u32 clksel; + clk_prepare_enable(host->biu_clk); + clk_prepare_enable(host->ciu_clk); + if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 || priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU) clksel = mci_readl(host, CLKSEL64); @@ -207,6 +210,9 @@ static int dw_mci_exynos_resume_noirq(struct device *dev) mci_writel(host, CLKSEL, clksel); } + clk_disable_unprepare(host->biu_clk); + clk_disable_unprepare(host->ciu_clk); + return 0; } #else