All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag
@ 2021-01-11 14:27 Mikko Perttunen
  2021-01-11 15:04 ` Ben Dooks
  0 siblings, 1 reply; 3+ messages in thread
From: Mikko Perttunen @ 2021-01-11 14:27 UTC (permalink / raw)
  To: thierry.reding, jonathanh
  Cc: talho, linux-i2c, linux-tegra, linux-kernel, Muhammed Fazal,
	stable, Mikko Perttunen

From: Muhammed Fazal <mfazale@nvidia.com>

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 <mfazale@nvidia.com>
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
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;
 }
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag
  2021-01-11 14:27 [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag Mikko Perttunen
@ 2021-01-11 15:04 ` Ben Dooks
  2021-01-11 15:49   ` Mikko Perttunen
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2021-01-11 15:04 UTC (permalink / raw)
  To: Mikko Perttunen, thierry.reding, jonathanh
  Cc: talho, linux-i2c, linux-tegra, linux-kernel, Muhammed Fazal, stable

On 11/01/2021 14:27, Mikko Perttunen wrote:
> From: Muhammed Fazal <mfazale@nvidia.com>
> 
> 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 <mfazale@nvidia.com>
> Cc: stable@vger.kernel.org # v4.19+
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag
  2021-01-11 15:04 ` Ben Dooks
@ 2021-01-11 15:49   ` Mikko Perttunen
  0 siblings, 0 replies; 3+ messages in thread
From: Mikko Perttunen @ 2021-01-11 15:49 UTC (permalink / raw)
  To: Ben Dooks, Mikko Perttunen, thierry.reding, jonathanh
  Cc: talho, linux-i2c, linux-tegra, linux-kernel, Muhammed Fazal, stable

On 1/11/21 5:04 PM, Ben Dooks wrote:
> On 11/01/2021 14:27, Mikko Perttunen wrote:
>> From: Muhammed Fazal <mfazale@nvidia.com>
>>
>> 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 <mfazale@nvidia.com>
>> Cc: stable@vger.kernel.org # v4.19+
>> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
>> ---
>> 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;
> 
> 
> 

Yep, I'll send a v2.

thanks,
Mikko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-11 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 14:27 [PATCH] i2c: tegra-bpmp: ignore DMA safe buffer flag Mikko Perttunen
2021-01-11 15:04 ` Ben Dooks
2021-01-11 15:49   ` Mikko Perttunen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.