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 -
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Stephen Rothwell | Re: Announce: Linux-next (Or Andrew's dream :-)) |
| Arjan van de Ven | Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning |
| Patrick McHardy | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Eric W. Biederman | Re: namespace support requires network modules to say "GPL" |
git: | |
