From patchwork Thu Sep 20 11:04:04 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: 10607429 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 87777174F for ; Thu, 20 Sep 2018 11:04:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76F3C2CE9D for ; Thu, 20 Sep 2018 11:04:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B0ED2CF8A; Thu, 20 Sep 2018 11:04:28 +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 6D3CE2CE9D for ; Thu, 20 Sep 2018 11:04:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731343AbeITQrV (ORCPT ); Thu, 20 Sep 2018 12:47:21 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39724 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbeITQrV (ORCPT ); Thu, 20 Sep 2018 12:47:21 -0400 Received: by mail-ed1-f65.google.com with SMTP id h4-v6so7495499edi.6 for ; Thu, 20 Sep 2018 04:04:24 -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=bzvs/Rk7Z/pSSGzIqL9xSXPc3ksPicNBSi7wcbfBHxw=; b=T11KuAKeL09lmjvPgrRpJQtXDRTyLIKT/ngX3HX7J4ObFgwaM9Miqy3gHNPHm+JTt+ Mx+9+Yp6SaI4WAC2c+bt3jtkVRdwKMQB14qzn7s7hMH8MjkTincSnPGGNY13rMmEMFS7 62r1/LP7BSMBuySJijI+AMT54BB5IvYBBmyEw= 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=bzvs/Rk7Z/pSSGzIqL9xSXPc3ksPicNBSi7wcbfBHxw=; b=bXeMd+fdxdayUJKt7pUx1Xang4aobMQzh9MV5Qu0bNTS23AKZoiTfV2VCIqrrJagHI +2C+QQG6fSP7dXBGoDztEk9HPtTDT1+KeXvJZOErAgVHCk/H42A6IXwi4kw8G7sAXklj INyLIgjMFbEFNxEeAOY8JaQGJto3K99xEHdNr//NMTw5kD+AAtMhVbENvmv2OpE6YdUy BNjSQbZ74Z561uQGRlQtduKuGR53HK4EfPktQVrTHvaxWOHYw1yzLDCIg7wA6ixmIO3m sQsN3KwVK9ei0NvJ4ci5FGpKnCFQkQaVCpbx8BkPXzKwEzZ86wR0wgylwzvICdEQTk4T EHYw== X-Gm-Message-State: APzg51D1iq/hXD00F/wiVDZtb933ob4ILRJE9S87zs7ZHY5tO7a3gFLj y9jQPeXOq73YWjnLkbi920nqvpNppjU= X-Google-Smtp-Source: ANB0VdbV6SRzexVhSBND0BKpQHAKQyNkimW4KmIJIOKEElPjsyg67WAV5qfpQsHHZLyY3m13faLBxQ== X-Received: by 2002:a50:93c5:: with SMTP id o63-v6mr3648699eda.154.1537441463706; Thu, 20 Sep 2018 04:04:23 -0700 (PDT) Received: from dhcp-10-123-74-106.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id s36-v6sm1232534edb.56.2018.09.20.04.04.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 04:04:22 -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 v2 0/6] mpt3sas: Hot-Plug Surprise removal support on IOC. Date: Thu, 20 Sep 2018 16:34:04 +0530 Message-Id: <1537441450-12434-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. 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 | 140 ++++++++++++++++------- drivers/scsi/mpt3sas/mpt3sas_base.h | 10 +- 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, 301 insertions(+), 178 deletions(-)