All of lore.kernel.org
 help / color / mirror / Atom feed
* Some problems about xhci_ring_expansion
@ 2022-11-16  8:46 chao zeng
  2022-11-16 10:06 ` Mathias Nyman
  0 siblings, 1 reply; 2+ messages in thread
From: chao zeng @ 2022-11-16  8:46 UTC (permalink / raw)
  To: mathias.nyman; +Cc: linux-usb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-16 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-16  8:46 Some problems about xhci_ring_expansion chao zeng
2022-11-16 10:06 ` Mathias Nyman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.