Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2143738rdb; Mon, 9 Oct 2023 14:17:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLc5NZeDy/wQC0+tIKZfsK1Gha1P2l/S4y4UEMK0PIKzjflbE3ujs9JyoBaL9Ki8zyiOLc X-Received: by 2002:a05:6808:2b0a:b0:3af:e45d:a0ee with SMTP id fe10-20020a0568082b0a00b003afe45da0eemr4529160oib.31.1696886221660; Mon, 09 Oct 2023 14:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696886221; cv=none; d=google.com; s=arc-20160816; b=yLyNUZtF2nSOxJqNlV0Lw6dTbexOLHiXy4UQUzBPgcwiw/Uaf8q9G4bUdfTv9A7TYM RArbTXpw6pEYEWTsuvGpjAI4aIHcyZlvT6Q59m8n6EHnDh7hXGhpz/jZCvSeQbH8qZKn a/uYCe0XargoOlJxuQYohbd4hYMeUp1x24xrCc6Huh39gh7nYZWXiJyByGva4/1QrdM3 NiJye+j+wQM6M48ok88y3duVpoBOydb050Hjj1dBXYLHHValMBx+eb9N+4OmnwtjyFX7 LPxfpW4Y97/xJT/ogK1p7/Tmn9m9AZ98KVWoSqzTUegH9Jl3r2iTBcD/FGf70K79rUoj 8IrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EYKuGGems9T+6zGXgi2t9NNdEBVNAcjgmaOdTsCRw4Q=; fh=Q+QwZIjHVBI6KB+rjKuagZ5f+61G3WUA3tiqFNJgx/w=; b=hIsNnNzCr8o0paHQ5+le2gW+g0xzEJLhZjG7MspSHJhIUgq1D8lw/b27bTuuG49REQ K8/Jt1aiWkuTZZTb+eh70B7azDTH4Z+VbInduzTaHfN129gzdHs8R3pKcb/jj1SO5aoI PW6heDrWwhz5ON1+LQ60b/WBnzMiBCDt4wAWYChRdj2by/0s4ar9nsQIvZSF5zgMgJqy qjyt51+ZFpIppuPl/bPR8xvUcrvev/SOAjWozNX+TXL0J79kYnbLpowWb386c8yl308m vrsxLoz1UbPMOAA2XSkmrjAgfyws4AvD4F6oYOdoOA8ggxNXG4xsxi5eR967vegiCquo fM3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QknR9rGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 130-20020a630088000000b00578b4992008si9960948pga.133.2023.10.09.14.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 14:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QknR9rGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D75F78119D0D; Mon, 9 Oct 2023 14:16:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378277AbjJIVQq (ORCPT + 99 others); Mon, 9 Oct 2023 17:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378256AbjJIVQb (ORCPT ); Mon, 9 Oct 2023 17:16:31 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72C5D1FDD; Mon, 9 Oct 2023 14:15:20 -0700 (PDT) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 399L5tKb016139; Mon, 9 Oct 2023 21:14:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=EYKuGGems9T+6zGXgi2t9NNdEBVNAcjgmaOdTsCRw4Q=; b=QknR9rGKY0F+WzEDax92xSB5iS9q90JKwkLYtTxJPihstKdK0hbTRyYzpx7l6KqsFNnj ulzH/J0+GKpUfWN60v5Fwjp9Yaqfcxwry2NnMe0DgHkt4p5wODROKXw/tQKqsKFOcP1h 2R41U9N7rSixjw/44jjw7yXG8ryw/LpycvVDF+liJCZ2usicDkr4+5qCcGxodG+vqc4q G7Vm7VNMbFkCXk+z/L+UCSXrq8y2zNh9Fef+WUR0aHxY1Jf6DohwFrNLmP85XHUci9II qWWMvRBfF03hcg0w8+27H7c/VNfs1tw6YscgNfIzqhSrSKh56cUjENm/ZxzVvJOLq1kR TA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tms4kr82s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 21:14:55 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 399JtgoH025863; Mon, 9 Oct 2023 21:14:54 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tkjnn3su5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 21:14:54 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 399LErGI28967334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Oct 2023 21:14:53 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DC775805A; Mon, 9 Oct 2023 21:14:53 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63F0C58054; Mon, 9 Oct 2023 21:14:53 +0000 (GMT) Received: from gfwa600.aus.stglabs.ibm.com (unknown [9.3.84.101]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Mon, 9 Oct 2023 21:14:53 +0000 (GMT) Received: by gfwa600.aus.stglabs.ibm.com (Postfix, from userid 181152) id D377B740052; Mon, 9 Oct 2023 16:14:52 -0500 (CDT) From: Lakshmi Yadlapati To: linux@roeck-us.net, wsa@kernel.org, sumit.semwal@linaro.org, christian.koenig@amd.com, jdelvare@suse.com, joel@jms.id.au, andrew@aj.id.au, eajames@linux.ibm.com, ninad@linux.ibm.com Cc: Lakshmi Yadlapati , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-hwmon@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v1 2/2] hwmon: (pmbus/max31785) Add minimum delay between bus accesses Date: Mon, 9 Oct 2023 16:14:20 -0500 Message-Id: <20231009211420.3454026-3-lakshmiy@us.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009211420.3454026-1-lakshmiy@us.ibm.com> References: <20231009211420.3454026-1-lakshmiy@us.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: cSuJDHQgLZ_TeooGShUucacu0_peuDDX X-Proofpoint-ORIG-GUID: cSuJDHQgLZ_TeooGShUucacu0_peuDDX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-09_19,2023-10-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 spamscore=0 impostorscore=0 mlxscore=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310090169 X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 14:16:57 -0700 (PDT) X-Spam-Level: ** The MAX31785 has shown erratic behaviour across multiple system designs, unexpectedly clock stretching and NAKing transactions. Inserting a small delay (250us) after register writes makes the issue go away. Signed-off-by: Lakshmi Yadlapati --- drivers/hwmon/pmbus/max31785.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/hwmon/pmbus/max31785.c b/drivers/hwmon/pmbus/max31785.c index f9aa576495a5..532e1c8f632c 100644 --- a/drivers/hwmon/pmbus/max31785.c +++ b/drivers/hwmon/pmbus/max31785.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -24,6 +25,9 @@ enum max31785_regs { #define MAX31785_NR_PAGES 23 #define MAX31785_NR_FAN_PAGES 6 +static unsigned long throttle_delay_us = 250; +module_param(throttle_delay_us, ulong, 0664); + static int max31785_read_byte_data(struct i2c_client *client, int page, int reg) { @@ -337,6 +341,10 @@ static int max31785_probe(struct i2c_client *client) I2C_FUNC_SMBUS_WORD_DATA)) return -ENODEV; + ret = i2c_smbus_throttle_client(client, throttle_delay_us); + if (ret) + return ret; + info = devm_kzalloc(dev, sizeof(struct pmbus_driver_info), GFP_KERNEL); if (!info) return -ENOMEM; -- 2.39.2