USB: isp1760: use a write barrier to ensure proper ndelay timing
[firefly-linux-kernel-4.4.55.git] / drivers / usb / host / isp1760-hcd.c
index dbcafa29c7753d9a6a41f46f09cb1ab959a3c7d7..bdba8c5d844aa4ba099e128e1ed5f765d2ae349b 100644 (file)
@@ -482,7 +482,6 @@ static int isp1760_run(struct usb_hcd *hcd)
        u32 chipid;
 
        hcd->uses_new_polling = 1;
-       hcd->poll_rh = 0;
 
        hcd->state = HC_STATE_RUNNING;
        isp1760_enable_interrupts(hcd);
@@ -830,6 +829,7 @@ static void enqueue_an_ATL_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
         * almost immediately. With ISP1761, this register requires a delay of
         * 195ns between a write and subsequent read (see section 15.1.1.3).
         */
+       mmiowb();
        ndelay(195);
        skip_map = isp1760_readl(hcd->regs + HC_ATL_PTD_SKIPMAP_REG);
 
@@ -871,6 +871,7 @@ static void enqueue_an_INT_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
         * almost immediately. With ISP1761, this register requires a delay of
         * 195ns between a write and subsequent read (see section 15.1.1.3).
         */
+       mmiowb();
        ndelay(195);
        skip_map = isp1760_readl(hcd->regs + HC_INT_PTD_SKIPMAP_REG);
 
@@ -1450,7 +1451,7 @@ static int isp1760_prepare_enqueue(struct isp1760_hcd *priv, struct urb *urb,
        epnum = urb->ep->desc.bEndpointAddress;
 
        spin_lock_irqsave(&priv->lock, flags);
-       if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &priv_to_hcd(priv)->flags)) {
+       if (!HCD_HW_ACCESSIBLE(priv_to_hcd(priv))) {
                rc = -ESHUTDOWN;
                goto done;
        }