linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Albert Lee <albertcc@tw.ibm.com>
Cc: IDE Linux <linux-ide@vger.kernel.org>,
	Vojtech Pavlik <vojtech@suse.cz>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Doug Maxey <dwm@maxeymade.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH/RFC] libata: honor the transfer cycle time speficied by the EIDE device
Date: Wed, 16 Nov 2005 07:59:56 -0500	[thread overview]
Message-ID: <437B2D4C.2090502@pobox.com> (raw)
In-Reply-To: <437AF68A.6020702@tw.ibm.com>

Albert Lee wrote:
> Jeff,
> 
>   The following code segment is not functional because the transfer cycle time speficied by 
>   the EIDE device is later overwritten by ata_timing_quantize():
> 
> 	/*
> 	 * If the drive is an EIDE drive, it can tell us it needs extended
> 	 * PIO/MW_DMA cycle timing.
> 	 */
> 	if (adev->id[ATA_ID_FIELD_VALID] & 2) {	/* EIDE drive */
> 		memset(&p, 0, sizeof(p));
> 		(snip)
> 		ata_timing_merge(&p, t, t, ATA_TIMING_CYCLE | ATA_TIMING_CYC8B);
>                <== uninitialized "t" is used here
> 	}
> 
> 	/*
> 	 * Convert the timing to bus clock counts.
> 	 */
> 	ata_timing_quantize(s, t, T, UT);  <== t is overwritten by quantized s
> 
>   The patch has been submitted for ide-timing.h before:
>   http://marc.theaimsgroup.com/?l=linux-ide&m=110820013425454&w=2
>   Resubmitted for libata.
> 
> Changes:
>   - Minor fix to honor the following transfer cycle time speficied by the device
>     - id[65]: Minimum Multiword DMA transfer cycle time per word
>     - id[67]: Minimum PIO transfer cycle time without flow control
>     - id[68]: Minimum PIO transfer cycle time with IORDY
> 
> Patch against the mainline tree
> (f6ff56cd56b83d8edf4b3cffc5c53c56b37a5081)
> For your review, thanks.
> 
> Albert
> Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
> 
> =======
> 
> --- linux/drivers/scsi/libata-core.c	2005-11-16 16:26:39.000000000 +0800
> +++ time/drivers/scsi/libata-core.c	2005-11-16 16:30:59.000000000 +0800
> @@ -1570,11 +1570,13 @@ int ata_timing_compute(struct ata_device
>  
>  	/*
>  	 * Find the mode. 
> -	*/
> +	 */
>  
>  	if (!(s = ata_timing_find_mode(speed)))
>  		return -EINVAL;
>  
> +	memcpy(t, s, sizeof(*s));
> +
>  	/*
>  	 * If the drive is an EIDE drive, it can tell us it needs extended
>  	 * PIO/MW_DMA cycle timing.
> @@ -1595,7 +1597,7 @@ int ata_timing_compute(struct ata_device
>  	 * Convert the timing to bus clock counts.
>  	 */
>  
> -	ata_timing_quantize(s, t, T, UT);
> +	ata_timing_quantize(t, t, T, UT);


Applied to upstream-fixes branch.  Let's see if Alan screams...  :)

	Jeff



      reply	other threads:[~2005-11-16 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-16  9:06 [PATCH/RFC] libata: honor the transfer cycle time speficied by the EIDE device Albert Lee
2005-11-16 12:59 ` Jeff Garzik [this message]

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=437B2D4C.2090502@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertcc@tw.ibm.com \
    --cc=bzolnier@gmail.com \
    --cc=dwm@maxeymade.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).