Commit 719b6399 authored by Ben Collins's avatar Ben Collins Committed by Linus Torvalds

[PATCH] 1394 updates

- New irq handler prototypes.
- Lots of un-enumurated locking fixes/cleanups (thanks in large part to
  spinlock debug compile options in the kernel).
- Other various trivial fixes.
parent 4f4b8e8c
...@@ -448,7 +448,7 @@ static int lock_regs(struct hpsb_host *host, int nodeid, quadlet_t *store, ...@@ -448,7 +448,7 @@ static int lock_regs(struct hpsb_host *host, int nodeid, quadlet_t *store,
/* bandwidth available algorithm adapted from IEEE 1394a-2000 spec */ /* bandwidth available algorithm adapted from IEEE 1394a-2000 spec */
if (arg > 0x1fff) { if (arg > 0x1fff) {
*store = cpu_to_be32(old); /* change nothing */ *store = cpu_to_be32(old); /* change nothing */
break; break;
} }
data &= 0x1fff; data &= 0x1fff;
if (arg >= data) { if (arg >= data) {
......
...@@ -455,6 +455,10 @@ struct video_card { ...@@ -455,6 +455,10 @@ struct video_card {
*/ */
spinlock_t spinlock; spinlock_t spinlock;
/* flag to prevent spurious interrupts (which OHCI seems to
generate a lot :) from accessing the struct */
int dma_running;
/* /*
3) the sleeping semaphore 'sem' - this is used from process context only, 3) the sleeping semaphore 'sem' - this is used from process context only,
to serialize various operations on the video_card. Even though only one to serialize various operations on the video_card. Even though only one
...@@ -568,7 +572,7 @@ static inline int video_card_initialized(struct video_card *v) ...@@ -568,7 +572,7 @@ static inline int video_card_initialized(struct video_card *v)
static int do_dv1394_init(struct video_card *video, struct dv1394_init *init); static int do_dv1394_init(struct video_card *video, struct dv1394_init *init);
static int do_dv1394_init_default(struct video_card *video); static int do_dv1394_init_default(struct video_card *video);
static int do_dv1394_shutdown(struct video_card *video, int free_user_buf); static void do_dv1394_shutdown(struct video_card *video, int free_user_buf);
/* NTSC empty packet rate accurate to within 0.01%, /* NTSC empty packet rate accurate to within 0.01%,
......
This diff is collapsed.
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
printk(KERN_ERR fmt, ## args) printk(KERN_ERR fmt, ## args)
static char version[] __devinitdata = static char version[] __devinitdata =
"$Rev: 886 $ Ben Collins <bcollins@debian.org>"; "$Rev: 895 $ Ben Collins <bcollins@debian.org>";
/* Our ieee1394 highlevel driver */ /* Our ieee1394 highlevel driver */
#define ETHER1394_DRIVER_NAME "ether1394" #define ETHER1394_DRIVER_NAME "ether1394"
...@@ -340,6 +340,7 @@ static void ether1394_add_host (struct hpsb_host *host, struct hpsb_highlevel *h ...@@ -340,6 +340,7 @@ static void ether1394_add_host (struct hpsb_host *host, struct hpsb_highlevel *h
priv = (struct eth1394_priv *)dev->priv; priv = (struct eth1394_priv *)dev->priv;
priv->host = host; priv->host = host;
spin_lock_init(&priv->lock);
hi = hpsb_create_hostinfo(hl, host, sizeof(*hi)); hi = hpsb_create_hostinfo(hl, host, sizeof(*hi));
......
This diff is collapsed.
...@@ -14,6 +14,7 @@ struct hpsb_highlevel { ...@@ -14,6 +14,7 @@ struct hpsb_highlevel {
/* Used by the highlevel drivers to store data per host */ /* Used by the highlevel drivers to store data per host */
struct list_head host_info_list; struct list_head host_info_list;
rwlock_t host_info_lock;
}; };
...@@ -154,7 +155,7 @@ int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, u64 start); ...@@ -154,7 +155,7 @@ int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, u64 start);
* iso_receive op. * iso_receive op.
*/ */
int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
unsigned int channel); unsigned int channel);
void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host,
unsigned int channel); unsigned int channel);
...@@ -176,5 +177,4 @@ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key); ...@@ -176,5 +177,4 @@ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key);
* hpsb_create_hostinfo, where the size is 0. */ * hpsb_create_hostinfo, where the size is 0. */
int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, void *data); int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, void *data);
#endif /* IEEE1394_HIGHLEVEL_H */ #endif /* IEEE1394_HIGHLEVEL_H */
...@@ -1295,7 +1295,6 @@ EXPORT_SYMBOL(highlevel_host_reset); ...@@ -1295,7 +1295,6 @@ EXPORT_SYMBOL(highlevel_host_reset);
/** nodemgr.c **/ /** nodemgr.c **/
EXPORT_SYMBOL(hpsb_guid_get_entry); EXPORT_SYMBOL(hpsb_guid_get_entry);
EXPORT_SYMBOL(hpsb_nodeid_get_entry); EXPORT_SYMBOL(hpsb_nodeid_get_entry);
EXPORT_SYMBOL(hpsb_check_nodeid);
EXPORT_SYMBOL(hpsb_node_fill_packet); EXPORT_SYMBOL(hpsb_node_fill_packet);
EXPORT_SYMBOL(hpsb_node_read); EXPORT_SYMBOL(hpsb_node_read);
EXPORT_SYMBOL(hpsb_node_write); EXPORT_SYMBOL(hpsb_node_write);
......
...@@ -79,13 +79,13 @@ struct hpsb_tlabel_pool { ...@@ -79,13 +79,13 @@ struct hpsb_tlabel_pool {
struct semaphore count; struct semaphore count;
}; };
#define HPSB_TPOOL_INIT(_tp) \ #define HPSB_TPOOL_INIT(_tp) \
do { \ do { \
CLEAR_BITMAP((_tp)->pool, 64); \ CLEAR_BITMAP((_tp)->pool, 64); \
spin_lock_init(&(_tp)->lock); \ spin_lock_init(&(_tp)->lock); \
(_tp)->next = 0; \ (_tp)->next = 0; \
(_tp)->allocations = 0; \ (_tp)->allocations = 0; \
sema_init(&(_tp)->count, 63); \ sema_init(&(_tp)->count, 63); \
} while(0) } while(0)
......
...@@ -47,8 +47,11 @@ static struct hpsb_iso* hpsb_iso_common_init(struct hpsb_host *host, enum hpsb_i ...@@ -47,8 +47,11 @@ static struct hpsb_iso* hpsb_iso_common_init(struct hpsb_host *host, enum hpsb_i
int dma_direction; int dma_direction;
/* make sure driver supports the ISO API */ /* make sure driver supports the ISO API */
if(!host->driver->isoctl) if(!host->driver->isoctl) {
printk(KERN_INFO "ieee1394: host driver '%s' does not support the rawiso API\n",
host->driver->name);
return NULL; return NULL;
}
/* sanitize parameters */ /* sanitize parameters */
......
...@@ -1616,18 +1616,6 @@ struct node_entry *hpsb_nodeid_get_entry(struct hpsb_host *host, nodeid_t nodeid ...@@ -1616,18 +1616,6 @@ struct node_entry *hpsb_nodeid_get_entry(struct hpsb_host *host, nodeid_t nodeid
return ne; return ne;
} }
struct node_entry *hpsb_check_nodeid(struct hpsb_host *host, nodeid_t nodeid)
{
struct node_entry *ne;
if (down_trylock(&nodemgr_serialize))
return NULL;
ne = find_entry_by_nodeid(host, nodeid);
up(&nodemgr_serialize);
return ne;
}
/* The following four convenience functions use a struct node_entry /* The following four convenience functions use a struct node_entry
* for addressing a node on the bus. They are intended for use by any * for addressing a node on the bus. They are intended for use by any
* process context, not just the nodemgr thread, so we need to be a * process context, not just the nodemgr thread, so we need to be a
......
...@@ -163,10 +163,6 @@ struct node_entry *hpsb_guid_get_entry(u64 guid); ...@@ -163,10 +163,6 @@ struct node_entry *hpsb_guid_get_entry(u64 guid);
* fool-proof by itself, since the nodeid can change. */ * fool-proof by itself, since the nodeid can change. */
struct node_entry *hpsb_nodeid_get_entry(struct hpsb_host *host, nodeid_t nodeid); struct node_entry *hpsb_nodeid_get_entry(struct hpsb_host *host, nodeid_t nodeid);
/* Same as above except that it will not block waiting for the nodemgr
* serialize semaphore. */
struct node_entry *hpsb_check_nodeid(struct hpsb_host *host, nodeid_t nodeid);
/* /*
* If the entry refers to a local host, this function will return the pointer * If the entry refers to a local host, this function will return the pointer
* to the hpsb_host structure. It will return NULL otherwise. Once you have * to the hpsb_host structure. It will return NULL otherwise. Once you have
......
...@@ -165,7 +165,7 @@ printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args) ...@@ -165,7 +165,7 @@ printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args)
printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args) printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)
static char version[] __devinitdata = static char version[] __devinitdata =
"$Rev: 866 $ Ben Collins <bcollins@debian.org>"; "$Rev: 897 $ Ben Collins <bcollins@debian.org>";
/* Module Parameters */ /* Module Parameters */
static int phys_dma = 1; static int phys_dma = 1;
......
...@@ -1163,7 +1163,7 @@ static ssize_t mem_write(struct file *file, const char *buffer, size_t count, ...@@ -1163,7 +1163,7 @@ static ssize_t mem_write(struct file *file, const char *buffer, size_t count,
********************************************************/ ********************************************************/
static void lynx_irq_handler(int irq, void *dev_id, static irqreturn_t lynx_irq_handler(int irq, void *dev_id,
struct pt_regs *regs_are_unused) struct pt_regs *regs_are_unused)
{ {
struct ti_lynx *lynx = (struct ti_lynx *)dev_id; struct ti_lynx *lynx = (struct ti_lynx *)dev_id;
...@@ -1174,7 +1174,8 @@ static void lynx_irq_handler(int irq, void *dev_id, ...@@ -1174,7 +1174,8 @@ static void lynx_irq_handler(int irq, void *dev_id,
linkint = reg_read(lynx, LINK_INT_STATUS); linkint = reg_read(lynx, LINK_INT_STATUS);
intmask = reg_read(lynx, PCI_INT_STATUS); intmask = reg_read(lynx, PCI_INT_STATUS);
if (!(intmask & PCI_INT_INT_PEND)) return; if (!(intmask & PCI_INT_INT_PEND))
return IRQ_HANDLED;
PRINTD(KERN_DEBUG, lynx->id, "interrupt: 0x%08x / 0x%08x", intmask, PRINTD(KERN_DEBUG, lynx->id, "interrupt: 0x%08x / 0x%08x", intmask,
linkint); linkint);
...@@ -1390,6 +1391,8 @@ static void lynx_irq_handler(int irq, void *dev_id, ...@@ -1390,6 +1391,8 @@ static void lynx_irq_handler(int irq, void *dev_id,
run_pcl(lynx, lynx->rcv_pcl_start, CHANNEL_ASYNC_RCV); run_pcl(lynx, lynx->rcv_pcl_start, CHANNEL_ASYNC_RCV);
} }
return IRQ_HANDLED;
} }
...@@ -1893,7 +1896,7 @@ static struct pci_driver lynx_pci_driver = { ...@@ -1893,7 +1896,7 @@ static struct pci_driver lynx_pci_driver = {
.name = PCILYNX_DRIVER_NAME, .name = PCILYNX_DRIVER_NAME,
.id_table = pci_table, .id_table = pci_table,
.probe = add_card, .probe = add_card,
.remove = __devexit_p(remove_card), .remove = remove_card,
}; };
static struct hpsb_host_driver lynx_driver = { static struct hpsb_host_driver lynx_driver = {
......
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
#include "sbp2.h" #include "sbp2.h"
static char version[] __devinitdata = static char version[] __devinitdata =
"$Rev: 884 $ James Goodwin <jamesg@filanet.com>"; "$Rev: 896 $ James Goodwin <jamesg@filanet.com>";
/* /*
* Module load parameter definitions * Module load parameter definitions
...@@ -3040,10 +3040,10 @@ static int sbp2scsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -3040,10 +3040,10 @@ static int sbp2scsi_proc_info(char *buffer, char **start, off_t offset,
SPRINTF("Driver version : %s\n", version); SPRINTF("Driver version : %s\n", version);
SPRINTF("\nModule options :\n"); SPRINTF("\nModule options :\n");
SPRINTF(" max_speed : %s\n", hpsb_speedto_str[max_speed]); SPRINTF(" max_speed : %s\n", hpsb_speedto_str[max_speed]);
SPRINTF(" max_sectors : %d\n", max_sectors); SPRINTF(" max_sectors : %d\n", max_sectors);
SPRINTF(" serialize_io : %s\n", serialize_io ? "yes" : "no"); SPRINTF(" serialize_io : %s\n", serialize_io ? "yes" : "no");
SPRINTF(" exclusive_login : %s\n", exclusive_login ? "yes" : "no"); SPRINTF(" exclusive_login : %s\n", exclusive_login ? "yes" : "no");
SPRINTF("\nAttached devices : %s\n", !list_empty(&host->my_devices) ? SPRINTF("\nAttached devices : %s\n", !list_empty(&host->my_devices) ?
"" : "none"); "" : "none");
......
...@@ -67,14 +67,6 @@ ...@@ -67,14 +67,6 @@
#define vmalloc_32(x) vmalloc(x) #define vmalloc_32(x) vmalloc(x)
#endif #endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3))
#define remap_page_range_1394(vma, start, addr, size, prot) \
remap_page_range(start, addr, size, prot)
#else
#define remap_page_range_1394(vma, start, addr, size, prot) \
remap_page_range(vma, start, addr, size, prot)
#endif
struct it_dma_prg { struct it_dma_prg {
struct dma_cmd begin; struct dma_cmd begin;
quadlet_t data[4]; quadlet_t data[4];
...@@ -496,11 +488,7 @@ void wakeup_dma_ir_ctx(unsigned long l) ...@@ -496,11 +488,7 @@ void wakeup_dma_ir_ctx(unsigned long l)
if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) { if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) {
reset_ir_status(d, i); reset_ir_status(d, i);
d->buffer_status[i] = VIDEO1394_BUFFER_READY; d->buffer_status[i] = VIDEO1394_BUFFER_READY;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
get_fast_time(&d->buffer_time[i]);
#else
do_gettimeofday(&d->buffer_time[i]); do_gettimeofday(&d->buffer_time[i]);
#endif
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment