aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-11-14 22:34:09 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-12-02 15:59:50 -0500
commit7dd09a1af2c7150269350aaa567a11b06e831003 (patch)
treed471de024c220174132915ba2f38a7d63dcd2462 /drivers/usb/host/xhci-ring.c
parente8b373326d8efcaf9ec1da8b618556c89bd5ffc4 (diff)
xhci: replace xhci_write_64() with writeq()
Function xhci_write_64() is used to write 64bit xHC registers residing in MMIO. On 32bit systems, xHC registers need to be written with 32bit accesses by writing first the lower 32bits and then the higher 32bits. The header file asm-generic/io-64-nonatomic-lo-hi.h ensures that on 32bit systems writeq() will will write 64bit registers in 32bit chunks with low-high order. Replace all calls to xhci_write_64() with calls to writeq(). This is done to reduce code duplication since 64bit low-high write logic is already implemented and to take advantage of inherent "atomic" 64bit write operations on 64bit systems. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 339733b8524a..fe9208a5d103 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -319,8 +319,7 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci)
319 return 0; 319 return 0;
320 } 320 }
321 xhci->cmd_ring_state = CMD_RING_STATE_ABORTED; 321 xhci->cmd_ring_state = CMD_RING_STATE_ABORTED;
322 xhci_write_64(xhci, temp_64 | CMD_RING_ABORT, 322 writeq(temp_64 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring);
323 &xhci->op_regs->cmd_ring);
324 323
325 /* Section 4.6.1.2 of xHCI 1.0 spec says software should 324 /* Section 4.6.1.2 of xHCI 1.0 spec says software should
326 * time the completion od all xHCI commands, including 325 * time the completion od all xHCI commands, including
@@ -2872,8 +2871,7 @@ hw_died:
2872 * the event ring should be empty. 2871 * the event ring should be empty.
2873 */ 2872 */
2874 temp_64 = readq(&xhci->ir_set->erst_dequeue); 2873 temp_64 = readq(&xhci->ir_set->erst_dequeue);
2875 xhci_write_64(xhci, temp_64 | ERST_EHB, 2874 writeq(temp_64 | ERST_EHB, &xhci->ir_set->erst_dequeue);
2876 &xhci->ir_set->erst_dequeue);
2877 spin_unlock(&xhci->lock); 2875 spin_unlock(&xhci->lock);
2878 2876
2879 return IRQ_HANDLED; 2877 return IRQ_HANDLED;
@@ -2900,7 +2898,7 @@ hw_died:
2900 2898
2901 /* Clear the event handler busy flag (RW1C); event ring is empty. */ 2899 /* Clear the event handler busy flag (RW1C); event ring is empty. */
2902 temp_64 |= ERST_EHB; 2900 temp_64 |= ERST_EHB;
2903 xhci_write_64(xhci, temp_64, &xhci->ir_set->erst_dequeue); 2901 writeq(temp_64, &xhci->ir_set->erst_dequeue);
2904 2902
2905 spin_unlock(&xhci->lock); 2903 spin_unlock(&xhci->lock);
2906 2904