From patchwork Thu Aug 19 15:48:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 62181 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 93F36B70EF for ; Fri, 20 Aug 2010 01:49:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191Ab0HSPt2 (ORCPT ); Thu, 19 Aug 2010 11:49:28 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:32069 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750935Ab0HSPt2 (ORCPT ); Thu, 19 Aug 2010 11:49:28 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o7JFnJM5016558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Aug 2010 15:49:20 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o7J5ejW4015662; Thu, 19 Aug 2010 15:49:18 GMT Received: from abhmt009.oracle.com by acsmt355.oracle.com with ESMTP id 512366721282232956; Thu, 19 Aug 2010 08:49:16 -0700 Received: from groovelator.mkp.net (/209.217.122.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 19 Aug 2010 08:49:14 -0700 From: "Martin K. Petersen" To: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, hch@lst.de Cc: "Martin K. Petersen" Subject: [PATCH 1/6] libata: Signal that our SATL supports WRITE SAME(16) with UNMAP Date: Thu, 19 Aug 2010 11:48:56 -0400 Message-Id: <1282232941-9910-2-git-send-email-martin.petersen@oracle.com> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: <1282232941-9910-1-git-send-email-martin.petersen@oracle.com> References: <1282232941-9910-1-git-send-email-martin.petersen@oracle.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Until now identifying that a device supports WRITE SAME(16) with the UNMAP bit set has been black magic. Implement support for the new (SBC3 r24) Thin Provisioning VPD page and the TPWS bit. Signed-off-by: Martin K. Petersen --- drivers/ata/libata-scsi.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index a54273d..e280ae6 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2001,6 +2001,7 @@ static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args, u8 *rbuf) 0x89, /* page 0x89, ata info page */ 0xb0, /* page 0xb0, block limits page */ 0xb1, /* page 0xb1, block device characteristics page */ + 0xb2, /* page 0xb2, thin provisioning page */ }; rbuf[3] = sizeof(pages); /* number of supported VPD pages */ @@ -2172,6 +2173,15 @@ static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf) return 0; } +static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf) +{ + rbuf[1] = 0xb1; + rbuf[3] = 0x3c; + rbuf[5] = 1 << 6; /* TPWS */ + + return 0; +} + /** * ata_scsiop_noop - Command handler that simply returns success. * @args: device IDENTIFY data / SCSI command of interest. @@ -3250,6 +3260,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, case 0xb1: ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b1); break; + case 0xb2: + ata_scsi_rbuf_fill(&args, ata_scsiop_inq_b2); + break; default: ata_scsi_invalid_field(cmd, done); break;