From patchwork Sun Apr 16 04:25:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13212701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82161C77B61 for ; Sun, 16 Apr 2023 04:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbjDPEZj (ORCPT ); Sun, 16 Apr 2023 00:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjDPEZi (ORCPT ); Sun, 16 Apr 2023 00:25:38 -0400 Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [150.101.137.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AFD07271C for ; Sat, 15 Apr 2023 21:25:34 -0700 (PDT) IronPort-SDR: 643b78b9_El9YGF+KMEXTXR0PvMJ0uz7o/Qcf/1TTffC6iTb0S/5Glqf eB2voDecIKy2LrjUXrMJzHJ0hB4HLZNjOZl5sbA== X-SMTP-MATCH: 0 X-IPAS-Result: A2BEAwCkdztkjPQc8jxaHgEBCxIMSYE7C4Iugk+WAp9dDwEPAQFEBAEBhQaFPiY3Bg4BAgQBAQEBAwIDAQEBAQEBAwEBBgEBAQEBAQYEFAEBAQFARYVoDYYGNgENAQE3ASiBFQGDEIJdrzeBAYIIAQEGgmKaaoFeCYFBAYt0gRaDNoE8P4FOhH6LBolrkGuBNHaBIA5KcoEEAgkCEWuBEAhqgXlAAg1kCw5vgUmDKgQCFEQOVAMJAwcFSUADCxgNFjoTLDUUIFxsLRISBQMLFSpHBAg4Bk8RAggPEg8sRAxCNzMTBlwBKQ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5W2bjEisCrXAsIWhWzGq 9J1/e12V7bJCC4Ir4A/CKiYzb41WjndAEBjG9RPpLgoG0PYcxGMgQm+EVi7IJ5xFqab4H2GB NxLDeMRcRaHjQKljC0RXIwIKJ9KxM8Z3sIIIO7XFDRXoomkj2RbtbzL/XLDn04tedJllPg9J q73dz6vFm+xh2Neq1TSrftra3aJXt0ZWDLShOyF0v0FN5YmgtFedUsf1riVvXLMPjB3oDOSn gfIPJHNw8JYlI9DoorLE4d4PTuSF+/dbuqyzV2Mg4x8Vu+XacbqnCEJm2bjJDVTbOcwWcwot LGjs+zX/ULivZQ0WGX3wKuERrh7zpi2VtpqL8vIFWRrrRaDfOTO4BIz3X+yBrIUsdFa5+ihH xCZbunpf/Eret5t/l9nQAkALAQ4FILMcbbGpwmxi9+uGyot+1XLA/3//EC4cFwBUDEDPqPPL zPdutGs14h+l5tNDhpVPMNWKcZ0D3G7UJR3auCrkyeTC1SppVawurHCsx4EwhOTA1mmFPfK2 770diLcRj+T5p6RlMp4trZstCI5FHx+2Ok8XnwM8u5M1gyVMjQ0EvQ/A74nVLdkyyD87cStL nWFJm4vEj70Ujl4YA3xqoarFBuWAusVfMz1PHo19keTcD27H56EHKAnzCp7/nNqYXH2+YlL8 z3FFqHYZXBdGq1UeNs= IronPort-HdrOrdr: A9a23:mrOmXqAtLlz5JjHlHemC55DYdb4zR+YMi2TDt3oadfWaSK2lfq eV7ZMmPX2dslsssRQb9exoV5PwIk80maQb3WBzB8bHYOCZghrLEGgK1+KLqAEIcBefygcy78 ldmycSMqyXMbEDt7ee3OChKadb/DCYytHSuQ4A9QYVcem6A5sQlztENg== X-Talos-CUID: 9a23:jKeCFGquvORwbbTz8ItX+gnmUdB4U2T4yVT/H0/7LTtGbLyUDg+R/4oxxg== X-Talos-MUID: 9a23:F1cy4A9zOhGXHuCfaxN+LY2Qf9lz2rmzB00HqooL4euuJXRyMW2NvCviFw== X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail03.adl2.internode.on.net with ESMTP; 16 Apr 2023 13:55:30 +0930 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 33G4PCj13415316 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 16 Apr 2023 14:25:20 +1000 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 33G4PCj13415316 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1681619121; bh=STkZTpRgXk4Bt9+1yrFHhQyLiEj+20CETjs0KGzkvCk=; h=From:To:Cc:Subject:Date:From; b=EzQjC7CxTChvpvOcJm7ng04+4MIMoQF15n7z5380xFU5ubE3yRRHKBNcFoe2kJtqG /r+fDpbme7Im6IGWpsFautfqkLDmeEH23HxP3XOCL/m4O0TebKs2oa46j607J2PcNl z457FeVYaKqQbFWfy3pBmEJxHcMB4JCorZD8KJKmeS/a1C5ys5Odt+aaAxSrz2BZTA RozG8RBLjBh7bl9+lrxvGPMgutwF2yeu264m9EB0za0YrGfoPOLriWwU1ulK7vlwj6 q10CMflTm4cJYA1d6miDKyVZoA2dQXg8h87jc3QKkFgZdxp699GAZJsjRg/bUNrV7Y 9wV0rGc5FED6g== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v2 0/4] hwmon: (it87) Add access control for SMBus Date: Sun, 16 Apr 2023 14:25:06 +1000 Message-Id: <20230416042510.1929077-1-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sun, 16 Apr 2023 14:25:21 +1000 (AEST) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Some chips support Environmental Controller access through SMBus. On those chips, it is possible that an Embedded Controller accesses Environmental Controller chip registers at any time. There is no real means for synchronization. On banked chips, this can and will result in access errors with unpredictable result. Disable SMBus access while reading or writing environmental controller registers to work around the problem. --- Changes since v1: * Reorder patches within patchset. * Remove spaces before tab. Frank Crawford (4): Some chips support Environmental Controller access through SMBus. Disable SMBus access while reading or writing environmental controller registers. Test for error in call to it87_update_device and return error. Add calls to smbus_enable/smbus_disable as required. Disable/enable SMBus access for IT8622E chipset. drivers/hwmon/it87.c | 288 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 240 insertions(+), 48 deletions(-)