From patchwork Wed Jan 13 08:09:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 8023201 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E82FE9F2F4 for ; Wed, 13 Jan 2016 08:10:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 260C5203F3 for ; Wed, 13 Jan 2016 08:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CE5820421 for ; Wed, 13 Jan 2016 08:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755111AbcAMIKg (ORCPT ); Wed, 13 Jan 2016 03:10:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:58977 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754903AbcAMIKU (ORCPT ); Wed, 13 Jan 2016 03:10:20 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D3FFAD6A; Wed, 13 Jan 2016 08:10:14 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: James Bottomley , Christoph Hellwig , Bart von Assche , Ewan Milne , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCHv3 16/24] scsi_dh_alua: Add new blacklist flag 'BLIST_SYNC_ALUA' Date: Wed, 13 Jan 2016 09:09:51 +0100 Message-Id: <1452672599-9820-17-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1452672599-9820-1-git-send-email-hare@suse.de> References: <1452672599-9820-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new blacklist flag BLIST_SYNC_ALUA to instruct the alua device handler to use synchronous command submission for ALUA commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 7 +++++++ include/scsi/scsi_devinfo.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 36c515c..f0687ba 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -27,6 +27,7 @@ #include #include #include +#include #define ALUA_DH_NAME "alua" #define ALUA_DH_VER "1.3" @@ -335,6 +336,10 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, int rel_port = -1, group_id; struct alua_port_group *pg, *old_pg = NULL; bool pg_updated = false; + unsigned int bflags = scsi_get_device_flags_keyed(sdev, + &sdev->inquiry[8], + &sdev->inquiry[16], + SCSI_DEVINFO_GLOBAL); group_id = scsi_vpd_tpg_id(sdev, &rel_port); if (group_id < 0) { @@ -373,6 +378,8 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, rcu_assign_pointer(h->pg, pg); pg_updated = true; } + if (bflags & BLIST_SYNC_ALUA) + pg->flags |= ALUA_SYNC_STPG; alua_rtpg_queue(h->pg, sdev, NULL); spin_unlock(&h->pg_lock); diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index aca3c80..dc0cb5f 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h @@ -37,6 +37,7 @@ #define BLIST_TRY_VPD_PAGES 0x10000000 /* Attempt to read VPD pages */ #define BLIST_NO_RSOC 0x20000000 /* don't try to issue RSOC */ #define BLIST_MAX_1024 0x40000000 /* maximum 1024 sector cdb length */ +#define BLIST_SYNC_ALUA 0x80000000 /* Synchronous ALUA commands */ /* list of keys for the lists */ enum {