From patchwork Wed Mar 17 19:08:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 12146861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D67E4C433E6 for ; Wed, 17 Mar 2021 19:09:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91F9A64F26 for ; Wed, 17 Mar 2021 19:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232865AbhCQTJI (ORCPT ); Wed, 17 Mar 2021 15:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232907AbhCQTIz (ORCPT ); Wed, 17 Mar 2021 15:08:55 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4823C06174A for ; Wed, 17 Mar 2021 12:08:55 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id g15so1803476pfq.3 for ; Wed, 17 Mar 2021 12:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=He7DX3iRuO9/WVBe7wbzkyCQ9hGXeS7TyqX1/mD7KFo=; b=dtOMNcdHD5OWon8DLE6xhjbrxxXgJ4tAmTSfB3x2GHrmkjn4CuX+0xyQDRrqa3a4+H 0Ajm9KQBBjduZmxt0D7ZuPQq+ERE8Xq2+CNxAyig/pFudvhLLXa2wxK5tnI/mTsWDUFv JGJmMgpBusyZVTclQaaUZ2zwwx+DZq3kNUBdQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=He7DX3iRuO9/WVBe7wbzkyCQ9hGXeS7TyqX1/mD7KFo=; b=V7ZAeiPvntyrqR42zKJ8f4yQW13dz6fZFRlfO5pj4+J/HerkN+rIdJX7Z/9XrdDV2M qYPxrkkRCsXFoifTl6Sgc+Tr8ezZctQnSCJltWqXZWwkwTzeAyjZMZueHgwAdV+22UOv SVAVxRi8OpKje2YJB7KRQa7BS0FoBxAIpLzyWqkI+UvFNE/gaLDS+6PY4N1cpKHn5Fz3 4BigchFLmjDiY5MGDwfLmx21cpZ+Ehe0KOiqrL8LADYn4S0yRVGLA6fycALJCqg4lbrI kE0GCOkqbZfZsu+CckA47D9wMmhDbijj71kszE4HAaDUXoMQRiWLb59BaJA7KyQIel2C pQAA== X-Gm-Message-State: AOAM5305Ov7NyoRwiLnK6B+aQ+6GnxbyIeE4njGYl9pjcY20sw1LR1Y7 zWAoXNDnXvHHQtFAahbaj6pk77hqfU2RbqtjK4UIfryiD2ukFsEESvju0h+eK95WcYCEHlrnyo5 FTM8lWdG0PmcCm6xcC/uoYcAqDHOb84RdszQTd8obdAEs43Aex4oWKadJhhy7nbzTg1t89PMLfP dXGES4xgfHroRd X-Google-Smtp-Source: ABdhPJym0xwXRikJ6GEWuRwrJ5dH2ylrr5revtn3/l8f6IId+/3QrXB3y7/6tf1ECnl6qUNfLj6i6w== X-Received: by 2002:a63:f754:: with SMTP id f20mr3724735pgk.382.1616008134894; Wed, 17 Mar 2021 12:08:54 -0700 (PDT) Received: from dhcp-10-123-20-75.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w2sm20569437pgh.54.2021.03.17.12.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 12:08:54 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, anand.lodnoor@broadcom.com, Chandrakanth Patil , stable@vger.kernel.org Subject: [PATCH 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Date: Thu, 18 Mar 2021 00:38:20 +0530 Message-Id: <20210317190824.3050-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210317190824.3050-1-chandrakanth.patil@broadcom.com> References: <20210317190824.3050-1-chandrakanth.patil@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Driver issues all non-ReadWrite IOs for TYPE_ENCLOSURE devices through the fast path with invalid dev handle and fast path inturn directs all the IOs to the firmware. As firmware stopped handling those IOs from SAS3.5 generation of controllers (Ventura and its onward generations) lead to IOs failure. The driver will issue all the non-ReadWrite IOs for TYPE_ENCLOSURE devices directly to firmware from SAS3.5 generation of controllers. Cc: # v5.10+ Signed-off-by: Chandrakanth Patil Signed-off-by: Sumit Saxena --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 38fc9467c625..73295cf74cbe 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3167,6 +3167,8 @@ megasas_build_io_fusion(struct megasas_instance *instance, { int sge_count; u8 cmd_type; + u16 pd_index = 0; + u8 drive_type = 0; struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request; struct MR_PRIV_DEVICE *mr_device_priv_data; mr_device_priv_data = scp->device->hostdata; @@ -3201,8 +3203,12 @@ megasas_build_io_fusion(struct megasas_instance *instance, megasas_build_syspd_fusion(instance, scp, cmd, true); break; case NON_READ_WRITE_SYSPDIO: - if (instance->secure_jbod_support || - mr_device_priv_data->is_tm_capable) + pd_index = MEGASAS_PD_INDEX(scp); + drive_type = instance->pd_list[pd_index].driveType; + if ((instance->secure_jbod_support || + mr_device_priv_data->is_tm_capable) || + (instance->adapter_type >= VENTURA_SERIES && + drive_type == TYPE_ENCLOSURE)) megasas_build_syspd_fusion(instance, scp, cmd, false); else megasas_build_syspd_fusion(instance, scp, cmd, true);