From patchwork Fri Sep 6 09:38:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1158941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xYy/pmif"; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46PvBP3p3dz9sNT; Fri, 6 Sep 2019 20:37:01 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1i6Bbs-0007Lu-9Z; Fri, 06 Sep 2019 10:36:56 +0000 Received: from mail-wm1-f41.google.com ([209.85.128.41]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1i6AhF-0001po-58 for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2019 09:38:25 +0000 Received: by mail-wm1-f41.google.com with SMTP id r195so6300793wme.2 for ; Fri, 06 Sep 2019 02:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=; b=xYy/pmifYSZVEkg4V/TPtqTRTUMq+XSiUL6yJZRo0p3HHFL04EBSbv2YAW2NsiNz7N xAiYwTA1eWd0r98zCUCYMjW5ehFbY3Lo30kqR/iqCusQWtSI4cXo5Edh7CKH3095t2xg 86PskpwO6ryDEOajP/rZfEh8ZQM2qYwLFrbrVuTRrxywmYGEzmg5rWMfK2QbM/FPB4Lr imThon4hYgEsoj6ApDBn0aEufWSWvRhskxZER5dEXPnUmv5O7+Ep5JQiASHImOPeu+Hc sUNkLz/wuF54iX/BW0n4c5LJGGhDlJ9Ex2azAq/Nif7+odkoMaEP8ceerBQ4XuQoYE9v SYNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=19vbMBbLeKgWt8VsEseKuJu+9+rmeS/Lh0ZhXOFWQYc=; b=sYwBr7RdapKBxjr6T8qOhm1QkvF8v6ygY7Fb5aiEwt/CLsWJ9/3MlYKJGe5Eb80EWJ mWxwFNkEK092k6txGHQGuKq8OiEnE6gy5/XCe6NwCAh2UDydlvypyVcpzG+2K+ZzV4IO kCbV8G4RP6cPGMb7xUBsC4aM203RW529b3d4uFe8G3uQIz1hfzHREXZkcSfQtaANAWxB GwkRhtnR2S466bDqBcWtvwj+COfpHal4xPIFbTWVUIOc0pPlKbaK1NgLorOfKC5bOt6q 7sAO8t6JbWIqdraFqAImu/khs83I/M1Bqq2mD2IJ70LS8R0Bjj3Sn6gQ1+ENPQh0Gusd 0vDQ== X-Gm-Message-State: APjAAAWt9cPMnqJMQIe3W5O+KTUY0OMgND2S416JP6qj2v7BIy89LSwZ PiNINa11Ua5Oj1rnUlZroWxL0g== X-Google-Smtp-Source: APXvYqwB7LHJwMXTu5qIe8EDGwaY+9w62LJ6WClLUah67w8v9N/6gdXPawQrlrDaKXOoizh23jwNpg== X-Received: by 2002:a1c:658a:: with SMTP id z132mr6717606wmb.98.1567762704783; Fri, 06 Sep 2019 02:38:24 -0700 (PDT) Received: from localhost.localdomain ([95.147.198.36]) by smtp.gmail.com with ESMTPSA id z25sm3552276wmk.0.2019.09.06.02.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 02:38:24 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 2/3] i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630 Date: Fri, 6 Sep 2019 10:38:16 +0100 Message-Id: <20190906093817.2897-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190906093817.2897-1-lee.jones@linaro.org> References: <20190906093817.2897-1-lee.jones@linaro.org> X-Mailman-Approved-At: Fri, 06 Sep 2019 10:36:52 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 --- 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 a89bfce5388e..17abf60c94ae 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