From patchwork Wed May 16 08:42:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 135987 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp619367lji; Wed, 16 May 2018 01:43:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZplTal8RcTPnB8b9686zsXBfeTMcwH2f2hvl8fB9q/7sVAX0mbZmEOpS8OrV8VVvJGwQdMf X-Received: by 2002:a17:902:9303:: with SMTP id bc3-v6mr18115382plb.18.1526460182109; Wed, 16 May 2018 01:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526460182; cv=none; d=google.com; s=arc-20160816; b=wrPLtSrJ6WAh7RAauGQyBbNFXKT0o8C6Z/WJY/Xy5fC122Zt2dh0H427eIYgar8dlm 7Ywk0hbiRChqIIGDbhzIDr7Nr5Nq7owf9WgAdioA8Xy5P6BdcmuJGkvA16Dk1+D7p/Nr 1kZMrXGQynbbdlVagcbpx2rsK+uS4pASjLuoNg07qvBm3YEYaepTFbjO9vH4fuLDp6P7 ZxmYC8/ffCcmCzM7+D8wXqn3MRraURUXcPc5Iw1rk64Xgx/y5IegUs2lg2zzNdVFDW/z MSAvj03/ns/c0VZzIct/IfHHPembdGEYY/1NJwgGO5+Ty+6RWVUSq20P//PCGWR3d8zt 3zxg== 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=QZVpEi4A8sL/dTuGy3R+4F5LALHQGTO6h3lw3CuKB8M=; b=XvLjGf+1CZyVJsq+exN+hMdvCIjInjoTAK9UMiMGVy3unv0JOPDrhyoVyd2Gbi1ejM bjn0i6XhafoRs8WX9msBCkbpnTNZOd1bWiBcSi9GBS7IgNIGbMaDwHdYdDcJcCQF3g7C zgE6amrx+SqkCvUXJbIANUBR5FPv4D/2JhRaBO4e1BCZVhuNA1H95+pmQJYCKz5MN5Jr eSguTk1k9oUjoTlytiiIlRPLrYtW9+vu6adeuI+4ypq9ND7u+rh0CCD+KkJ+T4XnX7FP Y+WNmkjrnY/Ix3UXeA9NbTN0XdLrX/j2WA5H4Pb3QUIhIZZz9ntNor36nTxTzo7sxgpY defQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=rjTDGWJ8; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 j10-v6si2082233plg.396.2018.05.16.01.43.01; Wed, 16 May 2018 01:43:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-spi-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=rjTDGWJ8; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 S1752205AbeEPInB (ORCPT + 1 other); Wed, 16 May 2018 04:43:01 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:35786 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbeEPIm7 (ORCPT ); Wed, 16 May 2018 04:42:59 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180516084257euoutp0229fa2a39781e499ca83f8ef636a881ea~vE3GNOhcW1974119741euoutp02f; Wed, 16 May 2018 08:42:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180516084257euoutp0229fa2a39781e499ca83f8ef636a881ea~vE3GNOhcW1974119741euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1526460177; bh=lOygUdkIN5S4PxBygygcpJGfPE5m7yVPZA3t4a9yoKc=; h=From:To:Cc:Subject:Date:References:From; b=rjTDGWJ8Ub69TUEANX9oAbNig4bD8UCbGqKN+DOHhwAJ5df0rAj7EsMod7rW4jpud oivSArFotjIUW/VOORCDnYwXUDgKfCDzbVSeKexH8hnYoeSzLItkkmZCya9xeKtCk+ TzGZ1EU6z5f/lmWE3QVosy0sfBWZew+2v5dj3XJI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180516084254eucas1p25cb44d4f25ee864f0bc2b5abaf8bd637~vE3ELkN4r2209322093eucas1p2V; Wed, 16 May 2018 08:42:54 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A1.04.05700.E0FEBFA5; Wed, 16 May 2018 09:42:54 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180516084252eucas1p214af3cac7e7115225214cd6d97bc92e6~vE3B4YD5q0467604676eucas1p2t; Wed, 16 May 2018 08:42:52 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-e5-5afbef0e0a34 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 98.FB.04183.C0FEBFA5; Wed, 16 May 2018 09:42:52 +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 <0P8T00ETXC7CDY90@eusync1.samsung.com>; Wed, 16 May 2018 09:42:52 +0100 (BST) From: Marek Szyprowski To: linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Andi Shyti , Mark Brown , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] spi: spi-s3c64xx: Fix system resume support Date: Wed, 16 May 2018 10:42:39 +0200 Message-id: <20180516084239.29244-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWy7djP87p8739HGWw+w2+x+MdzJouNM9az Wkx9+ITN4vz5DewWM87vY7Jo/HiT3WLtkbvsFofftLM6cHhcX/KJ2WPTqk42j74tqxg9Pm+S C2CJ4rJJSc3JLEst0rdL4Mr4+6OTvWA9b8XdPzNZGhhnc3cxcnJICJhI7Lx1gq2LkYtDSGAF o8TMJY+YQRJCAp8ZJWbskocpurPqIRNEfBmjxNQN9RANDUwSOze9ZwFJsAkYSnS97WIDsUUE HCSaHpwDm8os8J9R4syT12AJYQEbib+NK1hBbBYBVYlnK88BTeXg4BWwlVjxihNimbzEs+nz 2CHst6wSL99oQdguEk3dzSwQtrDEq+NboGpkJC5P7oaK10v0fT/CBLJXQqCHUWJvy1QmiIS1 xOHjF8H2MgvwSUzaNp0ZZK+EAK9ER5sQRImHxItZ16DKHSXmbD0GDYhYiR3v97JNYJRcwMiw ilE8tbQ4Nz212DAvtVyvODG3uDQvXS85P3cTIzD2Tv87/mkH49dLSYcYBTgYlXh4Fbb9jhJi TSwrrsw9xCjBwawkwpvJCxTiTUmsrEotyo8vKs1JLT7EKM3BoiTOG6dRFyUkkJ5YkpqdmlqQ WgSTZeLglGpgZObqVT+1MS5/umVrluSSZV/4/xx/0MrDt+zC8b9X3Tqaf7GeP9axYznzMiOh D6w7vd8mFf78+SL/mkyfZP730nstGgecXWUjdnYx+4gE+QdvOdGfONtk2b+8uGr9mikr3m// MDd/ivqSE8ESV2e0xagEh+3fw9m9bGsAs/7jT/8VF96V1/pur8RSnJFoqMVcVJwIAPMi55i5 AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsVy+t/xy7o8739HGXy6Kmmx+MdzJouNM9az Wkx9+ITN4vz5DewWM87vY7Jo/HiT3WLtkbvsFofftLM6cHhcX/KJ2WPTqk42j74tqxg9Pm+S C2CJ4rJJSc3JLEst0rdL4Mr4+6OTvWA9b8XdPzNZGhhnc3cxcnJICJhI3Fn1kKmLkYtDSGAJ o8TRpRcYQRJCAk1MEnenyoDYbAKGEl1vu9hAbBEBB4mmB+fYQBqYBf4zSvw6uI0JJCEsYCPx t3EFK4jNIqAq8WzlOaA4BwevgK3EilecEMvkJZ5Nn8c+gZFrASPDKkaR1NLi3PTcYiO94sTc 4tK8dL3k/NxNjMBQ2Hbs55YdjF3vgg8xCnAwKvHwntj8O0qINbGsuDL3EKMEB7OSCG8mL1CI NyWxsiq1KD++qDQntfgQozQHi5I473mDyighgfTEktTs1NSC1CKYLBMHp1QDY+u2Oy3cFf4K RmvefOVRWfksbe3zDeFRYt4Tb3OvqPjbErrYxqbp/DNNEyW/0MY28cVc71bX12xafkj9yYRc d5VHaw7HTf381bJMmfXyJp64jPIwK4/EL980erY8tXxq3xWqZ9dffq02WYj1fpD+7x2BUZG/ 7/ddZF+w6+/9PjnXro/lfX/vKbEUZyQaajEXFScCAOUSUqQBAgAA X-CMS-MailID: 20180516084252eucas1p214af3cac7e7115225214cd6d97bc92e6 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180516084252eucas1p214af3cac7e7115225214cd6d97bc92e6 X-RootMTR: 20180516084252eucas1p214af3cac7e7115225214cd6d97bc92e6 References: Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Since Linux v4.10 release (commit 1d9174fbc55e "PM / Runtime: Defer resuming of the device in pm_runtime_force_resume()"), pm_runtime_force_resume() function doesn't runtime resume device if it was not runtime active before system suspend. Thus, driver should not do any register access after pm_runtime_force_resume() without checking the runtime status of the device. To fix this issue, simply move s3c64xx_spi_hwinit() call to s3c64xx_spi_runtime_resume() to ensure that hardware is always properly initialized. This fixes Synchronous external abort issue on system suspend/resume cycle on newer Exynos SoCs. Signed-off-by: Marek Szyprowski --- This patch is prepared on top of linux-next. I intentionally didn't add any CC: stable tags, because such backport requires a change in s3c64xx_spi_hwinit() function parameters, what is caused by the commit 1c75862d8e5a ("spi: spi-s3c64xx: Remove unused s3c64xx_spi_hwinit() function argument") in current -next patchset. --- drivers/spi/spi-s3c64xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski Acked-by: Andi Shyti diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index f55dc78957ad..7b7151ec14c8 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1292,8 +1292,6 @@ static int s3c64xx_spi_resume(struct device *dev) if (ret < 0) return ret; - s3c64xx_spi_hwinit(sdd); - return spi_master_resume(master); } #endif /* CONFIG_PM_SLEEP */ @@ -1331,6 +1329,8 @@ static int s3c64xx_spi_runtime_resume(struct device *dev) if (ret != 0) goto err_disable_src_clk; + s3c64xx_spi_hwinit(sdd); + return 0; err_disable_src_clk: