From patchwork Thu Nov 5 15:47:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 7562331 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E0DEBEEA4 for ; Thu, 5 Nov 2015 15:48:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 222D7208A9 for ; Thu, 5 Nov 2015 15:48:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E4AD208B7 for ; Thu, 5 Nov 2015 15:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032972AbbKEPsM (ORCPT ); Thu, 5 Nov 2015 10:48:12 -0500 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35065 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030685AbbKEPsL (ORCPT ); Thu, 5 Nov 2015 10:48:11 -0500 Received: by pacrf6 with SMTP id rf6so11262265pac.2 for ; Thu, 05 Nov 2015 07:48:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vNij9D5DMOhVZ+jU2ccFY0dTDNn19wFNq12GyU0C1Yo=; b=kjYivY3FKMNOh54vyWRONg4GI3dAt64XshMLRAqJiYAxDSKg0GuE+M+n6tAPVIC9wF DsBYSG6U0mB6QOKWTelpp6+4H+NLxIXAYLY2PNtIWvDAX048LBXl3QWwmMNeVbCiOkJK mJLAX3rtBr4d6msvhx80XG8ZQKyROWLsn+xY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vNij9D5DMOhVZ+jU2ccFY0dTDNn19wFNq12GyU0C1Yo=; b=BoWJXrpnnPn0rdyU3oOk2j4bf5CXUE8kBuH987wVAmr4b68hJWlpmsUxPHH61QEMhw dbaOujvzmFFgMGWGm8Y3eiGEEkN9K/VpUZXGisTFZo/2abiSJslD+c2hqe28Oaim5veT 14DtRHPk51Hlyv6Ylcw4KfXwGLvrwCdewMq1GyIQaEJF5FMTdB6X8vm3NiGAH4JJOvK1 i2qzfks66LKmjOoHJvtZ++gIQks++9Gw2bGYiPqgAV1dUjLMXVUKMVAeszxe0xncerwo s9UAgkxEAX3+9kyYem3pUDzzJiTMViOUI9FXWYN3vtM1VRiikgHVohqtQQcBNnUfztec vZCA== X-Gm-Message-State: ALoCoQkjdp3TNEJH0GZWMFcV0qxGSg5ICgHdpJDdV8IXdKLZPml/W5OOyMChAmXPT9l84uZ9/x/H X-Received: by 10.67.3.167 with SMTP id bx7mr9927435pad.57.1446738490466; Thu, 05 Nov 2015 07:48:10 -0800 (PST) Received: from host1.lsi.com ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id sz7sm8628664pbc.57.2015.11.05.07.48.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Nov 2015 07:48:09 -0800 (PST) From: Sumit Saxena X-Google-Original-From: Sumit Saxena To: linux-scsi@vger.kernel.org, jbottomley@odin.com, martin.petersen@oracle.com, thenzl@redhat.com Cc: kashyap.desai@avagotech.com, Sumit Saxena Subject: [PATCH 1/2] megaraid_sas: Fix TAPE drive not exposed attached to PERC5 controller Date: Thu, 5 Nov 2015 21:17:37 +0530 Message-Id: <1446738458-12425-2-git-send-email-Sumit.Saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1446738458-12425-1-git-send-email-Sumit.Saxena@avagotech.com> References: <1446738458-12425-1-git-send-email-Sumit.Saxena@avagotech.com> 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 DELL PERC5 controller's(device ID- 0x0015) firmware does not expose TAPE drives to driver in response of DCMD- MR_DCMD_PD_LIST_QUERY and it causes TAPE drives not be exposed to OS when connected behind PERC5 controller. This patch will unblock scanning of TAPE drives connected behind PERC5 controller by exposing non TYPE_DISK unconditionally. This patch should be applied on top of last 2 patch series submitted by me. Here is the links for those series- http://marc.info/?l=linux-scsi&m=144489694505390&w=2 and http://marc.info/?l=linux-scsi&m=144102204225400&w=2 Signed-off-by: Kashyap Desai Signed-off-by: Sumit Saxena --- drivers/scsi/megaraid/megaraid_sas.h | 1 + drivers/scsi/megaraid/megaraid_sas_base.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 9b918ab..86572ee 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1790,6 +1790,7 @@ struct megasas_instance { u8 UnevenSpanSupport; u8 supportmax256vd; + u8 allow_fw_scan; u16 fw_supported_vd_count; u16 fw_supported_pd_count; diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index f8d5455..dfe1a3a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1760,6 +1760,20 @@ static void megasas_set_dma_alignment(struct scsi_device *sdev) static int megasas_slave_configure(struct scsi_device *sdev) { + u16 pd_index = 0; + struct megasas_instance *instance; + + instance = megasas_lookup_instance(sdev->host->host_no); + if (instance->allow_fw_scan) { + if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && + sdev->type == TYPE_DISK) { + pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) + + sdev->id; + if (instance->pd_list[pd_index].driveState != + MR_PD_STATE_SYSTEM) + return -ENXIO; + } + } megasas_set_dma_alignment(sdev); /* * The RAID firmware may require extended timeouts. @@ -1783,9 +1797,8 @@ static int megasas_slave_alloc(struct scsi_device *sdev) pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id; - if ((instance->pd_list[pd_index].driveState == - MR_PD_STATE_SYSTEM) || - (instance->pd_list[pd_index].driveType != TYPE_DISK)) { + if ((instance->allow_fw_scan || instance->pd_list[pd_index].driveState == + MR_PD_STATE_SYSTEM)) { return 0; } return -ENXIO; @@ -4699,6 +4712,7 @@ static int megasas_init_fw(struct megasas_instance *instance) case PCI_DEVICE_ID_DELL_PERC5: default: instance->instancet = &megasas_instance_template_xscale; + instance->allow_fw_scan = 1; break; }