From patchwork Thu Aug 30 03:26:26 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: 10581171 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 556E95A4 for ; Thu, 30 Aug 2018 03:27:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38CC12BCE4 for ; Thu, 30 Aug 2018 03:27:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29E342BCE6; Thu, 30 Aug 2018 03:27:04 +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 B91892BCE4 for ; Thu, 30 Aug 2018 03:27:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727493AbeH3H1D (ORCPT ); Thu, 30 Aug 2018 03:27:03 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:35035 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbeH3H1D (ORCPT ); Thu, 30 Aug 2018 03:27:03 -0400 Received: by mail-qt0-f195.google.com with SMTP id j7-v6so8317410qtp.2 for ; Wed, 29 Aug 2018 20:27:02 -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=FrQpbB8XP/wsX8ZQRAWuvrRBuLxWz6XwU4OG19upYtU=; b=QVE52p39GPP7iN5m5pviuBlBdauAm5Iz7YJ/eTG4helVCFFVO3YoUfTWga9Iz1HdBq SxEl/24w0NjdKhU/1o0VcdjOuA8nlNusL4L8/B6cK0S//I5HzTx4Wrc7LTTnDaYeCPIu 6axo/KTtePBsBbev/hgpscAAL3Uy8UTDgbbfk= 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=FrQpbB8XP/wsX8ZQRAWuvrRBuLxWz6XwU4OG19upYtU=; b=hPGyhePoQ8uxH3ROaf8oO+TGOv0K2s+zjf7lY5mmFrNSjU0nin2RsdZn0nuqlz9PKv BNW6Zaf1gFxgSxsG+KSD7zpwWv6mUkbSsUSpqelBeO3o67eDyLr96ubWAPtpi2wsliMD 46VNMvTMQ9Vu9WgwxL1ZX86lNh2XBvBrTyypcCWuB0Ak5NpDl7W83PW2t6236NRgOuFS RkFk92JA8uTrJve8mShziCUluOU8IqLEeYDftTeESqlxhs17fYVKgC/tmFiql/xzpK7R dt52cFw4RgGc4CgOI7o4g3uqr8Qd/R4oav1tiR6M1u26ve5QXFB1cUGAGCaHnuJXunT6 ljJg== X-Gm-Message-State: APzg51BaheqvvWmZx1yyGxSCLEckqpn5dUfC37oqRMMDxnRs8VyXR1Z5 X4Fl+nAQ9zKEqXRY1FTXnlGu9Sqw7Qw= X-Google-Smtp-Source: ANB0VdbLvmGkZDmA07WXWega1039sX5ViGT5fjJoRGfuR6fWuQJhkLZctwkMT0EubeROQUhS1v1x5w== X-Received: by 2002:ac8:435e:: with SMTP id a30-v6mr9799450qtn.261.1535599621491; Wed, 29 Aug 2018 20:27:01 -0700 (PDT) Received: from localhost.localdomain.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id f184-v6sm3215427qkc.23.2018.08.29.20.26.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Aug 2018 20:27:01 -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 0/7] mpt3sas: Hot-Plug Surprise removal support on IOC. Date: Wed, 29 Aug 2018 23:26:26 -0400 Message-Id: <1535599593-4739-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. Suganath Prabu S (7): mpt3sas: Introduce mpt3sas_base_pci_device_is_unplugged mpt3sas: Add HBA hot plug watchdog thread. mpt3sas: Seperate 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 | 247 ++++++++++++++++++++++++++----- drivers/scsi/mpt3sas/mpt3sas_base.h | 17 ++- drivers/scsi/mpt3sas/mpt3sas_config.c | 32 +--- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 26 +--- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 188 ++++++++++++++++++++--- drivers/scsi/mpt3sas/mpt3sas_transport.c | 82 +++------- 6 files changed, 413 insertions(+), 179 deletions(-)