From patchwork Thu Jul 30 18:27:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 30394 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by bilbo.ozlabs.org (Postfix) with ESMTP id 9BAE7B7BBB for ; Fri, 31 Jul 2009 04:27:58 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750786AbZG3S1y (ORCPT ); Thu, 30 Jul 2009 14:27:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750804AbZG3S1y (ORCPT ); Thu, 30 Jul 2009 14:27:54 -0400 Received: from mail-px0-f203.google.com ([209.85.216.203]:46034 "EHLO mail-px0-f203.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750786AbZG3S1y (ORCPT ); Thu, 30 Jul 2009 14:27:54 -0400 Received: by pxi41 with SMTP id 41so469134pxi.33 for ; Thu, 30 Jul 2009 11:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=m97ZeZAsQbA6DpE7eYt9p7b4d6ZKR8fVu6+ipF1Miho=; b=AnuzdT5BbrKsceP/ODlE66UPfQjROFN3Zss8EVENaM/jMBmHCfuBPjcugVaxEYZPeL N8DmQun82+4Jx5fKAkA45d5/DY6c8Ud7sUn8o6AgFkiH6auBMGpJzweVN8NrDqKT6iX4 6kngD7oRRCEzonhv21XuyDCV11Cy7H0ef4SHg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Gb4FIE0NViS7BFnqieTQjpHwMx/VX0gT6LhpXocdBZxXMjOk7jcjUOIvpdzPfaDNod m/coA+PrPcVYID7zHXJaRxdQX3vHR0gsjqTdBFqH7suVvP+6rNSO0wCE+RQDOMCcZaa7 sdHGL4hs7Bzy4xNJOx0+7Vep866TIViblUZpg= Received: by 10.114.61.16 with SMTP id j16mr894602waa.77.1248978474613; Thu, 30 Jul 2009 11:27:54 -0700 (PDT) Received: from ?192.168.1.113? (S0106000c41bb86e1.ss.shawcable.net [70.76.47.20]) by mx.google.com with ESMTPS id k21sm3596513waf.24.2009.07.30.11.27.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Jul 2009 11:27:52 -0700 (PDT) Message-ID: <4A71E623.7030205@gmail.com> Date: Thu, 30 Jul 2009 12:27:47 -0600 From: Robert Hancock User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Mark Lord CC: IDE/ATA development list , Tejun Heo , Jeff Garzik Subject: Re: hdparm-9.17 released, with experimental trim/wiper scripts for SSDs References: <4A70DCB8.9000909@rtr.ca> <4A70DDC5.3000607@rtr.ca> <4A7149C6.4030508@gmail.com> <4A719820.20900@rtr.ca> In-Reply-To: <4A719820.20900@rtr.ca> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org On 07/30/2009 06:54 AM, Mark Lord wrote: >> Yeah, according to the datasheet "The SiI3124 will decode the 8-bit ATA >> command at PRB offset 0x0a and automatically execute the default >> protocol for the command. In certain cases it might be desirable to >> specify a non-default protocol to be used, such as with vendor >> specific device commands." The DSM command seems to be DMA data-out >> and the chip likely doesn't know that command. I have to wonder why >> they decided to use that design instead of just making the driver >> indicate the protocol explicitly. In any case, it looks like the >> driver needs code to override the protocol setting for this command. >> (Maybe we should just set the protocol override for what we know the >> command is supposed to be in all cases?) > .. > > If you can puzzle out how to do that, and post a quick(?) patch, > it would certainly make testing SSDs easier for me here. > > I would like to use the Sil3124 ExpressCard controller with my notebook > for this stuff, rather than having to power up one of the noisy > full-size systems under the table. ;) You can try this patch (totally untested) which basically just bludgeons it into doing what we want for all non-packet commands: --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 77aa8d7..e6946fc 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c @@ -846,6 +846,17 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) if (!ata_is_atapi(qc->tf.protocol)) { prb = &cb->ata.prb; sge = cb->ata.sge; + if (ata_is_data(qc->tf.protocol)) { + u16 prot = 0; + ctrl = PRB_CTRL_PROTOCOL; + if (ata_is_ncq(qc->tf.protocol)) + prot |= PRB_PROT_NCQ; + if (qc->tf.flags & ATA_TFLAG_WRITE) + prot |= PRB_PROT_WRITE; + else + prot |= PRB_PROT_READ; + prb->prot = cpu_to_le16(prot); + } } else { prb = &cb->atapi.prb; sge = cb->atapi.sge;