On Mon, 2013-09-02 at 13:25 +0200, Gerd Hoffmann wrote:
> xhci maintains a radix tree for each stream endpoint because it must
> be able to map a trb address to the stream ring.  Each ring segment
> must be added to the ring for this to work.  Currently xhci sticks
> only the first segment of each stream ring into the radix tree.
[]
> This patch adds a helper function to update the radix tree.  It can
> both insert and remove ring segments.  It loops over the segment list
> and handles all segments instead of just the first.  It is called
> whenever an update is needed:  When allocating a ring, when expanding
> a ring and when releasing a ring.
[]
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
[]
> @@ -601,6 +609,33 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci,
>   * extended systems (where the DMA address can be bigger than 32-bits),
>   * if we allow the PCI dma mask to be bigger than 32-bits.  So don't do that.
>   */
> +
> +int xhci_update_stream_ring(struct xhci_ring *ring, bool insert)
> +{
> +     struct xhci_segment *seg;
> +     unsigned long key;
> +     bool present;
> +     int ret;
> +
> +     BUG_ON(ring->trb_address_map == NULL);

BUG_ON is really not nice.  Maybe:

        if (WARN_ON_ONCE(ring->trb_address_map == NULL))
                return 0;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to