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:	Mon, 8 Sep 2008 14:46:56 +0100
From:	Ben Dooks <ben-linux@...ff.org>
To:	Christer Weinigel <christer@...nigel.se>
Cc:	ben-linux@...ff.org, linux-kernel@...r.kernel.org
Subject: Re: [patch 2/3] s3cmci - call pio_tasklet from IRQ

On Mon, Sep 08, 2008 at 02:48:50PM +0200, Christer Weinigel wrote:
> Scheduling a tasklet to perform the pio transfer introduces a bit of
> extra processing, just call pio_tasklet directly from the interrupt
> instead.  Writing up to 64 bytes to a FIFO is probably uses less CPU
> than scheduling a tasklet anyway.

Hmm, i'd be interested to find out how long these are taking... I might
try and rig up something to test the time being taken via an SMDK.

If the fifo read/writes are taking significant amounts of time, then the
pio tasklet will at least improve the interrupt latencies invloved, as
iirc we're currently running the main irq handler in IRQ_DISABLED mode
to stop any problems with re-enternancy.... I'll check this and see what
is going on.
 
> Signed-off-by: Christer Weinigel <christer@...nigel.se>
> 
> Index: linux-2.6.26.2/drivers/mmc/host/s3cmci.c
> ===================================================================
> --- linux-2.6.26.2.orig/drivers/mmc/host/s3cmci.c
> +++ linux-2.6.26.2/drivers/mmc/host/s3cmci.c
> @@ -361,11 +361,8 @@ static void do_pio_write(struct s3cmci_h
>  	enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
>  }
>  
> -static void pio_tasklet(unsigned long data)
> +static void pio_tasklet(struct s3cmci_host *host)
>  {
> -	struct s3cmci_host *host = (struct s3cmci_host *) data;
> -
> -
>  	disable_irq(host->irq);
>  
>  	if (host->pio_active == XFER_WRITE)
> @@ -460,10 +457,10 @@ static irqreturn_t s3cmci_irq(int irq, v
>  	if (!host->dodma) {
>  		if ((host->pio_active == XFER_WRITE) &&
>  		    (mci_fsta & S3C2410_SDIFSTA_TFDET)) {
> -
>  			disable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
> -			tasklet_schedule(&host->pio_tasklet);
> +			pio_tasklet(host);
>  			host->status = "pio tx";
> +			goto irq_out;
>  		}
>  
>  		if ((host->pio_active == XFER_READ) &&
> @@ -473,8 +470,9 @@ static irqreturn_t s3cmci_irq(int irq, v
>  				      S3C2410_SDIIMSK_RXFIFOHALF |
>  				      S3C2410_SDIIMSK_RXFIFOLAST);
>  
> -			tasklet_schedule(&host->pio_tasklet);
> +			pio_tasklet(host);
>  			host->status = "pio rx";
> +			goto irq_out;
>  		}
>  	}
>  
> @@ -595,7 +593,7 @@ close_transfer:
>  	host->complete_what = COMPLETION_FINALIZE;
>  
>  	clear_imask(host);
> -	tasklet_schedule(&host->pio_tasklet);
> +	pio_tasklet(host);
>  
>  	goto irq_out;
>  
> @@ -666,7 +664,7 @@ void s3cmci_dma_done_callback(struct s3c
>  	host->complete_what = COMPLETION_FINALIZE;
>  
>  out:
> -	tasklet_schedule(&host->pio_tasklet);
> +	pio_tasklet(host);
>  	spin_unlock_irqrestore(&host->complete_lock, iflags);
>  	return;
>  
> @@ -1198,7 +1196,6 @@ static int __devinit s3cmci_probe(struct
>  	}
>  
>  	spin_lock_init(&host->complete_lock);
> -	tasklet_init(&host->pio_tasklet, pio_tasklet, (unsigned long) host);
>  
>  	if (is2440) {
>  		host->sdiimsk	= S3C2440_SDIIMSK;
> @@ -1381,7 +1378,6 @@ static int __devexit s3cmci_remove(struc
>  
>  	clk_put(host->clk);
>  
> -	tasklet_disable(&host->pio_tasklet);
>  	s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client);
>  
>  	free_irq(host->irq, host);
> Index: linux-2.6.26.2/drivers/mmc/host/s3cmci.h
> ===================================================================
> --- linux-2.6.26.2.orig/drivers/mmc/host/s3cmci.h
> +++ linux-2.6.26.2/drivers/mmc/host/s3cmci.h
> @@ -66,5 +66,4 @@ struct s3cmci_host {
>  	char			*status;
>  
>  	unsigned int		ccnt, dcnt;
> -	struct tasklet_struct	pio_tasklet;
>  };
> 
> -- 
> "Just how much can I get away with and still go to heaven?"
> 
> Christer Weinigel <christer@...nigel.se>  http://www.weinigel.se

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

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