Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2076441ybp; Thu, 10 Oct 2019 01:45:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqytNeUHD2YC02y0roc8NiyKreHbiPO9WKvnihVGtEVcZXvjRp/D5+xRJQm8cWgtUbh7EwgV X-Received: by 2002:aa7:d756:: with SMTP id a22mr7130174eds.198.1570697147397; Thu, 10 Oct 2019 01:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697147; cv=none; d=google.com; s=arc-20160816; b=jeD/if+V62enokWhLtJuJS3u7D/7oFOAdns2qdScDaevBnb17EH6wa/QkNF4KebGMU T2xvNa5WB7ISuvqlNElUYEBj+vzOhbBDVgmgE0q/bxGSnUvbjJL5DXbSMHu5Ug5Tkcmo ypcjBQFOBq6N01kUaaN5Nkn+r53IZY9CL7oiymqbWkPVs+ruy9669reX7+s5FO2FmMDL aTsvXPS3T4DFYC4gD8qJsU3O9OjTWoJ956VxwJJfiWs8avHnwuuIndM6gEP6kdc1ZTYY u81q2Qo/leFm7xSWoucaNGgybtod2OfLSVrGLjMwUxIqLRe0zPUutZrdAaIAkWALZuzW H0Aw== 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:dkim-signature; bh=lIstxGSsv7ohYFWSQ0quuBlM2Po8aWgDcvj5VcFVmdU=; b=EaxigSDmHNl5SqHDA+B7hmoi5zOcX55WzWsj52Dzf8GUsjmsoRYDH+UcyBEwp8V+in IU2IRSyuQ1o3hZ1tuDBs1zID8kSls13e9eY/gyThM5KhREALSqvTkfKIKKba3Zq9CGyc oUJYWO82a+/a4HX+kuM1oZUpaoYS2u2damNh5T/0ts2X2B1r1ZhawVPMVzq0HH/CzVvj LAIS3BNvp8ARDaaZNqPWDr0bUvcGbFD74FN1z5G78f3w1KWTxhkhL2kP9e1dT4oYItVL sMbrKOvO36Eq6J7mWK/O5g4hQx8cYGS91jp8bjxhyVycRLOZiyv4MRivx/b+kd/nYLbD CgZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZETNqqyG; 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 l23si2682447ejr.296.2019.10.10.01.45.23; Thu, 10 Oct 2019 01:45:47 -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=@kernel.org header.s=default header.b=ZETNqqyG; 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 S2388910AbfJJIoS (ORCPT + 99 others); Thu, 10 Oct 2019 04:44:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:49408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387838AbfJJIoR (ORCPT ); Thu, 10 Oct 2019 04:44:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1DD8E21929; Thu, 10 Oct 2019 08:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697056; bh=aH6ctXhIndO4xFNADjyeEW+RHGG7RRX4yg9ZHsOaVNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZETNqqyGFHTJVcCLBGc+ac/orl+ptqUekYmV6PsXOOhkwvRGAlLP328mm07hZH/7c QISX1spb9wZ+a0Ht4eL9Tly3nmvCOVnc5fLckczaV88vQQH2v7sKEEc+UENnjxO8ik /ePcXErit5gogOU7txtV+o68dvDW1G1GXdFLr7Kw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lee Jones , Bjorn Andersson , Wolfram Sang , Sasha Levin Subject: [PATCH 5.3 131/148] i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630 Date: Thu, 10 Oct 2019 10:36:32 +0200 Message-Id: <20191010083620.317468522@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Lee Jones [ Upstream commit 127068abe85bf3dee50df51cb039a5a987a4a666 ] We have a production-level laptop (Lenovo Yoga C630) which is exhibiting a rather horrific bug. When I2C HID devices are being scanned for at boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA. When it does, the laptop reboots and the user never sees the OS. Attempts are being made to debug the reason for the spontaneous reboot. No luck so far, hence the requirement for this hot-fix. This workaround will be removed once we have a viable fix. Signed-off-by: Lee Jones Tested-by: Bjorn Andersson Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-qcom-geni.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index a89bfce5388ee..17abf60c94aeb 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -355,11 +355,13 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, { dma_addr_t rx_dma; unsigned long time_left; - void *dma_buf; + void *dma_buf = NULL; struct geni_se *se = &gi2c->se; size_t len = msg->len; - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (!of_machine_is_compatible("lenovo,yoga-c630")) + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (dma_buf) geni_se_select_mode(se, GENI_SE_DMA); else @@ -394,11 +396,13 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, { dma_addr_t tx_dma; unsigned long time_left; - void *dma_buf; + void *dma_buf = NULL; struct geni_se *se = &gi2c->se; size_t len = msg->len; - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (!of_machine_is_compatible("lenovo,yoga-c630")) + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (dma_buf) geni_se_select_mode(se, GENI_SE_DMA); else -- 2.20.1