i2c: tegra-bpmp: ignore DMA safe buffer flag
PATCH v2 1/1 i2c: tegra-bpmp: ignore DMA safe buffer flag
From: Muhammed Fazal <[email protected]>
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.
---
v2:
- Remove unnecessary check for if the bit is set
--- drivers/i2c/busses/i2c-tegra-bpmp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-tegra-bpmp.c +2 -0
@@ -80,6 +80,8 @@ static int tegra_bpmp_xlate_flags(u16 flags, u16 *out) flags &= ~I2C_M_RECV_LEN ; } + flags &= ~I2C_M_DMA_SAFE ; +return (flags !=0 ) ? -EINVAL :0 ; }
Signature · 1 line
2.30.0
Quoted 5 lines · Mikko Perttunen
From: Muhammed Fazal <[email protected]>
Ignore
I2C_M_DMA_SAFEflag as it does not make a difference for bpmp-i2c, but causes-EINVALto be returned for valid transactions.
I wonder if bailing out on an unknown flag shouldn't be revisited in general? I mean this will happen again when a new I2C_M_* flag is introduced.
Quoted 11 lines · Wolfram Sang
Quoted 5 lines · Mikko Perttunen
From: Muhammed Fazal <[email protected]>
Ignore
I2C_M_DMA_SAFEflag as it does not make a difference for bpmp-i2c, but causes-EINVALto be returned for valid transactions.I wonder if bailing out on an unknown flag shouldn't be revisited in general? I mean this will happen again when a new I2C_M_* flag is introduced.
If it's guaranteed that any new flags are optional to handle by the driver, than that is certainly better. I'll post a v3 with that approach.
thanks,
Mikko
Quoted 8 lines
Quoted 5 lines
I wonder if bailing out on an unknown flag shouldn't be revisited in general? I mean this will happen again when a new I2C_M_* flag is introduced.
If it's guaranteed that any new flags are optional to handle by the driver, than that is certainly better. I'll post a v3 with that approach.
If there will be a new flag, it is highly likely that it will handle some corner case which only gets applied when there is a I2C_FUNC_* flag guarding it. If the new flag turns out to be mandatory, the (poor) author needs to check with all existing drivers anyhow.
Quoted 6 lines · Wolfram Sang
Quoted 6 lines
Quoted 5 lines
I wonder if bailing out on an unknown flag shouldn't be revisited in general? I mean this will happen again when a new I2C_M_* flag is introduced.
Quoted 8 lines
Quoted 2 lines
If it's guaranteed that any new flags are optional to handle by the driver, than that is certainly better. I'll post a v3 with that approach.
If there will be a new flag, it is highly likely that it will handle some corner case which only gets applied when there is a I2C_FUNC_* flag guarding it. If the new flag turns out to be mandatory, the (poor) author needs to check with all existing drivers anyhow.
Yep, I suppose that is true :)
I just sent out the v3.
thanks!
Mikko