From patchwork Thu Oct 10 08:36:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 175715 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1979491ill; Thu, 10 Oct 2019 01:44:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqy97JfdctwEHazAOufq/IQ4SJBgpI7hPVR9+tAb393ls7QDAdQmXHjxICurh7oHloS7kzCB X-Received: by 2002:a17:906:1342:: with SMTP id x2mr6930217ejb.304.1570697061511; Thu, 10 Oct 2019 01:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697061; cv=none; d=google.com; s=arc-20160816; b=JCMTtdPkgFgTZ2+vJrClzqqmpU9gJO+hpCiepnFzcGrHJn1M9kVr5Qgr1Df3bQTWUB 0h8+OCrZRIaySN6XeG6OCrt3fb3+OyF2cJFpwNt5v74tGpw7TdgUhKKu7sEtLU3tA1iN g+H5mrEJGwh08IO+dZaosTdBTKKmESRBskxpgQwutGk6Ctp99KV20e62+TWmIH5ErfY/ NQLb7lqYL6OMcPVHvLBWKFzzZuEq8+9klVJkuz3voqqYzTY/++w3UsazKRCbH4TYUmCp m/t3J/5ZgfgQpG7JJvaf+Naw+3XBPpW0nvOoWkuh1pyFmCbJgtx3zSxO8HiNFNLPkq4r OSyg== 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 r1si2577290ejp.287.2019.10.10.01.44.21; Thu, 10 Oct 2019 01:44:21 -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 S2388913AbfJJIoT (ORCPT + 26 others); Thu, 10 Oct 2019 04:44:19 -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 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(-) -- 2.20.1 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