Re: Problems with Promise controller or Seagate 500g ST3500630AS ?

2007-09-18 Thread Mikael Pettersson
Glen Larkins writes:
  Corrected. With only 1 of the 500g drives connected, I can boot fine.
  With all drives connected, I suddenly began getting COMRESET failed
  (errno=-16) and hearing physical noises from the two 80g drives
  connected to the motherboard sata. This has never occurred.

This report, and the fact that you wrote that things worked until
you added 4 drives on a second controller, makes me suspect that
the PSU simply cannot cope with the load.
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] pata_it821x: fix lost interrupt with atapi devices

2007-09-18 Thread Alan Cox
On Mon, Sep 17, 2007 at 07:00:03AM +0200, Tejun Heo wrote:
 I wonder whether we should be using similar check in generic path too.
 We have quite a few cases where MWDMA ATAPI devices choking on commands
 with small transfer sizes.  I don't think we'll experience significant
 performance regression with this applied and even if there is some, it's
 far better to have slightly slower working device.
 
 What do you guys think?

I think to start with someone should fix the ATAPI state machine. Stick
a BUG() in the driver if dma start is called when the atapi command data 
size is zero

Alan

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] pata_it821x: fix lost interrupt with atapi devices

2007-09-18 Thread Alan Cox
On Mon, Sep 17, 2007 at 01:46:01PM +0200, Tejun Heo wrote:
 failures and would really like to know what's broken.  The reason can be
 one of the following two.
 
 1. libata itself isn't doing anything wrong but using SCSI for mid and
 high level drivers are causing problems as more types of commands are used.
 
 2. Mode programming for MWDMA is broken.  This doesn't seem too likely
 as we're seeing MWDMA failures across different low level drivers but is
 still a possibility.

3 and 4

3. Libata is wrong (it is in places)

4. Old IDE uses DMA much less for ATAPI especially
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.22.6 sata_sil device errors timeouts

2007-09-18 Thread Andrew Paprocki
It appears to be the '-o on' causing the problem. If I remove that,
the errors go away. The strange part is that according to the smartctl
documentation, my drives support it:

# smartctl -c /dev/sda
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-7 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status:  (   0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (4797) seconds.
Offline data collection
capabilities:(0x5b) SMART execute Offline immediate.
Auto Offline data collection
on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities:(0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability:(0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time:(   1) minutes.
Extended self-test routine
recommended polling time:(  80) minutes.

Thanks, -Andrew

On 9/18/07, Bruce Allen [EMAIL PROTECTED] wrote:
 Does removing '-o on' and/or '-S on' eliminate the errors?


 On Mon, 17 Sep 2007, Andrew Paprocki wrote:

  Bruce,
 
  Just built it -- it eliminated the HSM violations, but I still get the
  device errors:
 
  smartmontools release 5.38 dated 2006/12/20 at 20:37:59 UTC
  (I see the above date, even though I verified it is built from CVS head)
 
  ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
  ata2.00: cmd b0/db:f8:00:4f:c2/00:00:00:00:00/00 tag 0 cdb 0x0 data 0
  res 51/04:f8:00:4f:c2/00:00:00:00:00/00 Emask 0x1 (device error)
  ata2.00: configured for UDMA/100
  ata2: EH complete
 
  This is what it is in smartd.conf:
  /dev/sda -d ata -a -o on -S on
  /dev/sdb -d ata -a -o on -S on
  /dev/sdc -d ata -a -o on -S on
 
  Thanks, -Andrew
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.22.6 sata_sil device errors timeouts

2007-09-18 Thread Bruce Allen

Andrew: thanks for isolating this problem.

Tejun: any thoughts?  The STRANGE_BUFFER_LENGTH problem is fixed in the 
code that Andrew is running.  The problem is provoked with '-o on' which 
goes via a TASKFILE ioctl.


Cheers,
Bruce

On Tue, 18 Sep 2007, Andrew Paprocki wrote:


It appears to be the '-o on' causing the problem. If I remove that,
the errors go away. The strange part is that according to the smartctl
documentation, my drives support it:

# smartctl -c /dev/sda
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-7 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
   was never started.
   Auto Offline Data Collection: Disabled.
Self-test execution status:  (   0) The previous self-test routine completed
   without error or no self-test has ever
   been run.
Total time to complete Offline
data collection: (4797) seconds.
Offline data collection
capabilities:(0x5b) SMART execute Offline immediate.
   Auto Offline data collection
on/off support.
   Suspend Offline collection upon new
   command.
   Offline surface scan supported.
   Self-test supported.
   No Conveyance Self-test supported.
   Selective Self-test supported.
SMART capabilities:(0x0003) Saves SMART data before entering
   power-saving mode.
   Supports SMART auto save timer.
Error logging capability:(0x01) Error logging supported.
   General Purpose Logging supported.
Short self-test routine
recommended polling time:(   1) minutes.
Extended self-test routine
recommended polling time:(  80) minutes.

Thanks, -Andrew

On 9/18/07, Bruce Allen [EMAIL PROTECTED] wrote:

Does removing '-o on' and/or '-S on' eliminate the errors?


On Mon, 17 Sep 2007, Andrew Paprocki wrote:


Bruce,

Just built it -- it eliminated the HSM violations, but I still get the
device errors:

smartmontools release 5.38 dated 2006/12/20 at 20:37:59 UTC
(I see the above date, even though I verified it is built from CVS head)

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata2.00: cmd b0/db:f8:00:4f:c2/00:00:00:00:00/00 tag 0 cdb 0x0 data 0
res 51/04:f8:00:4f:c2/00:00:00:00:00/00 Emask 0x1 (device error)
ata2.00: configured for UDMA/100
ata2: EH complete

This is what it is in smartd.conf:
/dev/sda -d ata -a -o on -S on
/dev/sdb -d ata -a -o on -S on
/dev/sdc -d ata -a -o on -S on

Thanks, -Andrew



-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH ver2 2/2] libata-scsi: convert to use the data buffer accessors

2007-09-18 Thread Boaz Harrosh

  simple search-and-replace of direct scsi_cmnd access to
  use the data buffer accessors.

Signed-off-by: Boaz Harrosh [EMAIL PROTECTED]
---
 drivers/ata/libata-scsi.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 6145a64..d23a181 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -450,8 +450,8 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct 
ata_device *dev,
qc-scsicmd = cmd;
qc-scsidone = done;
 
-   qc-__sg = (struct scatterlist *) cmd-request_buffer;
-   qc-n_elem = cmd-use_sg;
+   qc-__sg = scsi_sglist(cmd);
+   qc-n_elem = scsi_sg_count(cmd);
} else {
cmd-result = (DID_OK  16) | (QUEUE_FULL  1);
done(cmd);
@@ -1493,13 +1493,13 @@ static int ata_scsi_translate(struct ata_device *dev, 
struct scsi_cmnd *cmd,
/* data is present; dma-map it */
if (cmd-sc_data_direction == DMA_FROM_DEVICE ||
cmd-sc_data_direction == DMA_TO_DEVICE) {
-   if (unlikely(cmd-request_bufflen  1)) {
+   if (unlikely(scsi_bufflen(cmd)  1)) {
ata_dev_printk(dev, KERN_WARNING,
   WARNING: zero len r/w req\n);
goto err_did;
}
 
-   ata_sg_init(qc, cmd-request_buffer, cmd-use_sg);
+   ata_sg_init(qc, scsi_sglist(cmd), scsi_sg_count(cmd));
 
qc-dma_dir = cmd-sc_data_direction;
}
@@ -1553,7 +1553,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd 
*cmd, u8 **buf_out)
u8 *buf;
unsigned int buflen;
 
-   struct scatterlist *sg = (struct scatterlist *) cmd-request_buffer;
+   struct scatterlist *sg = scsi_sglist(cmd);
 
if (sg) {
buf = kmap_atomic(sg-page, KM_IRQ0) + sg-offset;
@@ -1580,7 +1580,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd 
*cmd, u8 **buf_out)
 
 static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
 {
-   struct scatterlist *sg = (struct scatterlist *) cmd-request_buffer;
+   struct scatterlist *sg = scsi_sglist(cmd);
if (sg)
kunmap_atomic(buf - sg-offset, KM_IRQ0);
 }
@@ -2383,7 +2383,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
}
 
qc-tf.command = ATA_CMD_PACKET;
-   qc-nbytes = scmd-request_bufflen;
+   qc-nbytes = scsi_bufflen(scmd);
 
/* check whether ATAPI DMA is safe */
if (!using_pio  ata_check_atapi_dma(qc))
@@ -2618,7 +2618,7 @@ static unsigned int ata_scsi_pass_thru(struct 
ata_queued_cmd *qc)
case ATA_CMD_WRITE_LONG_ONCE:
if (tf-protocol != ATA_PROT_PIO || tf-nsect != 1)
goto invalid_fld;
-   qc-sect_size = scmd-request_bufflen;
+   qc-sect_size = scsi_bufflen(scmd);
}
 
/*
@@ -2648,7 +2648,7 @@ static unsigned int ata_scsi_pass_thru(struct 
ata_queued_cmd *qc)
 * TODO: find out if we need to do more here to
 *   cover scatter/gather case.
 */
-   qc-nbytes = scmd-request_bufflen;
+   qc-nbytes = scsi_bufflen(scmd);
 
/* request result TF */
qc-flags |= ATA_QCFLAG_RESULT_TF;
-- 
1.5.3.1


-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH ver2 1/2] libata-scsi: Remove !use_sg code paths

2007-09-18 Thread Boaz Harrosh

 This is a minimal patch needed to remove use of !use_sg
 but it is not a complete clean up of the !use_sg paths.
 Libata-core still has the qc-flags  ATA_QCFLAG_SG
 and !qc-n_elem code paths. Perhaps an ata maintainer
 would have a go at it.

 - TODO: further cleanup of qc-flags  ATA_QCFLAG_SG
   and !qc-n_elem code paths in libata-core
 - TODO: Use scsi_dma_{map,unmap} where applicable.
---
 drivers/ata/libata-scsi.c |   31 +--
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e836476..6145a64 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -450,13 +450,8 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct 
ata_device *dev,
qc-scsicmd = cmd;
qc-scsidone = done;
 
-   if (cmd-use_sg) {
-   qc-__sg = (struct scatterlist *) cmd-request_buffer;
-   qc-n_elem = cmd-use_sg;
-   } else if (cmd-request_bufflen) {
-   qc-__sg = qc-sgent;
-   qc-n_elem = 1;
-   }
+   qc-__sg = (struct scatterlist *) cmd-request_buffer;
+   qc-n_elem = cmd-use_sg;
} else {
cmd-result = (DID_OK  16) | (QUEUE_FULL  1);
done(cmd);
@@ -1504,11 +1499,7 @@ static int ata_scsi_translate(struct ata_device *dev, 
struct scsi_cmnd *cmd,
goto err_did;
}
 
-   if (cmd-use_sg)
-   ata_sg_init(qc, cmd-request_buffer, cmd-use_sg);
-   else
-   ata_sg_init_one(qc, cmd-request_buffer,
-   cmd-request_bufflen);
+   ata_sg_init(qc, cmd-request_buffer, cmd-use_sg);
 
qc-dma_dir = cmd-sc_data_direction;
}
@@ -1562,15 +1553,14 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd 
*cmd, u8 **buf_out)
u8 *buf;
unsigned int buflen;
 
-   if (cmd-use_sg) {
-   struct scatterlist *sg;
+   struct scatterlist *sg = (struct scatterlist *) cmd-request_buffer;
 
-   sg = (struct scatterlist *) cmd-request_buffer;
+   if (sg) {
buf = kmap_atomic(sg-page, KM_IRQ0) + sg-offset;
buflen = sg-length;
} else {
-   buf = cmd-request_buffer;
-   buflen = cmd-request_bufflen;
+   buf = NULL;
+   buflen = 0;
}
 
*buf_out = buf;
@@ -1590,12 +1580,9 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd 
*cmd, u8 **buf_out)
 
 static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
 {
-   if (cmd-use_sg) {
-   struct scatterlist *sg;
-
-   sg = (struct scatterlist *) cmd-request_buffer;
+   struct scatterlist *sg = (struct scatterlist *) cmd-request_buffer;
+   if (sg)
kunmap_atomic(buf - sg-offset, KM_IRQ0);
-   }
 }
 
 /**
-- 
1.5.3.1


-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: ata_piix, laptop cdrom, ICH7: EH, limiting speed to PIO

2007-09-18 Thread Sergey Dolgov
On Mon, Sep 17, 2007 at 09:18:26PM +0400, Alexey Zaytsev wrote:
 On 9/17/07, Sergey Dolgov [EMAIL PROTECTED] wrote:
  On 9/17/07, Tejun Heo [EMAIL PROTECTED] wrote:
 
  [...]
BTW, this only happens when using libata of course. The
old CONFIG_IDE stuff works fine every time.
This maybe one of libata weirdness (I really don't get it why some 
hardware
works perfectly fine with an old IDE and don't work well with libata).
Hmmm... Is MWDMA2 mode used with ide driver too?
   
   
What's the best way to tell whether it does or not? (the log says
selected mode 0x22, see below)
  
   Yes, that's MWDMA2.  Hmm... We're seeing many cases where MWDMA doesn't
   work with libata while it works fine with IDE but have no idea what's
   going on yet.  :-(
  
 
 
 This may be well a hardware problem. Same laptop (HP nx7300 GB848ES)
 works fine with either 2.6.22 and 2.6.23-rc. Maybe actually using the
 DVD is required to trigger the problem on the next reboot?

No, that is not required. The problem shows up on a fresh start from
powered-off state just as well.

 Sergey, btw, on this laptop I've observed lockups twice with the -rc5.
 After switching to 2.6.22 it was stable for at least one day. Can you
 confirm or refute this?

I've been using 2.6.23 rcs (rc3, rc6) since August, often for days
without rebooting the machine. Haven't seen any lockups (except the
ones on a return from suspend-to-RAM, but that's another story).

--
Sergey
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [POWERPC] Fix build errors when BLOCK=n

2007-09-18 Thread Paul Mackerras
Emil Medve writes:

 The fix tries to use the smallest scope CONFIG_* symbols that will fix the 
 build
 problem. In this case linux/ide.h needs to be included only if IDE=y or
 IDE=m were selected. Also, ppc_ide_md is needed only if BLK_DEV_IDE=y or
 BLK_DEV_IDE=m

It would be nicer to remove the ppc_ide_md stuff from ppc_ksyms.c
altogether and just put the EXPORT_SYMBOL in setup_32.c.

Paul.
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html