From patchwork Wed Sep 26 04:22:33 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: 10615243 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 9938215A6 for ; Wed, 26 Sep 2018 04:23:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BE42285CB for ; Wed, 26 Sep 2018 04:23:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E99728627; Wed, 26 Sep 2018 04:23:07 +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=unavailable 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 C06FC285FD for ; Wed, 26 Sep 2018 04:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbeIZKeB (ORCPT ); Wed, 26 Sep 2018 06:34:01 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:41824 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbeIZKeA (ORCPT ); Wed, 26 Sep 2018 06:34:00 -0400 Received: by mail-qk1-f194.google.com with SMTP id n3-v6so14422595qkn.8 for ; Tue, 25 Sep 2018 21:23:03 -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=Lz8aiHv3tmdpsES4QvVmbMgVGn1T1cbRJZq6UNojIH0=; b=O5oeZ3mtzoxRHeRs1F8xtzjGijxtR3/YD3KyATVgZastCdkNKC0DbhME48BcVVQOyN 5lIZeWlyLPFPe0z4m9KYi8mOamgiHT0sTr8OMhUnLlirEnaEVvkEwWU2m828ceFdKIaM YKkUdi+1oFhYyL7sMXM8G/Qxa/Q2GqrRCieyE= 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=Lz8aiHv3tmdpsES4QvVmbMgVGn1T1cbRJZq6UNojIH0=; b=hKTnfksghgEuO2KDaCbrjOIhDCHasdA6quXd/z90P+3xiP1XD3eFfB4j2z1lhWFMo5 GtXEyXXI6nFZGBD1YvvJVa9F7Uql3mSzpOS19cEP0yL4EfL1/m9QQ8FbG2tq+iyPcN93 xDxDbzOyBrm+Rvoe1UEeY3LpzrjEnhn/5zozhele08ZgjkbYtZroBYpTMu4Q5PWPk8S9 fRwb4C79e0bQDb+mGYyDg4syUCgXFOY7jzdNruzZ9VJNwVrTZxyHHSRuOWtdGJWHl6Ur L/rmVdiV41K9uXjxqruHpOG8/3cnhA3yiHLUCtJoFBtmQBk7YaJ4n3xHMtDX6gA0gpxr 1qUw== X-Gm-Message-State: ABuFfohAehnSU0qOs8fwu+DQQqYEJfAhIC4E+VHA+P3KK2st4GX+nra9 NBNjlBP6YICqsVveFlRCWuwPI6fAOqA= X-Google-Smtp-Source: ACcGV62w/Ya/JyaAcJUjbEwCG48mG9tDoNtF51wef4DG6onDfppL7d9B9rK7geHj7mfHkLHaaspK/w== X-Received: by 2002:a37:50c3:: with SMTP id e186-v6mr2992945qkb.91.1537935782989; Tue, 25 Sep 2018 21:23:02 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id a17-v6sm2375260qkb.62.2018.09.25.21.22.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 21:23:02 -0700 (PDT) From: Suganath Prabu S To: linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org Cc: lukas@wunner.de, andy.shevchenko@gmail.com, Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, Suganath Prabu S Subject: [PATCH v4 0/6] mpt3sas: Hot-Plug Surprise removal support on IOC. Date: Wed, 26 Sep 2018 09:52:33 +0530 Message-Id: <1537935759-14754-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 V4 Change set: Reframe split strings in print statement, to avoid warning from checkpatch.pl. 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 | 133 +++++++++++++++------- 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, 296 insertions(+), 177 deletions(-)