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:	Thu, 11 Mar 2010 15:39:24 -0800
From:	Kevin Hilman <khilman@...prootsystems.com>
To:	Sudhakar Rajashekhara <sudhakar.raj@...com>
Cc:	linux-kernel@...r.kernel.org,
	davinci-linux-open-source@...ux.davincidsp.com,
	akpm@...ux-foundation.org
Subject: Re: [PATCH] davinci: MMC: Pass number of SG segments as platform data

Sudhakar Rajashekhara <sudhakar.raj@...com> writes:

> On some platforms like DM355, the number of EDMA parameter
> slots available for EDMA_SLOT_ANY usage are few. In such cases,
> if MMC/SD uses 16 slots for each instance of MMC controller,
> then the number of slots available for other modules will be
> very few.
>
> By passing the number of EDMA slots to be used in MMC driver
> from platform data, EDMA slots available for other purposes
> can be controlled.
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@...com>
> ---
>  arch/arm/mach-davinci/include/mach/mmc.h |    3 +++
>  drivers/mmc/host/davinci_mmc.c           |   22 +++++++++++++++-------
>  2 files changed, 18 insertions(+), 7 deletions(-)
>

[...]

> @@ -1202,6 +1206,10 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
>  
>  	init_mmcsd_host(host);
>  
> +	host->nr_sg = pdata->nr_sg - 1;

If a board doesn't setup pdata->nr_sg it will be zero, leaving
host->nr_sg = -1.

> +	if (host->nr_sg > MAX_NR_SG || host->nr_sg == 0)
> +		host->nr_sg = MAX_NR_SG;

Since host->nr_sg is unsigned, you get lucky and fix it up here, but
for readability, this not too clean and should be more thorough.

Wrapping the above in 'if (pdata->nr_sg)' is a more standard way
of handling optional platform_data paramaters.

Kevin
--
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