Alexandre reported a bug in the loopback rmmod path subsequent to a failure
in gb_pm_runtime_get_sync - something that can happen when you are
developing device-side firmware easily. Doing some cursory rmmod testing on
gb_loopback then showed a second (and long standing) error pertaining to
removal of gb_dev.root.
This series fixes both issues.
Bryan O'Donoghue (2):
staging: greybus: loopback: fix gb_pm_runtime_get_sync error handling
staging: greybus: loopback: fix oops on rmmod gb_loopback
drivers/staging/greybus/loopback.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--
2.7.4
From: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
The Greybus driver subsystem has a mailing list, so list it in the
MAINTAINERS file so that people know to send patches there as well.
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index cfff2c9e3d94..f6cb07684cea 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5504,6 +5504,7 @@ M: Alex Elder <elder(a)kernel.org>
M: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
S: Maintained
F: drivers/staging/greybus/
+L: greybus-dev(a)lists.linaro.org
GREYBUS AUDIO PROTOCOLS DRIVERS
M: Vaibhav Agarwal <vaibhav.sr(a)gmail.com>
Add sanity checks for cport_quiesce and cport_clear before invoking the
callbacks as these function pointers are not required during the host
device registration. This follows the logic implemented elsewhere for
various other function pointers.
Signed-off-by: Jason Hrycay <jhrycay(a)gmail.com>
---
drivers/staging/greybus/connection.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 833f83b..aa040b1 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -358,6 +358,9 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection)
size_t peer_space;
int ret;
+ if (!hd->driver->cport_quiesce)
+ return 0;
+
peer_space = sizeof(struct gb_operation_msg_hdr) +
sizeof(struct gb_cport_shutdown_request);
@@ -381,6 +384,9 @@ static int gb_connection_hd_cport_clear(struct gb_connection *connection)
struct gb_host_device *hd = connection->hd;
int ret;
+ if (!hd->driver->cport_clear)
+ return 0;
+
ret = hd->driver->cport_clear(hd, connection->hd_cport_id);
if (ret) {
dev_err(&hd->dev, "%s: failed to clear host cport: %d\n",
--
2.10.0
Two simple patches here resulting from using greybus on gbsim and
developing support for async. I found a bug in the user-space tool and
while doing that decided to update the kernel thread to be better behaved
when waiting for test completions.
V2:
Use available bundle pointer for dev_dbg printout - Johan
Bryan O'Donoghue (2):
staging: greybus: loopback: use gb_loopback_async_wait_all don't spin
staging: greybus: loopback_test: Fix race preventing test completion
drivers/staging/greybus/loopback.c | 11 +++++++++++
drivers/staging/greybus/tools/loopback_test.c | 10 +---------
2 files changed, 12 insertions(+), 9 deletions(-)
--
2.7.4
V2:
Scotty : "What are you standing around for - do you not know a jailbreak
when you see one" ?
Making sure to run format-patch against the right tree this time..
Updated meta-comments to highlight adding a generic async timeout - Johan
Captured the result code of schedule_work/queue_work - Bryan
Drop reference count on failure to submit schedule_work/queue_work - Bryan
Added timeout suffix back to new gb_operation_request_send - Johan/Greg
Updated Signed-off-by to my nexus-software.ie address - Bryan
Iterated requisite Star Trek Quote - Bryan/Johan
V4-private -> V1-public:
McCOY: You've got him, Jim! You've got him where you want him.
This patchset adds async operations to greybus-core. Rather than have
different drivers do variations on the same theme of launching and timing
out asynchronous operations, it makes sense instead to provide this
functionality via greybus-core.
This patchset makes it possible to launch asynchronous operations and have
the completion callback for an operation indicate -ETIMEDOUT for timeouts
without drivers having to manage that locally. This set doesn't convert the
existing synchronous operations away from
wait_for_completion_interruptible_timeout() since that would involve adding
an extra work-queue item to each synchronous call, with no added benefit
for synchronous operations. Synchronous operations can already detect
-ETIMEDOUT by blocking on the synchronous send operations, asynchronous
operations and the driver associated with those operations OTOH must
implement a completion handler. The main improvement this patchset makes is
to pass the -ETIMEDOUT completion status into that completion handler -
hiding the setup/timeout of operations away from a driver-level and into a
core-level set of logic.
Loopback as an example can have lots and lots of redundant code removed and
given we previously had some in-flight effort to add asynchronous
operations to SDIO it makes sense to move the generic types of things we
need to do on the asynchronous path into greybus-core so that SDIO and
other bundle drivers can reuse instead of reimplement asynchronous
operations.
Note: we had approximately three internal versions of this on Project-Ara.
Here's the log for completeness.
V3-private -> V4-private:
Fix bug in loopback conversion - Mitch Tasman
V2-private -> V3-private:
remotes/ara-main/sandbox/bodonoghue/ara-main-current+async_op3
Drop patch #6 converting sync operations to new t/o structure. Johan had a
concern about doing an in-depth analysis on that change and considering our
compressed timelines now, this analysis won't happen. OTOH the new async
API is the right thing for loopback and for potential later greybus
users/implementers to reuse.
Although it wasn't part of the motive for this change - I observe slightly
better performance than baseline with loopback tests with this change in
place - which shouldn't be surprising since we have less aggregate context
switching for operation timeouts.
V1-private -> V2-private:
Rename async_private => private - Greg
gb_operation_request_send_async_timeout ->
gb_operation_request_send_async() - Greg
Using existing gb_operation_completion_wq - Viresh
Split out gb_operation_cancel() - timeout need not wait synchronously on
cancellation queue - Bryan
Move timeout to work-queue - Greg/Viresh
cancel timeout workqueue @ operation completion point - Viresh/Bryan
Bryan O'Donoghue (5):
staging: greybus: operation: add asynchronous gb_operation_cancel
staging: greybus: operation: add generic asynchronous timeout
operation support
staging: greybus: operation: add private data with get/set accessors
staging: greybus: loopback: convert loopback to use generic async
operations
staging: greybus: loopback: convert to use msecs internally
drivers/staging/greybus/loopback.c | 181 ++++++++----------------------------
drivers/staging/greybus/operation.c | 85 ++++++++++++++++-
drivers/staging/greybus/operation.h | 19 ++++
3 files changed, 140 insertions(+), 145 deletions(-)
--
2.7.4