From patchwork Thu Dec 10 18:45:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 7823381 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B878DBEEE5 for ; Fri, 11 Dec 2015 01:40:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E329C20562 for ; Fri, 11 Dec 2015 01:40:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1964C20483 for ; Fri, 11 Dec 2015 01:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752536AbbLKBkj (ORCPT ); Thu, 10 Dec 2015 20:40:39 -0500 Received: from bby1mta03.pmc-sierra.com ([216.241.235.118]:32803 "EHLO bby1mta03.pmc-sierra.bc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752047AbbLKBk2 (ORCPT ); Thu, 10 Dec 2015 20:40:28 -0500 Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id BBF211070902; Thu, 10 Dec 2015 17:40:27 -0800 (PST) Received: from smtp.pmcs.com (bby1cas04.pmc-sierra.internal [216.241.227.182]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by bby1mta03.pmc-sierra.bc.ca (Postfix) with ESMTP id AE28C1070659; Thu, 10 Dec 2015 17:40:27 -0800 (PST) Received: from localhost (216.241.227.4) by bby1cas04.pmc-sierra.internal (216.241.227.182) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 10 Dec 2015 17:40:27 -0800 From: Raghava Aditya Renukunta To: , CC: , , , , , , Subject: [PATCH v2 7/9] aacraid: Fix AIF triggered IOP_RESET Date: Thu, 10 Dec 2015 10:45:57 -0800 Message-ID: <1449773159-25058-8-git-send-email-RaghavaAditya.Renukunta@pmcs.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449773159-25058-1-git-send-email-RaghavaAditya.Renukunta@pmcs.com> References: <1449773159-25058-1-git-send-email-RaghavaAditya.Renukunta@pmcs.com> MIME-Version: 1.0 X-Originating-IP: [216.241.227.4] DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pmcs.com; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-type; s=default; bh=e2aCPGubm6axOXtBhVaObVJ64VJ66GWfshv519zZbog=; b=W5ON01YeJKoNADnFL3Gkm5INLtmF3S5Y2uA5ObDWQYhWXDaXVnKTIt6lt+wm096pmFrR+Dt7cVoZuPkAm6QFC1xStoFytRGilSfzUnsGGkXUF1WrrUGmYlXo1Rtmkye9AfcXTZ9etbIg4FOE0hKrac50JmpjeT54KLIedsYX5jA= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Raghava Aditya Renukunta while driver removal is in progress or PCI shutdown is invoked, driver kills AIF aacraid thread, but IOCTL requests from the management tools re-start AIF thread leading to IOP_RESET. Fixed by setting adapter_shutdown flag when PCI shutdown is invoked. Changes in V2: Set adapter_shutdown flag before shutdown command is sent to \ controller Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/comminit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index 0e954e3..fe08854 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -212,8 +212,9 @@ int aac_send_shutdown(struct aac_dev * dev) return -ENOMEM; aac_fib_init(fibctx); - cmd = (struct aac_close *) fib_data(fibctx); + dev->adapter_shutdown = 1; + cmd = (struct aac_close *) fib_data(fibctx); cmd->command = cpu_to_le32(VM_CloseAll); cmd->cid = cpu_to_le32(0xfffffffe); @@ -229,7 +230,6 @@ int aac_send_shutdown(struct aac_dev * dev) /* FIB should be freed only after getting the response from the F/W */ if (status != -ERESTARTSYS) aac_fib_free(fibctx); - dev->adapter_shutdown = 1; if ((dev->pdev->device == PMC_DEVICE_S7 || dev->pdev->device == PMC_DEVICE_S8 || dev->pdev->device == PMC_DEVICE_S9) &&