All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilbert Wu <Gilbert_Wu@adaptec.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device
Date: Fri, 31 Aug 2007 11:03:39 -0700	[thread overview]
Message-ID: <1188583419.6353.9.camel@linux.site> (raw)

Subject:  [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device
driver to fix smartctl utility problem.

Contribution:
   Gilbert Wu <gilbert_wu@adaptec.com>

Change Log:


1. Fixed the problem that "smartctl -a /dev/some_sata_disk -d ata"
   does not work on aic94xx device drive with SATA devices.
   The smartctl utility send down ATA smart command to aic94xx
   driver and fail to get the result which is stored on ATA output
   register. 
   In normal case, Aic94xx’s firmware does not return the value of
   ATA output register to device driver due to performance reason.
   To solve this issue then the driver need to turn on internal
   flag (CSMI_TASK) for particular ATA command to enable firmware
   to return the value of ATA output register.




Patch: apply to aic94xx-sas-2.6.git development tree

Signed-off-by: Gilbert Wu <gilbert_wu@adaptec.com>




diff -urN old/drivers/scsi/aic94xx/aic94xx_task.c
new/drivers/scsi/aic94xx/aic94xx_task.c
--- old/drivers/scsi/aic94xx/aic94xx_task.c	2007-08-30 16:32:12.000000000 -0700
+++ new/drivers/scsi/aic94xx/aic94xx_task.c	2007-08-30 16:31:50.000000000 -0700
@@ -33,6 +33,11 @@
 static void asd_unbuild_smp_ascb(struct asd_ascb *a);
 static void asd_unbuild_ssp_ascb(struct asd_ascb *a);
 
+#define ATA_SMART_COMMAND       0xb0
+#define ATA_DEVICE_DIAGNOSTIC   0x90
+#define ATA_CHECK_POWER_MODE    0xe5
+#define ATA_SMART_STATUS        0xda
+
 static inline void asd_can_dequeue(struct asd_ha_struct *asd_ha, int num)
 {
 	unsigned long flags;
@@ -253,6 +258,7 @@
 		break;
 	case TC_SSP_RESP:
 	case TC_ATA_RESP:
+	case TC_CSMI:
 		ts->resp = SAS_TASK_COMPLETE;
 		ts->stat = SAS_PROTO_RESPONSE;
 		asd_get_response_tasklet(ascb, dl);
@@ -427,6 +433,15 @@
 			flags |= STP_AFFIL_POLICY;
 		scb->ata_task.flags = flags;
 	}
+
+	if ((scb->ata_task.fis.command == ATA_SMART_COMMAND &&
+		scb->ata_task.fis.features == ATA_SMART_STATUS)
+		|| scb->ata_task.fis.command == ATA_DEVICE_DIAGNOSTIC
+		|| scb->ata_task.fis.command == ATA_CHECK_POWER_MODE)
+	{
+		scb->ata_task.ata_flags|=CSMI_TASK;
+	}
+
 	ascb->tasklet_complete = asd_task_tasklet_complete;
 
 	if (likely(!task->ata_task.device_control_reg_update))


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2007-08-31 18:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-31 18:03 Gilbert Wu [this message]
2007-08-31 18:27 ` [PATCH] scsi: Update Aic94xx SAS/SATA Linux open source device Jeff Garzik
2007-08-31 21:20   ` Gilbert Wu
2007-08-31 21:31 ` Douglas Gilbert
2007-08-31 23:56   ` Gilbert Wu

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=1188583419.6353.9.camel@linux.site \
    --to=gilbert_wu@adaptec.com \
    --cc=linux-scsi@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.