From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B95EC43144 for ; Tue, 26 Jun 2018 10:17:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8B9D268C3 for ; Tue, 26 Jun 2018 10:17:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="QqV2jC9q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8B9D268C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=infineon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934404AbeFZKRq (ORCPT ); Tue, 26 Jun 2018 06:17:46 -0400 Received: from smtp11.infineon.com ([217.10.52.105]:57886 "EHLO smtp11.infineon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933509AbeFZKRk (ORCPT ); Tue, 26 Jun 2018 06:17:40 -0400 X-Greylist: delayed 609 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Jun 2018 06:17:38 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1530008260; x=1561544260; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=zrf7ZUH8tyF94Mm1aEx47Jqi5VHbvMuEHqKJk+dSlIk=; b=QqV2jC9qr/62psiUl4InvmTCU4qmJY3rX1H0jRaqmeAT42v2TsJ3Qess J12sm+CdaTjHo8m+/NS8uHQRIfRwnWWaBU6ivGYoveszTH/9nS0uegaWh lv0CKcOBR/QcF/wREIzlFaiY4mv2wjdhAjVXHwPlz61b0KMOnDhioL8E/ Q=; X-SBRS: None X-IronPort-AV: E=McAfee;i="5900,7806,8935"; a="83270583" X-IronPort-AV: E=Sophos;i="5.51,274,1526335200"; d="scan'208";a="83270583" Received: from unknown (HELO mucxv002.muc.infineon.com) ([172.23.11.17]) by smtp11.infineon.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Jun 2018 12:07:29 +0200 Received: from MUCSE708.infineon.com (MUCSE708.infineon.com [172.23.7.82]) by mucxv002.muc.infineon.com (Postfix) with ESMTPS; Tue, 26 Jun 2018 12:07:28 +0200 (CEST) Received: from [10.154.32.64] (172.23.8.247) by MUCSE708.infineon.com (172.23.7.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1466.3; Tue, 26 Jun 2018 12:07:28 +0200 Subject: Re: [PATCH v2 01/10] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) To: Jarkko Sakkinen , Peter Rosin CC: , Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , Brian Norris , Gregory Fong , Florian Fainelli , , Sekhar Nori , Kevin Hilman , Haavard Skinnemoen , Kukjin Kim , Krzysztof Kozlowski , Orson Zhai , Baolin Wang , Chunyan Zhang , Wolfram Sang , Guenter Roeck , Crt Mori , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Dmitry Torokhov , Antti Palosaari , Mauro Carvalho Chehab , Michael Krufky , Lee Jones , , , , , , , References: <20180620051803.12206-1-peda@axentia.se> <20180620051803.12206-2-peda@axentia.se> <20180625102454.GA3845@linux.intel.com> From: Alexander Steffen Message-ID: <7703d6a2-b22c-104c-7390-b5143a504725@infineon.com> Date: Tue, 26 Jun 2018 12:07:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180625102454.GA3845@linux.intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE706.infineon.com (172.23.7.80) To MUCSE708.infineon.com (172.23.7.82) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.06.2018 12:24, Jarkko Sakkinen wrote: > On Wed, Jun 20, 2018 at 07:17:54AM +0200, Peter Rosin wrote: >> 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 > > Studied enough so that I can give > > Reviewed-by: Jarkko Sakkinen > > Do not have hardware to test this, however. I don't have a mux-locked I2C mux either, but at least I can confirm that this change did not break my existing test setup (SLB9635/SLB9645 on Raspberry Pi 2B). Tested-by: Alexander Steffen Alexander From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Steffen Subject: Re: [PATCH v2 01/10] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Date: Tue, 26 Jun 2018 12:07:21 +0200 Message-ID: <7703d6a2-b22c-104c-7390-b5143a504725@infineon.com> References: <20180620051803.12206-1-peda@axentia.se> <20180620051803.12206-2-peda@axentia.se> <20180625102454.GA3845@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180625102454.GA3845@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Jarkko Sakkinen , Peter Rosin Cc: Crt Mori , Wolfram Sang , linux-iio@vger.kernel.org, Sekhar Nori , 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 List-Id: linux-i2c@vger.kernel.org On 25.06.2018 12:24, Jarkko Sakkinen wrote: > On Wed, Jun 20, 2018 at 07:17:54AM +0200, Peter Rosin wrote: >> 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 > > Studied enough so that I can give > > Reviewed-by: Jarkko Sakkinen > > Do not have hardware to test this, however. I don't have a mux-locked I2C mux either, but at least I can confirm that this change did not break my existing test setup (SLB9635/SLB9645 on Raspberry Pi 2B). Tested-by: Alexander Steffen Alexander From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander.Steffen@infineon.com (Alexander Steffen) Date: Tue, 26 Jun 2018 12:07:21 +0200 Subject: [PATCH v2 01/10] tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) In-Reply-To: <20180625102454.GA3845@linux.intel.com> References: <20180620051803.12206-1-peda@axentia.se> <20180620051803.12206-2-peda@axentia.se> <20180625102454.GA3845@linux.intel.com> Message-ID: <7703d6a2-b22c-104c-7390-b5143a504725@infineon.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 25.06.2018 12:24, Jarkko Sakkinen wrote: > On Wed, Jun 20, 2018 at 07:17:54AM +0200, Peter Rosin wrote: >> 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 > > Studied enough so that I can give > > Reviewed-by: Jarkko Sakkinen > > Do not have hardware to test this, however. I don't have a mux-locked I2C mux either, but at least I can confirm that this change did not break my existing test setup (SLB9635/SLB9645 on Raspberry Pi 2B). Tested-by: Alexander Steffen Alexander