aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2013-08-01 14:53:36 +0530
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-06 16:00:29 +1000
commit3a83de22bea75033af72ab6b5b6344ca893f0bbe (patch)
tree7d42f364b2f14ad70dcf9e60b5d65f5dc77922dd /lib
parent67dafd87d2a0a89bed786b19819b3ee1e714a785 (diff)
downloadSLOF-3a83de22bea75033af72ab6b5b6344ca893f0bbe.zip
SLOF-3a83de22bea75033af72ab6b5b6344ca893f0bbe.tar.gz
SLOF-3a83de22bea75033af72ab6b5b6344ca893f0bbe.tar.bz2
usb-ohci: add missing memory barriers
* Start the control/bulk processing after ed is written * Clear the content of control_head_ed and bulk_head_ed once done using them. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libusb/usb-ohci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libusb/usb-ohci.c b/lib/libusb/usb-ohci.c
index c40bbea..9a7cb73 100644
--- a/lib/libusb/usb-ohci.c
+++ b/lib/libusb/usb-ohci.c
@@ -424,6 +424,7 @@ static int ohci_send_ctrl(struct usb_pipe *pipe, struct usb_dev_req *req, void *
ohcd = pipe->dev->hcidev->priv;
regs = ohcd->regs;
write_reg32(&regs->cntl_head_ed, ohci_pipe_get_ed_phys(pipe));
+ mb();
write_reg32(&regs->cmd_status, OHCI_CMD_STATUS_CLF);
time = SLOF_GetTimer() + USB_TIMEOUT;
@@ -438,6 +439,9 @@ static int ohci_send_ctrl(struct usb_pipe *pipe, struct usb_dev_req *req, void *
__func__, ed->headp, ed->tailp);
ret = false;
}
+ ed->attr |= cpu_to_le32(EDA_SKIP);
+ mb();
+ write_reg32(&regs->cntl_head_ed, 0);
SLOF_dma_map_out(req_phys, req, sizeof(struct usb_dev_req));
if (datalen)
@@ -513,6 +517,7 @@ static int ohci_transfer_bulk(struct usb_pipe *pipe, void *td_ptr,
regs = ohcd->regs;
ed_phys = ohci_pipe_get_ed_phys(pipe);
write_reg32(&regs->bulk_head_ed, ed_phys);
+ mb();
write_reg32(&regs->cmd_status, 0x4);
time = SLOF_GetTimer() + USB_TIMEOUT;
@@ -527,6 +532,9 @@ static int ohci_transfer_bulk(struct usb_pipe *pipe, void *td_ptr,
__func__, ed->headp, ed->tailp);
ret = false;
}
+ ed->attr |= cpu_to_le32(EDA_SKIP);
+ mb();
+ write_reg32(&regs->bulk_head_ed, 0);
end:
return ret;
}