Message ID | 20181210210310.12677-3-wsa+renesas@sang-engineering.com (mailing list archive) |
---|---|
State | RFC |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DC0A14E2 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 10 Dec 2018 21:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C72E286FE for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 10 Dec 2018 21:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 606DE2A7E3; Mon, 10 Dec 2018 21:04:14 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 18101286FE for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 10 Dec 2018 21:04:14 +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:References: In-Reply-To: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:List-Owner; bh=n7lQSNoTm0nPwir9fS7Zj6x4HbDffUdwEY0o5l5SYNw=; b=OCU2qK5I53HSad6Gt0j7buT51U K8rTB0dFR93dRbUO/3OUl30dxK75fa2ivZhNjNkPuxuaU1RbPlJbYxn8n4jw9k6qE3vT4yZqx+U9Z IMjfVr0vbwKdP9KiQMceK3e7JtXBOiCkgn+oPlTZhZO90jseCNTKkOxbwZmCgJfFUDxhOqv0tadhw Pv/PqIJg9WVuFBoyH3yXXbST+4fKek0IrNV1wR5mGp6a5sT1O1Ey7Qhzn/0s7hoOj5m3bdCQQoNI1 amT2kd+IKdKTltaWSC8hDt5CyqKVu4epLNtjGyzhr+cKCTDxj0riSWRugyCg8/NPuhkR7r/WWwCCg +GkXECJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWSip-00088u-LQ; Mon, 10 Dec 2018 21:04:11 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWSi9-00076k-56 for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 21:03:31 +0000 Received: from localhost (p54B335CF.dip0.t-ipconnect.de [84.179.53.207]) by pokefinder.org (Postfix) with ESMTPSA id 783184C3C66; Mon, 10 Dec 2018 22:03:14 +0100 (CET) From: Wolfram Sang <wsa+renesas@sang-engineering.com> To: linux-i2c@vger.kernel.org Subject: [RFC/RFT 02/10] i2c: reject new transfers when adapters are suspended Date: Mon, 10 Dec 2018 22:03:00 +0100 Message-Id: <20181210210310.12677-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181210210310.12677-1-wsa+renesas@sang-engineering.com> References: <20181210210310.12677-1-wsa+renesas@sang-engineering.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181210_130329_339306_C05839E6 X-CRM114-Status: UNSURE ( 7.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Wolfram Sang <wsa@the-dreams.de>, linux-pm@vger.kernel.org, Wolfram Sang <wsa+renesas@sang-engineering.com>, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
i2c: move handling of suspended adapters to the core
|
expand
|
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9f89e258c8ff..5b2078a902f8 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1866,6 +1866,8 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) if (WARN_ON(!msgs || num < 1)) return -EINVAL; + if (WARN_ON(adap->is_suspended)) + return -ESHUTDOWN; if (adap->quirks && i2c_check_for_quirks(adap, msgs, num)) return -EOPNOTSUPP;
Using the new 'is_suspended' flag, we now reject new transfers if the adapter is already marked suspended. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/i2c/i2c-core-base.c | 2 ++ 1 file changed, 2 insertions(+)