From patchwork Fri Jan 6 00:59:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 134571 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DBE221007D6 for ; Fri, 6 Jan 2012 11:59:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030238Ab2AFA7h (ORCPT ); Thu, 5 Jan 2012 19:59:37 -0500 Received: from mga11.intel.com ([192.55.52.93]:46495 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030231Ab2AFA7g (ORCPT ); Thu, 5 Jan 2012 19:59:36 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 05 Jan 2012 16:59:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="109270800" Received: from dwillia2-linux.jf.intel.com (HELO dwillia2-linux.localdomain) ([10.23.45.73]) by fmsmga002.fm.intel.com with ESMTP; 05 Jan 2012 16:59:36 -0800 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by dwillia2-linux.localdomain (Postfix) with ESMTP id 4468B500248; Thu, 5 Jan 2012 16:59:36 -0800 (PST) Subject: [PATCH v3 07/14] libsas: async ata-eh To: linux-scsi@vger.kernel.org From: Dan Williams Cc: linux-ide@vger.kernel.org Date: Thu, 05 Jan 2012 16:59:36 -0800 Message-ID: <20120106005936.11464.35825.stgit@localhost6.localdomain6> In-Reply-To: <20120106005634.11464.64030.stgit@localhost6.localdomain6> References: <20120106005634.11464.64030.stgit@localhost6.localdomain6> User-Agent: StGit/0.15-7-g9bfb-dirty MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Once sas_ata_hard_reset() starts honoring the 'deadline' parameter a pathological configuration could take 25 seconds per ata device (serialized) to recover. Run per-port recoveries in parallel. Signed-off-by: Dan Williams --- drivers/scsi/libsas/sas_ata.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 39ce224..537e8da 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -23,6 +23,7 @@ #include #include +#include #include #include "sas_internal.h" @@ -605,10 +606,21 @@ int sas_discover_sata(struct domain_device *dev) return 0; } +static void async_sas_ata_eh(void *data, async_cookie_t cookie) +{ + struct domain_device *dev = data; + struct ata_port *ap = dev->sata_dev.ap; + struct sas_ha_struct *ha = dev->port->ha; + + ata_port_printk(ap, KERN_DEBUG, "sas eh calling libata port error handler"); + ata_scsi_port_error_handler(ha->core.shost, ap); +} + void sas_ata_strategy_handler(struct Scsi_Host *shost) { struct scsi_device *sdev; struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); + LIST_HEAD(async); /* it's ok to defer revalidation events during ata eh, these * disks are in one of three states: @@ -622,14 +634,13 @@ void sas_ata_strategy_handler(struct Scsi_Host *shost) shost_for_each_device(sdev, shost) { struct domain_device *ddev = sdev_to_domain_dev(sdev); - struct ata_port *ap = ddev->sata_dev.ap; if (!dev_is_sata(ddev)) continue; - ata_port_printk(ap, KERN_DEBUG, "sas eh calling libata port error handler"); - ata_scsi_port_error_handler(shost, ap); + async_schedule_domain(async_sas_ata_eh, ddev, &async); } + async_synchronize_full_domain(&async); sas_enable_revalidation(sas_ha); }