Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp800882pxb; Fri, 22 Apr 2022 11:25:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyonuRkKndyTzySnBMFPJ30BaDtUJPvhX0HdEdQlm2e8Z3mSio2rIaX6ymBIHiuzZ0aLiQH X-Received: by 2002:a17:902:e748:b0:15c:e3b9:bba3 with SMTP id p8-20020a170902e74800b0015ce3b9bba3mr99558plf.139.1650651914846; Fri, 22 Apr 2022 11:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650651914; cv=none; d=google.com; s=arc-20160816; b=iaOVbx/95oWl+hffxMpGbHECMH4rVXiB6tTng05ruh+9EuNR+QBCJCbEVrGudnSjk3 0Mbs/buGV/FYooJYI13H7jvr1Gh7KIgfKN8mkBKYDISuxD/vAtlB9jALqbquGyXSTTde 8nXHAbSt01jCPxMbs9e+PoqpX/Ubb7rj10UCjWnOjUVIUbglYJ4UxSo9RZSbai94l1u8 DnjZZ4hEhd0kOWfGr6snWgbN0iuofeRxV7zTFB2MhuJ0GRCl3fSwV42qgXCI/2+34MbM /1+Vs2b6wKZN4DqachPiMhF8i05roSlo+MJfAHCfrY1E840yXe/SoUGgGq7JSleGS0CL oi6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=9jqaNc5GS93TqmOq2Cq3d6a6vz0jEdB9F8+DagCs+Co=; b=plqaONQJse5JLlmnMZsptmeWD9NKYxqDxER9Ugn/YGefW5e1Hw6nZeKr0JSq/PHyrv wwVzfKTCSR/KwjIsiUHwDrRE4yrkDxGr5YwyUbE6tPVJTvybMEdjrHQdcpMFGNvUB5p4 y1Cnqbpd6vNTpUBP07DyktUkVWov2eDFhVGUhtfPvrBrLV6jz73Tk/QYuIHe8T+obZR7 ZbtTDAaGlE+YiQg0WBElDoiSUgOSU5t2Bqt7PL0frQW5PI6CpEdaV8dUTbBECRzjAqn0 MFo51ZFT/4Fix6LI6JMyjQ0pID8FEI9mXCrWocI+MXK2rIiGa6LwWiEdRMlXTqKUYxdy pfDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=h8epfsKD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b13-20020a631b0d000000b003986443b1f0si9366318pgb.832.2022.04.22.11.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:25:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=h8epfsKD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 54507105D64; Fri, 22 Apr 2022 10:54:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348218AbiDTBD1 (ORCPT + 99 others); Tue, 19 Apr 2022 21:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348181AbiDTBD0 (ORCPT ); Tue, 19 Apr 2022 21:03:26 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89251275CC; Tue, 19 Apr 2022 18:00:41 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-deb9295679so421944fac.6; Tue, 19 Apr 2022 18:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=9jqaNc5GS93TqmOq2Cq3d6a6vz0jEdB9F8+DagCs+Co=; b=h8epfsKDDQhn9rNEqVXlRvWdOyABHN1ZbHL/SpuTNNPtHIrikHxXUOWCErWTnFONvX SlUhfrcbJg6m/raBZAEtQcM8ePyH13DkirRtX5k6Zbf3sHs1UGHzHsUGuDHacn6nJ2Jf fY0Xdfla0BXMaGIr5JjjKw5aqvBz+4yQca7hiuDls6LVlnyKIucmogdTH2yNKeWagszR jpzPI3XwdMR0WLj8hijz+kQYs38OpuUrZTlAlby0harTRJ6m/KZxAAe7rvuYSQoo2X4j B2XBhlNQ2ovTwfp3Tp7aWR6/Hg2OIksju+xuHihX3oa4/gdtPN00xm8JZ23CpViEiPeB 9MaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=9jqaNc5GS93TqmOq2Cq3d6a6vz0jEdB9F8+DagCs+Co=; b=8N5vDBbdIjUFE2S26pu4wpx2sk6odiewqsEMAlO20yLaL0ZjGCK5hchg5Vy1zKFLzh rkxkGumjjNoiRPVNciaVEYE1dbO4XZ3JLgjPNj6StU4LHY/DtyayAxJ7djU/Y8aifweH /ySktLbwOZGF1eFd89B2jwI2zeXKb6oe6hYEb5wRiX4SzYKsUCdPojf5nUp7BIBJZbO2 UHbBk8h0lu9IpxOpTrxatXYXgwMOCXGSMt2svVo4208rDCfLcFcL1R1zZnjfuYj9UJUg 5FfzLbQut6EQsL9HdjwouIMcHAToGqTKrhhckUrUtNK2lZKQkvVsdUTnlkRdITfnkR+K riQA== X-Gm-Message-State: AOAM532UZ5jDOTUJI11KbQtoJVYf5d+lg7THzPmyE4egGAcRacLtyb4J K+1/72Hvzk0oclNBQmSZ0RfCN4EOl9Y= X-Received: by 2002:a05:6871:b22:b0:e6:49ed:4af0 with SMTP id fq34-20020a0568710b2200b000e649ed4af0mr93723oab.102.1650416440828; Tue, 19 Apr 2022 18:00:40 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id j5-20020a4a7505000000b0033a47bb6a74sm1332178ooc.47.2022.04.19.18.00.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 18:00:40 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Tue, 19 Apr 2022 18:00:38 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] hwmod: (pmbus) disable PEC if not enabled Content-Language: en-US To: Adam Wujek Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220419205228.303952-1-dev_public@wujek.eu> From: Guenter Roeck In-Reply-To: <20220419205228.303952-1-dev_public@wujek.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE 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 On 4/19/22 13:53, Adam Wujek wrote: > Explicitly disable PEC when the client does not support it. > Without the explicit disable, when the device with the PEC support is removed > later when a device without PEC support is inserted into the same address, > the driver uses the old value of client->flags which contains the I2C_CLIENT_PEC > flag. As a consequence the PEC is used when it should not. > > Signed-off-by: Adam Wujek > --- > drivers/hwmon/pmbus/pmbus_core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c > index 82c3754e21e3..f8ca36759b0a 100644 > --- a/drivers/hwmon/pmbus/pmbus_core.c > +++ b/drivers/hwmon/pmbus/pmbus_core.c > @@ -2014,6 +2014,8 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data, > ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); > if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) > client->flags |= I2C_CLIENT_PEC; > + else > + client->flags &= ~I2C_CLIENT_PEC; > I just realized that this patch is not based on the latest kernel version. Please rebase. Guenter