From patchwork Mon May 2 20:13:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 617678 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 3qzFqc75Lvz9t43 for ; Tue, 3 May 2016 06:13:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=KvzFxyUy; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755143AbcEBUNb (ORCPT ); Mon, 2 May 2016 16:13:31 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33077 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755129AbcEBUNa (ORCPT ); Mon, 2 May 2016 16:13:30 -0400 Received: by mail-pf0-f195.google.com with SMTP id y7so168503pfb.0; Mon, 02 May 2016 13:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:subject:date; bh=VfoEDthqxTQvzfDwhSkw5PrXJ2bJs+oWAQ0Bu37BC18=; b=KvzFxyUyRcQAIdhKkk0sb+wWoVWGHLrBL3eGxCOhjQjNlbDMRQgP4xcaOVU9zHyj8p 9UrLadvMeMrxKf8+lmTUkidzpCJz/h1iCm6ZJzNAhBFrGiMxC2i+94tFyxJ7x4pClbmD 3o64Cu1PhWCatgS8BZwYKq2qtfDz7Ryn2ctlOIfe/Qqw+y+obowrpsmX+MFHgbPztRKV DclH2gmA4ngc7OlzlvD6KOeLAF8pevIA1rhsiF8+lsGmmgDBVtw8rzBtJ2N+COzdWArm dzvFHGP81/HhQmSrrDbmh3C1a6GnZPnQAdnPatiIP0YaQ52BqmVehGkk0yzQbMvLtVhu 7Efw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:subject:date; bh=VfoEDthqxTQvzfDwhSkw5PrXJ2bJs+oWAQ0Bu37BC18=; b=OAp+eK4+H3MidMt5V/j1/2WF+uDDVyZold8/nCT9x5fL2B2TfMD/q495MPS3lm2BOm 721ZlU3+Zk/wA1AZctlhitKYe+AOem8SYVNmh6VOrm/r+G7zXD0VTUTnEgnKwp4cSoqf 7+zQcsHgavu0dOJ3pone71ALionhJoN4M4/FTzkoBbxV8qbk+dzM6OX7srnAp63SVCm1 61Se0Shj4OGvHbOjw0023B5q5gR4sC2xX0AlRKBCa/F2UhP5l+O8g6UlYl3lEzqc9KsB djycTOZiJCHqZ7OhvjD0GzSWCJhmbwGTqdMsQstF7PHcmaquzYUnDMcZZx1lhGYadcDw qCIA== X-Gm-Message-State: AOPr4FWM2LNPfW0dpwkCrBFiJpWSoE6EWSDgqPz82VS8HqIm9lXkiq29dh7igCregsSvrw== X-Received: by 10.98.69.213 with SMTP id n82mr54776279pfi.48.1462220009070; Mon, 02 May 2016 13:13:29 -0700 (PDT) Received: from localhost.localdomain (n11211848121.netvigator.com. [112.118.48.121]) by smtp.gmail.com with ESMTPSA id q70sm47469656pfj.81.2016.05.02.13.13.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 May 2016 13:13:28 -0700 (PDT) Message-ID: <5727b4e8.c923620a.641f4.17a2@mx.google.com> X-Google-Original-Message-ID: <1462220001-2566-1-git-send-email-me> From: tom.ty89@gmail.com X-Google-Original-From: me To: tj@kernel.org, linux-ide@vger.kernel.org Cc: linux-scsi@vger.kernel.org, Tom Yan Subject: [PATCH 1/3] libata-scsi: Set CmdQue=1 when NCQ is enabled Date: Tue, 3 May 2016 04:13:19 +0800 X-Mailer: git-send-email 2.8.2 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Tom Yan https://bugzilla.kernel.org/show_bug.cgi?id=105931 This might look trivial at first sight. However, it can be important to have the bit set accordingly when the device/SATL is SCSI-passthrough'd to a virtual machine with scsi-block in qemu: https://github.com/YanVugenfirer/kvm-guest-drivers-windows/issues/63#issuecomment-216199929 Signed-off-by: Tom Yan diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 567859c..cd30f11 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2007,7 +2007,10 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) 0, 0x5, /* claim SPC-3 version compatibility */ 2, - 95 - 4 + 95 - 4, + 0, + 0, + 0 }; VPRINTK("ENTER\n"); @@ -2024,6 +2027,9 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) hdr[2] = 0x6; /* ZBC is defined in SPC-4 */ } + if (ata_ncq_enabled(args->dev)) + hdr[7] |= (1 << 1); + memcpy(rbuf, hdr, sizeof(hdr)); memcpy(&rbuf[8], "ATA ", 8); ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16);