All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Martin Dalecki <dalecki@evision-ventures.com>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.13 IDE 52
Date: Sun, 5 May 2002 19:09:30 +0200	[thread overview]
Message-ID: <20020505170930.GG811@suse.de> (raw)
In-Reply-To: <1019549894.1450.41.camel@turbulence.megapathdsl.net> <3CC7E358.8050905@evision-ventures.com> <20020425172508.GK3542@suse.de> <20020425173439.GM3542@suse.de> <aa9qtb$d8a$1@penguin.transmeta.com> <3CD555BD.2010505@evision-ventures.com>

On Sun, May 05 2002, Martin Dalecki wrote:
> - Split up the TCQ UDMA handling stuff in to proper functions. Jens must has
>   been dreaming as he introduced them ;-).

This was pending stuff, and why I wrote that the start command tcq = 1
stuff was a gross hack.

> -		int tcq = 0;
>  
>  		if (!drive->using_dma)
>  			return ide_started;
>  
>  		/* for dma commands we don't set the handler */
> -		if (args->taskfile.command == WIN_WRITEDMA || args->taskfile.command == WIN_WRITEDMA_EXT)
> +		if (args->taskfile.command == WIN_WRITEDMA
> +		 || args->taskfile.command == WIN_WRITEDMA_EXT)
>  			dma_act = ide_dma_write;
> -		else if (args->taskfile.command == WIN_READDMA || args->taskfile.command == WIN_READDMA_EXT)
> +		else if (args->taskfile.command == WIN_READDMA
> +		      || args->taskfile.command == WIN_READDMA_EXT)
>  			dma_act = ide_dma_read;
> -		else if (args->taskfile.command == WIN_WRITEDMA_QUEUED || args->taskfile.command == WIN_WRITEDMA_QUEUED_EXT) {
> -			tcq = 1;
> -			dma_act = ide_dma_write_queued;
> -		} else if (args->taskfile.command == WIN_READDMA_QUEUED || args->taskfile.command == WIN_READDMA_QUEUED_EXT) {
> -			tcq = 1;
> -			dma_act = ide_dma_read_queued;
> -		} else {
> +#ifdef CONFIG_BLK_DEV_IDE_TCQ
> +		else if (args->taskfile.command == WIN_WRITEDMA_QUEUED
> +		      || args->taskfile.command == WIN_WRITEDMA_QUEUED_EXT
> +		      || args->taskfile.command == WIN_READDMA_QUEUED
> +		      || args->taskfile.command == WIN_READDMA_QUEUED_EXT)
> +			return udma_tcq_taskfile(drive, rq);
> +#endif
> +		else {
>  			printk("ata_taskfile: unknown command %x\n", args->taskfile.command);
>  			return ide_stopped;
>  		}
>  
> -		/*
> -		 * FIXME: this is a gross hack, need to unify tcq dma proc and
> -		 * regular dma proc -- basically split stuff that needs to act
> -		 * on a request from things like ide_dma_check etc.
> -		 */
> -		if (tcq)
> -			return drive->channel->udma(dma_act, drive, rq);
> -		else {
> -			if (drive->channel->udma(dma_act, drive, rq))
> -				return ide_stopped;
> -		}
> +
> +		if (drive->channel->udma(dma_act, drive, rq))
> +			return ide_stopped;

This is still ugly, IMHO. What I wanted was to split the udma->
function into two parts, one that acts on a request (ide_dma_read,
ide_dma_being, etc -- and then also ide_dma_read_queued) ad one that
does the silly stuff like ide_dma_check etc. Then unify the tcq and
non-tcq stuff so that udma_rw->(dma_act, drive, rq) always returns
ide_started or ide_stopped (or ide_released) and kill the #ifdef above.

I don't think udma_tcq_taskfile() should be public like this, and btw I
think the name really SUCKS! :-). ata_tcq_dma() is much better for
instance, even though it should be a private stratey. BTW, this goes for
all your tcq.c renaming.

-- 
Jens Axboe


  reply	other threads:[~2002-05-05 17:09 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23  8:18 2.5.9 -- OOPS in IDE code (symbolic dump and boot log included) Miles Lane
2002-04-23  8:00 ` Martin Dalecki
2002-04-23  9:18   ` Jens Axboe
2002-04-23  8:43     ` Martin Dalecki
2002-04-23  9:54       ` Jens Axboe
2002-04-23 17:39   ` Miles Lane
2002-04-23 17:54     ` Miles Lane
2002-04-24  8:06       ` Martin Dalecki
2002-04-24  9:11         ` Jens Axboe
2002-04-24  8:20           ` Martin Dalecki
2002-04-25 11:07           ` Martin Dalecki
2002-04-25 17:25             ` Jens Axboe
2002-04-25 17:34               ` Jens Axboe
2002-04-25 21:02                 ` Linus Torvalds
2002-04-26  7:33                   ` [PATCH] 2.5.10 UTS_VERSION Martin Dalecki
2002-04-26  9:52                     ` Keith Owens
2002-04-26  8:58                       ` Martin Dalecki
2002-04-26  7:41                   ` [PATCH] 2.5.10 IDE 42 Martin Dalecki
2002-04-26 16:09                     ` Pavel Machek
2002-04-26 17:31                       ` Dave Jones
2002-04-26 17:37                       ` Linus Torvalds
2002-04-26 20:05                         ` Oliver Xymoron
2002-04-26 21:34                           ` Martin Dalecki
2002-04-26 22:25                           ` Martin Dalecki
2002-04-26 21:32                         ` Martin Dalecki
2002-04-26 23:21                           ` Rene Rebe
2002-04-26 21:42                       ` Martin Dalecki
2002-04-26 16:10                     ` Sebastian Droege
2002-04-26 21:28                       ` Martin Dalecki
2002-04-26 22:44                         ` Padraig Brady
2002-04-28  9:18                           ` Kai Henningsen
2002-05-05 15:54                   ` [PATCH] 2.5.13 IDE 52 Martin Dalecki
2002-05-05 17:09                     ` Jens Axboe [this message]
2002-05-05 16:16                       ` Martin Dalecki
2002-05-05 15:55                   ` [PATCH] 2.5.13 IDE 53 Martin Dalecki
2002-05-06  9:53                     ` Russell King
2002-05-06  8:55                       ` Martin Dalecki
2002-05-06 23:48                         ` jw schultz
2002-05-05 15:56                   ` [PATCH 2.5.13 IDE 54 Martin Dalecki
2002-05-07 12:52                     ` Paul Mackerras
2002-05-07 12:06                       ` Martin Dalecki
2002-05-07 14:40                         ` benh
2002-05-07 13:40                           ` Martin Dalecki
2002-05-07 15:18                             ` benh
2002-05-07 14:07                       ` Alan Cox
2002-05-07 13:24                         ` Martin Dalecki
2002-04-24  9:29         ` 2.5.9 -- OOPS in IDE code (symbolic dump and boot log included) Luigi Genoni
2002-04-23 18:23   ` Melchior FRANZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020505170930.GG811@suse.de \
    --to=axboe@suse.de \
    --cc=dalecki@evision-ventures.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.