Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp763668rwb; Thu, 10 Nov 2022 07:09:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM68XHBlB39qagiPPD+1LLGbmrLw0hvD3p6ZyHonPRzICKbRoGY3vQiWb3WCFSkzi/1zsGr/ X-Received: by 2002:a05:6402:22f1:b0:462:f6eb:6c6b with SMTP id dn17-20020a05640222f100b00462f6eb6c6bmr63411603edb.365.1668092960518; Thu, 10 Nov 2022 07:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668092960; cv=none; d=google.com; s=arc-20160816; b=sa9dqoJH6Gktnpgc5QvNrK0Qym8iUU5dAYAiLunbvOEHEma5gd2c37a3YarxheFjUR vOcVk39eiNlsonNkWXjedLBLii0q1cfYPfQvFkv0q4Tf3QTq1RjwrY0udAYlXLMz2m2b KYEiOv5FLPzhulm0Pwu/dlvk1B8SWKImgYsSwmfke/LaBD3O8iauG98n14MfIo2Qj/df Z2lraQiMuZ7r5ZvDn5uizSGNXZ9jBR+y6WiGNRLGGNN3koyGxw/1s1838Tzds4EYX4Dv EIw2ciFiV1oXW5TBSyUQN4hFsuZ7Up2QexBMRmsHnXCSQeDhwFeisxOqXpJI9aGJexCT q4Cg== 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=mpGOwIDC6RyqeqJOJZ70WfswIAfcOXcXcK09BiGwsdE=; b=MzTooeU00E1cD4YskE1tiz4KtWEQNJ2YMRbFdY2wquYV0TZjpgnJz/rRfdI7wGsuM4 Bt3R4CW/yN8F/C/h0O/3mxv/cOMCeCZdWPeSvbwXmfVafHVoCwFYQW8L1XlL8N8hQG/J Cu20A/Zhy5kN3E2bJqcqVlsNZmJ6vFQYkT7RrPXh1JJHEAtvlhpux4jTfHnueDEsrcqP dBifPwS1JxaXHboAXsJUqwmkznRsObAFlVZ4BFP1eG9bn8OIIFnHRb+ppR104SU5iTCs VWsqPv19WRiUAhSlggcw+nocmXeK26V7yyoNqgdmYwMITTCd8U4r48fdLTS9GDIqh35m fH7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UZ7OEqL1; 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 sd16-20020a1709076e1000b007ae5ccae236si17482584ejc.90.2022.11.10.07.08.52; Thu, 10 Nov 2022 07:09:20 -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=UZ7OEqL1; 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 S229958AbiKJOL6 (ORCPT + 92 others); Thu, 10 Nov 2022 09:11:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbiKJOLx (ORCPT ); Thu, 10 Nov 2022 09:11:53 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5B116CA3B for ; Thu, 10 Nov 2022 06:11:51 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id f27so5349369eje.1 for ; Thu, 10 Nov 2022 06:11:51 -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=mpGOwIDC6RyqeqJOJZ70WfswIAfcOXcXcK09BiGwsdE=; b=UZ7OEqL1nYcU4Ljq+dD0Msj9k4SekcMDGBhg6G0O/pmW/rAv17Ek2hWXT4/vB3CKu7 13MaltHhltvh488ph7fWPljkTi01LUPvFz3zNV8Yrwyd3R6b60S9DFAAmjhE5sYOXuss cU6WeB617eP2bhP7WILKaHocbPlZLfYBfTBvI= 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=mpGOwIDC6RyqeqJOJZ70WfswIAfcOXcXcK09BiGwsdE=; b=Gj79xM1pya1PR26puZMZKQymU0N8GO9mb7r02OUmonzm8P5b8PIG+o+qKQ3MMv21eT wJQ2cs4+KhjDgeApdKodtG3hLjpBGbDmlx0YU+DNy5EwJa/Wfsnx/rYYiAeGoQLNJ1OJ SwO2pClMLPOOgjdQkCycG6owZ/gZk7e+dPB4LOWxywFQCzZzSUEO3hUBF5eDAmoeU2L4 rvAKtjbpHqgMweDrsCbTkQaJuh4y8LOpRnCTzt6vUIlBcp5x/cZTJAiCbjerSAs5fqZ5 ArctCtou7BHM2xovx5b6EpanWmUmH6zj5ZM+x/owoReTZjCIfeMYUWP9uWK+FNVukwb7 /f1Q== X-Gm-Message-State: ACrzQf2LkKhvt6aDjEMSSGXOG9DCpqTkJN6XBMUBD5lBNqvrhrMVyEov 6hxf0QclYTQloqa/ZoR8PPWKpw== X-Received: by 2002:a17:906:9b83:b0:730:b3ae:343 with SMTP id dd3-20020a1709069b8300b00730b3ae0343mr61811483ejc.670.1668089510192; Thu, 10 Nov 2022 06:11:50 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:e41d:ff2f:a5fe:e81e]) by smtp.gmail.com with ESMTPSA id l2-20020a1709063d2200b0076ff600bf2csm7308383ejf.63.2022.11.10.06.11.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 06:11:49 -0800 (PST) Subject: [PATCH v4 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: H4sIAJ4GbWMC/3XNTQ7CIBAF4Ks0rMUALba48h7GBT/TQlIhAYsxTe/uxKVpV5M3me/NSgrkAIVcm5 VkqKGEFDF0p4ZYr+MENDjMRDAhOGeKBmHpW4cKVIPqR9B85EYSvDe6ADVZR+tRxGWecelDeaX8+fVX juO+V1U5ZRRcz7RSRinmbtbn9AzL85zyRB5YVMUhFohZLyUzo3Da2h3cHuIWsRsuklvTmWH4/7xt2x exvo+FJAEAAA== From: Ricardo Ribalda Date: Thu, 10 Nov 2022 15:11:42 +0100 Message-Id: <20221109-i2c-waive-v4-0-e4496462833b@chromium.org> To: Tomasz Figa , Sakari Ailus , "Rafael J. Wysocki" , Wolfram Sang Cc: Hidenori Kobayashi , Ricardo Ribalda , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org X-Mailer: b4 0.11.0-dev-d93f8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1476; i=ribalda@chromium.org; h=from:subject:message-id; bh=3UiRQb+QdR5Bl65LKAPmfm03Ffuf+eTUqFblaN3JJzE=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjbQahdbgFKzWCA2RDpUGQVY/z/fzxN6ntwcXuLyNp B+dHg06JAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY20GoQAKCRDRN9E+zzrEiDEHD/ 4uxwmNSBFLQ/VjTr+fSQsLdXZFC9iPjfRkpKG85yJklzBtR83sivSwkQk7wWUe5/5m3cIIPy+345ym gGqDmsUGIulkr5NLScAGtcy/s8dmZvSZQeb+PJj344vG1qn9rkkwCcC4j+bM7KIFh6M50Ds6TZ6bVn vDMcOebKWGsW99YlgB8vVMJ9wxGVV9Dp0wp7NDhj6neyt/iTmOpOmELgJKaVUi3YzQJaoxnOovo1hf uFlxc3gh2blnLoDlwUQ0qwNux5hz0DpydtfzMTaamgyQP3wobZaAuSX4M3MB63WUt/3bmxkSbpDeqP 2rGbHrggz0WHVoZuGEjMlgJsaD/Nuot0aZfYQRWA52m38TByjUn3CqFTXy2Yvf4L7KWPfOBNaczLB8 eNAP3fpwa3Zkj5jBdXs3QTvUCbRRxlv4BYiebBrNNILuwfYPqDKoz9WeowZWjlRBgeyqnYeMKc2KGz 5xxmrUUayE/4OZ2pEJtFBgHB9ACk7MCraHhiT3hkJNE1VARKxFpFfZ18AQBt6LxxbqpnVqft5xPJUU RPKBSLnVv1NA7eN3VFFlEMp0YVR0cwCGi2GORQr/Wz4iGDHKDcdwhgbLIIxDtUUA68mWD77UAqWYHu xAwAtBtCz2UGQnotJZgm/hF0H4HVBXCTLzSBx8LON+E9qqypdGrLO09eyjhw== 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=unavailable 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 v4: - Rename full_power to do_power_on - Link to v3: https://lore.kernel.org/r/20221109-i2c-waive-v3-0-d8651cb4b88d@chromium.org 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 | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) --- base-commit: f141df371335645ce29a87d9683a3f79fba7fd67 change-id: 20221109-i2c-waive-ae97fea1f1b5 Best regards, -- Ricardo Ribalda