Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3739100imu; Tue, 18 Dec 2018 03:26:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/UXBSMg9/TjKgE17zk9/0ucToe49584Zzkz09ww+q2PxDT7TDeoPsK+JY98dC0PyNbNlstA X-Received: by 2002:a63:441e:: with SMTP id r30mr2562834pga.128.1545132416653; Tue, 18 Dec 2018 03:26:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545132416; cv=none; d=google.com; s=arc-20160816; b=APbGOouEpCs+toAm0pF8vxNGQbeSxyI8R+CC0Bn6OwXNPChkM3j/R3FY+9n8jidKdM 1zDsCw71TXILcGQkyA8ZAhqOgtRq5NA3uHw9M/nNTnzlyVSEhh6IGb6N9CQACn0vYaiX v7NC5KJL7+FJoYXwkOHZhczVpzjL/vltBkxJ+2BCXRjBQ/iE3s+Xbi60yxb4G9uTTUqS sEHUMhMLeQbfuR7pMipOei2I/tAKmwQuQ2cmZQk7JquUh7rNaEbagr7Q+X12AwRwI3TY j4Maa4jYc6phNHvPXwZHvkC60FRsFPmOqS1Jz79vUBoguLd8ETdyp7a1iT0l6A2YAoAI MPMg== 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:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=Fn2lPujTaFWPaBPTiAGvyln8G1YyYThIpI0wJbDCuyw=; b=aA4pxa2UUc7aIrzObcFmcgvGPQbefWW6aHomyRrulRrK34eq00DVY/tb+svFND2alp uHLXv1AmgZ74wCvlWMSkK3IUgpfG0ML1MOe27k9qNeEf8FAlC0VqGCYT/v5Wqji8WVZZ 5R6teNXR8SodBS0qSQZO8ewGEqV0Dk9HznG8WsWGl+srQbO0GnQUVAHKetW8OxeUqybj G07GqtRnX1cSsdmuwo/n8wMAweTBC/i4G19d3Ef9lhBVM+548xGXS/r+wOf35VMKxGaO +vthYLTq0xsiTtykOVYsSP1m/iT2pzSMURj2GwDTIO0cVr6hRfFKDKmjt+Xghs1+Xj79 bJSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tLxWo5EI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 y6si12819750pll.384.2018.12.18.03.26.40; Tue, 18 Dec 2018 03:26:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tLxWo5EI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbeLRLZA (ORCPT + 99 others); Tue, 18 Dec 2018 06:25:00 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53425 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbeLRLY7 (ORCPT ); Tue, 18 Dec 2018 06:24:59 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181218112457euoutp017a4101780afdcb3fb540ef337bc8b5ed~xaaNyYQe80259602596euoutp01W for ; Tue, 18 Dec 2018 11:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181218112457euoutp017a4101780afdcb3fb540ef337bc8b5ed~xaaNyYQe80259602596euoutp01W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1545132297; bh=Fn2lPujTaFWPaBPTiAGvyln8G1YyYThIpI0wJbDCuyw=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=tLxWo5EIDRBqnRDh7xjmvJ7kULVpTJoj2KCdVB7JQspn6cSrNb20oKVsxC1DKLjkp 5U2fULvdtv/vzGXPGGfScaO6TLSDQjceremlxB/BviKb+fkLRhDtEsC8lMbFqtS4oO VbDt+vpvC3YKl7tQZ+7pxgxBzl/bsNFYYvvfK8q4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181218112457eucas1p1591ca5aa0a3e3cdea6268224ca7adbca~xaaNJJ-Ms1106911069eucas1p1N; Tue, 18 Dec 2018 11:24:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2E.E2.04441.809D81C5; Tue, 18 Dec 2018 11:24:56 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181218112456eucas1p20bf31d210625499084754ad815be677c~xaaMaXtIb2617226172eucas1p2M; Tue, 18 Dec 2018 11:24:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181218112456eusmtrp2dc76df3486418d3280e6832867527508~xaaMLvBx90147001470eusmtrp2I; Tue, 18 Dec 2018 11:24:56 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-9b-5c18d9087ef2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 39.C0.04128.809D81C5; Tue, 18 Dec 2018 11:24:56 +0000 (GMT) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181218112455eusmtip265670bd80d3afdcde1d5c36ecfb2a929~xaaLshy1A3126131261eusmtip21; Tue, 18 Dec 2018 11:24:55 +0000 (GMT) Subject: Re: [RFC/RFT 09/10] i2c: s3c2410: use core helper to mark adapter suspended To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Hans de Goede , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org From: Marek Szyprowski Message-ID: <2b73c71b-2b73-7132-3629-cf700b251fdb@samsung.com> Date: Tue, 18 Dec 2018 12:24:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181210210310.12677-10-wsa+renesas@sang-engineering.com> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKKsWRmVeSWpSXmKPExsWy7djPc7ocNyViDF4ds7R4c3w6k0X/49fM FufPb2C32PT4GqtFx98vjBaXd81hs/jce4TRYuvLd0wWM87vY7LoO+fuwOWxaVUnm8fmJfUe 7/ddZfN4tnA9i8fnTXIBrFFcNimpOZllqUX6dglcGWuOxhfs5au4tOUtUwPjLe4uRk4OCQET ieddmxlBbCGBFYwSK5eoQ9hfGCVa1nh2MXIB2Z8ZJSa1NDHBNNxYOIUZIrGcUWLumy/sEB3v GSWmT5QFsYUFwiSWHP4JFhcRCJCY8H8hK0gDs8B0Jonmt6vAJrEJGEp0ve1iA7F5BewkDi45 wApiswioSkxbMBksLioQI/G0YR8LRI2gxMmZT4BsDg5OAXeJCzvtQcLMAvIS29/OYYawxSVu PZnPBLJLQuAQu8TshmPsEFe7SGxY94kNwhaWeHV8C1RcRuL/TpiGZkaJ9hmz2CGcHkaJrXN2 QHVYSxw+fpE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BwawkwnurVCJGiDclsbIqtSg/vqg0J7X4EKMp0GsTmaVEk/OBSSKvJN7Q1NDc wtLQ3Njc2MxCSZz3vEFllJBAemJJanZqakFqEUwfEwenVAMj0/27906duHZnxhyLbUfzW4R/ yGuuWHTq65aIlAkzq+a1b1h3xGDx6zrfrYeljKb1XLjVt33LIdbKxnebdKIfvtyTZbV5pnT3 dlkvH/PDnjxd1ezsK1RYvmgIzjqwpIbppW3rSctrt0x9oxTuHDiVvOecYu+f/rvbPPZPt/DW k3jzmdU7807+bSWW4oxEQy3mouJEAKQ1mpjaAgAA X-CMS-MailID: 20181218112456eucas1p20bf31d210625499084754ad815be677c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181210210451epcas5p2f186c09d2e89f30cdb7106272e5e4709 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181210210451epcas5p2f186c09d2e89f30cdb7106272e5e4709 References: <20181210210310.12677-1-wsa+renesas@sang-engineering.com> <20181210210310.12677-10-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2018-12-10 22:03, Wolfram Sang wrote: > Rejecting transfers should be handled by the core. Also, this will > ensure proper locking which was forgotten in this open coded version. > > Signed-off-by: Wolfram Sang Tested-by: Marek Szyprowski Works fine on Odroid U3. > --- > drivers/i2c/busses/i2c-s3c2410.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c > index 2f2e28d60ef5..7c76edb25514 100644 > --- a/drivers/i2c/busses/i2c-s3c2410.c > +++ b/drivers/i2c/busses/i2c-s3c2410.c > @@ -104,7 +104,6 @@ enum s3c24xx_i2c_state { > struct s3c24xx_i2c { > wait_queue_head_t wait; > kernel_ulong_t quirks; > - unsigned int suspended:1; > > struct i2c_msg *msg; > unsigned int msg_num; > @@ -703,9 +702,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, > unsigned long timeout; > int ret; > > - if (i2c->suspended) > - return -EIO; > - > ret = s3c24xx_i2c_set_master(i2c); > if (ret != 0) { > dev_err(i2c->dev, "cannot get bus (error %d)\n", ret); > @@ -1246,7 +1242,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev) > { > struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); > > - i2c->suspended = 1; > + i2c_mark_adapter_suspended(&i2c->adap, true); > > if (!IS_ERR(i2c->sysreg)) > regmap_read(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, &i2c->sys_i2c_cfg); > @@ -1267,7 +1263,7 @@ static int s3c24xx_i2c_resume_noirq(struct device *dev) > return ret; > s3c24xx_i2c_init(i2c); > clk_disable(i2c->clk); > - i2c->suspended = 0; > + i2c_mark_adapter_suspended(&i2c->adap, false); > > return 0; > } Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland