Some problems about xhci_ring_expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello!
  Thank you for taking the time to look at my question.

  At file xhci-ring.c
static inline int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
                unsigned int num_trbs)
{
        int num_trbs_in_deq_seg;

        if (ring->num_trbs_free < num_trbs)
                return 0;

        if (ring->type != TYPE_COMMAND && ring->type != TYPE_EVENT) {
                num_trbs_in_deq_seg = ring->dequeue - ring->deq_seg->trbs;
                if (ring->num_trbs_free < num_trbs + num_trbs_in_deq_seg)
                        return 0;////suppose return here
        }

        return 1;
}

Suppose the function room_on_ring returns in my bolded condition.
num_trbs_needed will be a very large value because the num_trbs <
num_trbs_free. In this way , we will just double the total ring size.
Is this as expected or should add one segment size instead?
                num_trbs_needed = num_trbs - ep_ring->num_trbs_free;//
unsigned int num_trbs_needed will be very large value
                if (xhci_ring_expansion(xhci, ep_ring, num_trbs_needed,
                                        mem_flags)) {
                        xhci_err(xhci, "Ring expansion failed\n");
                        return -ENOMEM;
                }



BR
Chao.Zeng



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux