From 20f6b82992a2500cfc93f41ab0a62105a1440b7d Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Sun, 11 May 2014 14:15:20 +0300 Subject: [PATCH] staging: octeon-usb: use generic prefetch Use generic prefetch. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/octeon-usb/octeon-hcd.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index b0c5f51..98a493a 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -245,9 +246,6 @@ enum cvmx_usb_pipe_flags { __CVMX_USB_PIPE_FLAGS_NEED_PING = 1 << 18, }; -/* Normal prefetch that use the pref instruction. */ -#define CVMX_PREFETCH(address, offset) asm volatile ("pref %[type], %[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (0)) - /* Maximum number of times to retry failed transactions */ #define MAX_RETRIES 3 @@ -2008,7 +2006,7 @@ static struct cvmx_usb_pipe *__cvmx_usb_find_ready_pipe( ((((int)current_frame - (int)pipe->split_sc_frame) & 0x7f) < 0x40)) && (!usb->active_split || (usb->active_split == t))) { - CVMX_PREFETCH(t, 0); + prefetch(t); return pipe; } } @@ -2658,13 +2656,13 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel) /* Make sure this channel is tied to a valid pipe */ pipe = usb->pipe_for_channel[channel]; - CVMX_PREFETCH(pipe, 0); + prefetch(pipe); if (!pipe) return 0; transaction = list_first_entry(&pipe->transactions, typeof(*transaction), node); - CVMX_PREFETCH(transaction, 0); + prefetch(transaction); /* * Disconnect this pipe from the HW channel. Later the schedule @@ -3121,11 +3119,7 @@ static int cvmx_usb_poll(struct cvmx_usb_state *usb) union cvmx_usbcx_hfnum usbc_hfnum; union cvmx_usbcx_gintsts usbc_gintsts; - CVMX_PREFETCH(usb, 0); - CVMX_PREFETCH(usb, 1*128); - CVMX_PREFETCH(usb, 2*128); - CVMX_PREFETCH(usb, 3*128); - CVMX_PREFETCH(usb, 4*128); + prefetch_range(usb, sizeof(*usb)); /* Update the frame counter */ usbc_hfnum.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFNUM(usb->index)); -- 2.7.4