From patchwork Thu May 17 10:15:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 136138 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp7478lji; Thu, 17 May 2018 03:25:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrSLqT3HS9R4Z0qwXjNQ4toDgyQUDlvgSvospNZ+m2QK9NSd2MMrCKjt4STFS3ywf5bKc7d X-Received: by 2002:a17:902:1aa:: with SMTP id b39-v6mr4711934plb.120.1526552725920; Thu, 17 May 2018 03:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526552725; cv=none; d=google.com; s=arc-20160816; b=x1/KoUXGjjTwp27Tlq3424ZBR+ti09gYwslq+hM1AwObmvQC4ipbJ561ZSP+wF6YAA bzZhWfT2fOfKGuLJhDoLIfv9SpbdjV7WP5Q47WJ/F5D5rVYM5wSgXKNoWBlgNu0bEM0v 3Tves+n1ZQ9u7FPkTC3PAd2qUn/i1Xkf7Aou/XkC+F+XVXymjplMQAMp4lnm8SNSHcFf Ejl5jx5HiJm/xHzHm10fV9fTCAoMGcoioE4k7M8P56jjokkA9mV0Xv4esZMO8UtN7wAH JtsKvqZjl4/xrBIuSa3Xgn49O33GvhObjm8u5dFSCrtQQOKMv0zBj+R1oPAsaa0aQh4l 9WXw== 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=L90UcW+ZCcyQrtglkaoOXqUkFOFOixxNVeehcbEdUEA=; b=JtBzh4/aewktHrqlfBk2zAAw8FZzDKEvFGgC7XvBld2FN6P+ox5+RGbw4/McAIU2s3 19uvfQdYPXIv5iVzqjJDsvc3YMJdRBQzz5+crp6f2mIYyKPKbBhEZt1j45RLiNqLAIDP 9OIMVrl8F4ac7g4OgA/xGuXoR4F78ixtv+O3UG+7hv0Uajt4CeAvTbZHz2v0IU7LrasK FNUgG3FbHWIUcDuWPoES8MiiNph5w/FfdX2XKAxop1jy+PQjmasx2TvaDEBIsWTKvhi+ Hc+gka/U+CPGNZ3zykRrcyMLbVaJ/X8JKxEc7OkaI+hZ7XwTcmXCFKJhdWjW7hWIFCJc LDuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=KzSwP8wu; 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 n10-v6si4588831plk.112.2018.05.17.03.25.25; Thu, 17 May 2018 03:25:25 -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=KzSwP8wu; 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 S1751334AbeEQKZY (ORCPT + 1 other); Thu, 17 May 2018 06:25:24 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:36570 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbeEQKZX (ORCPT ); Thu, 17 May 2018 06:25:23 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180517102520euoutp01cea4fcd873c6c88c27a0c15ba9ea285f~vZ5yHYjxO1575315753euoutp01R; Thu, 17 May 2018 10:25:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180517102520euoutp01cea4fcd873c6c88c27a0c15ba9ea285f~vZ5yHYjxO1575315753euoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1526552720; bh=t48S17FgYlTwGhEzuh8zEroUcR1XBtbXHdQXTcm7Jbk=; h=From:To:Cc:Subject:Date:References:From; b=KzSwP8wuy6C/r4r8UsLi8O+/a66kTSCj//LmLMsnXYHsNjjZL6PmpGkMdsJeGoh8D 4KOe82dYPUGBBtOHxd61GjkqM9Khf2dPajLSgCpWpMLWAlOHmFj/xML6Pf1rDNcsX6 rXKNMuxSb6JQvUUaKQnpYQhHMmzEk68SANfPAZPc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180517102519eucas1p192d54fc228b9770977f7732008b090f0~vZ5w9A7p12490424904eucas1p1E; Thu, 17 May 2018 10:25:19 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E6.43.17380.E885DFA5; Thu, 17 May 2018 11:25:18 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180517102518eucas1p10e55ae3c884f6fe29b37c01eff0fe7a4~vZ5v0jreq2327123271eucas1p1z; Thu, 17 May 2018 10:25:18 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-8a-5afd588e10d4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 05.5C.04183.E885DFA5; Thu, 17 May 2018 11:25:18 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P8V00JEEBLZVM00@eusync3.samsung.com>; Thu, 17 May 2018 11:25:18 +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 , stable@vger.kernel.org Subject: [PATCH] spi: spi-s3c64xx: Fix system resume support Date: Thu, 17 May 2018 12:15:08 +0200 Message-id: <20180517101508.25867-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRmVeSWpSXmKPExsWy7djP87p9EX+jDJZ/srFY/OM5k8XGGetZ LaY+fMJmcf78BnaLGef3MVk0frzJbrH2yF12i8Nv2lktFmx8xOjA6XF9ySdmj02rOtk8+ras YvT4vEkugCWKyyYlNSezLLVI3y6BK+Pljb9MBRN4K3b+nsLUwNjJ3cXIySEhYCLxZtVb9i5G Lg4hgRWMEkcanjFBOJ8ZJabveM8CU3Vi7X5WiMQyRoklGxugWhqYJCaePcEIUsUmYCjR9baL DcQWEXCQaHpwjg2kiFlgOpNE775f7CAJYQEbib+NK1hBbBYBVYn5R/6CNfAK2EpMmtrFDLFO XuLZ9HnsEPZXVokrv6K6GDmAbBeJ8xcqIcLCEq+Ob4EqkZG4PLkb6tJ6ib7vR8BekBDoYZTY 2zKVCSJhLXH4+EWwvcwCfBKTtk1nhpjJK9HRJgRR4iFx5/J7RgjbUaJn4i6w+UICsRINrffY JjBKLmBkWMUonlpanJueWmyUl1quV5yYW1yal66XnJ+7iREYiaf/Hf+yg3HXn6RDjAIcjEo8 vDus/0QJsSaWFVfmHmKU4GBWEuE1+QIU4k1JrKxKLcqPLyrNSS0+xCjNwaIkzhunURclJJCe WJKanZpakFoEk2Xi4JRqYMxz96z4IvHleEWG2pqCpPsSzeFx5Y+L/QRmSRv/WGVWd8DumvTd zaf7TkQwnjixRiNkk2jmFKniR3vXlJpm3HLfZLovdNODTfJmLx8rpvVdX6ccvPxs3FHVP4sm /vBZ+axy9qcQ33D5P5cWCdyXX/jpu/rSb8ZTSqQPq4boHrbJ+f12b7xFp7MSS3FGoqEWc1Fx IgD1IgGkwAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCJMWRmVeSWpSXmKPExsVy+t/xq7p9EX+jDD5s5rFY/OM5k8XGGetZ LaY+fMJmcf78BnaLGef3MVk0frzJbrH2yF12i8Nv2lktFmx8xOjA6XF9ySdmj02rOtk8+ras YvT4vEkugCWKyyYlNSezLLVI3y6BK+Pljb9MBRN4K3b+nsLUwNjJ3cXIySEhYCJxYu1+1i5G Lg4hgSWMEotfNzOCJIQEmpgkNi+tArHZBAwlut52sYHYIgIOEk0PzrGBNDALTGeSOPLqDDtI QljARuJv4wpWEJtFQFVi/pG/YA28ArYSk6Z2MUNsk5d4Nn0e+wRGrgWMDKsYRVJLi3PTc4uN 9IoTc4tL89L1kvNzNzECw2LbsZ9bdjB2vQs+xCjAwajEw7vD+k+UEGtiWXFl7iFGCQ5mJRFe ky9AId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rznDSqjhATSE0tSs1NTC1KLYLJMHJxSDYyBEQn5 DRN7Yp0EN3pozJ7mVLFstdOmuZ38zOqMYgkNOitX97/Om5AjVPzvEFdO3smrihM3Rt8VWvxe IMLkT9mPxjmWH29/yVr22nbroXsuhZ4uE9in9a/tYzV5vfydWwsL/08PuYMVB37sXz3577mv KyRXvtPbaPLhxvyD69U0cuRcL0prrHmixFKckWioxVxUnAgANIaWSgcCAAA= X-CMS-MailID: 20180517102518eucas1p10e55ae3c884f6fe29b37c01eff0fe7a4 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180517102518eucas1p10e55ae3c884f6fe29b37c01eff0fe7a4 X-RootMTR: 20180517102518eucas1p10e55ae3c884f6fe29b37c01eff0fe7a4 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 CC: # 4.10.x: 1c75862d8e5a spi: spi-s3c64xx: Remove unused s3c64xx_spi_hwinit() CC: # 4.10.x Reviewed-by: Krzysztof Kozlowski Acked-by: Andi Shyti --- Resend reason: added cc: stable, reviewed and acked tags --- 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 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: