From patchwork Mon Jan 11 14:27:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 361472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB056C433E0 for ; Mon, 11 Jan 2021 14:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 802AC224B8 for ; Mon, 11 Jan 2021 14:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388382AbhAKO2K (ORCPT ); Mon, 11 Jan 2021 09:28:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731825AbhAKO2G (ORCPT ); Mon, 11 Jan 2021 09:28:06 -0500 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F3A3C061786; Mon, 11 Jan 2021 06:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=L+JrZeQFviXuADS9yzDh+4MDUhWzTK6tO1mrS5qsi34=; b=o+Fs2ChgMgVFH9IFrdrBbZy06H tVSGSeN+1qPy5AX5+WVZPFakBLQHeRz76zSjH4GBRY/JSlKmMdobhbbxpeFxbcmbZ3jPd5vOASo1Z zYSWMc9pKGj/NpM721L8U52TB423Psp3J2sXuSFhBwhOLGpr0RtXmmj00sXWjM8jNNwQ4h72OK/Jp LQyZgcx35wn56cFEfYyYl8lWggIukdpW9qAvuQZ8gA24S+5STIFm0ALNWq7HmXezUXU0A7nRPka0H auJJmY8dVRes6K/oLFO0IK2sD2IlZAS+qGvx3qccGOnyed9/DZINai1yhdoyQAEBXfxhzgU/90xxt M1OlArTA==; Received: from dsl-hkibng22-54f986-236.dhcp.inet.fi ([84.249.134.236] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kyyAF-0003Er-Qx; Mon, 11 Jan 2021 16:27:23 +0200 From: Mikko Perttunen To: thierry.reding@gmail.com, jonathanh@nvidia.com Cc: talho@nvidia.com, linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Muhammed Fazal , stable@vger.kernel.org, Mikko Perttunen Subject: [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag Date: Mon, 11 Jan 2021 16:27:13 +0200 Message-Id: <20210111142713.3641208-1-mperttunen@nvidia.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 84.249.134.236 X-SA-Exim-Mail-From: mperttunen@nvidia.com X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Muhammed Fazal Ignore I2C_M_DMA_SAFE flag as it does not make a difference for bpmp-i2c, but causes -EINVAL to be returned for valid transactions. Signed-off-by: Muhammed Fazal Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Mikko Perttunen --- This fixes failures seen with PMIC probing tools on Tegra186+ boards. drivers/i2c/busses/i2c-tegra-bpmp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-tegra-bpmp.c b/drivers/i2c/busses/i2c-tegra-bpmp.c index ec7a7e917edd..998d4b21fb59 100644 --- a/drivers/i2c/busses/i2c-tegra-bpmp.c +++ b/drivers/i2c/busses/i2c-tegra-bpmp.c @@ -80,6 +80,9 @@ static int tegra_bpmp_xlate_flags(u16 flags, u16 *out) flags &= ~I2C_M_RECV_LEN; } + if (flags & I2C_M_DMA_SAFE) + flags &= ~I2C_M_DMA_SAFE; + return (flags != 0) ? -EINVAL : 0; }