public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Dalecki <dalecki@evision-ventures.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: "Adam J. Richter" <adam@yggdrasil.com>,
	zlatko.calusic@iskon.hr, linux-kernel@vger.kernel.org
Subject: Re: IDE{,-SCSI} trouble [2.5.20]
Date: Wed, 05 Jun 2002 10:48:19 +0200	[thread overview]
Message-ID: <3CFDD053.5090406@evision-ventures.com> (raw)
In-Reply-To: <200206042137.OAA00695@adam.yggdrasil.com> <20020604231859.F32338@flint.arm.linux.org.uk>

Russell King wrote:
> On Tue, Jun 04, 2002 at 02:37:55PM -0700, Adam J. Richter wrote:
> 
>>--- linux/drivers/ide/icside.c	2002-06-03 00:46:21.000000000 -0700
>>+++ linux-2.5.20/drivers/ide/icside.c	2002-06-02 18:44:41.000000000 -0700
>>@@ -275,9 +275,8 @@
>> #define NR_ENTRIES 256
>> #define TABLE_SIZE (NR_ENTRIES * 8)
>> 
>>-static int ide_build_sglist(struct ata_device *drive, struct request *rq)
>>+static int ide_build_sglist(struct ata_channel *ch, struct request *rq)
>> {
>>-	struct ata_channel *ch = drive->channel;
>> 	struct scatterlist *sg = ch->sg_table;
>> 	int nents;
>> 
> 
> 
> Umm, you sure this is right?  ide_build_sglist takes an ata_channel
> argument in my 2.5.20.
> 
> If this is reversed, you also forgot to change where it is used in
> icside.c.  Besides that, one of the recent changes from Martin broke
> the driver rather disgustingly again.  The following patch fixes this
> breakage such that:
> 
> 1. we won't issue *WRITE* commands to the drive when trying to
>    *READ* data from said drive.
> 2. allows icside.c to build again.
> 
> Luckily, (2) prevents its use in 2.5.20, which is a god-send given the
> effects that (1) could have.  Martin, could you please be more careful
> with your editing in future?  Maybe using '#error' if you're not able
> to fix stuff up properly?

Sorry this change had to be done. As you can see from the
rest of the associated diff it's actually simplifying stuff.
The goal which got me at this was to finally make it possible
to unify udma_init and udma_tcq_taksfile.

Unfortuantely I have apparently missed the remaining usage of
taskfile.command in icside.c during find -exec grep...
However my changelog documented the change so I hope at least that
it was "pretty obvious" how to accomodate. BTW.> Disaster
1. could not occur becouse I deleted the usage of the read
variant altogether.

Anyway as always: Thank you for cheerishing this out.


> 
> --- orig/drivers/ide/icside.c	Mon Jun  3 10:24:34 2002
> +++ linux/drivers/ide/icside.c	Mon Jun  3 11:54:42 2002
> @@ -517,33 +517,6 @@
>  	return 0;
>  }
>  
> -static int icside_dma_read(struct ata_device *drive, struct request *rq)
> -{
> -	struct ata_channel *ch = drive->channel;
> -	unsigned int cmd;
> -
> -	if (icside_dma_common(drive, rq, DMA_MODE_READ))
> -		return 1;
> -
> -	if (drive->type != ATA_DISK)
> -		return 0;
> -
> -	ide_set_handler(drive, icside_dmaintr, WAIT_CMD, NULL);
> -
> -	if ((rq->flags & REQ_DRIVE_ACB) && drive->addressing == 1) {
> -		struct ata_taskfile *args = rq->special;
> -		cmd = args->taskfile.command;
> -	} else if (drive->addressing) {
> -		cmd = WIN_READDMA_EXT;
> -	} else {
> -		cmd = WIN_READDMA;
> -	}
> -
> -	OUT_BYTE(cmd, IDE_COMMAND_REG);
> -	enable_dma(ch->hw.dma);
> -	return 0;
> -}
> -
>  static int icside_dma_init(struct ata_device *drive, struct request *rq)
>  {
>  	struct ata_channel *ch = drive->channel;
> @@ -559,11 +532,11 @@
>  
>  	if ((rq->flags & REQ_DRIVE_ACB) && drive->addressing == 1) {
>  		struct ata_taskfile *args = rq->special;
> -		cmd = args->taskfile.command;
> +		cmd = args->cmd;
>  	} else if (drive->addressing) {
> -		cmd = WIN_WRITEDMA_EXT;
> +		cmd = rq_data_dir(rq) == WRITE ? WIN_WRITEDMA_EXT : WIN_READDMA_EXT;
>  	} else {
> -		cmd = WIN_WRITEDMA;
> +		cmd = rq_data_dir(rq) == WRITE ? WIN_WRITEDMA : WIN_READDMA;
>  	}
>  	OUT_BYTE(cmd, IDE_COMMAND_REG);
>  


  reply	other threads:[~2002-06-05  9:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-04 21:37 IDE{,-SCSI} trouble [2.5.20] Adam J. Richter
2002-06-04 22:18 ` Russell King
2002-06-05  8:48   ` Martin Dalecki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-04 22:54 Adam J. Richter
2002-06-05  8:41 ` Martin Dalecki
2002-06-04 18:48 Zlatko Calusic

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=3CFDD053.5090406@evision-ventures.com \
    --to=dalecki@evision-ventures.com \
    --cc=adam@yggdrasil.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=zlatko.calusic@iskon.hr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox