Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5551526rwb; Mon, 14 Nov 2022 06:20:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf5W8OQlegt8Vi/OBpPNfWRzjCqk3eMvSdtAp7ZlQmfxuur3ZPyLBgVddac1OJEdl2xUk0DR X-Received: by 2002:adf:dcc3:0:b0:235:14dc:5e14 with SMTP id x3-20020adfdcc3000000b0023514dc5e14mr8052776wrm.252.1668435635417; Mon, 14 Nov 2022 06:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668435635; cv=none; d=google.com; s=arc-20160816; b=v+z8u63WarTf5AOGXxUbiPesuRoZ1RkMbQqYhOX85x1Bz2/OmOd0hP7+Y1YiULveeN GIfTfFAOTzLBN0bAQll1tieNrT43I89ORLHw4wyliVdHsUZZwcFS4OPyNZQceKo5k8C+ TpND/miEzdLZFyicJPXhn8BvY7OvGw9iMu7RjUpKoPzMd3RpuGPNymwbzI1TN1iXpXyN OuuYSTzHdycSF+Qtz80FIV8C/JxNF/asW2ZcQBtO4Y1FU++FYPEohbRNd65W+Mjs/5Hw mI4w9ouZSR1MIe3BSAmM1fD//zaoEsfiXKqQEUCWUgPrCFSzFRyfTYF34Xe3ulM1CKzz VzEQ== 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=iF/YlGNlOzxHojJmqcX9ZAPxwT365ADtjmnShW81IrE=; b=qnfL0MTwZ3rP3VNqSvO+lS09zLDDwo89fwB0qcKzQkX/VgGFgApFC4RvaZ2ZEVk3vb SknVb0s+9yz7vx/8v7y9AgzPBJLRZYV3NZiozb7sB059LZZW+cDBPI/dhFCB1eDtutv/ DI1Gr5TuBS7HzveTLg/u0nkX+pd5adSMas6kpEvt5eR/Vh7ZSDiIHZSteDFbGKGWlwZ8 5K1414zZyvMVVYt2cgRq6CKJxagDn1Noyx3plYzQCyf76FQV9qXeyCNdx+v62nuC7xa9 YIUwyDytUZdo58tsom7PuFTzhIlkmbqSH0ZjIYJ26bFoWCe1I4k/ol3LlelR7rd2Nkiq casg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="N93gK/ST"; 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 r19-20020a05640251d300b00461c852af19si11073147edd.633.2022.11.14.06.20.09; Mon, 14 Nov 2022 06:20:35 -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="N93gK/ST"; 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 S237133AbiKNMUy (ORCPT + 88 others); Mon, 14 Nov 2022 07:20:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbiKNMUt (ORCPT ); Mon, 14 Nov 2022 07:20:49 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5833E23149 for ; Mon, 14 Nov 2022 04:20:48 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id n20so7240994ejh.0 for ; Mon, 14 Nov 2022 04:20:48 -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=iF/YlGNlOzxHojJmqcX9ZAPxwT365ADtjmnShW81IrE=; b=N93gK/ST4ycT7bnx0m+f4iLT7pam3b3MwWSQyyseGWIj8X8lj/NK0bh0d8weSTCwRp P80t8q8nvbv5HJoAK0zRYXQqhjgSYwJlkkcdUq4Yq3O5yeizUWdayhcWpekfCFlTIkGi N/2Mtszd5Reir1QDCrrc812e4g8vTu820aCW4= 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=iF/YlGNlOzxHojJmqcX9ZAPxwT365ADtjmnShW81IrE=; b=wYKhPUNsVxutBw+HH8nnrrcynMH6+WK6SJF+0VYsoecThdaKa3+RPe3cwhkQ/b15Nw JzFo2xxc63KkN+acrgQhiaYs1iY/7t1sUJ7Ki0KFtlLNrh+fjdyKF4JYPAZJ4sPTLtPH Nn9WWj00oUwqgL/0S3LLx3ptSzlA2WTxvPow5pVy8oeDDyKHGox6E1AxQGInKV5LFRkN L0b3zueffSQDrWWMXUt7Z907eLfOG7qCXs8T7Hziy2G5m0l4priNrJKKiTxRfkEYNShf /n3Wbo3i1acZSqhgmwT0F0oxsqniaz5lF9LzP2TDaUQrHkPEqtoqjig7Qtg8eHi6VyjX FffQ== X-Gm-Message-State: ANoB5pkOYksc8Uxm8f4LO5NKjwsGSAWq+g+S1qQvyCM1nqYjs/zB8dLR h91+ogEDxeqCTm36bSS5oT91kU1zuTveclM5 X-Received: by 2002:a17:906:58f:b0:7a0:b505:e8f9 with SMTP id 15-20020a170906058f00b007a0b505e8f9mr9746850ejn.216.1668428446880; Mon, 14 Nov 2022 04:20:46 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:c205:5c4e:7456:c8cc]) by smtp.gmail.com with ESMTPSA id v19-20020aa7cd53000000b0045bd14e241csm4718483edw.76.2022.11.14.04.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 04:20:46 -0800 (PST) Subject: [PATCH v6 0/1] i2c: Restore power status of device if probe fails MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-b4-tracking: H4sIAJEycmMC/3XOwW7DIAwG4FepOJcKCBDoae8x9WDANEhtIsHKVFV593k9VsnJsuXvt1+sYS3Y2P nwYhV7aWWZqbHHA4sTzFfkJVHPlFBKSuF5UZH/QunIAf2YEWSWwTDaD9CQhwpznEjMj9uNhlNpP0t9 vvO7pPK9FdUlFxzTKMD74L1IX3Gqy7087qelXtmFgrraxYqwGI0RIasEMW7gYRcPhJOzRsagg3Nbl/ Uu1v9va+2ttsoNQ9jAZhcbwqS8tWN22cIHXtf1DzdyhHyeAQAA From: Ricardo Ribalda Date: Mon, 14 Nov 2022 13:20:33 +0100 Message-Id: <20221109-i2c-waive-v6-0-bc059fb7e8fa@chromium.org> To: "Rafael J. Wysocki" , Tomasz Figa , Mika Westerberg , Wolfram Sang Cc: Hidenori Kobayashi , stable@vger.kernel.org, Sergey Senozhatsky , linux-kernel@vger.kernel.org, Hidenori Kobayashi , Sakari Ailus , Ricardo Ribalda , linux-i2c@vger.kernel.org X-Mailer: b4 0.11.0-dev-d93f8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1988; i=ribalda@chromium.org; h=from:subject:message-id; bh=L2z4HpXH9DdNsrfjX1MA37K4xpBLN/Vx7QbAH2x2Tow=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjcjKU+wE96oFP+E1L/znBajMc+rWgWh2lC9qT2KLu ooHproKJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY3IylAAKCRDRN9E+zzrEiFfXD/ 9aSU+FTnIj4O/dTi54CbmZg6cB+GaKM+6TC0Kwvm67bXNy5FMtbzHpembTUvaO0rXxSTfdZfx1GnWN 6kA2SCsFxZb8ej2QLkd08mWSHiKoe+fvBnYzs/fHrmQBgepGc8b5higjQ+kf3Xg/u85VCfmi0NKs05 tIzdv0txs2ZpQ7SvuG2IvsGcyvst1UwwZwAbptfXL/GSH61cbmCRiWP6rEI56e75MdV+D32Bl200Vj MGlVq/IHWiwy7KesuGOQNmvTHmcloRZFMEWYlXfxMYIlzShuOHO7e3zC/5XzAhtcfMq/sgWZ4iKAp+ QGSeFHWwo8o1rFw0gPg+S6lNbYhGUrQzNE5CMAwwOA082IDCQ4p6g52kEd8iyaO3Nx17ocLesm6Pl4 4iDP31eVzvSqEIG1tTVrE5QPvubMVdwhTciBkiwZxYX+h6+RshVUayWA2cKkj0eYm1xzqQ4tm1/6vM mmsXOScs5fW84JeEChxh/P/hIWmFiaJv8l0jXtJKEqStBSwSseZBBjl+jpAxaWhFXZxtfeO4q18L4c LZH7VXaX4AvdAxWxnpq/PMkyw7QlYNzDRZKsurmNcA8KcYkyjMnK2dGyHtqi9qIktjW57XC45bOLsk bokFrxUKKHnHIIlIGbWuRaN+Ypt0A8Q2RzLtuijxsmosOaVNZAVlY7+rl5+g== 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: Mika Westerberg To: Wolfram Sang To: Sakari Ailus To: Tomasz Figa To: "Rafael J. Wysocki" Cc: Hidenori Kobayashi Cc: Sergey Senozhatsky Cc: linux-i2c@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Ricardo Ribalda --- Changes in v6: - Add Reviewed-by: Hidenori (Thanks!). - Set device always off at remove. - Link to v5: https://lore.kernel.org/r/20221109-i2c-waive-v5-0-2839667f8f6a@chromium.org Changes in v5: - Add Cc: stable - Add Reviewed-by Sakary (Thanks!). - Renamed turn-off as power-off, in the name of consistency (Thanks Sergey!) - Link to v4: https://lore.kernel.org/r/20221109-i2c-waive-v4-0-e4496462833b@chromium.org 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 if probe fails drivers/i2c/i2c-core-base.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- base-commit: f141df371335645ce29a87d9683a3f79fba7fd67 change-id: 20221109-i2c-waive-ae97fea1f1b5 Best regards, -- Ricardo Ribalda