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:	Tue, 30 Mar 2010 11:37:39 -0700
From:	Dan Williams <dcbw@...hat.com>
To:	Daniel Mack <daniel@...aq.de>
Cc:	linux-kernel@...r.kernel.org,
	Alagu Sankar <alagusankar@...wise.com>,
	Volker Ernst <volker.ernst@...r.com>,
	"John W. Linville" <linville@...driver.com>,
	Holger Schurig <hs4233@...l.mn-solutions.de>,
	Bing Zhao <bzhao@...vell.com>,
	libertas-dev@...ts.infradead.org, linux-wireless@...r.kernel.org,
	linux-mmc@...r.kernel.org,
	David Brownell <dbrownell@...rs.sourceforge.net>
Subject: Re: [PATCH] libertas/sdio: set ECSI and SCSI bits for 1-bit
 transfers

On Tue, 2010-03-30 at 19:38 +0200, Daniel Mack wrote:
> When operating in 1-bit mode, SDAT1 is used as dedicated interrupt line.
> However, the 8686 will only drive this line when the ECSI and SCSI bits
> are set in the CCCR_IF register.

While this looks fine enough to me, I don't have enough knowledge of the
SDIO stack to know whether or not this would be considered a layering
violation or not.  Given that I don't think there's an active maintainer
for the SDIO subsystem though, I'd say it's fine enough for me...

Any thoughts David since it appears to be at least somewhat SPI related?

Acked-by: Dan Williams <dcbw@...hat.com>

> Thanks to Alagu Sankar for pointing me in the right direction.
> 
> Signed-off-by: Daniel Mack <daniel@...aq.de>
> Cc: Alagu Sankar <alagusankar@...wise.com>
> Cc: Volker Ernst <volker.ernst@...r.com>
> Cc: Dan Williams <dcbw@...hat.com>
> Cc: John W. Linville <linville@...driver.com>
> Cc: Holger Schurig <hs4233@...l.mn-solutions.de>
> Cc: Bing Zhao <bzhao@...vell.com>
> Cc: libertas-dev@...ts.infradead.org
> Cc: linux-wireless@...r.kernel.org
> Cc: linux-mmc@...r.kernel.org
> ---
>  drivers/net/wireless/libertas/if_sdio.c |   24 ++++++++++++++++++++++++
>  include/linux/mmc/sdio.h                |    2 ++
>  2 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 7a73f62..d3170f2 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -34,6 +34,8 @@
>  #include <linux/mmc/card.h>
>  #include <linux/mmc/sdio_func.h>
>  #include <linux/mmc/sdio_ids.h>
> +#include <linux/mmc/sdio.h>
> +#include <linux/mmc/host.h>
>  
>  #include "host.h"
>  #include "decl.h"
> @@ -942,6 +944,7 @@ static int if_sdio_probe(struct sdio_func *func,
>  	int ret, i;
>  	unsigned int model;
>  	struct if_sdio_packet *packet;
> +	struct mmc_host *host = func->card->host;
>  
>  	lbs_deb_enter(LBS_DEB_SDIO);
>  
> @@ -1022,6 +1025,27 @@ static int if_sdio_probe(struct sdio_func *func,
>  	if (ret)
>  		goto disable;
>  
> +	/* For 1-bit transfers, we need to enable the interrupt flags in
> +	 * the CCCR register. Temporarily set the function number to 0
> +	 * for that. */
> +	if ((host->caps & MMC_CAP_SDIO_IRQ) &&
> +	    (host->ios.bus_width == MMC_BUS_WIDTH_1)) {
> +		unsigned int num = func->num;
> +		u8 reg;
> +
> +		func->num = 0;
> +		reg = sdio_readb(func, SDIO_CCCR_IF, &ret);
> +		if (ret)
> +			goto release_int;
> +
> +		reg |= SDIO_BUS_ECSI | SDIO_BUS_SCSI;
> +		sdio_writeb(func, reg, SDIO_CCCR_IF, &ret);
> +		if (ret)
> +			goto release_int;
> +
> +		func->num = num;
> +	}
> +
>  	card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
>  	if (ret)
>  		goto release_int;
> diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
> index 0ebaef5..329a8fa 100644
> --- a/include/linux/mmc/sdio.h
> +++ b/include/linux/mmc/sdio.h
> @@ -94,6 +94,8 @@
>  
>  #define  SDIO_BUS_WIDTH_1BIT	0x00
>  #define  SDIO_BUS_WIDTH_4BIT	0x02
> +#define  SDIO_BUS_ECSI		0x20	/* Enable continuous SPI interrupt */
> +#define  SDIO_BUS_SCSI		0x40	/* Support continuous SPI interrupt */
>  
>  #define  SDIO_BUS_ASYNC_INT	0x20
>  


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