Re: SMART problems in 2.6.22

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bruce Allen <ballen@...>
Cc: Mark Lord <liml@...>, David Greaves <david@...>, Douglas Gilbert <dougg@...>, Tejun Heo <htejun@...>, Alan Cox <alan@...>, Jeff Garzik <jeff@...>, Linux Kernel Mailing List <linux-kernel@...>, Jan Dvorak <fermentol@...>, Klaus Fuerstberger <kfuerstberger@...>, Bruce Allen <bruce.allen@...>, Robert Hancock <hancockr@...>
Date: Monday, July 9, 2007 - 5:11 pm

On Sun, 8 Jul 2007, Bruce Allen wrote:


I have done some more debugging on this one. An easy way to reproduce the 
problem is to use 'smartctl -H /dev/sdb'. If I enable debugging with '-r 
ioctl,2', I find the following difference between outputs using 2.6.21.1 
(works OK) and 2.6.22 (fails):

--- sm-2.6.21.1b.log    2007-07-09 23:47:28.000000000 +0300
+++ sm-2.6.22.log       2007-07-09 23:39:56.000000000 +0300
@@ -11,7 +11,7 @@
   status=0x0
  [ata pass-through(16): 85 08 0e 00 00 00 01 00 00 00 00 00 00 00 ec 00 ]
   scsi_status=0x0, host_status=0x0, driver_status=0x0
-  info=0x0  duration=0 milliseconds  resid=0
+  info=0x0  duration=4 milliseconds  resid=0
   Incoming data, len=512 [only first 256 bytes shown]:
  00     5a 0c ff 3f 37 c8 10 00  00 00 00 00 3f 00 00 00                        
  10     00 00 00 00 20 20 20 20  20 20 20 20 20 20 20 20                        
@@ -97,11 +97,11 @@
   scsi_status=0x2, host_status=0x0, driver_status=0x8
   info=0x1  duration=48 milliseconds  resid=0
   >>> Sense buffer, len=22:
- 00     72 00 00 00 00 00 00 0e  09 0c 00 00 00 00 00 00                        
- 10     00 4f 00 c2 00 50                                                       
+ 00     72 00 00 00 00 00 00 0e  09 0c 00 00 00 01 00 00                        
+ 10     00 00 00 00 00 50                                                       
   status=2: [desc] sense_key=0 asc=0 ascq=0
 Values from ATA status return descriptor are:
- 00     09 0c 00 00 00 00 00 00  00 4f 00 c2 00 50                              
+ 00     09 0c 00 00 00 01 00 00  00 00 00 00 00 50                              
 REPORT-IOCTL: DeviceFD=3 Command=SMART STATUS returned 0
 
 REPORT-IOCTL: DeviceFD=3 Command=SMART STATUS CHECK
@@ -110,9 +110,13 @@
   info=0x1  duration=40 milliseconds  resid=0
   >>> Sense buffer, len=22:
  00     72 00 00 00 00 00 00 0e  09 0c 00 00 00 00 00 00                        
- 10     00 4f 00 c2 00 50                                                       
+ 10     00 00 00 00 00 50                                                       
   status=2: [desc] sense_key=0 asc=0 ascq=0
 Values from ATA status return descriptor are:
- 00     09 0c 00 00 00 00 00 00  00 4f 00 c2 00 50                              
-REPORT-IOCTL: DeviceFD=3 Command=SMART STATUS CHECK returned 0
-
+ 00     09 0c 00 00 00 00 00 00  00 00 00 00 00 50                              
+Error SMART Status command failed
+Please get assistance from http://smartmontools.sourceforge.net/
+Values from ATA status return descriptor are:
+ 00     09 0c 00 00 00 00 00 00  00 00 00 00 00 50                              
+REPORT-IOCTL: DeviceFD=3 Command=SMART STATUS CHECK returned -1
+A mandatory SMART command failed: exiting. To continue, add one or more 
'-T permissive' options.


The log shows that the sense data returned by the commands differ: with 
2.6.22 the bytes 4f and 2c (tf.lbam and tf.lbah) are not returned. Both of 
the status commands fail to return these bytes but the tests in smartctl 
are more strict for the second case. This is why the second status command 
seems to be failing.

Next I added printks to the function ata_qc_complete() in libata-core.c. 
The changed code from 2.6.22 at line 5222 looked like this:

                /* read result TF if requested */
                if (qc->flags & ATA_QCFLAG_RESULT_TF) {
                        if (qc->tf.feature == 0xda)
                                printk("ata_qc_complete before: %02x %02x %02x %02x\n",
                                       qc->result_tf.feature,
                                       qc->result_tf.lbam, qc->result_tf.lbah,
                                       qc->result_tf.command);
                        fill_result_tf(qc);
                        if (qc->tf.feature == 0xda)
                                printk("ata_qc_complete %ld: %02x %02x %02x %02x\n",
                                       qc->flags & ATA_QCFLAG_RESULT_TF,
                                       qc->result_tf.feature,
                                       qc->result_tf.lbam, qc->result_tf.lbah,
                                       qc->result_tf.command);
                }

The output from 2.6.21.6 looks like this:

Jul  9 18:37:44 kai kernel: [  193.443874] ata_qc_complete before: 00 00 00 40
Jul  9 18:37:44 kai kernel: [  193.443880] ata_qc_complete 16: 00 4f c2 50
Jul  9 18:37:44 kai kernel: [  193.462802] ata_qc_complete before: 00 4f c2 40
Jul  9 18:37:44 kai kernel: [  193.462807] ata_qc_complete 16: 00 4f c2 50

i.e., the bytes are returned.

The output from 2.6.22 is different:

Jul  9 18:44:35 kai kernel: [  147.765965] ata_qc_complete before: 00 00 00 40
Jul  9 18:44:35 kai kernel: [  147.765970] ata_qc_complete 16: 00 00 00 50
Jul  9 18:44:35 kai kernel: [  147.784890] ata_qc_complete before: 00 00 00 40
Jul  9 18:44:35 kai kernel: [  147.784894] ata_qc_complete 16: 00 00 00 50

The lbam and lbah bytes are not returned but the command byte is.

fill_result_tf() basically calls the tf_read() method of the low-level  
driver. sata_nc has been changed between 2.6.21 and 2.6.22-rc1 and this 
particular smartctl problem may or may not be specific to CK804. Disabling 
adma did not change the results.

-- 
Kai

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
SMART problems in 2.6.22, Bruce Allen, (Sun Jul 8, 8:32 pm)
Re: SMART problems in 2.6.22, Kai Makisara, (Mon Jul 9, 5:11 pm)
Re: SMART problems in 2.6.22, Kai Makisara, (Mon Jul 16, 6:48 am)
Re: SMART problems in 2.6.22, Tejun Heo, (Mon Jul 16, 7:22 am)
Re: SMART problems in 2.6.22, Kai Makisara, (Mon Jul 16, 7:58 am)
Re: SMART problems in 2.6.22, Klaus Fuerstberger, (Mon Jul 16, 9:12 am)
Re: SMART problems in 2.6.22, Bruce Allen, (Mon Jul 16, 5:27 pm)
Re: SMART problems in 2.6.22, Douglas Gilbert, (Tue Jul 10, 12:24 am)
Re: SMART problems in 2.6.22, Bruce Allen, (Tue Jul 10, 9:31 pm)
Re: SMART problems in 2.6.22, David Greaves, (Mon Jul 9, 7:55 am)
Re: SMART problems in 2.6.22, Bruce Allen, (Mon Jul 9, 1:56 pm)
Re: SMART problems in 2.6.22, Jeff Garzik, (Mon Jul 9, 2:43 pm)
Re: SMART problems in 2.6.22, David Greaves, (Mon Jul 9, 2:00 pm)
Re: SMART problems in 2.6.22, Bruce Allen, (Sun Jul 8, 9:14 pm)
Re: [smartmontools-support] SMART problems in 2.6.22, Adam Spiers, (Mon Jul 9, 7:35 pm)
Re: SMART problems in 2.6.22, Jeff Garzik, (Sun Jul 8, 10:09 pm)
Re: SMART problems in 2.6.22, Bruce Allen, (Mon Jul 9, 1:35 pm)
Re: SMART problems in 2.6.22, Jeff Garzik, (Mon Jul 9, 1:52 pm)
Re: SMART problems in 2.6.22, Bruce Allen, (Mon Jul 9, 2:02 pm)