From: Jon Masters <jonmasters@gmail.com>
To: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: [PATCH] xsa_use_interrupts flag [WAS: xilinx_sysace]
Date: Thu, 23 Sep 2004 02:12:07 +0100 [thread overview]
Message-ID: <35fb2e59040922181249d18af6@mail.gmail.com> (raw)
In-Reply-To: <35fb2e59040919131864c26952@mail.gmail.com>
On Sun, 19 Sep 2004 21:18:14 +0100, Jon Masters <jonmasters@gmail.com> wrote:
> It's as I thought on and off and then on again - the code checks out
> ok (it's not pretty but it works) - and I seem to be getting unwanted
> extra unhandled interrupts from the hardware. This driver needs a lot
> of cleanup anyway - it doesn't handle these kinds of error state, nor
> does it handle the removal of a mounted CompactFlash, and a dozen
> other typical problems. I'll post a patch when I've solved the main
> problem - moan at me by private mail if you're using this, having
> similar issues, and feel like helping.
Hi all,
I have spoken to a number of people about this ongoing issue with the
Xilinx System ACE hardware that I am using (I have a Memec board - not
the Xilinx one) and the fact that the hardware insists on generating
an extra interrupt on SectorWrite operations which is neither
documented nor otherwise explainable (but I'd love it if someone would
enlighten me).
So I've added a trivial patch to xilinx_sysace to provide a flag for
disabling interrupts at least for now. I am working on a bunch of
other Virtex II Pro bits and pieces that I'll feed upstream when
they're ready but for now xsa_interrupt should probably also check
whether the request queue is empty in the case that it's called with
no good reason.
The following patch has been briefly tested on a modified inhouse
2.4.23 kernel which uses a few drivers from the Monta tree (like
xilinux_sysace) but otherwise differs quite heavily - I don't rely on
any generated xparameters and other EDK nonesense and I don't want to
rely on that in any way either - least of all for determining whether
or not to use interrupts.
Jon.
diff --unified --recursive --new-file xilinx_sysace_mvista/adapter.c
xilinx_sysace_nointr/adapter.c
--- xilinx_sysace_mvista/adapter.c 2004-03-15 11:41:30.000000000 +0000
+++ xilinx_sysace_nointr/adapter.c 2004-09-22 17:31:58.000000000 +0100
@@ -6,6 +6,10 @@
* Author: MontaVista Software, Inc.
* source@mvista.com
*
+ * History:
+ * 22/09/2004 - Added xsa_use_interrupts.
+ * Jon Masters <jcm@jonmasters.org>.
+ *
* 2002 (c) MontaVista, Software, Inc. This file is licensed under the terms
* of the GNU General Public License version 2. This program is licensed
* "as is" without any warranty of any kind, whether express or implied.
@@ -59,9 +63,17 @@
#include <xbasic_types.h>
#include "xsysace.h"
+/*
+ * We have to disable interrupts on certain boards where writing causes an
+ * additional unexpected hardware interrupt on sector write completion.
+ */
+
+static int xsa_use_interrupts = 0;
+
MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
MODULE_DESCRIPTION("Xilinx System ACE block driver");
MODULE_LICENSE("GPL");
+MODULE_PARM(xsa_enable_interrupts,"i");
/*
* We have to wait for a lock and for the CompactFlash to not be busy
@@ -497,11 +509,17 @@
DEVICE_NAME, stat, req_str, sector);
xsa_complete_request(0); /* Request failed. */
}
+
+ if ((!xsa_use_interrupts) && (stat == XST_SUCCESS)) {
+ printk("RIQC: request complete.\n");
+ xsa_complete_request(1);
+ }
}
- exit:
+
+ exit:
remove_wait_queue(&req_wait, &wait);
-
+
xsa_task = NULL;
complete_and_exit(&task_sync, 0);
}
@@ -757,16 +775,25 @@
return -ENODEV;
}
- i = request_irq(XSA_IRQ, xsysace_interrupt, 0, DEVICE_NAME, NULL);
- if (i) {
- printk(KERN_ERR "%s: Could not allocate interrupt %d.\n",
- DEVICE_NAME, XSA_IRQ);
- cleanup();
- return i;
+ if (xsa_use_interrupts) {
+
+ i = request_irq(XSA_IRQ, xsysace_interrupt, 0, DEVICE_NAME, NULL);
+ if (i) {
+ printk(KERN_ERR "%s: Could not allocate interrupt %d.\n",
+ DEVICE_NAME, XSA_IRQ);
+ cleanup();
+ return i;
+ }
+ reqirq = 1;
}
- reqirq = 1;
+
XSysAce_SetEventHandler(&SysAce, EventHandler, (void *) NULL);
- XSysAce_EnableInterrupt(&SysAce);
+
+ if (xsa_use_interrupts) {
+ XSysAce_EnableInterrupt(&SysAce);
+ } else {
+ XSysAce_DisableInterrupt(&SysAce);
+ }
/* Time to identify the drive. */
while (XSysAce_Lock(&SysAce, 0) == XST_DEVICE_BUSY)
@@ -832,10 +859,17 @@
register_disk(&xsa_gendisk, MKDEV(xsa_major, 0),
NR_HD << PARTN_BITS, &xsa_fops, size);
- printk(KERN_INFO
- "%s at 0x%08X mapped to 0x%08X, irq=%d, %ldKB\n",
- DEVICE_NAME, save_BaseAddress, cfg->BaseAddress, XSA_IRQ,
- size / 2);
+ if (xsa_use_interrupts) {
+ printk(KERN_INFO
+ "%s at 0x%08X mapped to 0x%08X, irq=%d, %ldKB\n",
+ DEVICE_NAME, save_BaseAddress, cfg->BaseAddress, XSA_IRQ,
+ size / 2);
+ } else {
+ printk(KERN_INFO
+ "%s at 0x%08X mapped to 0x%08X, polled IO, %ldKB\n",
+ DEVICE_NAME, save_BaseAddress, cfg->BaseAddress, XSA_IRQ,
+ size / 2);
+ }
/* Hook our reset function into system's restart code. */
old_restart = ppc_md.restart;
next parent reply other threads:[~2004-09-23 1:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <35fb2e5904090607241087442d@mail.gmail.com>
[not found] ` <35fb2e59040919131864c26952@mail.gmail.com>
2004-09-23 1:12 ` Jon Masters [this message]
2004-09-23 13:36 ` [PATCH] xsa_use_interrupts flag [WAS: xilinx_sysace] Jeff Angielski
2004-09-23 13:43 ` Jon Masters
[not found] ` <20040923045114.GF6889@thundrix.ch>
2004-09-23 13:40 ` Jon Masters
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=35fb2e59040922181249d18af6@mail.gmail.com \
--to=jonmasters@gmail.com \
--cc=jonathan@jonmasters.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
/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).