From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 067D2C433DB for ; Mon, 11 Jan 2021 15:05:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C18E822ADF for ; Mon, 11 Jan 2021 15:05:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbhAKPFd (ORCPT ); Mon, 11 Jan 2021 10:05:33 -0500 Received: from imap2.colo.codethink.co.uk ([78.40.148.184]:43418 "EHLO imap2.colo.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbhAKPFd (ORCPT ); Mon, 11 Jan 2021 10:05:33 -0500 Received: from cpc79921-stkp12-2-0-cust288.10-2.cable.virginm.net ([86.16.139.33] helo=[192.168.0.18]) by imap2.colo.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1kyykV-0008FJ-EB; Mon, 11 Jan 2021 15:04:51 +0000 Subject: Re: [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag To: Mikko Perttunen , 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 References: <20210111142713.3641208-1-mperttunen@nvidia.com> From: Ben Dooks Organization: Codethink Limited. Message-ID: <16a0be21-2cbe-dd0e-aed7-b84f6abcacac@codethink.co.uk> Date: Mon, 11 Jan 2021 15:04:50 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210111142713.3641208-1-mperttunen@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On 11/01/2021 14:27, Mikko Perttunen wrote: > 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; > + Just a comment, you can do without the test here. Just doing this would have been fine: flags &= ~I2C_M_DMA_SAFE; -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html