[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4550FB5D.5010804@serpentine.com>
Date: Tue, 07 Nov 2006 13:32:13 -0800
From: Bryan O'Sullivan <bos@...pentine.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Adrian Bunk <bunk@...sta.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
olson@...hscale.com, akpm@...l.org
Subject: Re: 2.6.19-rc4: known unfixed regressions (v3)
Eric W. Biederman wrote:
> If you really need to write to both the config space registers and your
> magic shadow copy of the register I can certainly do the config space
> writes for you.
Here's an updated copy of your second patch that does just that.
I've also included a preview of the ipath patch that depends on this.
With your original patch, my rework of your second patch, and the new
ipath patch, the driver is back to working happily for me on top of
current -git.
I need to test the ipath patch on powerpc before I consider it cooked,
but I won't have time to do that today.
<b
From: ebiederm@...ssion.com (Eric W. Biederman)
This patch adds a variant of ht_create_irq, __ht_create_irq, that takes
an additional parameter, update, that is a function that is called after
we have updated a driver's htirq configuration registers.
This is needed to support the ipath_iba6110, which has an interrupt
config register that is not connected to the hardware that controls
interrupt delivery.
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@...gic.com>
Cc: Dave Olson <dave.olson@...gic.com>
diff -r 5f5c47730ce4 drivers/pci/htirq.c
--- a/drivers/pci/htirq.c Tue Nov 07 07:45:59 2006 -0800
+++ b/drivers/pci/htirq.c Tue Nov 07 11:33:27 2006 -0800
@@ -25,6 +25,8 @@ static DEFINE_SPINLOCK(ht_irq_lock);
struct ht_irq_cfg {
struct pci_dev *dev;
+ /* Update callback used to cope with buggy hardware */
+ ht_irq_update_t *update;
unsigned pos;
unsigned idx;
struct ht_irq_msg msg;
@@ -44,6 +46,8 @@ void write_ht_irq_msg(unsigned int irq,
pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx + 1);
pci_write_config_dword(cfg->dev, cfg->pos + 4, msg->address_hi);
}
+ if (cfg->update)
+ cfg->update(cfg->dev, irq, msg);
spin_unlock_irqrestore(&ht_irq_lock, flags);
cfg->msg = *msg;
}
@@ -79,16 +83,14 @@ void unmask_ht_irq(unsigned int irq)
}
/**
- * ht_create_irq - create an irq and attach it to a device.
+ * __ht_create_irq - create an irq and attach it to a device.
* @dev: The hypertransport device to find the irq capability on.
* @idx: Which of the possible irqs to attach to.
- *
- * ht_create_irq is needs to be called for all hypertransport devices
- * that generate irqs.
+ * @update: Function to be called when changing the htirq message
*
* The irq number of the new irq or a negative error value is returned.
*/
-int ht_create_irq(struct pci_dev *dev, int idx)
+int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update)
{
struct ht_irq_cfg *cfg;
unsigned long flags;
@@ -123,6 +125,7 @@ int ht_create_irq(struct pci_dev *dev, i
return -ENOMEM;
cfg->dev = dev;
+ cfg->update = update;
cfg->pos = pos;
cfg->idx = 0x10 + (idx * 2);
/* Initialize msg to a value that will never match the first write. */
@@ -145,6 +148,21 @@ int ht_create_irq(struct pci_dev *dev, i
}
/**
+ * ht_create_irq - create an irq and attach it to a device.
+ * @dev: The hypertransport device to find the irq capability on.
+ * @idx: Which of the possible irqs to attach to.
+ *
+ * ht_create_irq needs to be called for all hypertransport devices
+ * that generate irqs.
+ *
+ * The irq number of the new irq or a negative error value is returned.
+ */
+int ht_create_irq(struct pci_dev *dev, int idx)
+{
+ return __ht_create_irq(dev, idx, NULL);
+}
+
+/**
* ht_destroy_irq - destroy an irq created with ht_create_irq
*
* This reverses ht_create_irq removing the specified irq from
@@ -162,5 +180,6 @@ void ht_destroy_irq(unsigned int irq)
kfree(cfg);
}
+EXPORT_SYMBOL(__ht_create_irq);
EXPORT_SYMBOL(ht_create_irq);
EXPORT_SYMBOL(ht_destroy_irq);
diff -r 5f5c47730ce4 include/linux/htirq.h
--- a/include/linux/htirq.h Tue Nov 07 07:45:59 2006 -0800
+++ b/include/linux/htirq.h Tue Nov 07 11:33:34 2006 -0800
@@ -15,4 +15,9 @@ void unmask_ht_irq(unsigned int irq);
/* The arch hook for getting things started */
int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev);
+/* For drivers of buggy hardware */
+typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq,
+ struct ht_irq_msg *msg);
+int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update);
+
#endif /* LINUX_HTIRQ_H */
View attachment "ipath-htirq.patch" of type "text/x-patch" (6677 bytes)
Powered by blists - more mailing lists