Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2517217imm; Mon, 24 Sep 2018 05:48:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV62wz79Be1tzEV0E0/C3nnV+TiJ2MsRs84pfgG27gH+EvSrX41fg9/6UsED1YqDt8hENrc52 X-Received: by 2002:a63:e60c:: with SMTP id g12-v6mr9590506pgh.308.1537793305969; Mon, 24 Sep 2018 05:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793305; cv=none; d=google.com; s=arc-20160816; b=rvzK/KwFum85UqA1UyC30/4wifjRL0ASHI2gQ3yPeADnIGuiAc/YWLTtw2qO0lzE9j Wa0ZBXOYz7MHmS7veDmXdKgozHpmAt8jXdcTUNlKru63676YbOeh09yRZTFtz9yTYAWI HWouYkgLlR+6MNaWwcLyugMN2vAG0/RuQeEb6jSuqpta0nXd8hFKhwlob32C0yadON+k 8eEFUp9MNZvxE/o9FweAxYTHqs+NVbTz79cR8T/lipxcL+X+ndEpZRmn9SwflMjvxkus pmIO8uxp758bOeHw0EpL0S0zr/UjbaSNvk0fFQH2mgFTjqLaD5+opXc2PCp5Moa67/X0 k2IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=8WgYYLG7eLyQUw2TDP2ExqA0/8EXpNI9z/X+ZglNFy0=; b=aVq5QfPfKpBzEVPMHwIxTLDPT7pSqBGWrk8cTSyTXq0KlEZnxyfN1gySdv527QsVXV zC/o+bsg1SO3e1J9Zml+TA+WujsV5uBlwvijDLEAHflfH7YrpG/uIXUV1zabMNo67DYT eTVlX0Ed1I7gW3o6HYVpFpJ3WPT0UAQ+xrF7zh4DSuPCefFEuWSFK65bfM/LNck0m5dM ldM0xo30aeIquhJxQvjCpzOC36U9erEcH3nbP3XfgV/YexWPKhazT5MBCK4s+zE3I4DV shV7lV7E0CS4+YSQD0jUpx4rV3EIcPqKbMQvBkYY0Emyagv/GnD1Nc58Lh+hVIRm3ejh dRvA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si34439319pgg.341.2018.09.24.05.48.10; Mon, 24 Sep 2018 05:48:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388656AbeIXStQ (ORCPT + 99 others); Mon, 24 Sep 2018 14:49:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59896 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728387AbeIXStP (ORCPT ); Mon, 24 Sep 2018 14:49:15 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 56EB61099; Mon, 24 Sep 2018 12:47:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Rosin , Dmitry Torokhov , Wolfram Sang , Sasha Levin Subject: [PATCH 4.18 206/235] input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Date: Mon, 24 Sep 2018 13:53:12 +0200 Message-Id: <20180924113124.595198699@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Rosin [ Upstream commit 193c2a07cfaacb9249ab0e3d34bce32490879355 ] 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 Acked-by: Dmitry Torokhov Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/rohm_bu21023.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- 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 i2 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 i2 } } - i2c_unlock_adapter(adap); + i2c_unlock_bus(adap, I2C_LOCK_SEGMENT); return ret; }