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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20180729222248.27180-1-tsotsos@gmail.com>
Date:   Mon, 30 Jul 2018 01:22:48 +0300
From:   Georgios Tsotsos <tsotsos@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Georgios Tsotsos <tsotsos@...il.com>,
        Aaro Koskinen <aaro.koskinen@....fi>,
        James Hogan <jhogan@...nel.org>, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v5] Staging: octeon-usb: Changes macro CVMX_WAIT_FOR_FIELD32 to function call

Replacing CVMX_WAIT_FOR_FIELD32 macro with equivalent function, and used
simpler approach for new function's parameters.

Signed-off-by: Georgios Tsotsos <tsotsos@...il.com>
---
v3: Changed CVMX_WAIT_FOR_FIELD32 macro to function according as refereed in
commit message and suggested by Greg Kroah-Hartman
v4: Added patch version text
v5: Fix parameters issue and simplify new function.

 drivers/staging/octeon-usb/octeon-hcd.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index edf87d1b3609..c9fbff93bed4 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -574,18 +574,15 @@ static inline int cvmx_usb_get_data_pid(struct cvmx_usb_pipe *pipe)
  * Loop through register until txfflsh or rxfflsh become zero.
  *
  * @usb:           USB block
- * @address:       64bit address to read
- * @timeout_usec:  Timeout
  * @fflsh_type:    Indicates fflsh type, 0 for txfflsh, 1 for rxfflsh
  *
  */
-static int cvmx_wait_for_field32(struct octeon_hcd *usb, u64 address,
-				 u64 timeout_usec, int fflsh_type)
+static int cvmx_wait_tx_rx(struct octeon_hcd *usb, int fflsh_type)
 {
 	int result;
-	u64 done = cvmx_get_cycle() + timeout_usec *
+	u64 address = CVMX_USBCX_GRSTCTL(usb->index);
+	u64 done = cvmx_get_cycle() + 100 *
 		   (u64)octeon_get_clock_rate / 1000000;
-
 	union cvmx_usbcx_grstctl c;
 
 	while (1) {
@@ -648,9 +645,9 @@ static void cvmx_fifo_setup(struct octeon_hcd *usb)
 	/* Flush all FIFOs */
 	USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfnum, 0x10);
 	USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfflsh, 1);
-	cvmx_wait_for_field32(usb, address, 0, 100);
+	cvmx_wait_tx_rx(usb, 0);
 	USB_SET_FIELD32(address, cvmx_usbcx_grstctl, rxfflsh, 1);
-	cvmx_wait_for_field32(usb, address, 1, 100);
+	cvmx_wait_tx_rx(usb, 1);
 }
 
 /**
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ