From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Doug Maxey <dwm@maxeymade.com>,
Linux IDE <linux-ide@vger.kernel.org>, Jens Axboe <axboe@suse.de>
Subject: Re: [PATCH 1/1] libata-dev-2.6: pdc2027x ATAPI DMA fix
Date: Wed, 27 Apr 2005 16:55:57 +0800 [thread overview]
Message-ID: <426F539D.3090605@tw.ibm.com> (raw)
In-Reply-To: <4264A057.9020604@tw.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
Hi Jeff,
Revised pdc2027x: pdc2027x ATAPI DMA fix.
(Please ignore the previous patch.)
Problem:
The previous (request_bufflen % 256) ATAPI DMA rule still fails and
causes timeout in some case.
Changes:
- Only turn on pdc2027x ATAPI DMA for READ/WRITE.
The additional (request_bufflen % 1024 == 0) check in the previous patch is
not necessary. Since most ATAPI devices has 512 bytes or 2048 bytes sector size,
it should be safe for ATAPI DMA. Thanks Jens for the advice.
Attached please find the revised patch against the libata-dev-2.6 tree for your
review. Thanks.
Albert
[-- Attachment #2: pdc_061.diff --]
[-- Type: text/plain, Size: 939 bytes --]
--- linux-2.6.5-SLES9_SP2_BRANCH_20050418161416/drivers/scsi/pata_pdc2027x.c.ori 2005-04-19 15:34:15.000000000 +0800
+++ linux-2.6.5-SLES9_SP2_BRANCH_20050418161416/drivers/scsi/pata_pdc2027x.c 2005-04-26 21:44:18.849971712 +0800
@@ -29,7 +29,7 @@
#include <asm/io.h>
#define DRV_NAME "pata_pdc2027x"
-#define DRV_VERSION "0.60"
+#define DRV_VERSION "0.61"
#undef PDC_DEBUG
#ifdef PDC_DEBUG
@@ -445,11 +445,24 @@
static int pdc2027x_check_atapi_dma(struct ata_queued_cmd *qc)
{
struct scsi_cmnd *cmd = qc->scsicmd;
- int rc = 0;
+ u8 *scsicmd = cmd->cmnd;
+ int rc = 1; /* atapi dma off by default */
- /* pdc2027x can only do ATAPI DMA for specific buffer size */
- if (cmd->request_bufflen % 256)
- rc = 1;
+ switch (scsicmd[0]) {
+ case READ_6:
+ case READ_10:
+ case READ_12:
+ case READ_16:
+
+ case WRITE_6:
+ case WRITE_10:
+ case WRITE_12:
+ case WRITE_16:
+ rc = 0;
+ break;
+ default:
+ ;
+ }
return rc;
}
next prev parent reply other threads:[~2005-04-27 8:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-11 9:57 [PATCH 0/4] libata-dev-2.6: pdc2027x PLL input clock detection fix, etc Albert Lee
2005-04-11 10:02 ` [PATCH 1/4] libata-dev-2.6: pdc2027x add ata_scsi_ioctl Albert Lee
2005-05-16 2:38 ` Jeff Garzik
2005-04-11 10:04 ` [PATCH 2/4] libata-dev-2.6: pdc2027x change comments Albert Lee
2005-04-11 10:06 ` [PATCH 3/4] libata-dev-2.6: pdc2027x move the PLL counter reading code Albert Lee
2005-04-11 10:11 ` [PATCH 0/4] libata-dev-2.6: pdc2027x PLL input clock detection fix, etc Albert Lee
2005-04-11 10:28 ` [PATCH 4/4] libata-dev-2.6: pdc2027x PLL input clock detection fix Albert Lee
2005-04-17 1:54 ` [PATCH 2.6.12-rc2 0/2] libata: add reporting of atapi errors Eric A. Cottrell
2005-04-19 6:08 ` [PATCH 1/1] libata-dev-2.6: pdc2027x ATAPI DMA fix Albert Lee
2005-04-27 8:55 ` Albert Lee [this message]
2005-04-29 3:19 ` [PATCH 1/1] libata-dev-2.6: pdc2027x yet another PLL fix Albert Lee
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=426F539D.3090605@tw.ibm.com \
--to=albertcc@tw.ibm.com \
--cc=axboe@suse.de \
--cc=bzolnier@gmail.com \
--cc=dwm@maxeymade.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/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).