2017-11-06 01:27:51

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v2 0/4] Convert greybus loopback to core async API

v2:
- Added Reviewed-by Johan for patch #3
- Added fix for mutex hold duration.
Johan mentioned the holding of this across a gb_operation_send() call.
Looking at this it shows a bug that crept in between two commits detailed
in patch#1 here.
- Split a separate bugfix from Mitch which had been squashed into an old
patch from nearly a year ago
- Added Mitch to the cc list
- Depends on Arnd Bermann's patch
"staging: greybus/loopback: use ktime_get() for time intervals"

v1:
dbec27298b0d ('staging: greybus: operation: add generic timeout support')
gives the ability to remove lots of the asynchronous operation code in
loopback.

Kees is also doing a cleanup of timer code which for loopback will go away
when converting to the core API.

These two patches kill two birds with err, two stones (no aggression to
birds intended) namely:

- Converting over to the core asynchronous API
- Getting rid of the timer code in loopback which will unblock what Kees is
doing.

Bryan O'Donoghue (4):
staging: greybus: loopback: Hold per-connection mutex across
operations
staging: greybus: loopback: Fix iteration count on async path
staging: greybus: operation: add private data with get/set accessors
staging: greybus: loopback: convert loopback to use generic async
operations

drivers/staging/greybus/loopback.c | 176 +++++++-----------------------------
drivers/staging/greybus/operation.h | 13 +++
2 files changed, 46 insertions(+), 143 deletions(-)

--
2.7.4


From 1583123998844324674@xxx Sat Nov 04 08:38:17 +0000 2017
X-GM-THRID: 1583123998844324674
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-06 01:27:17

by Bryan O'Donoghue

[permalink] [raw]
Subject: [PATCH v2 2/4] staging: greybus: loopback: Fix iteration count on async path

Commit 12927835d211 ("greybus: loopback: Add asynchronous bi-directional
support") does what it says on the tin - namely, adds support for
asynchronous bi-directional loopback operations.

What it neglects to do though is increment the per-connection
gb->iteration_count on an asynchronous operation error. This patch fixes
that omission.

Fixes: 12927835d211 ("greybus: loopback: Add asynchronous bi-directional support")

Signed-off-by: Bryan O'Donoghue <[email protected]>
Reported-by: Mitch Tasman <[email protected]>
Cc: Johan Hovold <[email protected]>
Cc: Alex Elder <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Mitch Tasman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/staging/greybus/loopback.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 20d1b45..9c5980c 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -1021,8 +1021,10 @@ static int gb_loopback_fn(void *data)
else if (type == GB_LOOPBACK_TYPE_SINK)
error = gb_loopback_async_sink(gb, size);

- if (error)
+ if (error) {
gb->error++;
+ gb->iteration_count++;
+ }
} else {
/* We are effectively single threaded here */
if (type == GB_LOOPBACK_TYPE_PING)
--
2.7.4


From 1583053527599651242@xxx Fri Nov 03 13:58:10 +0000 2017
X-GM-THRID: 1583053527599651242
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread