From: Tejun Heo <htejun@gmail.com>
To: Jan Gutter <jang@lucidview.net>
Cc: linux-ide@vger.kernel.org
Subject: Re: ICH7m problem using libata
Date: Wed, 20 Dec 2006 09:18:12 +0900 [thread overview]
Message-ID: <45888144.9070608@gmail.com> (raw)
In-Reply-To: <1165253799.16504.37.camel@laundromat.jangutter.com>
[-- Attachment #1: Type: text/plain, Size: 771 bytes --]
Jan Gutter wrote:
> Our company has recently purchased two Acer 5632WSMi laptops and we're
> running Gentoo x86 unstable on them. The most hindering problem that's
> currently plaguing us is the IDE chipset.
>
> Without the combined_mode=libata on the command line, DMA is disabled
> and the hard drive just uses PIO. With libata, it hangs up randomly,
> causing the driver to eventually clock down to PIO mode too.
>
> I'd be willing to test patches (like really INSANE ones), because the
> laptop's not too critical currently. I can post the full dmesg and lspci
> -vvnn if it might be of use. I have no idea whether this problem has
> been solved or reported before.
Please apply the attached patch over 2.6.19 and report what the kernel says.
Thanks.
--
tejun
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2496 bytes --]
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 02b2b27..bbbec75 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1433,16 +1433,47 @@ static void ata_eh_report(struct ata_port *ap)
}
for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
+ static const char *dma_str[] = {
+ [DMA_BIDIRECTIONAL] = "bidi",
+ [DMA_TO_DEVICE] = "out",
+ [DMA_FROM_DEVICE] = "in",
+ [DMA_NONE] = "",
+ };
struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
+ struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
+ const u8 *c = qc->cdb;
+ unsigned int nbytes;
if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask)
continue;
- ata_dev_printk(qc->dev, KERN_ERR, "tag %d cmd 0x%x "
- "Emask 0x%x stat 0x%x err 0x%x (%s)\n",
- qc->tag, qc->tf.command, qc->err_mask,
- qc->result_tf.command, qc->result_tf.feature,
- ata_err_string(qc->err_mask));
+ nbytes = qc->nbytes;
+ if (!nbytes)
+ nbytes = qc->nsect << 9;
+
+ ata_dev_printk(qc->dev, KERN_ERR,
+ "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
+ "tag %d cdb 0x%x data %u %s\n "
+ "res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
+ "Emask 0x%x (%s)\n",
+ cmd->command, cmd->feature, cmd->nsect,
+ cmd->lbal, cmd->lbam, cmd->lbah,
+ cmd->hob_feature, cmd->hob_nsect,
+ cmd->hob_lbal, cmd->hob_lbam, cmd->hob_lbah,
+ cmd->device, qc->tag, qc->cdb[0], nbytes,
+ dma_str[qc->dma_dir],
+ res->command, res->feature, res->nsect,
+ res->lbal, res->lbam, res->lbah,
+ res->hob_feature, res->hob_nsect,
+ res->hob_lbal, res->hob_lbam, res->hob_lbah,
+ res->device, qc->err_mask, ata_err_string(qc->err_mask));
+
+ ata_dev_printk(qc->dev, KERN_ERR,
+ "CDB: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
+ "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x p=%d\n",
+ c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7],
+ c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15],
+ cmd->protocol);
}
}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 3ac4890..f018e49 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -191,6 +191,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
goto out;
req->cmd_len = COMMAND_SIZE(cmd[0]);
+ memset(req->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
memcpy(req->cmd, cmd, req->cmd_len);
req->sense = sense;
req->sense_len = 0;
next prev parent reply other threads:[~2006-12-20 0:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-04 17:36 ICH7m problem using libata Jan Gutter
2006-12-20 0:18 ` Tejun Heo [this message]
2007-01-03 3:07 ` Matthew Stapleton
2007-01-03 3:44 ` Tejun Heo
2007-01-09 22:17 ` Matthew Stapleton
2007-01-15 5:20 ` Tejun Heo
2007-01-15 23:58 ` Matthew Stapleton
2007-01-16 8:56 ` Tejun Heo
2007-01-16 11:31 ` Jan Gutter
2007-01-16 11:42 ` Tejun Heo
2007-01-16 13:53 ` Jan Gutter
2007-01-17 5:11 ` Tejun Heo
2007-01-17 13:25 ` Jan Gutter
2007-01-17 13:41 ` Tejun Heo
2007-01-18 2:13 ` Matthew Stapleton
-- strict thread matches above, loose matches on Subject: below --
2006-12-19 0:40 Matthew Stapleton
2007-01-16 14:11 Mikael Pettersson
2007-01-16 14:51 ` Jan Gutter
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=45888144.9070608@gmail.com \
--to=htejun@gmail.com \
--cc=jang@lucidview.net \
--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 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.