This continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:
commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
This change adds a new WQ_PERCPU flag to explicitly request
alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.
With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND),
any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND
must now use WQ_PERCPU.
Once migration is complete, WQ_UNBOUND can be removed and unbound will
become the implicit default.
Suggested-by: Tejun Heo <tj(a)kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari(a)suse.com>
Reviewed-by: Johan Hovold <johan(a)kernel.org>
---
Changes in v2:
- updated commit log removing two paragraph not strictly related to
the work.
- subject changed removing "drivers/" before the actual prefix.
---
drivers/greybus/operation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/greybus/operation.c b/drivers/greybus/operation.c
index 54ccc434a1f7..7e12ffb2dd60 100644
--- a/drivers/greybus/operation.c
+++ b/drivers/greybus/operation.c
@@ -1238,7 +1238,7 @@ int __init gb_operation_init(void)
goto err_destroy_message_cache;
gb_operation_completion_wq = alloc_workqueue("greybus_completion",
- 0, 0);
+ WQ_PERCPU, 0);
if (!gb_operation_completion_wq)
goto err_destroy_operation_cache;
--
2.51.1
In a classic Greybus topology, there is an application processor, an
SVC, and one or more modules, all connected to a UniPro bus. Most of the
time, as the application processor doesn't have a UniPro interface, it
is actually connected to a device acting as a bridge with the bus, and
this bridge also acts as the SVC.
Sometimes, there is no UniPro bus at all, like for the BeaglePlay, which
has the following topology:
+----+ +------------+ +--------+
| AP | <--- UART ---> | SVC/Bridge | <--- 802.15.4 ---> | Module |
+----+ +------------+ +--------+
|
| +--------+
`------------ 802.15.4 ---> | Module |
+--------+
There are two main interesting aspects with Greybus:
- the SVC protocol to monitor and configure the bus
- other protocols, to expose module peripherals to the host
When the bus has a single module connected directly to the AP, then this
module must also implement the SVC protocol:
+----+ +------------+
| AP | <--- bus ---> | SVC/Module |
+----+ +------------+
The SVC doesn' really serve a purpose here, as there is no bus to
manage, and adding its support only increase the complexity and the code
size needed on memory-constrained devices.
The goal of this patchset is to let a single module expose some Greybus
protocols without requiring the module to also implement SVC protocol.
We call this mode "Point-To-Point". There are three main notable facts
with the implementation of this patchset:
- most of the time, what this patchet does is just skipping calls that
issue commands to the SVC, as they are not applicable without an SVC
- CPort ID allocation is a bit different as there is no SVC/Bridge to
do translation between AP address space and interface address space,
so the patchset forces allocation of AP CPort IDs that matches the
ones found in interface's manifest
- enumeration of a module is normally started by a "Module Inserted"
event issued by the SVC. As the SVC is absent, the host device
driver must manually call a function to start the enumeration
We tested this patchset with the gb-beagleplay driver, slightly tweaked
to only keep the HLDC over UART part of the driver, connected over UART
to an EFR32MG24 running BeagleBoard's implementation of Greybus-Zephyr [1].
In the discussion to integrate this module into Zephyr [2] (it's
currently as separate module not part of the main Zephyr code base),
there seems to be interest in being able to have a single-node
device on the bus without SVC [3]. If some features that were
implemented by the SVC are missing, we can consider adding more
callbacks to the gb_hd_driver structure at a later time, and let drivers
decide how they want to support these features.
[1] https://github.com/beagleboard/greybus-zephyr
[2] https://github.com/zephyrproject-rtos/zephyr/issues/98259
[3] https://github.com/zephyrproject-rtos/zephyr/issues/98259#issuecomment-3561…
Damien Riégel (8):
greybus: add P2P interface type
greybus: let gb_interface_create take additional p2p argument
greybus: force CPort ID allocation in P2P mode
greybus: split module creation function
greybus: add function create module in P2P mode
greybus: make host API work without SVC
greybus: add function to create SVC-less host device
greybus: add function to probe p2p module
drivers/greybus/connection.c | 15 ++++--
drivers/greybus/hd.c | 80 +++++++++++++++++++++++++++----
drivers/greybus/interface.c | 72 ++++++++++++++++++++--------
drivers/greybus/module.c | 55 ++++++++++++++++++---
include/linux/greybus/hd.h | 6 +++
include/linux/greybus/interface.h | 4 +-
include/linux/greybus/module.h | 1 +
7 files changed, 193 insertions(+), 40 deletions(-)
--
2.49.0
Hi,
This patchset brings support for Silicon Labs' Co-Processor
Communication (CPC) protocol as transport layer for Greybus. This is
introduced as a module that sits between Greybus and CPC Host Device
Drivers implementations, like SDIO or SPI. This patchset includes SDIO
as physical layer but the protocol is not final and might change, it's
mostly there to showcase all the elements.
+----------------------------------------------------+
| Greybus |
+----------------------------------------------------+
/|\
|
\|/
+----------------------------------------------------+
| CPC |
+----------------------------------------------------+
/|\ /|\ /|\
| | |
\|/ \|/ \|/
+----------+ +---------+ +-----------+
| SDIO | | SPI | | Others |
+----------+ +---------+ +-----------+
CPC implements some of the features of Unipro that Greybus relies upon,
like reliable transmission. CPC takes care of detecting transmission
errors and retransmit frames if necessary, but that feature is not part
of the RFC to keep it concise. There's also a flow-control
feature, preventing sending messages to already full cports.
In order to implement these features, a 4-byte header is prepended to
Greybus messages, making the whole header 12 bytes (Greybus header
itself is 8 bytes).
This RFC starts by implementing a shim layer between physical bus
drivers (like SDIO and SPI) and Greybus, and progressively add more
elements to it to make it useful in its own right. Finally, an SDIO
driver is added to enable the communication with a remote device.
Changes since the RFC:
- added missing Signed-off-by on one commit
- added SDIO driver to give a full example
Damien Riégel (13):
greybus: cpc: add minimal CPC Host Device infrastructure
greybus: cpc: introduce CPC cport structure
greybus: cpc: use socket buffers instead of gb_message in TX path
greybus: cpc: pack cport ID in Greybus header
greybus: cpc: switch RX path to socket buffers
greybus: cpc: introduce CPC header structure
greybus: cpc: account for CPC header size in RX and TX path
greybus: cpc: add and validate sequence numbers
greybus: cpc: acknowledge all incoming messages
greybus: cpc: use holding queue instead of sending out immediately
greybus: cpc: honour remote's RX window
greybus: cpc: let host device drivers dequeue TX frames
greybus: cpc: add private data pointer in CPC Host Device
Gabriel Beaulieu (1):
greybus: cpc: add CPC SDIO host driver
MAINTAINERS | 6 +
drivers/greybus/Kconfig | 2 +
drivers/greybus/Makefile | 2 +
drivers/greybus/cpc/Kconfig | 22 ++
drivers/greybus/cpc/Makefile | 9 +
drivers/greybus/cpc/cpc.h | 75 +++++
drivers/greybus/cpc/cport.c | 107 +++++++
drivers/greybus/cpc/header.c | 146 +++++++++
drivers/greybus/cpc/header.h | 55 ++++
drivers/greybus/cpc/host.c | 313 +++++++++++++++++++
drivers/greybus/cpc/host.h | 63 ++++
drivers/greybus/cpc/protocol.c | 167 ++++++++++
drivers/greybus/cpc/sdio.c | 554 +++++++++++++++++++++++++++++++++
13 files changed, 1521 insertions(+)
create mode 100644 drivers/greybus/cpc/Kconfig
create mode 100644 drivers/greybus/cpc/Makefile
create mode 100644 drivers/greybus/cpc/cpc.h
create mode 100644 drivers/greybus/cpc/cport.c
create mode 100644 drivers/greybus/cpc/header.c
create mode 100644 drivers/greybus/cpc/header.h
create mode 100644 drivers/greybus/cpc/host.c
create mode 100644 drivers/greybus/cpc/host.h
create mode 100644 drivers/greybus/cpc/protocol.c
create mode 100644 drivers/greybus/cpc/sdio.c
--
2.49.0
The pwm.c driver already uses pwm_ops::apply. This item was completed
in commit 832ce36f44a2 ("staging: greybus: introduce pwm_ops::apply")
but never removed from the TODO list.
Removed the outdated TODO item.
Signed-off-by: Sammy Malik <sammy(a)parkour.is>
---
Changes in v2:
- Added commit reference 832ce36f44a2 that originally implemented pwm_ops::apply
- Fixed typos: PWN -> PWM, pwn_ops -> pwm_ops
drivers/staging/greybus/TODO | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/greybus/TODO b/drivers/staging/greybus/TODO
index 6461e0132fe3..31f1f2cb401c 100644
--- a/drivers/staging/greybus/TODO
+++ b/drivers/staging/greybus/TODO
@@ -1,5 +1,3 @@
* Convert all uses of the old GPIO API from <linux/gpio.h> to the
GPIO descriptor API in <linux/gpio/consumer.h> and look up GPIO
lines from device tree or ACPI.
-* Make pwm.c use the struct pwm_ops::apply instead of ::config, ::set_polarity,
- ::enable and ::disable.
--
2.52.0
This series fixes some issues with the arche platform drivers probe
function.
A fix for the first issue was sent to the list two months ago, but there
has been no reply to the review feedback given then.
Non of these are tagged for stable backport as very few people should
have the hardware in question and be bothered by this.
Johan
Johan Hovold (3):
staging: greybus: arche-platform: fix coldboot probe error path
staging: greybus: arche-platform: fix memleak on probe failure
staging: greybus: arche-platform: fix OF populate on driver rebind
drivers/staging/greybus/arche-platform.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
--
2.51.2