mbox series

[v6,0/9] iProc I2C slave mode and NIC mode

Message ID 20190403011830.3254-1-ray.jui@broadcom.com (mailing list archive)
Headers show
Series iProc I2C slave mode and NIC mode | expand

Message

Ray Jui April 3, 2019, 1:18 a.m. UTC
This patch series adds the following support to the iProc I2C driver:
- Increase maximum read transfer size to 255 bytes
- I2C slave mode
- Polling mode
- NIC I2C mode

This patch series is based on kernel v5.1-rc3 and available at:
https://github.com/Broadcom/arm64-linux.git
branch: i2c-slave-v6

Changes from v5:
 - Address various comments from Wolfram
 - Rebase to v5.1-rc3

Changes from v4:
 - Add more detailed explanations in the device tree binding document
   changes, to address Rob's review comments

Changes from v3:
 - Various minor fixes on commit messages and commits
 - Rebased to v5.0-rc3

Changes from v2:
 - Address Ray's review comments.

Changes from v1:
 - Rebased to Linux v5.0.0-rc2

Michael Cheng (1):
  i2c: iproc: Add support for more master error status

Ray Jui (1):
  dt-bindings: i2c: iproc: make 'interrupts' optional

Rayagonda Kokatanur (5):
  i2c: iproc: add polling support
  i2c: iproc: use wrapper for read/write access
  dt-bindings: i2c: iproc: add "brcm,iproc-nic-i2c" compatible string
  i2c: iproc: add NIC I2C support
  arm64: dts: Stingray: Add NIC i2c device node

Shreesha Rajashekar (2):
  i2c: iproc: Extend I2C read up to 255 bytes
  i2c: iproc: Add slave mode support

 .../bindings/i2c/brcm,iproc-i2c.txt           |  17 +-
 .../boot/dts/broadcom/stingray/stingray.dtsi  |  18 +
 drivers/i2c/busses/Kconfig                    |   1 +
 drivers/i2c/busses/i2c-bcm-iproc.c            | 758 +++++++++++++++---
 4 files changed, 662 insertions(+), 132 deletions(-)

Comments

Wolfram Sang April 3, 2019, 8:44 p.m. UTC | #1
On Tue, Apr 02, 2019 at 06:18:21PM -0700, Ray Jui wrote:
> This patch series adds the following support to the iProc I2C driver:
> - Increase maximum read transfer size to 255 bytes
> - I2C slave mode
> - Polling mode
> - NIC I2C mode
> 
> This patch series is based on kernel v5.1-rc3 and available at:
> https://github.com/Broadcom/arm64-linux.git
> branch: i2c-slave-v6
> 
> Changes from v5:
>  - Address various comments from Wolfram

In the future, please write in detail what you changed. I review so many
patches that I can't recall all my comments on every patch.

That being said, all patches applied to for-next, thanks!

Can be fixed incrementally, my code checkers complain about:

    CPPCHECK
drivers/i2c/busses/i2c-bcm-iproc.c:720:14: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
    val |= 1 << M_TX_WR_STATUS_SHIFT;
             ^
drivers/i2c/busses/i2c-bcm-iproc.c:847:13: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
 val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
            ^
drivers/i2c/busses/i2c-bcm-iproc.c:998:13: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
 val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
Ray Jui April 3, 2019, 8:56 p.m. UTC | #2
Hi Wolfram,

On 4/3/2019 1:44 PM, Wolfram Sang wrote:
> On Tue, Apr 02, 2019 at 06:18:21PM -0700, Ray Jui wrote:
>> This patch series adds the following support to the iProc I2C driver:
>> - Increase maximum read transfer size to 255 bytes
>> - I2C slave mode
>> - Polling mode
>> - NIC I2C mode
>>
>> This patch series is based on kernel v5.1-rc3 and available at:
>> https://github.com/Broadcom/arm64-linux.git
>> branch: i2c-slave-v6
>>
>> Changes from v5:
>>  - Address various comments from Wolfram
> 
> In the future, please write in detail what you changed. I review so many
> patches that I can't recall all my comments on every patch.
> 

Sure will do next time.

> That being said, all patches applied to for-next, thanks!
> 

Thanks!

> Can be fixed incrementally, my code checkers complain about:
> 
>     CPPCHECK
> drivers/i2c/busses/i2c-bcm-iproc.c:720:14: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
>     val |= 1 << M_TX_WR_STATUS_SHIFT;
>              ^
> drivers/i2c/busses/i2c-bcm-iproc.c:847:13: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
>  val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
>             ^
> drivers/i2c/busses/i2c-bcm-iproc.c:998:13: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
>  val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
> 

I'll submit an incremental patch to fix the above warnings. I think we
can convert all '1 << XXX' syntax in this driver to 'BIT(XXX)'. It will
fix all of the above warnings and make the code more readable.

Thanks,

Ray
Florian Fainelli April 3, 2019, 10:20 p.m. UTC | #3
On 4/3/19 1:44 PM, Wolfram Sang wrote:
> On Tue, Apr 02, 2019 at 06:18:21PM -0700, Ray Jui wrote:
>> This patch series adds the following support to the iProc I2C driver:
>> - Increase maximum read transfer size to 255 bytes
>> - I2C slave mode
>> - Polling mode
>> - NIC I2C mode
>>
>> This patch series is based on kernel v5.1-rc3 and available at:
>> https://github.com/Broadcom/arm64-linux.git
>> branch: i2c-slave-v6
>>
>> Changes from v5:
>>  - Address various comments from Wolfram
> 
> In the future, please write in detail what you changed. I review so many
> patches that I can't recall all my comments on every patch.
> 
> That being said, all patches applied to for-next, thanks!

OK, I will drop patch #9 from my queue then, thanks.

> 
> Can be fixed incrementally, my code checkers complain about:
> 
>     CPPCHECK
> drivers/i2c/busses/i2c-bcm-iproc.c:720:14: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
>     val |= 1 << M_TX_WR_STATUS_SHIFT;
>              ^
> drivers/i2c/busses/i2c-bcm-iproc.c:847:13: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
>  val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
>             ^
> drivers/i2c/busses/i2c-bcm-iproc.c:998:13: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
>  val &= ~(1 << TIM_CFG_MODE_400_SHIFT);
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Wolfram Sang April 4, 2019, 6:16 a.m. UTC | #4
On Wed, Apr 03, 2019 at 03:20:14PM -0700, Florian Fainelli wrote:
> On 4/3/19 1:44 PM, Wolfram Sang wrote:
> > On Tue, Apr 02, 2019 at 06:18:21PM -0700, Ray Jui wrote:
> >> This patch series adds the following support to the iProc I2C driver:
> >> - Increase maximum read transfer size to 255 bytes
> >> - I2C slave mode
> >> - Polling mode
> >> - NIC I2C mode
> >>
> >> This patch series is based on kernel v5.1-rc3 and available at:
> >> https://github.com/Broadcom/arm64-linux.git
> >> branch: i2c-slave-v6
> >>
> >> Changes from v5:
> >>  - Address various comments from Wolfram
> > 
> > In the future, please write in detail what you changed. I review so many
> > patches that I can't recall all my comments on every patch.
> > 
> > That being said, all patches applied to for-next, thanks!
> 
> OK, I will drop patch #9 from my queue then, thanks.

Sorry, I meant patches 1-8 applied, assuming patch 9 was already taken.
I usually don't pick up DTS patches, so I'd be happy if you could keep
#9 in your tree.
Florian Fainelli April 4, 2019, 4:28 p.m. UTC | #5
On 4/3/19 11:16 PM, Wolfram Sang wrote:
> On Wed, Apr 03, 2019 at 03:20:14PM -0700, Florian Fainelli wrote:
>> On 4/3/19 1:44 PM, Wolfram Sang wrote:
>>> On Tue, Apr 02, 2019 at 06:18:21PM -0700, Ray Jui wrote:
>>>> This patch series adds the following support to the iProc I2C driver:
>>>> - Increase maximum read transfer size to 255 bytes
>>>> - I2C slave mode
>>>> - Polling mode
>>>> - NIC I2C mode
>>>>
>>>> This patch series is based on kernel v5.1-rc3 and available at:
>>>> https://github.com/Broadcom/arm64-linux.git
>>>> branch: i2c-slave-v6
>>>>
>>>> Changes from v5:
>>>>  - Address various comments from Wolfram
>>>
>>> In the future, please write in detail what you changed. I review so many
>>> patches that I can't recall all my comments on every patch.
>>>
>>> That being said, all patches applied to for-next, thanks!
>>
>> OK, I will drop patch #9 from my queue then, thanks.
> 
> Sorry, I meant patches 1-8 applied, assuming patch 9 was already taken.
> I usually don't pick up DTS patches, so I'd be happy if you could keep
> #9 in your tree.

Now applied and pushed out, not a problem, thanks!