lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1378138922.1953.73.camel@joe-AO722>
Date:	Mon, 02 Sep 2013 09:22:02 -0700
From:	Joe Perches <joe@...ches.com>
To:	Gerd Hoffmann <kraxel@...hat.com>
Cc:	linux-usb@...r.kernel.org,
	Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/5] xhci: fix usb3 streams

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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ