From patchwork Thu Jul 30 20:11:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 30397 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 3F9E4B7BCD for ; Fri, 31 Jul 2009 06:11:35 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687AbZG3ULc (ORCPT ); Thu, 30 Jul 2009 16:11:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752688AbZG3ULc (ORCPT ); Thu, 30 Jul 2009 16:11:32 -0400 Received: from rv-out-0506.google.com ([209.85.198.230]:21266 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbZG3ULc (ORCPT ); Thu, 30 Jul 2009 16:11:32 -0400 Received: by rv-out-0506.google.com with SMTP id f6so478483rvb.1 for ; Thu, 30 Jul 2009 13:11:32 -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:content-type :content-transfer-encoding; bh=J9tZhc4y/BO36ZuZt6KqEMmkz2edw7bSdPnYi9ivXiM=; b=CMoCax1Th/LJ6M++na5HL3kdaonkhFY4VYbmZn02pm1bNEb9AwRPF5NmSzHIHVr8Xw kn8xos9LlWILJD8ZUUYLTj6dnTBmQvuYvUE7FyBI5/POGhR7mmhEJTp+CFim4k7mmtI7 Q+ur+Zp9b8KqdfU3+ss4rHJRIXgxG8CbX9VyA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=irfx855AVk0/kHZDH8jHKN09NU4vydxbd9WmRGUk6pvp4283uD39+aHxzSfUGbWOt6 ZM68BtBULXx8KMno9edzvbqmKrhF9HGsK4jna7QJj3nn7he9gfKIzH2XRewogqGmUqzp zqXT46dhu+stqkArjN0rlp2avUtks47e0Gd5s= Received: by 10.140.165.21 with SMTP id n21mr1176443rve.268.1248984692558; Thu, 30 Jul 2009 13:11:32 -0700 (PDT) Received: from ?192.168.1.113? (S0106000c41bb86e1.ss.shawcable.net [70.76.47.20]) by mx.google.com with ESMTPS id l31sm13811149rvb.24.2009.07.30.13.11.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Jul 2009 13:11:32 -0700 (PDT) Message-ID: <4A71FE71.7040002@gmail.com> Date: Thu, 30 Jul 2009 14:11:29 -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: ide , Jeff Garzik CC: Tejun Heo , Mark Lord Subject: [PATCH #upstream] sata_sil24: always set protocol override for non-ATAPI data commands Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The sil24 hardware has a built-in list of commands and associated protocols that gets used by default to decide how to handle a given command. However, if the command is not known to the controller then it presumably assumes it to be a non-data command which then causes protocol mismatch errors if the device ends up requesting data transfer. The new DATA SET MANAGEMENT - Trim command causes this issue since it's a DMA data-out command. Since we should always know best what protocol the command should be using, let's just set the override flag to inform the controller what protocol to use for all non-ATAPI commands with data transfer. Signed-off-by: Robert Hancock Tested-by: Mark Lord --- 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;