From patchwork Wed Jun 20 05:17:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10476079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C97C60210 for ; Wed, 20 Jun 2018 05:22:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A95C28C88 for ; Wed, 20 Jun 2018 05:22:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DF7028DD0; Wed, 20 Jun 2018 05:22:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20AC428C88 for ; Wed, 20 Jun 2018 05:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xaX7pzvisaUq0LWyK3268Jl0MgLX+R/wLKPhR8gnYB0=; b=GU3CeKzKl8PrNw HLTH7O5AlScxRh2sUW9vd6Trf8Wl7HOWA/ve0HMRV4GJ3A0SIvOchhGdNR4q/qk8tDuuHD7F9gVmv Y91DrUPfWfTf0ztDq1nni9YWl4PAFRAjSNzAcMDLEZJCwWgFQUf1I8JM1yisxMKQeRF6v9KDVXigK BsoH6akOPWeqzTm+Fo9Rw90m/ZE0g+c/4tesvfI1sQSzhD4Whf51Lq2e+ai5Aqr4yFo613Vsng1lX logsT6Xnv+qGxOiUFXeeq0PO3t+DUrCN6alGZRL3V6LL3FnmWoSWmwmkMjCgbmD34RFjjwPGak2aJ vAJgFjvrUz9B0judO7Rg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVVZY-000404-CP; Wed, 20 Jun 2018 05:22:24 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVVVv-0001AH-4p for linux-arm-kernel@bombadil.infradead.org; Wed, 20 Jun 2018 05:18:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zchVYeGS8ChEzT0NgwxQMMJI2btJ66LexAHSvtOL5kU=; b=SG5+GNhoBsFh5RoK4pY/uSHYb sG85eGTDlZFexTd9T/20Q0cNdEFAzUoE3Y5ZHqnroFTFDdMtsJI+YqdKLvgSInItdO27HJk2INnyy OTnhKN9nYKZ9haBXX7Ld3SwpvSNgyLmD5v6J9wmqXFIOzzmgqtfEs9jOXKqV4xOGTj13PJ0P+PgjI k4cEy0eDySzMKbVtuvo+TN5Nct1E3iwkaYZbxAilK6NnhE/bzVDgFPrUoFhxPU+NmMwdZ5H0oZker 2Bigwec7rRSHzeSeLbymAepDVoXLK8D++cKYY47uuJyVdnJmuOQ3e0n602H7nPin+OsO7Ash9P/jz Jm5uBZACw==; Received: from mail-he1eur01on0120.outbound.protection.outlook.com ([104.47.0.120] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVVVn-0005fv-QO for linux-arm-kernel@lists.infradead.org; Wed, 20 Jun 2018 05:18:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zchVYeGS8ChEzT0NgwxQMMJI2btJ66LexAHSvtOL5kU=; b=IMQS8mG6YYD/B/bR5rJh7zMKH5+5eiGET2jy4jZKD1T3g2hJ3q8X/aIG4JFJ72dqooAlXDQjKb3jECIGh7293LuQ8n8Yrlez2e6SVQDf02E9KnqcMz893PvzaGllF4254yYo0kvnhnpG+FGmzbpsvO7PK2dqCMwQOP146xGq8do= Received: from orc.pedanet (85.226.244.23) by AM5PR0201MB2452.eurprd02.prod.outlook.com (2603:10a6:203:35::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.20; Wed, 20 Jun 2018 05:18:17 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v2 01/10] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Date: Wed, 20 Jun 2018 07:17:54 +0200 Message-Id: <20180620051803.12206-2-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180620051803.12206-1-peda@axentia.se> References: <20180620051803.12206-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR05CA0127.eurprd05.prod.outlook.com (2603:10a6:7:28::14) To AM5PR0201MB2452.eurprd02.prod.outlook.com (2603:10a6:203:35::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52da9687-c185-4310-00ca-08d5d66d3c3e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:AM5PR0201MB2452; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 3:ulYxBNE+U4iO6GErMm+Eapf+6P7zFMIXB+wpZD1N1lcpYpsBITegfnpIosF4/7+1bkQP7LVykCje93CBuvz8kDl1AbU10D51eb0RbCK7rOoEZ0/olbq8p4tdk4jyVbtBYX32qhR36Be4AtDPYtwmtvCmEhK6LTxed7MXcykRwl+nT9BTX42Lj6I2DTI4xkioMLILiLdX9+dW1BSG/Zo+aWvXk6McKn9oQ2IO9lh98sbW7w41dHg/KO54acw9tmoy; 25:HqPEDBmXRnffnYUS1cT+bZWsc745QSw7CHZ5YintuBifN0vT1e2euFfEZTCinaownTEmJEwYzzelMyfNGgFVWKa5eMmm3Y+gltnw8Th+DoDH4tO6+mfob9l8AMetTChNeq1T0B9d/S3KQ96QL8B+lj/SMfXd+jRTlJHgtEqJZtponWVerjtkQh5nIN8iggXxX83+OlvRc47PrfOx/lsVdxNhX9upd79A7rT6/YSf3+JQxSPYz23lCgUVeF6WfViziz6RYA2W9zNiAjR5GMcg+NlGnztM6lL0w51iRt83qy/LlhV/brX92+PxdFJzTR7xZTM/CjPppTlpzTEqEYWmLQ==; 31:L1nXfH9U5UOceCHAPcCWmMK8UMyGATKFjoHjc5jomHUb/+nMzCKZpd4VWRyns2wPPb/GLN0r/WGpHVkVSSBVQubL7CER2jCgaMyEes9rJeXZURYuofYp0CFGTelIO2LqfvmKAk2hhOQuX7tRZ+88VtIc1qU4pHrCXF8eOv4p8uw7eQwT7y9sVlIhUixT5SvH9do0CAxgvtFgFlR88wr3YB/dl6baiu36P14QqQZt+fU= X-MS-TrafficTypeDiagnostic: AM5PR0201MB2452: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(2016111802025)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(6043046)(201708071742011)(7699016); SRVR:AM5PR0201MB2452; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0201MB2452; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 4:hHIx3iWA1EX9BZ68SKntO/J5RNNUYaCbVKdRoBwgX8ZdajL5GvDgMH6C/kP+volAT51eh6f//LvQDtGu7HM1tHiWH/Zf5vS/A5blmk1T5NIe+6f6ebg5Ctf02x5lZ0pVSOWupckIvt+csZjvgQqQlgtK9f3YGhjR1zC4ccUqC4Im+fgta3l8T2X/nVDBu/P46IsOu2NyED9A6O06zWQrIiSoIPgOsF6bes8NlUwTRzLq3t4B6t5Hz9jRBKIfvLmMo+MsPit5Wz+SmcoiflXYAw== X-Forefront-PRVS: 070912876F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39380400002)(346002)(376002)(39840400004)(189003)(199004)(43544003)(51416003)(50466002)(7416002)(6116002)(186003)(59450400001)(48376002)(3846002)(26005)(6916009)(53936002)(6666003)(1076002)(7406005)(6512007)(76176011)(15760500003)(2906002)(316002)(386003)(36756003)(478600001)(6506007)(68736007)(86362001)(5660300001)(16586007)(50226002)(52116002)(54906003)(16526019)(2361001)(4326008)(2351001)(47776003)(25786009)(39060400002)(66066001)(8666007)(305945005)(486006)(8676002)(7736002)(97736004)(81166006)(956004)(106356001)(476003)(105586002)(81156014)(6486002)(2616005)(8936002)(74482002)(446003)(11346002)(70780200001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0201MB2452; H:orc.pedanet; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0201MB2452; 23:OS4f3rCmweGDplp1LtMr1uwwa4hVsN/EOnD3Rd9?= =?us-ascii?Q?Zk+M+L5du0yivTZRRTtDGJ657P2IRf/8oaFaBR186AU9oRUDRgVPtJ2eeUE/?= =?us-ascii?Q?KOjIXJ8jEiYKWIEbi5OF8YR7ZlUrWD8CWMLJSiiQym8BY42CdrzTPomg3Gnl?= =?us-ascii?Q?TazTTbUXXDMCmS7tVVKa3shahC453vqlEbS299QFCA8YdwduJ0UJnBflGRdF?= =?us-ascii?Q?6uzZAlqchuz6CwBiY6CePnT9f0+6USCZf1EFnV/BaDLmiHr573bRFM6kc8Dk?= =?us-ascii?Q?IQv7L18qjRxz7uNOlBh5BpeojU8KTO63UxGglMW6qryXL8g2sMSmOPzuWWuY?= =?us-ascii?Q?c51iHb/wosrWNczpXjuIzGaSpMEU67xukMPYCSa08nHoZy+rriAwsI2u/Twz?= =?us-ascii?Q?8RrnGTR3h4eJef7q+aoDGBI94eheAu3C3qjaMHz3LmxSg0BMzDX9a8eCBQzT?= =?us-ascii?Q?Xd+b5eK1e6F2TPUyMU5G2I1KvHmKVORZbWAXfDHm3ZyM0X7HDYhaOetzA2lP?= =?us-ascii?Q?nv+CNuNu7xFUNrWMro1HQTJ3Bf+pu06HyGluS664V0oFiILm+q2r0EWX33Ox?= =?us-ascii?Q?bY/oDdRJ2xhxMqrByyomouspVgleNZ+NgsmCaK5AdqAm2Z4ErQDXQ6NDGvVH?= =?us-ascii?Q?hy9KedJOHF0XbePPKk5D+aYLcEuDnrVeaoZRa/cMAF8a2OOt9m/2Iofzu0Wd?= =?us-ascii?Q?+Vs/kJVeNxN2rgscc/93o8BzatbWqcmVNSHvDA3e2iAs7ESYv9s1cPiRv+wK?= =?us-ascii?Q?YXl4hZOFMeBHOBCSCDCng77h3/g/kv765lIaVfviGWu9UcIbo1ddPTjxdaIP?= =?us-ascii?Q?/d4MUDnfgfCbHHlENGVu4SF6KkT5WjDPEEagtkMljPHeFR49tsnfgVuIbElb?= =?us-ascii?Q?qszzs2zNApvWyPzUloidz4Huzx4tc0ZK14rlZuoRU5thx1uuzD7WslAqDno+?= =?us-ascii?Q?PfTyNB4JiO6dMgznhi2LUQtpX6S0rnezvwphFuMadLywiIgA6p+b3dHjph4Y?= =?us-ascii?Q?yLHb33/HmhoLsk6W3y9IWJGxtK0NYzCqEk1O9SRdFjscsHE6FSphF9cgjOUW?= =?us-ascii?Q?F1lt1aaaSEwUNv+En+DqyM1LQJkdg3Hf6OncdUh0vMBA4AW++zV4cYLxbcmT?= =?us-ascii?Q?PxF8zNTPvcMLZ9HXU57hlTv6HMJ9bwSmbo0//zjSg+/9WpNOBKbVfcfxftbi?= =?us-ascii?Q?AH27o46Sj8ZayCgJOYaENq1/2WpZTJM9goScxbQQVEt34qeLurc2nqUYsVzO?= =?us-ascii?Q?ru3h4ObcaaH5roP6170Yh+dD2Ha4Isb2ZPqbZXUFK/aAYekbypvcq2hDWpep?= =?us-ascii?Q?os9nF6Dz1Xgn2oPHaCgpP9hV/qZYqsTi8rrOKjGasF3q428QVblWJPSntV4B?= =?us-ascii?Q?uSBMd9Ij77RYMrD2rB7wi4QMmfuElmXOenYwFlw93xd2I0o3Ug5Nv+A4+7JF?= =?us-ascii?Q?UIdd9n1Vonh7zM5idP+QoZO5fEsQ8SLz1fH595g8LoIDLWC6CoXogmtSerUZ?= =?us-ascii?Q?gQMR9H1feOkknkA=3D=3D?= X-Microsoft-Antispam-Message-Info: m4BPkcslxAJ3X62BfdJiwW8RbudD3/16dsVPI0RXV/95YW27GJzj6BIEaUIma4+csMV4ebtRtn1ZWNkCVL+tu12REheorqW+pAI6RMpfOlcOK83iIs8+iEhlwyYkGQRAfuErgpQOmXd+9OayfYUUc+eXxaSw3p0BU0M5h+L7eFo/Nd6QCZtOoqHDSGfLKEicrao8id4NS4O0sjH7tcKmjIR4rgD2u9Gv9H7/hkazelM+nygQujNpcG3Xp46DqnNn60OtPV+GMiJPIQJdrtunoUClmKWoXJkfnndno5LA/MMsP6TDhaIOl64lOI5XEFGB X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 6:EnYtub62pgGLRfH+1Phq7WIVI/nuTkTzTU+JfuTOYaXZiCGlxBQtPvOc2y/9ClZfcDKL5mRLLOXxHDNpa+zUd4twcafBzvXir2y0Qa1P0cyoPZdSSTQGdsuK9uEULbnGyFdN8+5gLIRN0pkU0qBhpy0pG/ZgILdFvfZM0AKNnRhk6i8sFKZC49j6E+O/AcIsglyN1J9jE3WJm49FlX9f4OYn+pXnw9P2136siimnvDZM0ePcAJzP3q2gj5AzAlNR7uXeNMeiKglysQ6ALLMD5nhfAv4Xb6kKJMEftHMBf0kKwvIZ/scgR3Gc9G2TqGZRlcSLXo09rvQKAPZtffucWJL8WbKBsie1siZSGPWBGH1T0g1E31MB6sx+u6KEcYMaWHOx0U/YSCCrmxgmu1P58BQLT+qK5E2jxFk6+hG+wN0dH2JHg/U/fCY0eOTHbB0CwR5HrVjyANAJPhGef7GDdg==; 5:+1v1z2kfnDPxTAd3xL1R4RLa3qki4nZchHelvBt/s5kpnE4v0QpIWc5iObJ2ZQqdQXXGM2n2FJjxgi0+tntpi/wI6QY8cUp8y8jRWMSQ8gA2O6f+Nv7y2b/HXAhZTIKCneAvfpZ62E9XWEvUbxiRrWwzAAehdYAfa18CuVJJtlY=; 24:aqwEFjtsmzjPtmyJ+LR4dsl06d5DtJmiwNrJ7/BPMTLqNjVf0luJADZsVVjp5a9RnlBAj19M1MIroleaxloBeFUzxEAwSPxeIdC8Qhm2UIQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 7:lc+N61iyPx4CMtzAeQQVvM/dpR0LML9p700qbaHYSoiDUFAOPdLFx5/XSdDb3xwx4MDjy/vIXR0m1DHNXJ7LMvyJQgOXhnWEA/BuUl4WCx8YAUCUaRUBeNZdeKsDePCMXvvfUhe7/fuNb1r693ggF9s9VdsdzGVlkl/8gTk+Cs1zOBYYLUe8MLeFbCAr3dUFDZQL/nelWddP1jq1ppyfaZ+LsONlDXz4XoCcg5oAkGqGQTNAWvsdFxAqiZ3Kq03T X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 05:18:17.2332 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52da9687-c185-4310-00ca-08d5d66d3c3e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0201MB2452 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180620_011831_887210_40E5A310 X-CRM114-Status: GOOD ( 13.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Crt Mori , Wolfram Sang , linux-iio@vger.kernel.org, Sekhar Nori , Jarkko Sakkinen , linux-i2c@vger.kernel.org, Peter Meerwald-Stadler , Peter Huewe , Michael Krufky , Lee Jones , Antti Palosaari , linux-samsung-soc@vger.kernel.org, Florian Fainelli , Kevin Hilman , Chunyan Zhang , Krzysztof Kozlowski , Jason Gunthorpe , Kukjin Kim , bcm-kernel-feedback-list@broadcom.com, linux-input@vger.kernel.org, Orson Zhai , Guenter Roeck , Haavard Skinnemoen , Arnd Bergmann , linux-media@vger.kernel.org, Lars-Peter Clausen , Gregory Fong , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Baolin Wang , Greg Kroah-Hartman , Dmitry Torokhov , Hartmut Knaack , linux-integrity@vger.kernel.org, Brian Norris , Peter Rosin , Jonathan Cameron Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin Reviewed-by: Jarkko Sakkinen Tested-by: Alexander Steffen --- drivers/char/tpm/tpm_i2c_infineon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index 6116cd05e228..9086edc9066b 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c @@ -117,7 +117,7 @@ static int iic_tpm_read(u8 addr, u8 *buffer, size_t len) /* Lock the adapter for the duration of the whole sequence. */ if (!tpm_dev.client->adapter->algo->master_xfer) return -EOPNOTSUPP; - i2c_lock_adapter(tpm_dev.client->adapter); + i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); if (tpm_dev.chip_type == SLB9645) { /* use a combined read for newer chips @@ -192,7 +192,7 @@ static int iic_tpm_read(u8 addr, u8 *buffer, size_t len) } out: - i2c_unlock_adapter(tpm_dev.client->adapter); + i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); /* take care of 'guard time' */ usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI); @@ -224,7 +224,7 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len, if (!tpm_dev.client->adapter->algo->master_xfer) return -EOPNOTSUPP; - i2c_lock_adapter(tpm_dev.client->adapter); + i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); /* prepend the 'register address' to the buffer */ tpm_dev.buf[0] = addr; @@ -243,7 +243,7 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len, usleep_range(sleep_low, sleep_hi); } - i2c_unlock_adapter(tpm_dev.client->adapter); + i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); /* take care of 'guard time' */ usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI);