From patchwork Wed Apr 5 14:52:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 7757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp375147vqo; Wed, 5 Apr 2023 08:04:42 -0700 (PDT) X-Google-Smtp-Source: AKy350YZzfo5EMgCYfvsKol0qJGTo4Zg1DOny0iA+H/vdPbRJ6vugFUjlOeCmkH6HFwVCqAhdHnt X-Received: by 2002:a17:902:dad0:b0:1a1:da3c:605f with SMTP id q16-20020a170902dad000b001a1da3c605fmr7517224plx.58.1680707082556; Wed, 05 Apr 2023 08:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680707082; cv=none; d=google.com; s=arc-20160816; b=ZK6+Z+hIepccmPnNUeEeo7c82M6q22xhVEDNlKuSrUnZDcgltCiKeqXCFcmrUCoofp MklBixyZpl5cvrtHARiY7MkMYGRBrwCQMV6rWjQ5Z8l1cpbF98HjY7X0oCdg0o+eVbbq RGSeCRTVz3lYaDJzQyLGX7+x14+pUqnjEVAV+oojHf7iJAYKug/CQwBQBc0YFDqQ42zW V5snenhtr8ivQ26Y9BpshEtjdsqoiGbubd2Lb6sYfAtEbJPH6UkQAV3Q1VMu31tX2Rzo +UsDd8s+bkz4YfsJeXqvuSl83NPGXrv6iKAP/NEIlNWVCI7kLtTh7A1pyj5tq+X0gHnW UHWQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0LY5K3/UU1Qjs5PFdmU5VBsJBkEF/LvIvCjnOMIzEVc=; b=AcyOZpApPQkuPcmd9fQB32hkSmgSDZ/DYP98Afk0qb/HhauFh8nGIHYDmI01YmW2Cd CJ5uPO9g5sj5t5EFGuDejcPG9AjdXoYMyPpuKZD/OLsOq0kHSkLc/DGIATb1PJvRCYUg paqRHqsl1eVgG/buLJdK4BNSyE3Bnqk5Nbf3ayrZWMSTVCOUpZA5ePDUrtG3+rL/pINb tlgaIV3+oGx4zFDasizSGY//m48kJsw1lVv+unHCC1SSGr6hzSI4GQPGb++TTn4Nsa89 q1+H5AFZJxVNy5ctOqAjbtQzyCjb7o3rdEOFyVjjWmEQ7sGwH4Me+zrls79VbJ5m/teY 7f9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=cqFJBbNr; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170903244700b001a0039e3597si12867483pls.316.2023.04.05.08.04.27; Wed, 05 Apr 2023 08:04:42 -0700 (PDT) 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=@ibm.com header.s=pp1 header.b=cqFJBbNr; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238387AbjDEOwy (ORCPT + 99 others); Wed, 5 Apr 2023 10:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233443AbjDEOwu (ORCPT ); Wed, 5 Apr 2023 10:52:50 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26671E60; Wed, 5 Apr 2023 07:52:49 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 335DALID013141; Wed, 5 Apr 2023 14:52:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=0LY5K3/UU1Qjs5PFdmU5VBsJBkEF/LvIvCjnOMIzEVc=; b=cqFJBbNrZv0ARXm7XuOr/A3lNdSKF4tCe34b0H0CDvTfGa1BSQaPumeaCMLr9zP5IyKu j9lyzHDvUgNXNlPe5OJV41Z+ZvOIQLVytqgHWecwbZJAAqte1rar+ugN9T5HjbGTDWGN EI2ngbH5c1MBtZMdeD/C0UYgDF1aAgsoAnv+JadwfUD5P8T8srOaVXksSkK9HJs+KVbO wFYOmb9Dqggcw5DgRW7d0WdXrNtsICHASyUdA6+cBJZJqdx7OVunM2gA+T8GWQpywJe2 7nNRqRS6oiy+B/2ZoDtc+iPTBsqE2grWKPijQMEUqVUGO4yETVuWIZ3BPYC3sFrAzKKq Jg== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3ps8w7v85m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Apr 2023 14:52:34 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 335EAfsl031572; Wed, 5 Apr 2023 14:52:34 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([9.208.130.101]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3ppc88cg41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Apr 2023 14:52:34 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 335EqXOo15008362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Apr 2023 14:52:33 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFBB558052; Wed, 5 Apr 2023 14:52:32 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D80E58063; Wed, 5 Apr 2023 14:52:32 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.160.127.161]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Apr 2023 14:52:32 +0000 (GMT) From: Eddie James To: linux-hwmon@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jdelvare@suse.com, linux@roeck-us.net, Eddie James Subject: [PATCH 0/2] hwmon: (pmbus/core) Add lock and unlock functions Date: Wed, 5 Apr 2023 09:52:28 -0500 Message-Id: <20230405145230.68631-1-eajames@linux.ibm.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: jKtaBBRi8RygmATlEj866q1pUgQRAuqb X-Proofpoint-ORIG-GUID: jKtaBBRi8RygmATlEj866q1pUgQRAuqb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-05_09,2023-04-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 suspectscore=0 mlxlogscore=715 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304050132 X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762349109847582873?= X-GMAIL-MSGID: =?utf-8?q?1762349109847582873?= Debugfs operations may set the page number, which must be done atomically with the subsequent i2c operation. Lock the update_lock in the debugfs functions and provide a function for pmbus drivers to lock and unlock the update_lock. Use the new lock/unlock functions in the ibm-cffps driver and make some additional improvements. Eddie James (2): hwmon: (pmbus/core) Add lock and unlock functions hwmon: (pmbus/ibm-cffps) Use default debugfs attributes and lock function drivers/hwmon/pmbus/ibm-cffps.c | 273 +++++++++++++------------------ drivers/hwmon/pmbus/pmbus.h | 2 + drivers/hwmon/pmbus/pmbus_core.c | 30 ++++ 3 files changed, 150 insertions(+), 155 deletions(-)