lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180918004732.9875-13-dmitry.torokhov@gmail.com>
Date:   Mon, 17 Sep 2018 17:47:25 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     linux-input@...r.kernel.org, Tim Schumacher <timschumi@....de>
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH 13/20] Input: iforce - signal command completion from transport code

Signalling command completion from iforce_process_packet() does
not make sense, as not all transport use the same data path for
both commands and motion data form the device, that is why USB
code already has to signal command completion iforce_usb_out().

Let's move signalling completion into individual transport
modules.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
 drivers/input/joystick/iforce/iforce-packets.c | 2 --
 drivers/input/joystick/iforce/iforce-serio.c   | 9 ++++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 35b7a5206977..c0a665961c23 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -172,8 +172,6 @@ void iforce_process_packet(struct iforce *iforce,
 	struct input_dev *dev = iforce->dev;
 	int i, j;
 
-	wake_up(&iforce->wait);
-
 	if (!iforce->type)
 		return;
 
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c
index f8bf7d2aa59f..0dd95d145e85 100644
--- a/drivers/input/joystick/iforce/iforce-serio.c
+++ b/drivers/input/joystick/iforce/iforce-serio.c
@@ -169,10 +169,13 @@ static irqreturn_t iforce_serio_irq(struct serio *serio,
 			iforce->ecmd = (iforce_serio->id << 8) |
 					iforce_serio->idx;
 			memcpy(iforce->edata, iforce->data, IFORCE_MAX_LENGTH);
-		}
 
-		iforce_process_packet(iforce, iforce_serio->id,
-				      iforce->data, iforce_serio->len);
+			/* Signal that command is done */
+			wake_up(&iforce->wait);
+		} else {
+			iforce_process_packet(iforce, iforce_serio->id,
+					      iforce->data, iforce_serio->len);
+		}
 
 		iforce_serio->pkt = 0;
 		iforce_serio->id  = 0;
-- 
2.19.0.397.gdd90340f6a-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ