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]
Message-ID: <3876dea7-cd61-e7cf-e838-8bab6927c8fb@rock-chips.com>
Date:   Fri, 27 Jan 2017 10:05:25 +0800
From:   Shawn Lin <shawn.lin@...k-chips.com>
To:     Gerd Hoffmann <kraxel@...hat.com>,
        linux-rpi-kernel@...ts.infradead.org
Cc:     Stefan Wahren <stefan.wahren@...e.com>,
        Eric Anholt <eric@...olt.net>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        linux-mmc@...r.kernel.org, Florian Fainelli <f.fainelli@...il.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>,
        "maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..." 
        <bcm-kernel-feedback-list@...adcom.com>,
        Stephen Warren <swarren@...dotorg.org>,
        Lee Jones <lee@...nel.org>,
        "moderated list:BROADCOM BCM2835 ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 04/13] mmc: bcm2835: add bcm2835_check_data_error

On 2017/1/27 7:37, Gerd Hoffmann wrote:
> Factor out common code.
>
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
> ---
>  drivers/mmc/host/bcm2835.c | 30 ++++++++++++------------------
>  1 file changed, 12 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
> index 6f9fb12..d25b85a 100644
> --- a/drivers/mmc/host/bcm2835.c
> +++ b/drivers/mmc/host/bcm2835.c
> @@ -951,6 +951,16 @@ static void bcm2835_timeout(unsigned long data)
>  	spin_unlock_irqrestore(&host->lock, flags);
>  }
>
> +static void bcm2835_check_data_error(struct bcm2835_host *host, u32 intmask)
> +{
> +	if (!host->data)
> +		return;
> +	if (intmask & (SDHSTS_CRC16_ERROR | SDHSTS_FIFO_ERROR))
> +		host->data->error = -EILSEQ;
> +	if (intmask & SDHSTS_REW_TIME_OUT)
> +		host->data->error = -ETIMEDOUT;
> +}
> +
>  static void bcm2835_busy_irq(struct bcm2835_host *host, u32 intmask)
>  {
>  	struct device *dev = &host->pdev->dev;
> @@ -1007,15 +1017,7 @@ static void bcm2835_data_irq(struct bcm2835_host *host, u32 intmask)
>  	if (!host->data)
>  		return;
>

remove this check, !host->data, as well.

> -	if (intmask & (SDHSTS_CRC16_ERROR |
> -		       SDHSTS_FIFO_ERROR |
> -		       SDHSTS_REW_TIME_OUT)) {
> -		if (intmask & (SDHSTS_CRC16_ERROR |
> -			       SDHSTS_FIFO_ERROR))
> -			host->data->error = -EILSEQ;
> -		else
> -			host->data->error = -ETIMEDOUT;
> -	}
> +	bcm2835_check_data_error(host, intmask);
>
>  	if (host->data->error) {
>  		bcm2835_finish_data(host);
> @@ -1043,15 +1045,7 @@ static void bcm2835_block_irq(struct bcm2835_host *host, u32 intmask)
>  		return;
>  	}
>
> -	if (intmask & (SDHSTS_CRC16_ERROR |
> -		       SDHSTS_FIFO_ERROR |
> -		       SDHSTS_REW_TIME_OUT)) {
> -		if (intmask & (SDHSTS_CRC16_ERROR |
> -			       SDHSTS_FIFO_ERROR))
> -			host->data->error = -EILSEQ;
> -		else
> -			host->data->error = -ETIMEDOUT;
> -	}
> +	bcm2835_check_data_error(host, intmask);
>
>  	if (!host->dma_desc) {
>  		WARN_ON(!host->blocks);
>


-- 
Best Regards
Shawn Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ