From patchwork Tue Jul 12 18:54:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 9225955 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 A515D60868 for ; Tue, 12 Jul 2016 18:55:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97F8327C38 for ; Tue, 12 Jul 2016 18:55:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B61227D5D; Tue, 12 Jul 2016 18:55:22 +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 2BE1327C38 for ; Tue, 12 Jul 2016 18:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750986AbcGLSzV (ORCPT ); Tue, 12 Jul 2016 14:55:21 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33310 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750850AbcGLSzU (ORCPT ); Tue, 12 Jul 2016 14:55:20 -0400 Received: by mail-pa0-f65.google.com with SMTP id q2so1537990pap.0; Tue, 12 Jul 2016 11:55:15 -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=owt4oFeLhITwyEbY1GHEP8LnbtGTQT36QEjGD8bIxhw=; b=V9uxPZ0aPI6So6rLQQIxeVG4wDmTS82KSwnjr8oXP5N00Nc0hjjgQXDg+K1p6nLYY4 O8Y6DhGcMC5qdr/NcHmoPS+jz21xoDck6oYDOwJsL3Yhdn7pr/cQDB6l12HH5ZqQGLy5 spaqAUEUKnYWArHw8gJmxmKAF1p+4RlTu87/AEdA+AJu3ojQ6B4PFowNfk9Q4dtBsoLU UccCzYZ1TsATIid/gT9uuUOxhCqOWcn1Qa/eqi1jkixa5YAA80SO7l5jEme0YMUjIZGl K42LMN2WDPQmtpxiZP16XSOnHnqsOOzHzJ3PkJHe9lzntNucRd1+Ywiqu8QOqaqrvKDS yZ7A== 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=owt4oFeLhITwyEbY1GHEP8LnbtGTQT36QEjGD8bIxhw=; b=G95OTkUhBiNHNwNad9mOHPSDCqPROuv+O+GkQyLKR5YmRQdoUbwDgdOtaH38KQ6vEB 3wEANG9lIIIk/FIqIy8Udwqu7KFvLYoDWSW+YMC0vqi0rW2+Iiq9a/pF6xR99cl/uI8u C8Y3JxviKGW6qMeK2EfEphhmlQw+uwHAsSDlmMlgFbSFBM/rhttizbc6CXWLia4SSqCe 825xSTfwYqjlIesSy3Pg59+++iVe1pJCq0l6lIfGfQZTPCFLUnHK7sQQuDbplwYk7kXv AJzpAyf3PaTp6QtyvyyJtYVZy3sqUB0F/PwRMtxfLTdylDTzAb+q4/Prf68yQPUuy+UY vLCQ== X-Gm-Message-State: ALyK8tINfp+rwVRBspxA5nyDJP79t8Tj9EZ6eUMrWaik7TCpzyJMFdfGGtgloKEUN3Q2yQ== X-Received: by 10.66.138.74 with SMTP id qo10mr6465195pab.135.1468349685546; Tue, 12 Jul 2016 11:54:45 -0700 (PDT) Received: from localhost.localdomain ([2404:c805:e00:4700:ae22:bff:fe29:e60c]) by smtp.gmail.com with ESMTPSA id tm1sm6862368pab.31.2016.07.12.11.54.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2016 11:54:45 -0700 (PDT) Message-ID: <57853cf5.c193420a.83221.11da@mx.google.com> X-Google-Original-Message-ID: <20160712185412.4462-1-me> From: tom.ty89@gmail.com X-Google-Original-From: me To: tj@kernel.org, hare@suse.de Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Tom Yan Subject: [PATCH v2 1/2] libata-scsi: fix D_SENSE bit relection in control mode page Date: Wed, 13 Jul 2016 02:54:11 +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 The bit should always be set to 1 when the requested version of page is "changeable" because we've made it so in ata_mselect_control(). Also, it should always be set to 1 if ATA_DFLAG_D_SENSE is set (when the requested version of page is "current" or "default"). Signed-off-by: Tom Yan diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index bfec66f..7e24f0a 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2446,7 +2446,7 @@ static unsigned int ata_msense_ctl_mode(struct ata_device *dev, u8 *buf, bool changeable) { modecpy(buf, def_control_mpage, sizeof(def_control_mpage), changeable); - if (changeable && (dev->flags & ATA_DFLAG_D_SENSE)) + if (changeable || (dev->flags & ATA_DFLAG_D_SENSE)) buf[2] |= (1 << 2); /* Descriptor sense requested */ return sizeof(def_control_mpage); }