From patchwork Thu Nov 10 10:32:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 1438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp66371wru; Thu, 10 Nov 2022 02:38:56 -0800 (PST) X-Google-Smtp-Source: AMsMyM6VvHF136MJRaPj/01cX6uWopXDm7yTn3XoA4fKVYsgTApoDqyIeBpWJsqCk90JPqH6YihY X-Received: by 2002:a17:906:fe45:b0:791:9624:9ea4 with SMTP id wz5-20020a170906fe4500b0079196249ea4mr58642106ejb.147.1668076735916; Thu, 10 Nov 2022 02:38:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668076735; cv=none; d=google.com; s=arc-20160816; b=NwIl+J3FecLtoaqVqiLyXOn7gIvY2hKFqFie2e8ruiIQZ1UHBwge7Kbtp/6e3crXVv y7JGk7hKJXVb/fF8bewoAavi89Fa9NmAjHu6vevA8+nWCIZGO0kxRQR4Jv+QQlEjDA/e DxvwrD8jfSAGeh40AhYMASqa3Gkex9HHO/akZVHN/IpxQSBzoW+o53dL3OK9aXfoACDO 9EzMLfdCI6wWSvFXSjLVpkkT55ocYSvIw5iIpFv685bOACc6hnM2Aw10V3uXcpMEGuZS maStdmUQIQwDrzrxp6qH0f/7l1RvOSKduFEipHK84gy08Hyz6+Q59yGwJwbAbi2OvwaN XnmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:date:from :content-transfer-encoding:mime-version:subject:dkim-signature; bh=oFMauseen+ABgndLJ/pvPKOevrA3IhGI5Uq/VIXv6FA=; b=RrWshUmVgpMMjwUw0i4qP7ptfFtIlxsPb60e0eQoKTRW9VAHYfJk+81VGm/ShZjewm SYIOP0Quf6sFiYmkeCGfJM8OWGe0BrCQTA8DQqc1s5j8MCjqGKeRvvB+d42V2wGuD8xC y2uwzDiU3D+jnDR2u2Xg+0sopQIbvj8Dx6H+i+ttwOLIH8vPPrGNlqbSQ+E509iUxmzN iPe4SD+yI39MsgA3oMje3n0SjQ/t9RngRKe9MXdoovX0sCegysXVpXHv5VAt/tUlEGo+ +ZJhJpKoy6bGqRbwuYrdFpLUJ7x2xFc1rs1pX2IAT0uEObRQP3IRyCPJ/bTFi1k615eH CdqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OqVKUXXA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a056402510b00b0045dbfc32399si20226209edd.552.2022.11.10.02.38.32; Thu, 10 Nov 2022 02:38:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OqVKUXXA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbiKJKdH (ORCPT + 99 others); Thu, 10 Nov 2022 05:33:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbiKJKdF (ORCPT ); Thu, 10 Nov 2022 05:33:05 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5286178A3 for ; Thu, 10 Nov 2022 02:33:04 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id i21so2380146edj.10 for ; Thu, 10 Nov 2022 02:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=oFMauseen+ABgndLJ/pvPKOevrA3IhGI5Uq/VIXv6FA=; b=OqVKUXXA348kFsLjvHj0vLxUJDIhYoP1ifKxr+a2mjZJvjKIPBSS3x7E/+mD8wvh1O kCJi45/J9n7IBhuy1Gj5otkK1gEsBLKoqNs2UFDjeqil9XrXMgsBBNggfxATEHLci+EZ qT7tcIlX6f6Q4duMF/RtntTJ+EwD+VoCi9yfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oFMauseen+ABgndLJ/pvPKOevrA3IhGI5Uq/VIXv6FA=; b=I/9xVN+RZ6NUT1fQ0bpDNNjtOhyiri0zAy7NkG7fVI749C0MRKF7Nukr1kGtNzHkqz fnA3vx0atGt9iWPOV5/MjRNZPGhNoonJPM56axDbTXZ+ICA2ljXQXtN9aw5IqszwCAeg HoYlT7UO81I+EA84HOb8hD5wDNj4OaV0ebtWw3Ypk5KXbqklbmOLI4p9dGp8XZTiZ+sr rUzQJhMMB5QhFX8t7w96Ush+bfiRCR2Cfgtx8W54Bkc6iPCR+OBS3jCCgNehAfFLq0tZ yB2TyOqfFJ/SDUF14T+OfN6uSnzS5fU7VRiEtNPMA4/Msn4E4X2KGCa1LoZZKMnact+p OHYA== X-Gm-Message-State: ACrzQf0+YbxlmITwU31kaRLWPglHRPzR0DF0/mgMEOe4rIZDdpcyWwO2 SI/5vgae7RUjE54AkBHVpgyUp9biZ/sLrMVa X-Received: by 2002:aa7:d601:0:b0:460:21d2:e14c with SMTP id c1-20020aa7d601000000b0046021d2e14cmr1987293edr.3.1668076383324; Thu, 10 Nov 2022 02:33:03 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:8565:42a1:677d:6677]) by smtp.gmail.com with ESMTPSA id o5-20020a170906768500b007a1d4944d45sm7137467ejm.142.2022.11.10.02.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 02:33:02 -0800 (PST) Subject: [PATCH v3 0/1] i2c: Restore power status of device if probe fail or device is removed MIME-Version: 1.0 X-b4-tracking: H4sIAFDTbGMC/3WMwQrDIBBEfyV4rkUtIdhT/6P0sOomLiQKmlhKyL936bG0p2GGeW8XFQthFdduFw UbVcqJy+XUCR8hTSgpcBdGGaO1spKMl0+ghhLQDiOCHrXrBf8dVJSuQPKRibTNM4+R6prL6+NvmuP+ S9W0VBLDoMBaZ60KNx9LXmhbzrlM4sGiZv7ChmE19L1yowng/Rd8HMcbDgyiN+cAAAA= From: Ricardo Ribalda Date: Thu, 10 Nov 2022 11:32:48 +0100 Message-Id: <20221109-i2c-waive-v3-0-d8651cb4b88d@chromium.org> To: Sakari Ailus , Tomasz Figa , "Rafael J. Wysocki" , Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda , Hidenori Kobayashi X-Mailer: b4 0.11.0-dev-d93f8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1330; i=ribalda@chromium.org; h=from:subject:message-id; bh=M82E0oMA35H24/OwUFwrKs63mvZo7xgnzXo5zM2LJXw=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjbNNSwWMZYHSZT0P9hHJCObX0tWclR+ojzLBIWFjw muqCxhqJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY2zTUgAKCRDRN9E+zzrEiIVFD/ 96FpLAsxQ/kKC+TsCzvHjm3ugGFVt5wxifhSQvzB7/NAAO0nRyGHtApfxVyLnEOgLp2fn3/db0kmap aEcNfpAjz48H5QyL6t/DA5xYzVJJvgVtawFHvh65fdTJoLZIBnqcM/4nsspUG0v/Qt5X8/35q09ln/ 8Fe4lkBKsHa+ggiRChPaU7PJlD9GigihbVHKxrnjrTO4blA482EcCi08w14YEu2IvJqso+hepGMNqi XpZzT6ncF+1tXwKuSqxI2gGipDkJ9f1lvn07JykrYd5Ga9QBIl4R/9fjtVw4Dy1Ki9IgUm0kbfoRPp SmJzUB99ZPA892Yl0xKATe7v77XrZB4X8yGleBwCHEmIhMV+jXpYN9sN8rfc/v0yV2L5cHZzct0FrH Fpj5hqNr0jwWm2uhoCns2+6DXuBahmFG7dxPViQ7U+HAkNqZ0d/Ri5By2NC8BN9N/9pEBt37GY/EGJ MMdGq2rqMoom3S3/8brZduGkfSMxAjaNxcIm3TtSUwsaR7Ugd9rAI+Uz6uYfJKx1jUK88vjPvS1e+i Mw/aBQp8NAV8Km63fUAMGOosAlaPLKEDJLMx6cSylvCytWX+UU8JWiukVh/aUzROFQ5wKsGXinMOG3 /kazf0TUk3ubySQf5743UUcU5rlVtvPHC0j62FBmWPE81REGwpYWa90awv5A== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749105231281099171?= X-GMAIL-MSGID: =?utf-8?q?1749105231281099171?= We have discovered that some power lines were always on even if the devices on that power line was not used. This happens because we failed to probe a device on the i2c bus, and the ACPI Power Resource were never turned off. This patch tries to fix this issue. To: Wolfram Sang To: Sakari Ailus To: Tomasz Figa To: "Rafael J. Wysocki" Cc: Hidenori Kobayashi Cc: linux-i2c@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Ribalda --- Changes in v3: - Introduce full_power variable to make more clear what we are doing. - Link to v2: https://lore.kernel.org/r/20221109-i2c-waive-v2-0-07550bf2dacc@chromium.org Changes in v2: - Cover also device remove - Link to v1: https://lore.kernel.org/r/20221109-i2c-waive-v1-0-ed70a99b990d@chromium.org --- Ricardo Ribalda (1): i2c: Restore initial power state when we are done. drivers/i2c/i2c-core-base.c | 11 +++++++---- include/linux/i2c.h | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) --- base-commit: f141df371335645ce29a87d9683a3f79fba7fd67 change-id: 20221109-i2c-waive-ae97fea1f1b5 Best regards,