From patchwork Wed Jul 6 17:13:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 9216699 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 F08C760467 for ; Wed, 6 Jul 2016 17:13:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC1D727F9E for ; Wed, 6 Jul 2016 17:13:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0E9327FA2; Wed, 6 Jul 2016 17:13:34 +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 8D4E927F9E for ; Wed, 6 Jul 2016 17:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755118AbcGFRNe (ORCPT ); Wed, 6 Jul 2016 13:13:34 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36686 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbcGFRNb (ORCPT ); Wed, 6 Jul 2016 13:13:31 -0400 Received: by mail-pa0-f67.google.com with SMTP id ib6so5484435pad.3; Wed, 06 Jul 2016 10:13:31 -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=/fOL7Ej37WYayNPwiPmPDKTnkExmGt6OooPaFi0k5EE=; b=cqh7OnVs6edG5Q/6iTGOAnCRj4EJRo514WBv/3JBO665gb4kiGmpKj2rjww2i8VdJl 64HTg/jGGRtALGhK6zw82JsvOH3/J8dqIic88i7LyZy1uFBFzGLEvKJtrg2VznMspFCh aLdhtVs91lNFS1Nmij66uPo7WUL19yzQ8ThlZW723nG9hbYDS8cJtuDkwc60LrZVP26L Peit/U+cTxO3w8q1dLmS6vOr8SjsSPU2beUzh9k7rFVKGWWqtm6MUtpiyIX5LQ95voqT SLlnCPY56mzrP9nHu8G1mDHZByAoIge25LMGMcxyP0VxNDC7+tZ4DfsvdOSo/f/SvGaM FRUA== 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=/fOL7Ej37WYayNPwiPmPDKTnkExmGt6OooPaFi0k5EE=; b=kIauWGhBLMX7HuLJIrDemTIKXidPLRfXZGHLN2Vgi2JYdJEraVt64MJWOLw0DtD2fl jLOtqu0dTf4qwNB4ib3mc8NMnGFy6WcIsAsUgyJkFGF4hAyMa164imUPaKFtQZdtGeqx 5y2WHCVTfTPkP2W6Ht644n2uDgisOcBiZdglePy69FC2x+rLTFg+yU1okSa7Z0KIfL+7 XtaiCuKMeusbWr9nSQ6Sc39nB7T2Rp1L7YU+pG21cnuZEvcym+2AJFUQSIqW+qAUYr+2 JZtl5jh3j8QgNTISgfTnayBPTu91wIVFwmSY6R7e3K7yLa16z4obEaq3+2bcmPV1m3Y6 OjzQ== X-Gm-Message-State: ALyK8tKxSuTH0XDubVegPoPJESwmPWXgeq0vtIo/RYKCUt7TdRCXVx8D2ufTbhTcz78DbQ== X-Received: by 10.66.150.67 with SMTP id ug3mr44143104pab.41.1467825206068; Wed, 06 Jul 2016 10:13:26 -0700 (PDT) Received: from localhost.localdomain ([2404:c805:e00:4700:ae22:bff:fe29:e60c]) by smtp.gmail.com with ESMTPSA id e20sm5461565pfk.1.2016.07.06.10.13.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 10:13:25 -0700 (PDT) Message-ID: <577d3c35.949b620a.2f8b5.ffffb1c4@mx.google.com> X-Google-Original-Message-ID: <20160706171309.1772-1-me> From: tom.ty89@gmail.com X-Google-Original-From: me To: tj@kernel.org, martin.petersen@oracle.com, sergei.shtylyov@cogentembedded.com Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Tom Yan Subject: [PATCH resend 1/2] libata-scsi: do not respond with "invalid field" for FORMAT UNIT Date: Thu, 7 Jul 2016 01:13:08 +0800 X-Mailer: git-send-email 2.9.0 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 respond with "Invalid field in CDB" while we have no support at all implemented for FORMAT UNIT. It is decent to let it go to the default, which will respond 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 bfec66f..f1125fd 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -4039,11 +4039,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);