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] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Feb 2009 16:58:07 +0100
From:	Pierre Ossman <drzeus@...eus.cx>
To:	Anton Vorontsov <avorontsov@...mvista.com>
Cc:	Pierre Ossman <drzeus-sdhci@...eus.cx>,
	Ben Dooks <ben-linux@...ff.org>, Arnd Bergmann <arnd@...db.de>,
	Kumar Gala <galak@...nel.crashing.org>,
	Liu Dave <DaveLiu@...escale.com>, sdhci-devel@...t.drzeus.cx,
	linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org
Subject: Re: [PATCH 03/13] sdhci: Split card-detection IRQs management from
 sdhci_init()

On Fri, 13 Feb 2009 17:47:15 +0300
Anton Vorontsov <avorontsov@...mvista.com> wrote:

> Card detection interrupts should be handled separately as they should
> not be enabled before mmc_add_host() returns and should be disabled
> before calling mmc_remove_host(). The same is for suspend and resume
> routines.
> 
> sdhci_init() no longer enables card-detection irqs. Instead, two new
> functions implemented: sdhci_enable_card_detection() and
> sdhci_disable_card_detection().
> 
> New sdhci_reinit() call implemented to behave the same way as the old
> sdhci_init().
> 
> Also, this patch implements and uses few new helpers to manage IRQs in
> a more conveinient way, that is:
> 
> - sdhci_clear_set_irqs()
> - sdhci_unmask_irqs()
> - sdhci_mask_irqs()
> - SDHCI_INT_ALL_MASK constant
> 
> sdhci_enable_sdio_irq() converted to these new helpers, plus the
> helpers will be used by the subsequent patches.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@...mvista.com>
> ---

That's a lot of indirection, but fair enough. :)

> @@ -1792,6 +1832,8 @@ int sdhci_add_host(struct sdhci_host *host)
>  
>  	mmc_add_host(mmc);
>  
> +	sdhci_enable_card_detection(host);
> +
>  	printk(KERN_INFO "%s: SDHCI controller on %s [%s] using %s%s\n",
>  		mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)),
>  		(host->flags & SDHCI_USE_ADMA)?"A":"",

There is a small race here, but I'm not sure it's worth dealing with.

> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index e907441..45c8309 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -124,6 +124,10 @@
>  		SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \
>  		SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \
>  		SDHCI_INT_DATA_END_BIT)
> +#define SDHCI_INT_ALL_MASK	(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK | \
> +		SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE | \
> +		SDHCI_INT_CARD_INT | SDHCI_INT_ERROR | SDHCI_INT_BUS_POWER | \
> +		SDHCI_INT_ACMD12ERR | SDHCI_INT_ADMA_ERROR)
>  

In the context this is used, why not just use (unsigned)-1?

Rgds
-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ