Skip to content

i2c: aspeed: Add bus idle waiting logic for multi-master use cases

Jae Hyun Yoo linux-arm-kernel linux-aspeed linux-devicetree linux-i2c lkml openbmc 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest5 patches 8 repliesIn review
  2. v85 patches 0 repliesSuperseded
  3. v75 patches 10 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v65 patches2 repliesSuperseded
v55 patches3 repliesSuperseded
v43 patches2 repliesSuperseded
v33 patches4 repliesSuperseded
v22 patches0 repliesSuperseded
v1 RFC2 patches8 repliesSuperseded

Changes in v9 from the cover letter

- Fixed a build break when CONFIG_I2C_SLAVE is not set.

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dt-bindings: i2c: Add 'bus-timeout-ms' and '#retries' properties as common optionalDocumentation/devicetree/bindings/i2c/i2c.txt+6 -02 replies
2/5i2c: core: Add support reading of 'bus-timeout-ms' and '#retries' propertiesdrivers/i2c/i2c-core-base.c+10 -20 replies
3/5dt-bindings: i2c: aspeed: Add 'bus-timeout-ms' property as an optional propertyDocumentation/devicetree/bindings/i2c/i2c-aspeed.txt+3 -00 replies
4/5i2c: aspeed: Remove hard-coded bus timeout value settingdrivers/i2c/busses/i2c-aspeed.c+0 -10 replies
5/5i2c: aspeed: Add bus idle waiting logic for multi-master use casesdrivers/i2c/busses/i2c-aspeed.c+40 -154 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchRob HerringBrendan HigginsJoel Stanley
1/5R-b
2/5
3/5R-b R-b
4/5R-b R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v9 thread

Cover letter [PATCH i2c-next v9 0/5] i2c: aspeed: Add bus idle waiting logic for multi-master use cases

In multi-master environment, this driver's master cannot know exactly when a peer master sends data to this driver's slave so a case can be happened that this master tries to send data through the master_xfer function but slave data from peer master is still being processed by this driver. To prevent state corruption in the case, this patch adds checking code if any slave operation is ongoing and it waits up to the bus timeout duration before starting a master_xfer operation.

To support this change, it introduces changes on i2c-core-base to make that able to read the bus timeout and master transfer retries count values from device tree properties.

Please review this patch set.

Thanks,

-Jae

Changes since v8:
- Fixed a build break when CONFIG_I2C_SLAVE is not set.

Changes since v7:
- Simplified the bus idle waiting logic using jiffy based timer APIs.

Changes since v6:
- Changed the 'timeout-ms' property name to 'bus-timeout-ms'.

Changes since v5:
- Changed using of property reading API to device_property_read_u32.

Changes since v4:
- Moved the property reading code into i2c-base-core and changed the property name to 'timeout-ms'. Also, added '#retries' property reading code.
- Changed bus busy checking logic to make that check slave_state instead of 'Transfer Mode State Machine' reg value.

Changes since v3:
- Changed the property name to 'timeout' and made it use the default setting in i2c-core when not specified.

Changes since v2:
- Changed the property name to 'aspeed,timeout' and made it to update the adapter's timeout configuration.

Changes since v1:
- Changed define names of timeout related.

Jae Hyun Yoo (5):
dt-bindings: i2c: Add 'bus-timeout-ms' and '#retries' properties as
common optional
i2c: core: Add support reading of 'bus-timeout-ms' and '#retries'
properties
dt-bindings: i2c: aspeed: Add 'bus-timeout-ms' property as an optional
property
i2c: aspeed: Remove hard-coded bus timeout value setting
i2c: aspeed: Add bus idle waiting logic for multi-master use cases

 .../devicetree/bindings/i2c/i2c-aspeed.txt    |  3 +
 Documentation/devicetree/bindings/i2c/i2c.txt |  6 ++
 drivers/i2c/busses/i2c-aspeed.c               | 56 +++++++++++++------
 drivers/i2c/i2c-core-base.c                   | 12 +++-
 4 files changed, 59 insertions(+), 18 deletions(-)
Signature · 1 line
2.19.1