From patchwork Mon Sep 24 06:35:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10611923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 927D614BD for ; Mon, 24 Sep 2018 06:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95E892867F for ; Mon, 24 Sep 2018 06:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A41529BD9; Mon, 24 Sep 2018 06:35:29 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2CD8C2867F for ; Mon, 24 Sep 2018 06:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbeIXMgB (ORCPT ); Mon, 24 Sep 2018 08:36:01 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39278 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbeIXMgA (ORCPT ); Mon, 24 Sep 2018 08:36:00 -0400 Received: by mail-pg1-f193.google.com with SMTP id 85-v6so5658471pge.6 for ; Sun, 23 Sep 2018 23:35:27 -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; bh=K6S9S0vGMiElXsbntYNwuliQC2o7qtyMUd9dHcS3sIY=; b=eYi7NOJeNxd0BHP2VKOLcMBB+eSvBIn5xkl4TCsFL0d8KNlIb5AiSZFydLfR2Jz5o8 lL6RcE6j4n9frDByMRPA9TWyTVKYp+3wLWdFZVBkkQ+IbmE22FBOrKXH6dVoRocz3tNO gDUAvJwyOG1yl+8FJtleHhi6clKh6mmMNiEZI= 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; bh=K6S9S0vGMiElXsbntYNwuliQC2o7qtyMUd9dHcS3sIY=; b=ECRaGxU0A99VsT9/TTDGQKDvsEnsVDSfDW3c4r173bhDY/QDyhe5fOqj6jiqfBYOiY Ht91DOSKrpBOQ+6jekjfRtCtUkbGNsw7mncwUOcAa74aGwMKng5nfL/m0dzomt7pB+Of 99q+Ls3dy6gRBt/cFE/uwhk5zUQU+NY8DoM/ZlvrbCTr+hq8+vDKae1X/heASqxlQehY sftvjcKM0sQfUK7hcHYefe220GO4Id2jfnRu95Jm6gu4juw0//uOOv0e1TynVjwY/oKo XSYxq92j1ttsJ++n+Vc8QzxT3D6g5glYWUdqAX1UWJkqHQG/qcEHZg7iI7x69PfGizK0 DMCg== X-Gm-Message-State: ABuFfog8OeLzCDiZ2seqxKoB7NGyUlr4uY4fqU6sbLbVS03Q1TYuyQgy cfu+snYQN5GvXQfWAGJQbIXF5N42KGM= X-Google-Smtp-Source: ACcGV62ixBs9hPDXQQIvT1bE1lV9T/RPwP8ceAYwEkLI80t+jOW2EgZgNAotGMh3uLCiYE33iQj6xg== X-Received: by 2002:a65:6654:: with SMTP id z20-v6mr8243056pgv.186.1537770926798; Sun, 23 Sep 2018 23:35:26 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 203-v6sm12287064pge.25.2018.09.23.23.35.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 23:35:25 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v3 0/6] mpt3sas: Hot-Plug Surprise removal support on IOC. Date: Mon, 24 Sep 2018 12:05:10 +0530 Message-Id: <1537770916-16337-1-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 1.8.3.1 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 Posting below set of patches to support PCIe Hot Plug surprise removal, and few defect fixes. This is NOT the normal PCIe Hot Plug support, whereby the user informs the OS that a hot removal is desired, the OS does an orderly shutdown of the driver on the device, special hot plug circuitry removes power from the PCIe slot, then the user can remove the device and replace it (where orderly bring-up of the device is done). With a true surprise removal (just removing HBA from a slot) there is a possibility to get all kinds of PCIe transaction errors, Below patches addresses those issues and remove HBA without bringing the system down. For surprise removal detection, driver does a PCI read of IOC's vendor field in IOC's PCI configuration space. If the read value is 0xFFFFFFFF this indicates that the device might have hot removed and the device will be removed from driver. V1 changes: In Patch 0001 - unlock mutex, if active reset is in progress. V2 changes: Replaced mpt3sas_base_pci_device_is_unplugged with pci_device_is_present. V3 Change Set: Simplified function "mpt3sas_base_pci_device_is_available" and made inline Suganath Prabu S (6): mpt3sas: Introduce mpt3sas_base_pci_device_is_available mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational mpt3sas: Introdude _scsih_get_shost_and_ioc. mpt3sas: Fix Sync cache command failure during driver unload. mpt3sas: Fix driver modifying NVRAM/persistent data. mpt3sas: Bump driver version to 27.100.00.00. drivers/scsi/mpt3sas/mpt3sas_base.c | 135 +++++++++++++++------- drivers/scsi/mpt3sas/mpt3sas_base.h | 11 +- drivers/scsi/mpt3sas/mpt3sas_config.c | 32 +----- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 26 +---- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 189 +++++++++++++++++++++++++++---- drivers/scsi/mpt3sas/mpt3sas_transport.c | 82 +++----------- 6 files changed, 298 insertions(+), 177 deletions(-)