From patchwork Fri Aug 31 04:34:34 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: 10583103 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 A22F714BD for ; Fri, 31 Aug 2018 04:35:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8603F2C18F for ; Fri, 31 Aug 2018 04:35:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77CFC2C1C2; Fri, 31 Aug 2018 04:35:09 +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 2F0B52C18F for ; Fri, 31 Aug 2018 04:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727070AbeHaIkk (ORCPT ); Fri, 31 Aug 2018 04:40:40 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45441 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726660AbeHaIkk (ORCPT ); Fri, 31 Aug 2018 04:40:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id 20-v6so9892989wrb.12 for ; Thu, 30 Aug 2018 21:35:05 -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=B4Ts4S/l/XsvQYueiGSb6vbf1TJPxuOCJnNg4GazaIw=; b=R2BDFjn+deYQjBTp/yGYpjiphJJ5Xp50LTnRwoCQhhctC1DCbuYCdMSwk6XMQRT4pw eNh1X5GwkN0Lg1pf0BwPRS8wbqUFU67Y2aB5ixGUVWTFqToC8je02AE6NTn2zgITY7Zb o/YAr+Pxk89Fr5ux2oI9mRaoUStZTNzC0s9pk= 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=B4Ts4S/l/XsvQYueiGSb6vbf1TJPxuOCJnNg4GazaIw=; b=qKhQRYADcnwDjK0gc73kizVT/1WpmBUPb1FTSHIXh+DpGH3F0hkFdhqPau6sNP/8Ce iTi1jsQaFToVzk3Rutn64ix9p+y2omy0ptl/B2C4rdTKSqqBmiiKFF8Qivno2svF0uCQ LypPQcx3W4wcuImzsxvQyAA9kyu8oLWGIvrlDxXuITP1zrzQMDpp8clxZZ23FSnLhFBN v0Vb6mYXZm3WmUX9/tXd0u7vl6YQLk1JhOeIICpNgl849OJs33PUPSi3yRC405Z+0Joh bonUgjpOja5JXLQgSJj9AkYlbgb2XfEOL7VFAIFgrrKBl2Am+83cCErrxghb3OadbYto pC8w== X-Gm-Message-State: APzg51ABUMiwgxZmUZ9aQwLSGrRQnscoZkjKgRFGqTFK/cGOVBymmY6c QJ3POjmMj/g2FaGYVbWl2Lb0fUsuFIM= X-Google-Smtp-Source: ANB0VdaHC1WmT++9n0UqYKVx9akHFvsaPJ5FA0a6tdl735LUNnJDI45FOFsW6qWJiGSfVJycaEJNxA== X-Received: by 2002:adf:d245:: with SMTP id o5-v6mr9327474wri.91.1535690104102; Thu, 30 Aug 2018 21:35:04 -0700 (PDT) Received: from localhost.localdomain.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id h15-v6sm2261735wmb.21.2018.08.30.21.35.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 21:35:03 -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 v1 0/7] mpt3sas: Hot-Plug Surprise removal support on IOC. Date: Fri, 31 Aug 2018 00:34:34 -0400 Message-Id: <1535690081-16116-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. 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 | 248 ++++++++++++++++++++++++++----- 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, 414 insertions(+), 179 deletions(-)