From patchwork Fri Oct 22 02:28:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 1544755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=GFmmGhXF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4Hb7Zw57R7z9sXN for ; Fri, 22 Oct 2021 13:29:12 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232310AbhJVCb0 (ORCPT ); Thu, 21 Oct 2021 22:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232180AbhJVCbX (ORCPT ); Thu, 21 Oct 2021 22:31:23 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53313C061764 for ; Thu, 21 Oct 2021 19:29:07 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id r13-20020a17090a1bcd00b001a1b1747cd2so1329257pjr.9 for ; Thu, 21 Oct 2021 19:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ijVYb03qsUXHo6CKgq/jFRZoGv36pg7G0FzeLowQevM=; b=GFmmGhXFGiiG4aBOIbuik6hEaw76jr99tzyjl7v7t3Gfmzc0u3UPmHbGBa+WAwzn0k WxWnCK1oml3wfu8uS3NvmvMI3Kd5Y/JFIZ4Q1voLaAc6RaqgTB7T8nPrBVutWnraZTYq CyIs5CrcQiESRIFHLm44RiTwzMOuJ4nRyVyMPk9AYShAoV8qWvjP+prQ607aP+K2E5M9 U90FgLVS/4T+uSac3ZMiOfveSMgeAk0r2vW2syM756aOPIS3TeVfCEwJofjEXAV1tbgL UUMkQvo0JxfMUTr0tpj9h6IccSNykU7q4ZrqNdKWTvrNed0M9+sOr3h/TpcjcNuLKR49 V+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ijVYb03qsUXHo6CKgq/jFRZoGv36pg7G0FzeLowQevM=; b=nZcVkYe+cC1Ccu5p/oFmYsv2nwHauPdIFT0fLrWi8jPC8E2JZFHvdTh2cZqHwIhqVB HdPNNTg7I392g4N3dWX9N1m49LX9YRezDdk5kKyl2yFk9jLG0MNguqbv5kHE66iqyrJh shatYT3uqtnn2H2BwuY9ZadpYdPHXlcsaWttYj2cNf5lLCq0ilJaqiR1nxypbuN7b41j GqlaXvfNkmh9xloEC1s0cyjz/Yrntc8aQcX9lzJ98GTemIXrH0ATyx8gJpZpXMvElYpN UbfwFfkEKkaSCHSfP7l2QpaTZSYeAQom9NtVWEt+pvVOFGrZmLiPnWz13TJfR5YSswhQ k7tA== X-Gm-Message-State: AOAM532hyalOVSPtNqaNx3Xmz77ubkCF3yUdfDWMgLAWzcadYoJjn4nY fsV52lkLDub7v0WMfhCJADZerHpviMc/ X-Google-Smtp-Source: ABdhPJxk2OnWe6ziiCaTwDnvay3U5Dq4gzwUl08eYp9OFoMcwi1QgNd/aLIbB6QCrVNIqVy6bPPtz7uwbAOn X-Received: from rajat2.mtv.corp.google.com ([2620:15c:202:201:cc25:d9a3:4b5:37b9]) (user=rajatja job=sendgmr) by 2002:a17:90b:4f84:: with SMTP id qe4mr11246662pjb.209.1634869746745; Thu, 21 Oct 2021 19:29:06 -0700 (PDT) Date: Thu, 21 Oct 2021 19:28:57 -0700 In-Reply-To: <20211022022859.1888836-1-rajatja@google.com> Message-Id: <20211022022859.1888836-2-rajatja@google.com> Mime-Version: 1.0 References: <20211022022859.1888836-1-rajatja@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH 1/3] i2c: designware: Enable async suspend / resume of designware devices From: Rajat Jain To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dtor@google.com Cc: Rajat Jain , rajatxjain@gmail.com, dbasehore@chromium.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Mark the designware devices for asynchronous suspend. With this, the resume for designware devices does not get stuck behind other unrelated devices (e.g. intel_backlight that takes hundreds of ms to resume, waiting for its parent devices). Signed-off-by: Rajat Jain Acked-by: Jarkko Nikula --- drivers/i2c/busses/i2c-designware-platdrv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 21113665ddea..2bd81abc86f6 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -293,6 +293,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) DPM_FLAG_MAY_SKIP_RESUME); } + device_enable_async_suspend(&pdev->dev); + /* The code below assumes runtime PM to be disabled. */ WARN_ON(pm_runtime_enabled(&pdev->dev)); From patchwork Fri Oct 22 02:28:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 1544756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=pE3noKnz; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4Hb7Zy4FbTz9sXN for ; Fri, 22 Oct 2021 13:29:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232294AbhJVCb2 (ORCPT ); Thu, 21 Oct 2021 22:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbhJVCb0 (ORCPT ); Thu, 21 Oct 2021 22:31:26 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53570C061764 for ; Thu, 21 Oct 2021 19:29:09 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id mn23-20020a17090b189700b001a04f094a68so960891pjb.2 for ; Thu, 21 Oct 2021 19:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ppyPwtt5n85t9ULlL3N3xlbKIm0Tw6nUJj2XNXuvqyM=; b=pE3noKnzPMT7teGJLrQJpn1gerl+AMcHg8Dbs1ag4fUvRBlJzJBG1sTYH11At0gW5o R7uU9pewISmYZsLVrahy3kEnTTNgqNSBFQ/QbU5jbtpIdMdKgjKkShAyYskfrpkKw/fr OTcN5LaTiIED26DSiYM9gIp6bM3rXpMdDePStxu6+IGqGTj7ze+uXuBxzbGwbyzxykED ER6WL42eFjN2Yo7Pin9BJFAkR7J+t3V7h54btZqtwiFVbArkuPXH1ZMDqqOMvvGLsOsg FSYzpGLw9b0/AUKDpizj8flGmTwlSQyS1nqYv45S+YZ10Pzn/9cDsxLp5EYzE/wsJaaF 1BNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ppyPwtt5n85t9ULlL3N3xlbKIm0Tw6nUJj2XNXuvqyM=; b=1SgDQqsYrfrUkTLByzHxZOx0OcyBYBAC6qN1Yj/gM4mpjDk7ec/NHJRfQzOYt2TTDN iRrPRFIcmgDW5Y2lSdvIaAMJnyvZtvxP3b18TNdtxR9+GC91DVIMju5T7CyvdIGEv8es z+BkYTAEv+1x68BSVE/AR/x34Lu7ALX083jubOirMQif5g7jCWEw/2tf5eMXDEELHDgg XZfA/djRKaKxIXes4z13YUnmNRfY8bU/fejiFZ1+qGCqgffG9rvRS+nnx8nlgYE7kSqo HDGUhc4poPMFmNfzJhCWWgbyL2WBfbBbYMegymTgyU5v3Q7+hovjn5AfZTy7kHDNf8gJ +VAQ== X-Gm-Message-State: AOAM530qzzxXE+gBMy+EGVji6lu3zBCgCFbif9Rq3rA47DCK6EXhVk8X SAHGv0Tf5DEqAJJDsdj8EXC0EChecyw6 X-Google-Smtp-Source: ABdhPJwQAVpfNpKQ2duOM0MLmXlIIPimsq+Dsm9f51VuSfRwP2v4psGr6i7e6lSzKHwLnSB3acJA8MnzeCdn X-Received: from rajat2.mtv.corp.google.com ([2620:15c:202:201:cc25:d9a3:4b5:37b9]) (user=rajatja job=sendgmr) by 2002:a17:902:db0e:b0:13e:f4d3:84c with SMTP id m14-20020a170902db0e00b0013ef4d3084cmr8682802plx.2.1634869748751; Thu, 21 Oct 2021 19:29:08 -0700 (PDT) Date: Thu, 21 Oct 2021 19:28:58 -0700 In-Reply-To: <20211022022859.1888836-1-rajatja@google.com> Message-Id: <20211022022859.1888836-3-rajatja@google.com> Mime-Version: 1.0 References: <20211022022859.1888836-1-rajatja@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH 2/3] i2c: enable async suspend/resume for i2c adapters From: Rajat Jain To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dtor@google.com Cc: Rajat Jain , rajatxjain@gmail.com, dbasehore@chromium.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Enable async suspend/resume of i2c adapters. It enormously helps with reducing the resume time of systems (as much as 20%-40%) where I2C devices can take significant time (100s of ms) to resume. Signed-off-by: Rajat Jain --- drivers/i2c/i2c-core-base.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 54964fbe3f03..8d4f2be54e17 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1576,6 +1576,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) if (res) goto out_reg; + device_enable_async_suspend(&adap->dev); pm_runtime_no_callbacks(&adap->dev); pm_suspend_ignore_children(&adap->dev, true); pm_runtime_enable(&adap->dev); From patchwork Fri Oct 22 02:28:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 1544757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=EPIcE6Gv; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4Hb7Zz03l4z9ssP for ; Fri, 22 Oct 2021 13:29:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232370AbhJVCba (ORCPT ); Thu, 21 Oct 2021 22:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232241AbhJVCb2 (ORCPT ); Thu, 21 Oct 2021 22:31:28 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECA4C061225 for ; Thu, 21 Oct 2021 19:29:11 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id w201-20020a25dfd2000000b005be4c3971cdso2503562ybg.13 for ; Thu, 21 Oct 2021 19:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=vzQUdY93uV17R+6G8Th/GOFeC3+4FEsDpxtXXZhhmgs=; b=EPIcE6GvBrjKsPNVxqqaat57B6owyW5X9cDEKMMaYE5XhESc6lpKEvdWUNG0dER35X FHOm3sNngnTML67qiPsr0gA7n0eWOvDoBP8hC+tiGqedyJtDPZ+jkATU6IDPGyzSpdPU NbJWkyOUg9XPE7fn5D49t3EoOu7Um3pcnKf7+z1Hz9exsuB7aPb6gTdLaEkWYqgf8noC qw+ViDwKtml5G0uo34mjRJKuAaV4tgRruirbP4fgNBGKP4+Jzl9McgTrVIYJLfIinoMA PopNitr9a/qIOW3ijuCd3+bLRPpJg2y6+wJextWbG++TfsNpqWT/g635MYbSfGxx3aF5 V8vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=vzQUdY93uV17R+6G8Th/GOFeC3+4FEsDpxtXXZhhmgs=; b=ai5a/LcbgraNL25jHzgagWqfte3lGXm/nsKIAoIdh2ngcLydNha5oz0nOL8AaaBMPq cNQSxmwcHwvstxB57wak1rbQ0hDUckmdP7A4b7JXRbSbOow+/IhSZTBW3ByEpS+p+Fuo SHr0GGuh4OKc6yLZg1gWZkmj6uGH7RBKEaBg4cma+jaZiab73baaCFmUEmxKUoPsRQUL GYFDImd6uW33cfe4pCLfchAOHaEGOcwjdD2+f9xHS6oKDm/GupUDqd3mD6CMnBSUfL42 33N1EqDyclv5JpBR5towBzRCwIKzhXhOV22tbLRwe2Zd7imn/n3HxbyJ5prZsODaEH1t /PaQ== X-Gm-Message-State: AOAM533Jjm6sTgWy8Cbtzi5xkJzKtGMKRJQQ4gDNiCip1FnxwlHlX7p1 imr22eb1gH5DD+jtOWZC7YLZZzaLCr7i X-Google-Smtp-Source: ABdhPJw45Ku+iLqKDAWxLO0IAZK55UZm/2cUJLCsdnPLHrj29/HH5/+WviiQLyP3gWnZQiylvF/+8VEm0WXJ X-Received: from rajat2.mtv.corp.google.com ([2620:15c:202:201:cc25:d9a3:4b5:37b9]) (user=rajatja job=sendgmr) by 2002:a25:1c08:: with SMTP id c8mr10660210ybc.316.1634869750638; Thu, 21 Oct 2021 19:29:10 -0700 (PDT) Date: Thu, 21 Oct 2021 19:28:59 -0700 In-Reply-To: <20211022022859.1888836-1-rajatja@google.com> Message-Id: <20211022022859.1888836-4-rajatja@google.com> Mime-Version: 1.0 References: <20211022022859.1888836-1-rajatja@google.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH 3/3] i2c: enable async suspend/resume on i2c client devices From: Rajat Jain To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dtor@google.com Cc: Derek Basehore , rajatxjain@gmail.com, Rajat Jain Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Derek Basehore This enables the async suspend for i2c client devices. This reduces the suspend/resume time considerably on platforms where i2c devices can take a lot of time (hundreds of ms) to resume. Signed-off-by: Derek Basehore Signed-off-by: Rajat Jain --- drivers/i2c/i2c-core-base.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 8d4f2be54e17..70d32efb68ef 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1047,6 +1047,7 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf client->dev.of_node = of_node_get(info->of_node); client->dev.fwnode = info->fwnode; + device_enable_async_suspend(&client->dev); i2c_dev_set_name(adap, client, info); if (info->swnode) {