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]
Date:	Fri, 30 Oct 2015 10:02:47 +0200
From:	Peter Ujfalusi <peter.ujfalusi@...com>
To:	<vinod.koul@...el.com>, <nsekhar@...com>
CC:	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-omap@...r.kernel.org>,
	<dmaengine@...r.kernel.org>, <devicetree@...r.kernel.org>,
	<tony@...mide.com>, <r.schwebel@...gutronix.de>
Subject: Re: [PATCH 1/3] dmaengine: ti-dma-crossbar: dra7: Use bitops instead
 of idr

For the record...

On 10/29/2015 10:28 AM, Peter Ujfalusi wrote:
> The use of idr was nice, but it was a bit heavy and we did not need the
> features it provides. Using simple bitmap to track allocated DMA channels
> is adequate here and it will be easier to add support for reserving
> channels later on.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> -	map->xbar_out = idr_alloc(&xbar->map_idr, NULL, 0, xbar->dma_requests,
> -				  GFP_KERNEL);
> +	mutex_lock(&xbar->mutex);
> +	map->xbar_out = find_next_zero_bit(xbar->dma_inuse, xbar->dma_requests,
> +					   0);

find_first_zero_bit() ;)

> +	mutex_unlock(&xbar->mutex);
> +	if (map->xbar_out) {

Well, this is obviously wrong... Should have been:
	if (map->xbar_out == xbar->dma_requests) {


> +		dev_err(&pdev->dev, "Run out of free DMA requests\n");
> +		kfree(map);
> +		return ERR_PTR(-ENOMEM);
> +	}
> +	set_bit(map->xbar_out, xbar->dma_inuse);
> +

-- 
Péter
--
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