Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp429714rwb; Thu, 10 Nov 2022 02:54:52 -0800 (PST) X-Google-Smtp-Source: AMsMyM5L8bhFcHjOuNGMTbXKlI2FM04UfJXjSNh/evpsRHlpqwKNTb48aN5lnRi5uvUkbBO74Iyi X-Received: by 2002:a63:db12:0:b0:464:203c:b964 with SMTP id e18-20020a63db12000000b00464203cb964mr2352475pgg.270.1668077692672; Thu, 10 Nov 2022 02:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668077692; cv=none; d=google.com; s=arc-20160816; b=jxELiyO1B+WVRvE1xOOP5l9eC1byLvQBstUKbZqCNTkvwSZ+5f1GIOa9z5MbLFmHq8 eNScPewnhm15mP4+5xPExyMxNooUUXc3Hy53H+hsxaw+Y26Fw1KUqZc47efty+l0jgn5 Hvugaseql3tWdleL8Yk3J+5GFg+V4/1gwkJhQL38/e9zIn0tVd6lJi0KfU2XUmLc8HUs h21jy18mSsPZYte3y0HHTg95o+4b7mX39PodwciTIGs/2K/tY0jyOyhOLq0r7GOJ8Wbk CE5CpJaSMRNKYb+nZ1xYqG00UlRV+X8mRoQLa0thj2g3il1W4Fl2eTLVrNmLVsmwg6L1 JdJQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pm13-20020a17090b3c4d00b002138cf12ae0si3970463pjb.117.2022.11.10.02.54.00; Thu, 10 Nov 2022 02:54:52 -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 + 93 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 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, -- Ricardo Ribalda