Changeset 3d8a3bd in mainline


Ignore:
Timestamp:
2017-08-20T19:12:12Z (7 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6da6039
Parents:
decfc8d1
Message:

Fixed the issue that cause waiting for command completion in alloc_dev to timeout with a quick hotfix, this

Location:
uspace/drv/bus/usb/xhci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hc.c

    rdecfc8d1 r3d8a3bd  
    402402}
    403403
    404 static void hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb)
     404static void hc_handle_event(xhci_hc_t *hc, xhci_trb_t *trb, xhci_interrupter_regs_t *intr)
    405405{
    406406        usb_log_debug2("TRB event encountered.");
     
    410410                break;
    411411        case XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT:
     412                /**
     413                 * TODO: This is a very crude hotfix, I'm not sure if
     414                 *       we can do this one level above in the event handling
     415                 *       loop (incase the xHC adds more events while we process events).
     416                 */
     417                hc->event_ring.dequeue_ptr = host2xhci(64, addr_to_phys(hc->event_ring.dequeue_trb));
     418                uint64_t erdp = hc->event_ring.dequeue_ptr;
     419                XHCI_REG_WR(intr, XHCI_INTR_ERDP_LO, LOWER32(erdp));
     420                XHCI_REG_WR(intr, XHCI_INTR_ERDP_HI, UPPER32(erdp));
     421                XHCI_REG_SET(intr, XHCI_INTR_ERDP_EHB, 1);
    412422                xhci_handle_port_status_change_event(hc, trb);
    413423                break;
     
    430440                                        xhci_trb_str_type(TRB_TYPE(trb)));
    431441
    432                         hc_handle_event(hc, &trb);
     442                        hc_handle_event(hc, &trb, intr);
    433443                } else {
    434444                        usb_log_warning("Error while accessing event ring: %s", str_error(err));
  • uspace/drv/bus/usb/xhci/trb_ring.c

    rdecfc8d1 r3d8a3bd  
    121121int xhci_trb_ring_fini(xhci_trb_ring_t *ring)
    122122{
     123        if (!ring)
     124                return EOK;
     125
    123126        list_foreach(ring->segments, segments_link, trb_segment_t, segment)
    124127                dmamem_unmap_anonymous(segment);
Note: See TracChangeset for help on using the changeset viewer.