From patchwork Fri Nov 20 09:32:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Schmidt X-Patchwork-Id: 61616 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAK9WUdj030457 for ; Fri, 20 Nov 2009 09:32:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbZKTJcO (ORCPT ); Fri, 20 Nov 2009 04:32:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752723AbZKTJcO (ORCPT ); Fri, 20 Nov 2009 04:32:14 -0500 Received: from mtagate1.de.ibm.com ([195.212.17.161]:40757 "EHLO mtagate1.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752649AbZKTJcM (ORCPT ); Fri, 20 Nov 2009 04:32:12 -0500 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id nAK9WHHf011515; Fri, 20 Nov 2009 09:32:17 GMT Received: from d12av03.megacenter.de.ibm.com (d12av03.megacenter.de.ibm.com [9.149.165.213]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nAK9WHdU1347820; Fri, 20 Nov 2009 10:32:17 +0100 Received: from d12av03.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id nAK9WF1h023494; Fri, 20 Nov 2009 10:32:17 +0100 Received: from alex-laptop (dyn-9-152-241-144.boeblingen.de.ibm.com [9.152.241.144]) by d12av03.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id nAK9WEuW023457; Fri, 20 Nov 2009 10:32:14 +0100 Date: Fri, 20 Nov 2009 10:32:13 +0100 From: Alexander Schmidt To: Roland Dreier , Linux RDMA Cc: lkml , Stefan Roscher , Joachim Fenkes , Christoph Raisch , Hoang-Nam Nguyen Subject: [PATCH resend] ib/ehca: rework destroy_eq() Message-ID: <20091120103213.13b7ba81@alex-laptop> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org --- linux-2.6.orig/drivers/infiniband/hw/ehca/ehca_eq.c +++ linux-2.6/drivers/infiniband/hw/ehca/ehca_eq.c @@ -169,12 +169,15 @@ int ehca_destroy_eq(struct ehca_shca *sh unsigned long flags; u64 h_ret; - spin_lock_irqsave(&eq->spinlock, flags); ibmebus_free_irq(eq->ist, (void *)shca); - h_ret = hipz_h_destroy_eq(shca->ipz_hca_handle, eq); + spin_lock_irqsave(&shca_list_lock, flags); + eq->is_initialized = 0; + spin_unlock_irqrestore(&shca_list_lock, flags); + + tasklet_kill(&eq->interrupt_task); - spin_unlock_irqrestore(&eq->spinlock, flags); + h_ret = hipz_h_destroy_eq(shca->ipz_hca_handle, eq); if (h_ret != H_SUCCESS) { ehca_err(&shca->ib_device, "Can't free EQ resources."); --- linux-2.6.orig/drivers/infiniband/hw/ehca/ehca_classes.h +++ linux-2.6/drivers/infiniband/hw/ehca/ehca_classes.h @@ -375,6 +375,7 @@ extern rwlock_t ehca_qp_idr_lock; extern rwlock_t ehca_cq_idr_lock; extern struct idr ehca_qp_idr; extern struct idr ehca_cq_idr; +extern spinlock_t shca_list_lock; extern int ehca_static_rate; extern int ehca_port_act_time; --- linux-2.6.orig/drivers/infiniband/hw/ehca/ehca_main.c +++ linux-2.6/drivers/infiniband/hw/ehca/ehca_main.c @@ -123,7 +123,7 @@ DEFINE_IDR(ehca_qp_idr); DEFINE_IDR(ehca_cq_idr); static LIST_HEAD(shca_list); /* list of all registered ehcas */ -static DEFINE_SPINLOCK(shca_list_lock); +DEFINE_SPINLOCK(shca_list_lock); static struct timer_list poll_eqs_timer; -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in