linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Roscher <ossrosch@linux.vnet.ibm.com>
To: Roland Dreier <rolandd@cisco.com>,
	Paul Mackerras <paulus@samba.org>,
	"LinuxPPC-Dev" <linuxppc-dev@ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"OF-EWG" <ewg@lists.openfabrics.org>,
	general@lists.openfabrics.org
Cc: TKLEIN@de.ibm.com, fenkes@de.ibm.com, raisch@de.ibm.com,
	THEMANN@de.ibm.com
Subject: [PATCH REPOST] IB/ehca: In case of lost interrupts, trigger EOI to reenable interrupts
Date: Tue, 10 Jun 2008 16:44:31 +0200	[thread overview]
Message-ID: <200806101644.34693.ossrosch@linux.vnet.ibm.com> (raw)

During corner case testing, we noticed that some versions of ehca 
do not properly transition to interrupt done in special load situations.
This can be resolved by periodically triggering EOI through H_EOI, 
if eqes are pending.

Signed-off-by: Stefan Roscher <stefan.roscher@de.ibm.com>

---
This patch replaces my previous patch-set.
As Paul suggested, this version of the patch calls H_EOI directly and doesn't need
any ibmebus changes.
 
 drivers/infiniband/hw/ehca/ehca_main.c |   11 +++++++++--
 drivers/infiniband/hw/ehca/hcp_if.c    |   11 +++++++++++
 drivers/infiniband/hw/ehca/hcp_if.h    |    1 +
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 482103e..add4ff4 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -937,6 +937,7 @@ static struct of_platform_driver ehca_driver = {
 void ehca_poll_eqs(unsigned long data)
 {
 	struct ehca_shca *shca;
+	u64 ret;
 
 	spin_lock(&shca_list_lock);
 	list_for_each_entry(shca, &shca_list, shca_list) {
@@ -955,8 +956,14 @@ void ehca_poll_eqs(unsigned long data)
 				spin_unlock_irqrestore(&eq->spinlock, flags);
 				max--;
 			} while (q_ofs == q_ofs2 && max > 0);
-			if (q_ofs == q_ofs2)
-				ehca_process_eq(shca, 0);
+			if (q_ofs == q_ofs2) {
+				ret = hipz_h_eoi(eq->ist);
+				if (ret != H_SUCCESS)
+					ehca_err(&shca->ib_device,
+						 "bad return code EOI -"
+						 "rc = %ld\n", ret);
+				tasklet_hi_schedule(&shca->eq.interrupt_task);
+			}
 		}
 	}
 	mod_timer(&poll_eqs_timer, round_jiffies(jiffies + HZ));
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
index 5245e13..7084efd 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -933,3 +933,14 @@ u64 hipz_h_error_data(const struct ipz_adapter_handle adapter_handle,
 				       r_cb,
 				       0, 0, 0, 0);
 }
+
+u64 hipz_h_eoi(int irq)
+{
+	int value;
+	unsigned long xirr;
+
+	iosync();
+	value = (0xff << 24) | irq;
+	xirr = value & 0xffffffff;
+	return plpar_hcall_norets(H_EOI, xirr);
+}
diff --git a/drivers/infiniband/hw/ehca/hcp_if.h b/drivers/infiniband/hw/ehca/hcp_if.h
index 60ce02b..2c3c6e0 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.h
+++ b/drivers/infiniband/hw/ehca/hcp_if.h
@@ -260,5 +260,6 @@ u64 hipz_h_error_data(const struct ipz_adapter_handle adapter_handle,
 		      const u64 ressource_handle,
 		      void *rblock,
 		      unsigned long *byte_count);
+u64 hipz_h_eoi(int irq);
 
 #endif /* __HCP_IF_H__ */
-- 
1.5.5

             reply	other threads:[~2008-06-10 14:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10 14:44 Stefan Roscher [this message]
2008-06-10 14:52 ` [PATCH REPOST] IB/ehca: In case of lost interrupts, trigger EOI to reenable interrupts Roland Dreier
2008-06-10 15:01   ` Stefan Roscher
2008-06-10 16:18     ` Roland Dreier
2008-06-12  8:37       ` Paul Mackerras
2008-06-13 14:39       ` Stefan Roscher
2008-06-12  7:23 ` Benjamin Herrenschmidt
2008-06-12  9:39 ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200806101644.34693.ossrosch@linux.vnet.ibm.com \
    --to=ossrosch@linux.vnet.ibm.com \
    --cc=THEMANN@de.ibm.com \
    --cc=TKLEIN@de.ibm.com \
    --cc=ewg@lists.openfabrics.org \
    --cc=fenkes@de.ibm.com \
    --cc=general@lists.openfabrics.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=raisch@de.ibm.com \
    --cc=rolandd@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).