From patchwork Thu Oct 10 08:35:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 175710 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1975078ill; Thu, 10 Oct 2019 01:39:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyGVsdm6DO2rC0xeOJ0GZgTZSGvoq7aAFq3xgNJ3Rt10fgJoUwjI+AiDHhDzvUPMNATCH6 X-Received: by 2002:a17:906:4a97:: with SMTP id x23mr6743245eju.218.1570696769196; Thu, 10 Oct 2019 01:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696769; cv=none; d=google.com; s=arc-20160816; b=YDZBFFJ0SKwjEyn8o42BTRI74UCkf79KLs6R4PmGsPNATDpmmLTqOLtKxOeGyJFTR7 xOP/DBi5YhpVxB205zEe7Z/VLVPg3Vu+qsypkjWpHw9AOFkmMDlG/vpUZ4m+VVsyryxr H9FKLgrBP8h/dPRgy+Cc5kyVKibKrXTZdRyGx6tlsD+vRFnqaia4EWBpAI700PVrKSKA nXJC8Zg9HrG+bGj7AsPNPN8mi+t/hAHhs2YohMr6/I+XyYFKgnQausINNHv3wvQG2ej+ CNCDb7RNnR1pXzKNy0VTcHAOPnTFMT9Ar0KqAyiZdvt6QDJv2VhKIiWokfaDNkL6ynK+ 4ilg== 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=FE+1wEawqtBxi025TOTIuWTjnHUOgZN51bocypmwzD8=; b=H3tCfAzAs+q1rvIINTdWmMk9znaoZJiClTK0g1HsrSRdGFMYh8pR/kI/4rtBLzcked H0WpZLpSEYKb7DG8BQmhMR84mA2NkJH5EpOe3sPT/BgUeaBgiMILut8pZ6K68YF84nUB 6vPSY/4Huyu4Q72rtjRZSWnkevVSpIpU9Q5NKftcSpvEumRAFQmXx1gEZGFe/Hw0v5Lv 3p3GXMcsoDuizKusWvmDlkg7Sb1o1zS+Yqoh7FeRZHbDuAIt/5w7GyRqmbVrESKF7rga Rjv1F3nQcE8zlQuGqqb7wH9fTR/x/tDLTVK7gs/wl0fJHhrBrfQsDGRgPcwlZUb0A6kL F05A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FXwrZ3NA; 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 e6si2872415ejb.348.2019.10.10.01.39.29; Thu, 10 Oct 2019 01:39:29 -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=FXwrZ3NA; 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 S2387868AbfJJIj1 (ORCPT + 26 others); Thu, 10 Oct 2019 04:39:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:42918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387430AbfJJIjZ (ORCPT ); Thu, 10 Oct 2019 04:39:25 -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 3FD1921920; Thu, 10 Oct 2019 08:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696764; bh=ZwsGgjl9+rpPm+dqONwrfFcqeSGtvnpm4WmFQaz5YAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FXwrZ3NA8GPEoFeoPA/ZJYcCKPxnhsWgpP2GpaUihRORuFe6GoQpISs6DupNbN2An Wd+7vc/mecqMakE6OtnzTLYA+kDlaiXo28ss1FRi87F0YkxGejxXXrMqR1+oretVHq tae0pQL4lp/dLX/XrmewgwSJSgbzfvZ1MOSYaxtM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef , Herbert Xu Subject: [PATCH 5.3 045/148] crypto: ccree - account for TEE not ready to report Date: Thu, 10 Oct 2019 10:35:06 +0200 Message-Id: <20191010083613.871875992@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: Gilad Ben-Yossef commit 76a95bd8f9e10cade9c4c8df93b5c20ff45dc0f5 upstream. When ccree driver runs it checks the state of the Trusted Execution Environment CryptoCell driver before proceeding. We did not account for cases where the TEE side is not ready or not available at all. Fix it by only considering TEE error state after sync with the TEE side driver. Signed-off-by: Gilad Ben-Yossef Fixes: ab8ec9658f5a ("crypto: ccree - add FIPS support") CC: stable@vger.kernel.org # v4.17+ Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccree/cc_fips.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/crypto/ccree/cc_fips.c +++ b/drivers/crypto/ccree/cc_fips.c @@ -21,7 +21,13 @@ static bool cc_get_tee_fips_status(struc u32 reg; reg = cc_ioread(drvdata, CC_REG(GPR_HOST)); - return (reg == (CC_FIPS_SYNC_TEE_STATUS | CC_FIPS_SYNC_MODULE_OK)); + /* Did the TEE report status? */ + if (reg & CC_FIPS_SYNC_TEE_STATUS) + /* Yes. Is it OK? */ + return (reg & CC_FIPS_SYNC_MODULE_OK); + + /* No. It's either not in use or will be reported later */ + return true; } /* From patchwork Thu Oct 10 08:35:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 175711 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1975107ill; Thu, 10 Oct 2019 01:39:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoFDGkkCq75fZxzP078Ga30w4WMtSjLwQ1c7BIqJ/XEBphtUtLlLEvS0BF/FzYcovkuznq X-Received: by 2002:a17:906:5e07:: with SMTP id n7mr6874918eju.271.1570696770871; Thu, 10 Oct 2019 01:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696770; cv=none; d=google.com; s=arc-20160816; b=egI8cASZzDHxarZTAWrSoWCqqittwW1377XwaKzjGYIOi9G4annKsRmbzt5HqOHmoe OhhmqHWrU6KMTJS3haw259JwpRDI9O1RQt61HnfrddB5zO/U4M6pG8/MibG9yiMAeav2 0h1P/2uGweDQRindHH+hVyg951Mn+hLFgziqebzqrp/lG3bVAbjdILHL79ovOv/hQKDG HfPQkYffihfFMtIKlExgK2EjOG0BKSphRHeatcuSpkjqFwag+LWzeg+al76yJE375NnM mAeY7HtmUtKsatqj4jUGSIyXFataStwrDM/FQpxyOS5XOmp1ems4xKi4ppH7k/4sN32m pFVA== 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=oXRtJDQVCYqQepuBh63PyzDOl9HVm/TPbiVNbXxc1OI=; b=JWMDwycn8GlkAfQFFu0caR+lLEMBsTb0mFhxPxf/9t8SyoU5keiHIrMYdlNKnyGtW2 Wyc+pIPWv7+0jDTLgT7KCVsnxd9zFwjWW7RrkHf9r1IwKMC4fL4x5JTizmeurNWqeRec 1o2Y/e9nIinUoehd7qYNNMnWbZllv2o+X7LMnr9wCDSGlTvtXj0gDSU9xJ9GQv3eat7G ZJ+HJ20b4jJZA/ibm4v7I8x/crZCQq4nki/zOt0AltKuJigIRKX852vBlLDwNugACDuQ MeHhEx6s6/MoU1HmOAF5t1HHwq/hjV8w6qHz7/wC4JUZWzIytDFKvxkVo5Fv0UQTxEos LSgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="H/+3Oj3J"; 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 e6si2872415ejb.348.2019.10.10.01.39.30; Thu, 10 Oct 2019 01:39:30 -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="H/+3Oj3J"; 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 S2387880AbfJJIj3 (ORCPT + 26 others); Thu, 10 Oct 2019 04:39:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:42992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387430AbfJJIj2 (ORCPT ); Thu, 10 Oct 2019 04:39:28 -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 0B06E21D7A; Thu, 10 Oct 2019 08:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696767; bh=NROWJEU6vUCbpXiz1egOIyuqyJi8o/fjEm1WAP2iO8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/+3Oj3JxOOsgeqZZpLMxk8j1DnYfKlZTElVCPBr34YyFJ2vbrFifS1VwgEriupRK wfBnilp59wcKjGKekRpeLiOX3NBS5wtka/UG+On8VJTtA/vyeWmgwxtjXlTbsZvYQU ro4O8I/clwyGRQohk5PC5nyVgN+sdt+pyuAA/PF4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef , Herbert Xu Subject: [PATCH 5.3 046/148] crypto: ccree - use the full crypt length value Date: Thu, 10 Oct 2019 10:35:07 +0200 Message-Id: <20191010083613.938277698@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: Gilad Ben-Yossef commit 7a4be6c113c1f721818d1e3722a9015fe393295c upstream. In case of AEAD decryption verifcation error we were using the wrong value to zero out the plaintext buffer leaving the end of the buffer with the false plaintext. Signed-off-by: Gilad Ben-Yossef Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support") CC: stable@vger.kernel.org # v4.17+ Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccree/cc_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/ccree/cc_aead.c +++ b/drivers/crypto/ccree/cc_aead.c @@ -236,7 +236,7 @@ static void cc_aead_complete(struct devi /* In case of payload authentication failure, MUST NOT * revealed the decrypted message --> zero its memory. */ - cc_zero_sgl(areq->dst, areq_ctx->cryptlen); + cc_zero_sgl(areq->dst, areq->cryptlen); err = -EBADMSG; } } else { /*ENCRYPT*/ From patchwork Thu Oct 10 08:35:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 175712 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1975946ill; Thu, 10 Oct 2019 01:40:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6kUxFaDMW56ooWfl0hHdI4S52YLctaKOOTepymw2uZZ/gBkNQNUht3OcLPBQPiV04Gwhf X-Received: by 2002:a17:906:6ad7:: with SMTP id q23mr6747326ejs.214.1570696828028; Thu, 10 Oct 2019 01:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696828; cv=none; d=google.com; s=arc-20160816; b=pbgVjEHSz13YJ9IoaWNhSXtJtMut3i6yFt72uyV/yOIOB2O/7s79wAnUY6N07yARC1 Nb0TJxGDJ8qAwn82+CR7rRzb5qsd40BS9A1YJxLTgZCT6r9bvJiOyD1jSOMD8BGgw29G zxtvBrTIgCsU9YFH+HpkQD5fbM+J0kO0KnOUXxB1IWz9FSt4HYpmfQRSy5h56nUgxBLC 7pZyX3HoqrrGKrrUfNdUCxMslgcYNC8pDDIjxgDhHEsQoI0qp153jDrfrueSEh5LX+dL B0gqlU5XgFs4Zo884uY1P4lFxRleLBrXCmp/iFM3kZ4875Q8zra1MoRXn0C4+zfiJOKO 2Q5A== 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=7oCnS2S6WBLqUE2ZYRVaxoQ7E5gRzhCJLxKS3UD0ZTM=; b=kP1K/a2YFIboCVcLwf2kLCx+n87yTkTIMcHcDzALwnv583Q1wyMqnfSwofJf0QWgA5 Tt1d8q2Vp59p2cGMWKSAVJZcKOsZLZRUDpKA1B61MbFJ+OaF2O/LWtt8A5fCw+siKV4F 2JjnNpi2ZawF3Q/avhSaDcbex9KqM3zPnP/STi1DE33AZkTJkexUNZKTyu8luq0GIkNU 28fGIo7tvxBUmmu9HopJdxdOR9FWkAfA89pZGsLsZHTmJz+h/ozI5SAoikgD8ycDZqm8 4xMPNEpVwO0z8JpriJkNPh1XWTeJ8YJtmxsbZbroDx+xLzQDkvbqCKOe+X0nSt+uAtMF 21yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iR5sm8Sa; 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 n19si2809317edo.172.2019.10.10.01.40.26; Thu, 10 Oct 2019 01:40:28 -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=iR5sm8Sa; 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 S2388107AbfJJIk0 (ORCPT + 26 others); Thu, 10 Oct 2019 04:40:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:44516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388088AbfJJIkZ (ORCPT ); Thu, 10 Oct 2019 04:40:25 -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 0715721D6C; Thu, 10 Oct 2019 08:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696824; bh=PQpdJK/h9ToD5AevYVxFZxB/f9VAVRWbA53bQfTfcew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iR5sm8Sa76ON4c1T/ffjovAvXJcRQG0nPltDjy76VDxG9wYKnt0KRUh5R+PyjJBJG ei13oh12qDImXHzRToFfi2O+h7j1vyN8n8oyToKR5TlATPMC/b5gCeot/l7oPBJrlw OY5+L8m5cwW5OcaOK5QoNLPkGxWJvEecX702vNNI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liviu Dudau , Anders Roxell , Liviu Dudau Subject: [PATCH 5.3 065/148] drm: mali-dp: Mark expected switch fall-through Date: Thu, 10 Oct 2019 10:35:26 +0200 Message-Id: <20191010083615.398042278@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: Anders Roxell commit 28ba1b1da49a20ba8fb767d6ddd7c521ec79a119 upstream. Now that -Wimplicit-fallthrough is passed to GCC by default, the following warnings shows up: ../drivers/gpu/drm/arm/malidp_hw.c: In function ‘malidp_format_get_bpp’: ../drivers/gpu/drm/arm/malidp_hw.c:387:8: warning: this statement may fall through [-Wimplicit-fallthrough=] bpp = 30; ~~~~^~~~ ../drivers/gpu/drm/arm/malidp_hw.c:388:3: note: here case DRM_FORMAT_YUV420_10BIT: ^~~~ ../drivers/gpu/drm/arm/malidp_hw.c: In function ‘malidp_se_irq’: ../drivers/gpu/drm/arm/malidp_hw.c:1311:4: warning: this statement may fall through [-Wimplicit-fallthrough=] drm_writeback_signal_completion(&malidp->mw_connector, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/gpu/drm/arm/malidp_hw.c:1313:3: note: here case MW_START: ^~~~ Rework to add a 'break;' in a case that didn't have it so that the compiler doesn't warn about fall-through. Cc: stable@vger.kernel.org # v5.2+ Fixes: b8207562abdd ("drm/arm/malidp: Specified the rotation memory requirements for AFBC YUV formats") Acked-by: Liviu Dudau Signed-off-by: Anders Roxell Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20190730153056.3606-1-anders.roxell@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/arm/malidp_hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c @@ -385,6 +385,7 @@ int malidp_format_get_bpp(u32 fmt) switch (fmt) { case DRM_FORMAT_VUY101010: bpp = 30; + break; case DRM_FORMAT_YUV420_10BIT: bpp = 15; break; @@ -1309,7 +1310,7 @@ static irqreturn_t malidp_se_irq(int irq break; case MW_RESTART: drm_writeback_signal_completion(&malidp->mw_connector, 0); - /* fall through to a new start */ + /* fall through - to a new start */ case MW_START: /* writeback started, need to emulate one-shot mode */ hw->disable_memwrite(hwdev); From patchwork Thu Oct 10 08:35:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 175713 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1975985ill; Thu, 10 Oct 2019 01:40:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTDv243JnonJW1b8T/PGqTFQYvjY4oFF1M5O+SkUa0bVLLZTD/DzhiVwoyLrcqYucfxg3/ X-Received: by 2002:a05:6402:64f:: with SMTP id u15mr6817908edx.231.1570696830716; Thu, 10 Oct 2019 01:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696830; cv=none; d=google.com; s=arc-20160816; b=By1guxeA88/D1vL8C6KdkZ8SVpSQUDa6VQM19/y8T/S8Jy8P8Z1oX4Gei2/EOWKAj5 c/ReTIPfPzFdtHenXYYYi5T4LbBKsHByS8c/YOcjb1/2bNsJgzN/EbqfqgM2czMkCd4B T9rJF50PXM63aMSDCvh7mYF5eWC/S9WwIX2Kdm5BsVZn0sZ4tqeX3u9bMlNCuScKD8Do AZ9O2SzSfFVyf2AtAayDyaOGWs2Uf0SiIVI2alWXHG0HDj/MG2R8OGkKyhoFgcXBbrvL pMHUGRdpDVWkfybaoUyAGoTR6t5QvNF9Ai1K34pYg1Bj/MQOcZQwMGu9Nz07Kb7z9YQR l8vw== 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=Z1Uo4cB9yOSynznXlmaxJHonESqz8I5Vaw6TZHLVr5I=; b=wV9O+xHXPx/EVgAS+kty3qx38f+W9mm0YQrzfzzEIuoURduewHa3XXyCJSfqTXJoxK 1NrLIo1xD1mqGvGrm1yiVnukA1nWSztuW7qie7NiS6wAvJGThfXXsrySyGwfe6E9X4BS tKrmNZld7THp1EA0hY2UuX/uqIDsh8akJSOdNEqmT1yPdecnYnAkz55P0Z/MB2kG8TcF tMYD22oeKiNv571GotNT5xJUUTRZuQ/DHG0X3rKoGaYZvIZoCJ1ceyESC+JkGJA+z8kc W+M3rWg9jnmv7UoP7wIu5udaLPjVaSvd+AGgQR8CFWvsihEhX54MdN+OBr3YTGWZn+gR t4Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J1ELj8v9; 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 n19si2809317edo.172.2019.10.10.01.40.30; Thu, 10 Oct 2019 01:40:30 -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=J1ELj8v9; 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 S2388119AbfJJIk3 (ORCPT + 26 others); Thu, 10 Oct 2019 04:40:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:44560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387493AbfJJIk1 (ORCPT ); Thu, 10 Oct 2019 04:40:27 -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 EF46720B7C; Thu, 10 Oct 2019 08:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696827; bh=IzsSl5RJoQIY9CfSt/mZ/FS85qR1vAUixNJ0vwRnrxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J1ELj8v9FSHeC3uVqe0Wu8D4u5Z5vB7GL9gS6mlOzNBdwQj6J69EIvmDfP3viMp03 BrgJw9UVh/4GDddPVjAhj5JdEpiMfUjR0s0lhdsCpJN8puej99Alm5VSURjkCbhO3t Li/D972vwPPPbM2K6Qg0YwR1GwY7hd7quUXFORiI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomi Valkeinen , Adam Ford , Jyri Sarha Subject: [PATCH 5.3 066/148] drm/omap: fix max fclk divider for omap36xx Date: Thu, 10 Oct 2019 10:35:27 +0200 Message-Id: <20191010083615.450362990@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: Tomi Valkeinen commit e2c4ed148cf3ec8669a1d90dc66966028e5fad70 upstream. The OMAP36xx and AM/DM37x TRMs say that the maximum divider for DSS fclk (in CM_CLKSEL_DSS) is 32. Experimentation shows that this is not correct, and using divider of 32 breaks DSS with a flood or underflows and sync losts. Dividers up to 31 seem to work fine. There is another patch to the DT files to limit the divider correctly, but as the DSS driver also needs to know the maximum divider to be able to iteratively find good rates, we also need to do the fix in the DSS driver. Signed-off-by: Tomi Valkeinen Cc: Adam Ford Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20191002122542.8449-1-tomi.valkeinen@ti.com Tested-by: Adam Ford Reviewed-by: Jyri Sarha Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/omapdrm/dss/dss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1090,7 +1090,7 @@ static const struct dss_features omap34x static const struct dss_features omap3630_dss_feats = { .model = DSS_MODEL_OMAP3, - .fck_div_max = 32, + .fck_div_max = 31, .fck_freq_max = 173000000, .dss_fck_multiplier = 1, .parent_clk_name = "dpll4_ck", From patchwork Thu Oct 10 08:35:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 175714 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1978711ill; Thu, 10 Oct 2019 01:43:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVM3f89V279P7QeP+ECCRM0hOys1GjjWAdHowpJrNzwnCxoIU3zIqVN7RgQG2tGM8N6ves X-Received: by 2002:a17:906:af8e:: with SMTP id mj14mr7199031ejb.45.1570697011239; Thu, 10 Oct 2019 01:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697011; cv=none; d=google.com; s=arc-20160816; b=wmQDynnn1o97Fp07+IwOc9FWCdgHtNySaS1tHzXAVpf/EOsiod2F/prhmS6c1liV/c oetZ70KsdmijbQKHtcZtqMsQnQxNlKzOfG1x4NBFAUO7TlMzlfWHCUbErN/MtBm35+ch 8C3hN1tu8tttDPUro92cU0n+Q/pt/wR7rYOwh1/WVajU4TyJCuJ3TeV/a+48z10ACpRP tEFDsYRtjP3a8Bje3KtmB/AThZg/5Ok3+2TTrNROF0Ferdy34D1dFJfu72LSSY8Zg9w3 7Bk8R4bp5Q21GJBsTzAkUDbNvg4bMkGfgYbGI6bkZl7oCqkwhLmXCvWPpsmWyZEslPW9 98vw== 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=AaDFtTKEn/rBJ83PgiKyNFFIys0nJ0TrsD77J2is9vI=; b=tafuuya8Y7B5FNciiHd0DLBox9e/f8bg7HAjw+/LufiYQwv9Qe4YwGIJ3UGujFSbxS QX0R6Ppnc+FlcJWjHEViPMPaN7n84X33BS370N/y8knhnNM2ZGyVUQBT2g0WxDJfl1M5 KGUoL0tJoQaZxiHsuJSypnRB551J6abntmq3PDwP4mbayqAPOUa2OLTonwassFXOdi5U sFzpQ+hWpT3swNOBhyW8mGpRRqsQCWmW1tY9mJJzNqSDs20/pPw4dbRHoACEyHySMjXm MDjkr0ajD4RSHZpF/+HqmN0tl3o/o7v92HcSWvYM+b69xURdcjJgn5w7xzkBwhAX538A NM+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oYzKSRa3; 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 u8si3234134edb.57.2019.10.10.01.43.31; Thu, 10 Oct 2019 01:43:31 -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=oYzKSRa3; 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 S2388740AbfJJIn2 (ORCPT + 26 others); Thu, 10 Oct 2019 04:43:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:48242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388001AbfJJIn0 (ORCPT ); Thu, 10 Oct 2019 04:43:26 -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 3DF602190F; Thu, 10 Oct 2019 08:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697004; bh=sdWjKc7950Ix1oAlzn3Bdm8pbL63ww+3W/0cLP/FqRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oYzKSRa3MMRLJgHq8dHKJ9HOypNhv8l8D9tuAfET54JVsR5NeVcsCIwzsH5Vtqby8 3Run2qM0p3qYF8x3QrlwPDmJfwUFyD8OO25fOrnR2lxerQmoZW0iK1/9wmEAND0on1 MR2UrSuZbincpYMyRkujTs9Hor43oxf8izOi8ct0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Amit Kucheria , Zhang Rui , Sasha Levin Subject: [PATCH 5.3 088/148] drivers: thermal: qcom: tsens: Fix memory leak from qfprom read Date: Thu, 10 Oct 2019 10:35:49 +0200 Message-Id: <20191010083616.685532154@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: Srinivas Kandagatla [ Upstream commit 6b8249abb093551ef173d13a25ed0044d5dd33e0 ] memory returned as part of nvmem_read via qfprom_read should be freed by the consumer once done. Existing code is not doing it so fix it. Below memory leak detected by kmemleak [] kmemleak_alloc+0x50/0x84 [] __kmalloc+0xe8/0x168 [] nvmem_cell_read+0x30/0x80 [] qfprom_read+0x4c/0x7c [] calibrate_v1+0x34/0x204 [] tsens_probe+0x164/0x258 [] platform_drv_probe+0x80/0xa0 [] really_probe+0x208/0x248 [] driver_probe_device+0x98/0xc0 [] __device_attach_driver+0x9c/0xac [] bus_for_each_drv+0x60/0x8c [] __device_attach+0x8c/0x100 [] device_initial_probe+0x20/0x28 [] bus_probe_device+0x34/0x7c [] deferred_probe_work_func+0x6c/0x98 [] process_one_work+0x160/0x2f8 Signed-off-by: Srinivas Kandagatla Acked-by: Amit Kucheria Signed-off-by: Zhang Rui Signed-off-by: Sasha Levin --- drivers/thermal/qcom/tsens-8960.c | 2 ++ drivers/thermal/qcom/tsens-v0_1.c | 12 ++++++++++-- drivers/thermal/qcom/tsens-v1.c | 1 + drivers/thermal/qcom/tsens.h | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 8d9b721dadb65..e46a4e3f25c42 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -229,6 +229,8 @@ static int calibrate_8960(struct tsens_priv *priv) for (i = 0; i < num_read; i++, s++) s->offset = data[i]; + kfree(data); + return 0; } diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index 6f26fadf4c279..055647bcee67d 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -145,8 +145,10 @@ static int calibrate_8916(struct tsens_priv *priv) return PTR_ERR(qfprom_cdata); qfprom_csel = (u32 *)qfprom_read(priv->dev, "calib_sel"); - if (IS_ERR(qfprom_csel)) + if (IS_ERR(qfprom_csel)) { + kfree(qfprom_cdata); return PTR_ERR(qfprom_csel); + } mode = (qfprom_csel[0] & MSM8916_CAL_SEL_MASK) >> MSM8916_CAL_SEL_SHIFT; dev_dbg(priv->dev, "calibration mode is %d\n", mode); @@ -181,6 +183,8 @@ static int calibrate_8916(struct tsens_priv *priv) } compute_intercept_slope(priv, p1, p2, mode); + kfree(qfprom_cdata); + kfree(qfprom_csel); return 0; } @@ -198,8 +202,10 @@ static int calibrate_8974(struct tsens_priv *priv) return PTR_ERR(calib); bkp = (u32 *)qfprom_read(priv->dev, "calib_backup"); - if (IS_ERR(bkp)) + if (IS_ERR(bkp)) { + kfree(calib); return PTR_ERR(bkp); + } calib_redun_sel = bkp[1] & BKP_REDUN_SEL; calib_redun_sel >>= BKP_REDUN_SHIFT; @@ -313,6 +319,8 @@ static int calibrate_8974(struct tsens_priv *priv) } compute_intercept_slope(priv, p1, p2, mode); + kfree(calib); + kfree(bkp); return 0; } diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c index 10b595d4f6199..870f502f2cb6c 100644 --- a/drivers/thermal/qcom/tsens-v1.c +++ b/drivers/thermal/qcom/tsens-v1.c @@ -138,6 +138,7 @@ static int calibrate_v1(struct tsens_priv *priv) } compute_intercept_slope(priv, p1, p2, mode); + kfree(qfprom_cdata); return 0; } diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 2fd94997245bf..b89083b61c383 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -17,6 +17,7 @@ #include #include +#include struct tsens_priv; 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: "gregkh@linuxfoundation.org" 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