From patchwork Mon Jul 4 20:53:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 9213103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5942F60572 for ; Mon, 4 Jul 2016 20:53:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49A5823B3D for ; Mon, 4 Jul 2016 20:53:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E3B02879D; Mon, 4 Jul 2016 20:53:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE4E23B3D for ; Mon, 4 Jul 2016 20:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753956AbcGDUxs (ORCPT ); Mon, 4 Jul 2016 16:53:48 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36765 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753851AbcGDUxr (ORCPT ); Mon, 4 Jul 2016 16:53:47 -0400 Received: by mail-pf0-f194.google.com with SMTP id i123so17128467pfg.3; Mon, 04 Jul 2016 13:53:47 -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:in-reply-to:references; bh=+jpvi2kjtcreRrh31c22xL33s2SwpQQX3PUg8IAspdQ=; b=fL4k6yHKXiR7AKqgQyoFSx31lnRNlMKk/yDm/lMSdF3r/fRebiXKT/MSYv41WWXAFZ NdMJMEoBKmwOd5xB1wyLIfLuYbOEqROlt4HIw2Pscf8cq2/uUrCxCQe3a1Wc5qjHG+yh RlOmP5FC3ahDE6W4uqW5ZdcUbGzHXaqsjkEVx6YvuUdQRJaQpmQZcbpcVRKFRsHNMVAn pPsTl8meQlZY3lWgAO7DGXdVkYmy2nLX1Q5o0/Ceo/yHmCETF3WvWpqLes639Qu4HRDd bwnxIleSVpjTwiF2rpijaOj97tJ+6sNi22MxI3H5xeoDWQfw6y8mA7UHsH2WCW3YrEcJ T2GQ== 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:in-reply-to :references; bh=+jpvi2kjtcreRrh31c22xL33s2SwpQQX3PUg8IAspdQ=; b=V3rIe3JwCiACFLFTUeseI3eK8ty5cuTPmyf1mXukfJng25wihWj1OY8bq+bNktsgn6 dWV5CGQJR73y345dcerfxdeiUzMhTFDYFrAFVEaVkQ8MAXB83m43i7O+w7bGR5cwmTeQ P/6qj6CquB5qBfe38LkqSDYe4TqpkURZKYKKULY6Xnh2ShuYayW6whT4xfdcsty4rMCR q91/40crP3mlgDPoo8XxJlPescRf4f7LRasbhr+dM26JRVozcibo17J7392dFt/B41YI lyHziZZ7/Mlxr6K+aBk51Y9jHt3MX5qsLJaJldLnMVFCGGSizGeLn/7A/GhKhiExrgop GhzQ== X-Gm-Message-State: ALyK8tJsvb2wF0NNsr7ljAeeThGOaDh4NDZt7CpRrbzoZ8BluF0a+1yNJtjFBkZx/7gzAg== X-Received: by 10.98.33.138 with SMTP id o10mr25618156pfj.151.1467665626955; Mon, 04 Jul 2016 13:53:46 -0700 (PDT) Received: from localhost.localdomain ([2404:c805:e00:4700:ae22:bff:fe29:e60c]) by smtp.gmail.com with ESMTPSA id x67sm7023413pff.47.2016.07.04.13.53.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 13:53:46 -0700 (PDT) Message-ID: <577accda.46c0620a.65070.ffffec86@mx.google.com> X-Google-Original-Message-ID: <20160704205335.5484-2-me> From: tom.ty89@gmail.com X-Google-Original-From: me To: tj@kernel.org, martin.petersen@oracle.com Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Tom Yan Subject: [PATCH 2/2] libata-scsi: do not response with "invalid field" for FORMAT UNIT Date: Tue, 5 Jul 2016 04:53:35 +0800 X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160704205335.5484-1-me> References: <20160704205335.5484-1-me> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tom Yan It does not make sense and is confusing to response with "Invalid field in cbd" while we have no support at all implemented for FORMAT UNIT. It is decent to let it go to the default, which will response with "Invalid command operation code" instead. Signed-off-by: Tom Yan diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 80d732c..f70f9d1 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -4045,11 +4045,6 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd) args.done = cmd->scsi_done; switch(scsicmd[0]) { - /* TODO: worth improving? */ - case FORMAT_UNIT: - ata_scsi_invalid_field(dev, cmd, 0); - break; - case INQUIRY: if (scsicmd[1] & 2) /* is CmdDt set? */ ata_scsi_invalid_field(dev, cmd, 1);