From patchwork Wed Aug 5 02:42:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Krause X-Patchwork-Id: 6945631 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AA859F38B for ; Wed, 5 Aug 2015 02:42:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33C85205CA for ; Wed, 5 Aug 2015 02:42:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49896205B6 for ; Wed, 5 Aug 2015 02:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751659AbbHECmO (ORCPT ); Tue, 4 Aug 2015 22:42:14 -0400 Received: from mail-ig0-f178.google.com ([209.85.213.178]:38257 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbbHECmN (ORCPT ); Tue, 4 Aug 2015 22:42:13 -0400 Received: by iggf3 with SMTP id f3so24203516igg.1; Tue, 04 Aug 2015 19:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=qrbtrzE7GWGlhGCmXlImbYrAYCQeZjWeQJRErUPh1O4=; b=OEOlCPYY+LzVqAB2iXPmD3JdyH+oB7SzexSGodYwgwNkLoTNNcRtA4v9T3wQbhZuE/ 7Wc0X9vZIIE+NliAT3sd85jxacEqaaWFBWX3jQimUaEOtcltSFym0zCGA03EIkOPrtXS wWusWUNcZwz1AQXXK4N/b60Ufd2cQ7u3hROpdlLmWMq1wKGSrmMVvnG3rMvlcrwKtgHr jVNoDL/RKDN6gJ3nPMTM5AFfGaVnT1WqhnMafJXAiP6jP29a9XEZb83eFqSXnI8N0orh GT+Q+zPwbhBoSowiAJhdKP9xDrSIUWxNapk2pLY3hVg66hh8aNtrPjQ37a6W/dPOujxX 64VA== X-Received: by 10.50.97.97 with SMTP id dz1mr3149391igb.64.1438742533096; Tue, 04 Aug 2015 19:42:13 -0700 (PDT) Received: from nick-System-Product-Name.hitronhub.home (CPEbc4dfb2691f3-CMbc4dfb2691f0.cpe.net.cable.rogers.com. [99.231.110.121]) by smtp.googlemail.com with ESMTPSA id lp3sm2642472igb.12.2015.08.04.19.42.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Aug 2015 19:42:12 -0700 (PDT) From: Nicholas Krause To: JBottomley@odin.com Cc: davem@davemloft.net, hariprasad@chelsio.com, praveenm@chelsio.com, thenzl@redhat.com, dan.carpenter@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Krause Subject: [PATCH] csiostor:Fix error handling in the function csio_hws_ready Date: Tue, 4 Aug 2015 22:42:06 -0400 Message-Id: <1438742526-28530-1-git-send-email-uboot477@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Nicholas Krause This fixes error handling in the function csio_hws_ready for when this function calls csio_scim_cleanup_io to cleanup outstanding commands by checking if it cleaned a error code to signal internal failure and if so tell the user we are unable to clean up the outstanding io commands by printing this to the console before Signed-off-by: Nicholas Krause --- drivers/scsi/csiostor/csio_hw.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 622bdab..49c47d3 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c @@ -2445,11 +2445,17 @@ csio_hws_ready(struct csio_hw *hw, enum csio_hw_ev evt) csio_set_state(&hw->sm, csio_hws_quiescing); /* cleanup all outstanding cmds */ if (evt == CSIO_HWE_HBA_RESET || - evt == CSIO_HWE_PCIERR_DETECTED) - csio_scsim_cleanup_io(csio_hw_to_scsim(hw), false); - else - csio_scsim_cleanup_io(csio_hw_to_scsim(hw), true); - + evt == CSIO_HWE_PCIERR_DETECTED) { + if (csio_scsim_cleanup_io(csio_hw_to_scsim(hw), false)) { + csio_err(hw, "Unable to properly cleanup outstanding commands on this device\n"); + return; + } + } else { + if (csio_scsim_cleanup_io(csio_hw_to_scsim(hw), true)) { + csio_err(hw, "Unable to properly cleanup outstanding commands on this device\n"); + return; + } + } csio_hw_intr_disable(hw); csio_hw_mbm_cleanup(hw); csio_evtq_stop(hw);