Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1203672imm; Wed, 20 Jun 2018 13:30:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKt/bJR8I9TaaLg+XbqXL320aCtXicId2X3vUTYBiypI34oyjJ/X3C14zIfGMX2YIJqRepQ X-Received: by 2002:a62:c882:: with SMTP id i2-v6mr23842810pfk.13.1529526627783; Wed, 20 Jun 2018 13:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529526627; cv=none; d=google.com; s=arc-20160816; b=FE46WcXWm26Iqp3lW1JcHP2Sd9fbrkXXvkTESmiGzz7hxQ0CZoB13/ZhMzfmrqVu1W 0pvQ/Ok3Ks4d4XzBl2KmmCqxWIOL2rgn8ZoGUPiGKRqcoUX/4oNTA7VYfI9sWUMeLGtv k1E/HFbmXgSHma9KLy9SMe+pxsHmKDfsAQtkU76Cr96EUfUtHTnmzB2kIu2GNFjaBjfX VDG9+o7rv/hcT8lEiE1p2+r0uQ4bvU9xSz38DuRx41ern4mTlOQ/LNLI9rtREzce930q 8kK1qQdBzG4/tyVBRaBEj6A7TQN/Ik+x9yBC6Zxl7iPvbN7bLtjhA9xj0hSO5QFgkeyF Ph+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7OWw0y6sCQpDjtt//2VWjVs4J4f/XVp9B/7/tWdZI2Q=; b=JoUZR94aBf/Qdlh1n+/GY5ljMrmAN+AUQssu7XL3zfTtFEyfM0aJuDscrVmKbBjHZM P/I5FD5K7dubbIx5QvASsHkFiaL3FwTvvZ4ecG5oElJsIFSj+nBkb2WC4uVZrReDBUx9 WxGI05+uUsGrz/2qCtAK1Jqk3BzPMn2mmsTsY3LFU8MteocTRn4ya85lncnsF9rWvXPC JLX8tggz/rj/gHTLTI8EKWZMPM3zmv8Bs7cQChsDwmv+H7vAgQ9fx/V1U2emHBEBhJKF exJFdJRX5iPr5uc4aHrF7YeZUcO7p9EN44xPBi879vVxYwGyDxC0UZgO2IzdOH3aaRq1 Anog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D+iEQAe8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si2416506pgr.156.2018.06.20.13.30.13; Wed, 20 Jun 2018 13:30:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D+iEQAe8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933347AbeFTU2O (ORCPT + 99 others); Wed, 20 Jun 2018 16:28:14 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35018 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932570AbeFTU2J (ORCPT ); Wed, 20 Jun 2018 16:28:09 -0400 Received: by mail-pl0-f66.google.com with SMTP id k1-v6so386237plt.2; Wed, 20 Jun 2018 13:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7OWw0y6sCQpDjtt//2VWjVs4J4f/XVp9B/7/tWdZI2Q=; b=D+iEQAe8DU7nPttACnxNWFPs6rzmbrXO8T9obtD5+ZJHbFNTejG133E9apEny161VI oAjDoVGtp7eWNCwF+I7PmBOGEOzaLwpiSZWRqHNGfWMNEZ/3GL8pEU1/4WkQhW5sHYNN ddHPAmccEpTxPVRlBjtZrhScAksEf+Yn8A69pkRMLNL76x8IrFr3Z8a/dlFVHpNiqCYv P7XXbaxuv0EeMWCVw+gwOA1X7wmWURka7KVyivX9q3ASdixcTPk8tBbk377q8wEnRkQu ZVC6U7zVN5ZHC+pfYdGm4Cyp/vH9aElh5UhpmadX3YgpwJFldG1ysKxO89BfuOmq3664 pMYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7OWw0y6sCQpDjtt//2VWjVs4J4f/XVp9B/7/tWdZI2Q=; b=OA02OVmpnzcD/a1MzR6ew82uiIIa4TqZsA6YdlhH+i906KGzhkbKUsdDn7D4cyaO4k pKVd0138cGTml60L8MStQ7317pOTBL4MLURtOorqg7sZrKNgp9tYc8zwN/8MdSsowClR ykWa5tGpBCqR56/HCr1+rSu7Tn9zLU1/xDr8ndUhj43gYsgmhvSxNLaJH4EJGvp9EXoe gzO1S9xY3tKMaBTglYvUBCG8V3Roho/9otnwWi3Vw+zweUv4epHdB2cfaBo5fQe1mrd2 JVvLpQC7SSNYZI1vP662rQnW+OenXQ/vt0hFfwZ8/ww9Bt1/NByjVnEqCDhjcG8UUtBT f2Ng== X-Gm-Message-State: APt69E2DIFfSqToEw2nzBNgYLZSgh3otdJGFgMM7pQVSx70GQ1jMiPiV mZeiFDEStHfl4et7vtaanTo= X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr25362351pld.29.1529526488599; Wed, 20 Jun 2018 13:28:08 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id y18-v6sm4400519pfl.122.2018.06.20.13.28.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 13:28:07 -0700 (PDT) Date: Wed, 20 Jun 2018 13:28:05 -0700 From: Dmitry Torokhov To: Peter Rosin Cc: linux-kernel@vger.kernel.org, Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , Brian Norris , Gregory Fong , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, 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 , Antti Palosaari , Mauro Carvalho Chehab , Michael Krufky , Lee Jones , linux-integrity@vger.kernel.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-iio@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH v2 03/10] input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Message-ID: <20180620202805.GB75925@dtor-ws> References: <20180620051803.12206-1-peda@axentia.se> <20180620051803.12206-4-peda@axentia.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180620051803.12206-4-peda@axentia.se> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 20, 2018 at 07:17:56AM +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 Still Acked-by: Dmitry Torokhov Feel free to merge through I2C tree. > --- > drivers/input/touchscreen/rohm_bu21023.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/touchscreen/rohm_bu21023.c b/drivers/input/touchscreen/rohm_bu21023.c > index bda0500c9b57..714affdd742f 100644 > --- a/drivers/input/touchscreen/rohm_bu21023.c > +++ b/drivers/input/touchscreen/rohm_bu21023.c > @@ -304,7 +304,7 @@ static int rohm_i2c_burst_read(struct i2c_client *client, u8 start, void *buf, > msg[1].len = len; > msg[1].buf = buf; > > - i2c_lock_adapter(adap); > + i2c_lock_bus(adap, I2C_LOCK_SEGMENT); > > for (i = 0; i < 2; i++) { > if (__i2c_transfer(adap, &msg[i], 1) < 0) { > @@ -313,7 +313,7 @@ static int rohm_i2c_burst_read(struct i2c_client *client, u8 start, void *buf, > } > } > > - i2c_unlock_adapter(adap); > + i2c_unlock_bus(adap, I2C_LOCK_SEGMENT); > > return ret; > } > -- > 2.11.0 > Thanks. -- Dmitry