Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1659358pxj; Fri, 4 Jun 2021 22:44:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiMPe9topyBpnYg4LYXP4GwTmqIzgqUhmzVGHMEFHf3ZRVREEuNw3A5e2ga8eg2pShuUk4 X-Received: by 2002:a50:fb8f:: with SMTP id e15mr8290874edq.46.1622871865735; Fri, 04 Jun 2021 22:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622871865; cv=none; d=google.com; s=arc-20160816; b=vY44n3KZk/5iNuon4/TZrrX1VUfnWqEqvE8KyYuVh/RgQFaDIplr7Klvb3dHBVITkd /uIyRM96SFiKpOsCjyf36liGWdA/HsYFIyOX7WM+THuJumqdwQc8dN+zd77mk7zNpDeZ DOhGLZWLRuQoXwKfBm1OCmOGZQfD5vS8BAjt67th65eb3PBa4WSdNxC5euaFd6g5fLH1 VyPYqAlmdmufzm0P3Sy9zQO9i4/b6dn5K7vFWBozFs/u1OtElOxn2zisYsaEr/e0yi6A +mW42BmaV46HkMAoxlwFH/SqKNgan8s+weZY1oha82eAFZwZNF/7M2qanFq+X5PMYmCn Xu+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=pIeo2DHZK8KO1+ekifaARjA+Z2eLYklUkqdVd1CFdXc=; b=yVY+fw1IUMyKxLXKi52bHXdKqgCuxPlsT27fsCUSLV5Ey+EUmXIfE31Dyofnc4J4uJ n23vKWauxyXqJg5vhKNS/SsxiY3ejG0sZKNE00MBav7d7kd44hAcyeETntN9rSqO8hpH nxXIzwLBdGCzhHe20JIXQT6PQlYqJTjJpUeB6fT4azJaJi7BhzOVMieS1qL+9sIzV4A2 DIpIowcFB3HOUDfZj0rqlXIWfN0I7m4J2Eqvfo4k0i2sJYZsIBCgb2t8ypc0LtkqCejo 91XHIkZb7Oqiz3V7DBtnxmQSS/3+bWxc2tMhGyro/mCf/c1a0H2gQrjvz7tNT/unvBPw SNYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si1492641edo.370.2021.06.04.22.44.02; Fri, 04 Jun 2021 22:44:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbhFEFbr (ORCPT + 99 others); Sat, 5 Jun 2021 01:31:47 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:49543 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229660AbhFEFbq (ORCPT ); Sat, 5 Jun 2021 01:31:46 -0400 Received: from [192.168.0.3] (ip5f5aeece.dynamic.kabel-deutschland.de [95.90.238.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 2D75361E64762; Sat, 5 Jun 2021 07:29:58 +0200 (CEST) Subject: Re: [PATCH] hwmon: (pmbus_core) Check adapter PEC support To: Guenter Roeck Cc: Jean Delvare , Madhava Reddy Siddareddygari , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210604135714.529042-1-pmenzel@molgen.mpg.de> <20210605005124.GA255680@roeck-us.net> From: Paul Menzel Message-ID: <8534d106-0936-a41d-b9c7-2f527b315dae@molgen.mpg.de> Date: Sat, 5 Jun 2021 07:29:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210605005124.GA255680@roeck-us.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Guenter, Am 05.06.21 um 02:51 schrieb Guenter Roeck: > On Fri, Jun 04, 2021 at 03:57:14PM +0200, Paul Menzel wrote: >> From: Madhava Reddy Siddareddygari >> >> Currently, for Packet Error Checking (PEC) only the controller >> is checked for support. This causes problems on the cisco-8000 >> platform where a SMBUS transaction errors are observed. This is >> because PEC has to be enabled only if both controller and >> adapter support it. >> >> Added code to check PEC capability for adapter and enable it >> only if both controller and adapter supports PEC. >> >> Signed-off-by: Madhava Reddy Siddareddygari >> [Upstream from SONiC https://github.com/Azure/sonic-linux-kernel/pull/215] >> Signed-off-by: Paul Menzel >> --- >> drivers/hwmon/pmbus/pmbus_core.c | 10 ++++++---- >> 1 file changed, 6 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c >> index bbd745178147..7fbd82b7560d 100644 >> --- a/drivers/hwmon/pmbus/pmbus_core.c >> +++ b/drivers/hwmon/pmbus/pmbus_core.c >> @@ -2214,11 +2214,13 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data, >> data->has_status_word = true; >> } >> >> - /* Enable PEC if the controller supports it */ >> - if (!(data->flags & PMBUS_NO_CAPABILITY)) { > > What is the rationale for removing this check ? > AFAICS that will render the ibm-cffps driver unusable. I screwed up forward porting this change. Thank you for spotting this. I sent a second iteration/version 2 of this patch. Kind regards, Paul >> - ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); >> - if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) >> + /* Enable PEC if the controller and bus supports it */ >> + ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); >> + if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) { >> + if (i2c_check_functionality(client->adapter, >> + I2C_FUNC_SMBUS_PEC)) { >> client->flags |= I2C_CLIENT_PEC; >> + } >> } >> >> /* >> -- >> 2.32.0.rc2