All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] i2c-designware: Add support for AMD PSP semaphore
@ 2022-02-08 14:12 Jan Dabros
  2022-02-08 14:12 ` [PATCH v4 1/2] i2c: designware: Add missing locks Jan Dabros
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Jan Dabros @ 2022-02-08 14:12 UTC (permalink / raw)
  To: linux-kernel, linux-i2c, jarkko.nikula, andriy.shevchenko
  Cc: mika.westerberg, hdegoede, wsa, rrangel, mw, jaz, upstream,
	thomas.lendacky, alexander.deucher, Nimesh.Easow,
	mario.limonciello, jsd, kernel test robot

This patchset comprises support for new i2c-designware controller setup on some
AMD Cezanne SoCs, where x86 is sharing i2c bus with PSP. PSP uses the same
controller and acts as an i2c arbitrator there (x86 is leasing bus from it).

First commit aims to improve generic i2c-designware code by adding extra locking
on probe() and disable() paths. I would like to ask someone with access to
boards which use Intel BayTrail(CONFIG_I2C_DESIGNWARE_BAYTRAIL) to verify
behavior of my changes on such setup.

Second commit adds support for new PSP semaphore arbitration mechanism.
Implementation is similar to the one from i2c-designware-baytrail.c however
there are two main differences:
1) Add new ACPI ID in order to protect against silent binding of the old driver
to the setup with PSP semaphore. Extra flag ARBITRATION_SEMAPHORE added to this
new _HID allows to recognize setup with PSP.
2) Beside acquire_lock() and release_lock() methods we are also applying quirks
to the lock_bus() and unlock_bus() global adapter methods. With this in place
all i2c clients drivers may lock i2c bus for a desired number of i2c
transactions (e.g. write-wait-read) without being aware of that such bus is
shared with another entity.

This patchset is a follow-up to the RFC sent earlier on LKML [1], with review
comments applied.

Looking forward to some feedback.

[1] https://lkml.org/lkml/2021/12/22/219

v3->v4:
* Remove unnecessary alignment of psp_i2c_req
* Add missing bits.h header
* Make use of USEC_PER_MSEC
* Simplify `if` conditions with unsigned variables
* Add additional comments

v2 -> v3:
* Change X86_64 Kconfig dependency to X86_MSR
* Switch from phys_addr_t to u64 in mailbox struct definition
* Remove redundant guard in semaphores' probes
* Add comments about error propagation
* Move credits for kernel test robot into changelog

v1 -> v2:
* Remove usage of unions
* Get rid of unnecessary __packed attributes
* Switch to use iopoll.h and bitfields.h APIs were applicable
* Follow the convention to check for the error first
* Reorder entries (includes, table entries) alphabetically
* Add necessary includes
* Add Kconfig dependency on X86_64
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
* Modify probe() to use terminating entry for traversing through table
  instead of ARRAY_SIZE
* Fix typos in comments
* Rebase patchset

Jan Dabros (2):
  i2c: designware: Add missing locks
  i2c: designware: Add AMD PSP I2C bus support

 MAINTAINERS                                  |   1 +
 drivers/acpi/acpi_apd.c                      |   7 +-
 drivers/i2c/busses/Kconfig                   |  11 +
 drivers/i2c/busses/Makefile                  |   1 +
 drivers/i2c/busses/i2c-designware-amdpsp.c   | 394 +++++++++++++++++++
 drivers/i2c/busses/i2c-designware-baytrail.c |  12 +-
 drivers/i2c/busses/i2c-designware-common.c   |  12 +
 drivers/i2c/busses/i2c-designware-core.h     |  18 +-
 drivers/i2c/busses/i2c-designware-master.c   |   6 +
 drivers/i2c/busses/i2c-designware-platdrv.c  |  60 +++
 10 files changed, 510 insertions(+), 12 deletions(-)
 create mode 100644 drivers/i2c/busses/i2c-designware-amdpsp.c

-- 
2.35.0.263.gb82422642f-goog


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

end of thread, other threads:[~2022-02-11  9:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 14:12 [PATCH v4 0/2] i2c-designware: Add support for AMD PSP semaphore Jan Dabros
2022-02-08 14:12 ` [PATCH v4 1/2] i2c: designware: Add missing locks Jan Dabros
2022-02-09 15:01   ` Jarkko Nikula
2022-02-09 15:23   ` Andy Shevchenko
2022-02-10 22:08   ` Wolfram Sang
2022-02-10 23:05     ` Jan Dąbroś
2022-02-08 14:12 ` [PATCH v4 2/2] i2c: designware: Add AMD PSP I2C bus support Jan Dabros
2022-02-09 15:27   ` Andy Shevchenko
2022-02-10  8:18     ` Jan Dąbroś
2022-02-10 14:43       ` Jarkko Nikula
2022-02-10 15:04         ` Jan Dąbroś
2022-02-10 22:09   ` Wolfram Sang
2022-02-10 23:05     ` Jan Dąbroś
2022-02-11  9:56       ` Wolfram Sang
2022-02-09 15:11 ` [PATCH v4 0/2] i2c-designware: Add support for AMD PSP semaphore Jarkko Nikula
2022-02-10  8:13   ` Jan Dąbroś

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.