linux1394-cvslog Mailing List for IEEE 1394 for Linux
Brought to you by:
aeb,
bencollins
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
(12) |
Aug
(8) |
Sep
(9) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(7) |
Feb
(3) |
Mar
(15) |
Apr
(12) |
May
(5) |
Jun
(9) |
Jul
(32) |
Aug
(39) |
Sep
(42) |
Oct
(22) |
Nov
(28) |
Dec
(8) |
| 2002 |
Jan
(37) |
Feb
(47) |
Mar
(6) |
Apr
(29) |
May
(33) |
Jun
(9) |
Jul
(28) |
Aug
(30) |
Sep
(15) |
Oct
(75) |
Nov
(37) |
Dec
(31) |
| 2003 |
Jan
|
Feb
(89) |
Mar
(41) |
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ben C. <bco...@de...> - 2003-04-10 16:27:33
|
The CVSLog list is moving to svn...@li... Please go to: http://www.linux1394.org/mailman/listinfo To subscribe to the new list. -- Debian - http://www.debian.org/ Linux 1394 - http://www.linux1394.org/ Subversion - http://subversion.tigris.org/ Deqo - http://www.deqo.com/ |
|
From: SVN U. <ben...@li...> - 2003-04-10 15:06:53
|
Author: bencollins
Date: 2003-04-10 11:06:12 -0400 (Thu, 10 Apr 2003)
New Revision: 860
Modified:
trunk/nodemgr.c
Log:
Patch from Jim Radford to keep from building up long delays from busreset
storms.
Modified: trunk/nodemgr.c
==============================================================================
--- trunk/nodemgr.c (original)
+++ trunk/nodemgr.c 2003-04-10 11:06:13.000000000 -0400
@@ -1570,28 +1570,26 @@
while (!down_interruptible(&hi->reset_sem) &&
!down_interruptible(&nodemgr_serialize)) {
unsigned int generation;
+ int i;
- /* Many resets can happen while we are waiting below.
- * Make sure we respond only to the most recent one. */
- do {
- /* Pause for 1/4 second, to make sure things
- * settle down. If schedule_timeout returns
- * non-zero, it means we caught a signal and that
- * we should exit. */
+ /* Pause for 1/4 second, to make sure things settle down. */
+ for (i = HZ/4; i > 0; i-= HZ/16) {
set_current_state(TASK_INTERRUPTIBLE);
- if (schedule_timeout (HZ/4)) {
- up(&nodemgr_serialize);
+ if (schedule_timeout(HZ/16))
goto caught_signal;
- }
- /* Now get the generation in which the node ID's
- * we collect are valid. During the bus scan we
- * will use this generation for the read
- * transactions, so that if another reset occurs
- * during the scan the transactions will fail
- * instead of returning bogus data. */
+ /* Now get the generation in which the node ID's we collect
+ * are valid. During the bus scan we will use this generation
+ * for the read transactions, so that if another reset occurs
+ * during the scan the transactions will fail instead of
+ * returning bogus data. */
generation = get_hpsb_generation(hi->host);
- } while (!down_trylock(&hi->reset_sem));
+
+ /* If we get a reset before we are done waiting, then
+ * start the the waiting over again */
+ while (!down_trylock(&hi->reset_sem))
+ i = HZ/4;
+ }
if (!nodemgr_check_root_capability(host)) {
/* Do nothing, we are resetting */
|
|
From: SVN U. <ben...@li...> - 2003-04-10 15:06:38
|
Author: bencollins
Date: 2003-04-10 11:05:57 -0400 (Thu, 10 Apr 2003)
New Revision: 859
Modified:
branches/linux-2.4/nodemgr.c
Log:
Patch from Jim Radford to keep from building up long delays from busreset
storms.
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-04-10 11:05:58.000000000 -0400
@@ -1260,18 +1260,13 @@
while (!down_interruptible(&hi->reset_sem) &&
!down_interruptible(&nodemgr_serialize)) {
unsigned int generation;
+ int i;
- /* Many resets can happen while we are waiting below.
- * Make sure we respond only to the most recent one. */
- do {
- /* Pause for 1/4 second, to make sure things settle down. If
- * schedule_timeout returns non-zero, it means we caught a signal
- * and that we should exit. */
+ /* Pause for 1/4 second, to make sure things settle down. */
+ for (i = HZ/4; i > 0; i-= HZ/16) {
set_current_state(TASK_INTERRUPTIBLE);
- if (schedule_timeout (HZ/4)) {
- up(&nodemgr_serialize);
+ if (schedule_timeout(HZ/16))
goto caught_signal;
- }
/* Now get the generation in which the node ID's we collect
* are valid. During the bus scan we will use this generation
@@ -1279,7 +1274,12 @@
* during the scan the transactions will fail instead of
* returning bogus data. */
generation = get_hpsb_generation(hi->host);
- } while(!down_trylock(&hi->reset_sem));
+
+ /* If we get a reset before we are done waiting, then
+ * start the the waiting over again */
+ while (!down_trylock(&hi->reset_sem))
+ i = HZ/4;
+ }
if (!nodemgr_check_root_capability(hi->host)) {
/* Do nothing, we are resetting */
|
|
From: SVN U. <ben...@li...> - 2003-04-10 14:45:26
|
Author: bencollins
Date: 2003-04-10 10:44:45 -0400 (Thu, 10 Apr 2003)
New Revision: 858
Modified:
trunk/ohci1394.c
trunk/ohci1394.h
Log:
busReset loop check, forward ported from 2.4 branch
Modified: trunk/ohci1394.c
==============================================================================
--- trunk/ohci1394.c (original)
+++ trunk/ohci1394.c 2003-04-10 10:44:46.000000000 -0400
@@ -80,6 +80,10 @@
* Manfred Weihs <we...@ic...>
* . Reworked code for initiating bus resets
* (long, short, with or without hold-off)
+ *
+ * Nandu Santhi <con...@us...>
+ * . Added support for nVidia nForce2 onboard Firewire chipset
+ *
*/
#include <linux/config.h>
@@ -146,7 +150,7 @@
#define OHCI_DMA_FREE(fmt, args...) \
HPSB_ERR("%s(%s)free(%d): "fmt, OHCI1394_DRIVER_NAME, __FUNCTION__, \
--global_outstanding_dmas, ## args)
-u32 global_outstanding_dmas = 0;
+static int global_outstanding_dmas = 0;
#else
#define OHCI_DMA_ALLOC(fmt, args...)
#define OHCI_DMA_FREE(fmt, args...)
@@ -2293,17 +2297,35 @@
* selfID phase, so we disable busReset interrupts, to
* avoid burying the cpu in interrupt requests. */
spin_lock_irqsave(&ohci->event_lock, flags);
- reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
- if (ohci->dev->vendor == PCI_VENDOR_ID_APPLE &&
- ohci->dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) {
- udelay(10);
- while(reg_read(ohci, OHCI1394_IntEventSet) & OHCI1394_busReset) {
- reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
+ reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
+
+ if (ohci->check_busreset) {
+ int loop_count = 0;
+
+ udelay(10);
+
+ while (reg_read(ohci, OHCI1394_IntEventSet) & OHCI1394_busReset) {
+ reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
+
spin_unlock_irqrestore(&ohci->event_lock, flags);
- udelay(10);
+ udelay(10);
spin_lock_irqsave(&ohci->event_lock, flags);
- }
- }
+
+ /* The loop counter check is to prevent the driver
+ * from remaining in this state forever. For the
+ * initial bus reset, the loop continues for ever
+ * and the system hangs, until some device is plugged-in
+ * or out manually into a port! The forced reset seems
+ * to solve this problem. This mainly effects nForce2. */
+ if (loop_count > 10000) {
+ hpsb_reset_bus(host, 1);
+ DBGMSG(ohci->id, "Detected bus-reset loop. Forced a bus reset!");
+ loop_count = 0;
+ }
+
+ loop_count++;
+ }
+ }
spin_unlock_irqrestore(&ohci->event_lock, flags);
if (!host->in_bus_reset) {
DBGMSG(ohci->id, "irq_handler: Bus reset requested");
@@ -2440,6 +2462,8 @@
if (event)
PRINT(KERN_ERR, ohci->id, "Unhandled interrupt(s) 0x%08x",
event);
+
+ return;
}
/* Put the buffer back into the dma context */
@@ -3279,6 +3303,18 @@
ohci->selfid_swap = 1;
#endif
+#ifndef PCI_DEVICE_ID_NVIDIA_NFORCE2_FW
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2_FW 0x006e
+#endif
+
+ /* These chipsets require a bit of extra care when checking after
+ * a busreset. */
+ if ((dev->vendor == PCI_VENDOR_ID_APPLE &&
+ dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) ||
+ (dev->vendor == PCI_VENDOR_ID_NVIDIA &&
+ dev->device == PCI_DEVICE_ID_NVIDIA_NFORCE2_FW))
+ ohci->check_busreset = 1;
+
/* We hardwire the MMIO length, since some CardBus adaptors
* fail to report the right length. Anyway, the ohci spec
* clearly says it's 2kb, so this shouldn't be a problem. */
Modified: trunk/ohci1394.h
==============================================================================
--- trunk/ohci1394.h (original)
+++ trunk/ohci1394.h 2003-04-10 10:44:47.000000000 -0400
@@ -233,6 +233,9 @@
unsigned int selfid_swap:1;
/* Some Apple chipset seem to swap incoming headers for us */
unsigned int no_swap_incoming:1;
+
+ /* Force extra paranoia checking on bus-reset handling */
+ unsigned int check_busreset:1;
};
static inline int cross_bound(unsigned long addr, unsigned int size)
|
|
From: SVN U. <ben...@li...> - 2003-04-10 14:44:32
|
Author: bencollins
Date: 2003-04-10 10:43:33 -0400 (Thu, 10 Apr 2003)
New Revision: 857
Modified:
branches/linux-2.4/ohci1394.c
branches/linux-2.4/ohci1394.h
Log:
busReset loop check for nForce2 chipsets.
Modified: branches/linux-2.4/ohci1394.c
==============================================================================
--- branches/linux-2.4/ohci1394.c (original)
+++ branches/linux-2.4/ohci1394.c 2003-04-10 10:43:35.000000000 -0400
@@ -78,6 +78,10 @@
*
* Dan Maas <dm...@ma...>
* . New isochronous API (rawiso)
+ *
+ * Nandu Santhi <con...@us...>
+ * . Added support for nVidia nForce2 onboard Firewire chipset
+ *
*/
#include <linux/config.h>
@@ -143,7 +147,7 @@
#define OHCI_DMA_FREE(fmt, args...) \
HPSB_ERR("%s(%s)free(%d): "fmt, OHCI1394_DRIVER_NAME, __FUNCTION__, \
--global_outstanding_dmas, ## args)
-u32 global_outstanding_dmas = 0;
+static int global_outstanding_dmas = 0;
#else
#define OHCI_DMA_ALLOC(fmt, args...)
#define OHCI_DMA_FREE(fmt, args...)
@@ -2309,18 +2313,35 @@
* selfID phase, so we disable busReset interrupts, to
* avoid burying the cpu in interrupt requests. */
spin_lock_irqsave(&ohci->event_lock, flags);
- reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
+ reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
+
+ if (ohci->check_busreset) {
+ int loop_count = 0;
+
+ udelay(10);
+
+ while (reg_read(ohci, OHCI1394_IntEventSet) & OHCI1394_busReset) {
+ reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
- if (ohci->dev->vendor == PCI_VENDOR_ID_APPLE &&
- ohci->dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) {
- udelay(10);
- while(reg_read(ohci, OHCI1394_IntEventSet) & OHCI1394_busReset) {
- reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
spin_unlock_irqrestore(&ohci->event_lock, flags);
- udelay(10);
+ udelay(10);
spin_lock_irqsave(&ohci->event_lock, flags);
- }
- }
+
+ /* The loop counter check is to prevent the driver
+ * from remaining in this state forever. For the
+ * initial bus reset, the loop continues for ever
+ * and the system hangs, until some device is plugged-in
+ * or out manually into a port! The forced reset seems
+ * to solve this problem. This mainly effects nForce2. */
+ if (loop_count > 10000) {
+ hpsb_reset_bus(host, 1);
+ DBGMSG(ohci->id, "Detected bus-reset loop. Forced a bus reset!");
+ loop_count = 0;
+ }
+
+ loop_count++;
+ }
+ }
spin_unlock_irqrestore(&ohci->event_lock, flags);
if (!host->in_bus_reset) {
@@ -2460,6 +2481,8 @@
if (event)
PRINT(KERN_ERR, ohci->id, "Unhandled interrupt(s) 0x%08x",
event);
+
+ return;
}
/* Put the buffer back into the dma context */
@@ -3298,6 +3321,18 @@
ohci->selfid_swap = 1;
#endif
+#ifndef PCI_DEVICE_ID_NVIDIA_NFORCE2_FW
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2_FW 0x006e
+#endif
+
+ /* These chipsets require a bit of extra care when checking after
+ * a busreset. */
+ if ((dev->vendor == PCI_VENDOR_ID_APPLE &&
+ dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW) ||
+ (dev->vendor == PCI_VENDOR_ID_NVIDIA &&
+ dev->device == PCI_DEVICE_ID_NVIDIA_NFORCE2_FW))
+ ohci->check_busreset = 1;
+
/* We hardwire the MMIO length, since some CardBus adaptors
* fail to report the right length. Anyway, the ohci spec
* clearly says it's 2kb, so this shouldn't be a problem. */
Modified: branches/linux-2.4/ohci1394.h
==============================================================================
--- branches/linux-2.4/ohci1394.h (original)
+++ branches/linux-2.4/ohci1394.h 2003-04-10 10:43:35.000000000 -0400
@@ -233,6 +233,9 @@
unsigned int selfid_swap:1;
/* Some Apple chipset seem to swap incoming headers for us */
unsigned int no_swap_incoming:1;
+
+ /* Force extra paranoia checking on bus-reset handling */
+ unsigned int check_busreset:1;
};
static inline int cross_bound(unsigned long addr, unsigned int size)
|
|
From: SVN U. <ben...@li...> - 2003-04-10 02:15:06
|
Author: bencollins
Date: 2003-04-09 22:14:25 -0400 (Wed, 09 Apr 2003)
New Revision: 856
Modified:
trunk/nodemgr.c
Log:
Typo: s/__ne/ne/
Modified: trunk/nodemgr.c
==============================================================================
--- trunk/nodemgr.c (original)
+++ trunk/nodemgr.c 2003-04-09 22:14:26.000000000 -0400
@@ -31,16 +31,6 @@
#include "nodemgr.h"
-#if BUS_ID_SIZE >= 20
-#define FW_BUS_ID_FMT "%016Lx"
-#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)(__ne->guid)
-#elif 1
-#define FW_BUS_ID_FMT "%012Lx"
-#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)__ne->guid & 0xffffffffffffLL
-#else
-#define FW_BUS_ID_FMT "%d-" NODE_BUS_FMT
-#define FW_BUS_ID_ARGS(__hi, __ne) __hi->id, NODE_BUS_ARGS(__ne->nodeid)
-#endif
static char *nodemgr_find_oui_name(int oui)
{
@@ -457,8 +447,9 @@
struct unit_directory *ud;
ud = container_of(list_to_dev(lh), struct unit_directory, device);
- sprintf(ud->device.name, "IEEE-1394 unit directory %d-" NODE_BUS_FMT "-%u",
- hi->id, NODE_BUS_ARGS(ne->nodeid), ud->id);
+ snprintf(ud->device.name, DEVICE_NAME_SIZE,
+ "IEEE-1394 unit directory %d-" NODE_BUS_FMT "-%u",
+ hi->id, NODE_BUS_ARGS(ne->nodeid), ud->id);
}
}
@@ -701,10 +692,11 @@
memcpy(&ne->device, &nodemgr_dev_template_ne,
sizeof(ne->device));
ne->device.parent = &host->device;
- snprintf(ne->device.bus_id, BUS_ID_SIZE, FW_BUS_ID_FMT,
- FW_BUS_ID_ARGS(hi, ne));
- sprintf(ne->device.name, "IEEE-1394 device %d-" NODE_BUS_FMT,
- hi->id, NODE_BUS_ARGS(ne->nodeid));
+ snprintf(ne->device.bus_id, BUS_ID_SIZE, "%016Lx",
+ (unsigned long long)(ne->guid));
+ snprintf(ne->device.name, DEVICE_NAME_SIZE,
+ "IEEE-1394 device %d-" NODE_BUS_FMT, hi->id,
+ NODE_BUS_ARGS(ne->nodeid));
device_register(&ne->device);
@@ -1296,8 +1288,9 @@
int update_ud_names = 0;
if (ne->nodeid != nodeid) {
- sprintf(ne->device.name, "IEEE-1394 device %d-" NODE_BUS_FMT,
- hi->id, NODE_BUS_ARGS(ne->nodeid));
+ snprintf(ne->device.name, DEVICE_NAME_SIZE,
+ "IEEE-1394 device %d-" NODE_BUS_FMT,
+ hi->id, NODE_BUS_ARGS(ne->nodeid));
HPSB_DEBUG("Node " NODE_BUS_FMT " changed to " NODE_BUS_FMT,
NODE_BUS_ARGS(ne->nodeid), NODE_BUS_ARGS(nodeid));
ne->nodeid = nodeid;
@@ -1736,8 +1729,9 @@
memcpy(&host->device, &nodemgr_dev_template_host,
sizeof(host->device));
host->device.parent = &host->pdev->dev;
- sprintf(host->device.bus_id, "fw-host%d", hi->id);
- sprintf(host->device.name, "IEEE-1394 Host %s-%d", host->driver->name, hi->id);
+ snprintf(host->device.bus_id, BUS_ID_SIZE, "fw-host%d", hi->id);
+ snprintf(host->device.name, DEVICE_NAME_SIZE, "IEEE-1394 Host %s-%d",
+ host->driver->name, hi->id);
sprintf(hi->daemon_name, "knodemgrd_%d", hi->id);
|
|
From: SVN U. <ben...@li...> - 2003-04-10 02:14:51
|
Author: bencollins
Date: 2003-04-09 22:14:01 -0400 (Wed, 09 Apr 2003)
New Revision: 855
Modified:
trunk/dv1394.c
Log:
Fix devfs_mk_dir call.
Modified: trunk/dv1394.c
==============================================================================
--- trunk/dv1394.c (original)
+++ trunk/dv1394.c 2003-04-09 22:14:03.000000000 -0400
@@ -2919,11 +2919,7 @@
}
#ifdef CONFIG_DEVFS_FS
- if (!devfs_mk_dir(NULL, "ieee1394/dv", NULL)) {
- printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/dv\n");
- ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
- return -ENOMEM;
- }
+ devfs_mk_dir("ieee1394/dv");
#endif
#ifdef CONFIG_PROC_FS
|
|
From: SVN U. <ben...@li...> - 2003-04-06 15:23:14
|
Author: bencollins
Date: 2003-04-06 11:22:33 -0400 (Sun, 06 Apr 2003)
New Revision: 854
Modified:
branches/linux-2.4/ieee1394_core.c
Log:
Patch pulled from AC tree to alleviate sleep while in atomic context.
Modified: branches/linux-2.4/ieee1394_core.c
==============================================================================
--- branches/linux-2.4/ieee1394_core.c (original)
+++ branches/linux-2.4/ieee1394_core.c 2003-04-06 11:22:35.000000000 -0400
@@ -127,9 +127,8 @@
{
struct hpsb_packet *packet = NULL;
void *data = NULL;
- int kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
- packet = kmem_cache_alloc(hpsb_packet_cache, kmflags);
+ packet = kmem_cache_alloc(hpsb_packet_cache, GFP_ATOMIC);
if (packet == NULL)
return NULL;
@@ -137,7 +136,7 @@
packet->header = packet->embedded_header;
if (data_size) {
- data = kmalloc(data_size + 8, kmflags);
+ data = kmalloc(data_size + 8, GFP_ATOMIC);
if (data == NULL) {
kmem_cache_free(hpsb_packet_cache, packet);
return NULL;
@@ -472,8 +471,7 @@
quadlet_t *data;
size_t size=packet->data_size+packet->header_size;
- int kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
- data = kmalloc(packet->header_size + packet->data_size, kmflags);
+ data = kmalloc(packet->header_size + packet->data_size, GFP_ATOMIC);
if (!data) {
HPSB_ERR("unable to allocate memory for concatenating header and data");
return 0;
|
|
From: SVN U. <ben...@li...> - 2003-04-06 15:22:31
|
Author: bencollins
Date: 2003-04-06 11:21:44 -0400 (Sun, 06 Apr 2003)
New Revision: 853
Modified:
trunk/ieee1394_core.c
Log:
Patch from AC branch to alleviate some sleep problems in atomic context.
Modified: trunk/ieee1394_core.c
==============================================================================
--- trunk/ieee1394_core.c (original)
+++ trunk/ieee1394_core.c 2003-04-06 11:21:45.000000000 -0400
@@ -127,9 +127,8 @@
{
struct hpsb_packet *packet = NULL;
void *data = NULL;
- int kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
- packet = kmem_cache_alloc(hpsb_packet_cache, kmflags);
+ packet = kmem_cache_alloc(hpsb_packet_cache, GFP_ATOMIC);
if (packet == NULL)
return NULL;
@@ -137,7 +136,7 @@
packet->header = packet->embedded_header;
if (data_size) {
- data = kmalloc(data_size + 8, kmflags);
+ data = kmalloc(data_size + 8, GFP_ATOMIC);
if (data == NULL) {
kmem_cache_free(hpsb_packet_cache, packet);
return NULL;
@@ -493,8 +492,7 @@
quadlet_t *data;
size_t size=packet->data_size+packet->header_size;
- int kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
- data = kmalloc(packet->header_size + packet->data_size, kmflags);
+ data = kmalloc(packet->header_size + packet->data_size, GFP_ATOMIC);
if (!data) {
HPSB_ERR("unable to allocate memory for concatenating header and data");
return 0;
|
|
From: SVN U. <ben...@li...> - 2003-04-03 15:19:49
|
Author: bencollins
Date: 2003-04-03 10:19:11 -0500 (Thu, 03 Apr 2003)
New Revision: 852
Modified:
trunk/dv1394.c
trunk/ieee1394_core.c
trunk/video1394.c
Log:
Update devfs_mk_dir usage. Patch merged from 2.5.66.
Modified: trunk/ieee1394_core.c
==============================================================================
--- trunk/ieee1394_core.c (original)
+++ trunk/ieee1394_core.c 2003-04-03 10:19:13.000000000 -0500
@@ -1152,7 +1152,7 @@
hpsb_packet_cache = kmem_cache_create("hpsb_packet", sizeof(struct hpsb_packet),
0, 0, NULL, NULL);
- ieee1394_devfs_handle = devfs_mk_dir(NULL, "ieee1394", NULL);
+ ieee1394_devfs_handle = devfs_mk_dir("ieee1394");
if (register_chrdev(IEEE1394_MAJOR, "ieee1394", &ieee1394_chardev_ops)) {
HPSB_ERR("unable to register character device major %d!\n", IEEE1394_MAJOR);
Modified: trunk/video1394.c
==============================================================================
--- trunk/video1394.c (original)
+++ trunk/video1394.c 2003-04-03 10:19:13.000000000 -0500
@@ -1251,7 +1251,7 @@
{
struct video_card *video;
unsigned long flags;
- char name[16];
+ char name[24];
int minor;
video = kmalloc(sizeof(struct video_card), GFP_KERNEL);
@@ -1270,9 +1270,9 @@
video->id = ohci->id;
video->ohci = ohci;
- sprintf(name, "%d", video->id);
+ sprintf(name, "%s/%d", VIDEO1394_DRIVER_NAME, video->id);
minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + video->id;
- video->devfs = devfs_register(devfs_handle, name, DEVFS_FL_DEFAULT,
+ video->devfs = devfs_register(NULL, name, DEVFS_FL_DEFAULT,
IEEE1394_MAJOR, minor,
S_IFCHR | S_IRUSR | S_IWUSR,
&video1394_fops, NULL);
@@ -1486,7 +1486,7 @@
return -EIO;
}
- devfs_handle = devfs_mk_dir(NULL, VIDEO1394_DRIVER_NAME, NULL);
+ devfs_handle = devfs_mk_dir(VIDEO1394_DRIVER_NAME);
hl_handle = hpsb_register_highlevel (VIDEO1394_DRIVER_NAME, &hl_ops);
if (hl_handle == NULL) {
Modified: trunk/dv1394.c
==============================================================================
--- trunk/dv1394.c (original)
+++ trunk/dv1394.c 2003-04-03 10:19:13.000000000 -0500
@@ -2648,12 +2648,9 @@
#endif
#ifdef CONFIG_DEVFS_FS
- snprintf(buf, sizeof(buf), "ieee1394/dv/host%d", ohci->id);
- devfs_mk_dir(NULL, buf, NULL);
- snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/NTSC", ohci->id);
- devfs_mk_dir(NULL, buf, NULL);
- snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/PAL", ohci->id);
- devfs_mk_dir(NULL, buf, NULL);
+ devfs_mk_dir("ieee1394/dv/host%d", ohci->id);
+ devfs_mk_dir("ieee1394/dv/host%d/NTSC", ohci->id);
+ devfs_mk_dir("ieee1394/dv/host%d/PAL", ohci->id);
#endif
dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE);
|
|
From: SVN U. <ben...@li...> - 2003-04-03 15:08:13
|
Author: bencollins
Date: 2003-04-03 10:07:41 -0500 (Thu, 03 Apr 2003)
New Revision: 851
Modified:
trunk/pcilynx.c
Log:
Update decleration of i2c adapter to fit new model.
Modified: trunk/pcilynx.c
==============================================================================
--- trunk/pcilynx.c (original)
+++ trunk/pcilynx.c 2003-04-03 10:07:42.000000000 -0500
@@ -139,10 +139,12 @@
};
static struct i2c_adapter bit_ops = {
- .name = "PCILynx I2C adapter",
.id = 0xAA, //FIXME: probably we should get an id in i2c-id.h
.client_register = bit_reg,
.client_unregister = bit_unreg,
+ .dev = {
+ .name = "PCILynx I2C",
+ },
};
|
|
From: SVN U. <we...@li...> - 2003-04-03 13:16:46
|
Author: weihs
Date: 2003-04-03 08:16:12 -0500 (Thu, 03 Apr 2003)
New Revision: 850
Modified:
branches/linux-2.4/highlevel.c
Log:
use write_lock_irqsave instead of write_lock_irq etc. where interrupts could be already diabled.
Patch from Alexander Unrau
Backport from trunk
Modified: branches/linux-2.4/highlevel.c
==============================================================================
--- branches/linux-2.4/highlevel.c (original)
+++ branches/linux-2.4/highlevel.c 2003-04-03 08:16:14.000000000 -0500
@@ -98,6 +98,7 @@
struct hpsb_address_serve *as;
struct list_head *entry;
int retval = 0;
+ unsigned long flags;
if (((start|end) & 3) || (start >= end) || (end > 0x1000000000000ULL)) {
HPSB_ERR("%s called with invalid addresses", __FUNCTION__);
@@ -116,7 +117,7 @@
as->start = start;
as->end = end;
- write_lock_irq(&addr_space_lock);
+ write_lock_irqsave(&addr_space_lock, flags);
entry = addr_space.next;
while (list_entry(entry, struct hpsb_address_serve, as_list)->end
@@ -130,7 +131,7 @@
}
entry = entry->next;
}
- write_unlock_irq(&addr_space_lock);
+ write_unlock_irqrestore(&addr_space_lock, flags);
if (retval == 0) {
kfree(as);
@@ -144,8 +145,9 @@
int retval = 0;
struct hpsb_address_serve *as;
struct list_head *entry;
+ unsigned long flags;
- write_lock_irq(&addr_space_lock);
+ write_lock_irqsave(&addr_space_lock, flags);
entry = hl->addr_list.next;
@@ -161,7 +163,7 @@
}
}
- write_unlock_irq(&addr_space_lock);
+ write_unlock_irqrestore(&addr_space_lock, flags);
return retval;
}
|
|
From: SVN U. <we...@li...> - 2003-04-03 13:16:05
|
Author: weihs
Date: 2003-04-03 08:15:32 -0500 (Thu, 03 Apr 2003)
New Revision: 849
Modified:
trunk/highlevel.c
Log:
use write_lock_irqsave instead of write_lock_irq etc. where interrupts could be already diabled.
Patch from Alexander Unrau
Modified: trunk/highlevel.c
==============================================================================
--- trunk/highlevel.c (original)
+++ trunk/highlevel.c 2003-04-03 08:15:34.000000000 -0500
@@ -99,6 +99,7 @@
struct hpsb_address_serve *as;
struct list_head *entry;
int retval = 0;
+ unsigned long flags;
if (((start|end) & 3) || (start >= end) || (end > 0x1000000000000ULL)) {
HPSB_ERR("%s called with invalid addresses", __FUNCTION__);
@@ -117,7 +118,7 @@
as->start = start;
as->end = end;
- write_lock_irq(&addr_space_lock);
+ write_lock_irqsave(&addr_space_lock, flags);
entry = addr_space.next;
while (list_entry(entry, struct hpsb_address_serve, as_list)->end <= start) {
@@ -129,7 +130,7 @@
}
entry = entry->next;
}
- write_unlock_irq(&addr_space_lock);
+ write_unlock_irqrestore(&addr_space_lock, flags);
if (retval == 0) {
kfree(as);
@@ -143,8 +144,9 @@
int retval = 0;
struct hpsb_address_serve *as;
struct list_head *entry;
+ unsigned long flags;
- write_lock_irq(&addr_space_lock);
+ write_lock_irqsave(&addr_space_lock, flags);
entry = hl->addr_list.next;
@@ -160,7 +162,7 @@
}
}
- write_unlock_irq(&addr_space_lock);
+ write_unlock_irqrestore(&addr_space_lock, flags);
return retval;
}
|
|
From: SVN U. <ben...@li...> - 2003-03-24 03:48:45
|
Author: bencollins
Date: 2003-03-23 22:48:03 -0500 (Sun, 23 Mar 2003)
New Revision: 848
Modified:
trunk/dv1394.c
Log:
Patch from Christoph Hellwig to cleanup devfs registration.
Modified: trunk/dv1394.c
==============================================================================
--- trunk/dv1394.c (original)
+++ trunk/dv1394.c 2003-03-23 22:48:04.000000000 -0500
@@ -177,15 +177,6 @@
static struct hpsb_highlevel *hl_handle; /* = NULL; */
-static LIST_HEAD(dv1394_devfs);
-struct dv1394_devfs_entry {
- struct list_head list;
- devfs_handle_t devfs;
- char name[32];
- struct dv1394_devfs_entry *parent;
-};
-static spinlock_t dv1394_devfs_lock = SPIN_LOCK_UNLOCKED;
-
/* translate from a struct file* to the corresponding struct video_card* */
static inline struct video_card* file_to_video_card(struct file *file)
@@ -2456,137 +2447,25 @@
};
-/*** DEVFS HELPERS *********************************************************/
-
-struct dv1394_devfs_entry *
-dv1394_devfs_find( char *name)
-{
- struct list_head *lh;
- struct dv1394_devfs_entry *p;
-
- spin_lock( &dv1394_devfs_lock);
- if(!list_empty(&dv1394_devfs)) {
- list_for_each(lh, &dv1394_devfs) {
- p = list_entry(lh, struct dv1394_devfs_entry, list);
- if(!strncmp(p->name, name, sizeof(p->name))) {
- goto found;
- }
- }
- }
- p = NULL;
-
-found:
- spin_unlock( &dv1394_devfs_lock);
- return p;
-}
-
#ifdef CONFIG_DEVFS_FS
static int dv1394_devfs_add_entry(struct video_card *video)
{
- char buf[32];
- struct dv1394_devfs_entry *p;
- struct dv1394_devfs_entry *parent;
+ char buf[64];
- p = kmalloc(sizeof(struct dv1394_devfs_entry), GFP_KERNEL);
- if(!p) {
- printk(KERN_ERR "dv1394: cannot allocate dv1394_devfs_entry\n");
- goto err;
- }
- memset(p, 0, sizeof(struct dv1394_devfs_entry));
-
- snprintf(buf, sizeof(buf), "dv/host%d/%s", (video->id>>2),
- (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"));
-
- parent = dv1394_devfs_find(buf);
- if (parent == NULL) {
- printk(KERN_ERR "dv1394: unable to locate parent devfs of %s\n", buf);
- goto err_free;
- }
-
- video->devfs_handle = devfs_register(
- parent->devfs,
- (video->mode == MODE_RECEIVE ? "in" : "out"),
- DEVFS_FL_NONE,
- IEEE1394_MAJOR,
+ snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/%s/%s",
+ (video->id>>2),
+ (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
+ (video->mode == MODE_RECEIVE ? "in" : "out"));
+
+ video->devfs_handle = devfs_register(NULL, buf, 0, IEEE1394_MAJOR,
IEEE1394_MINOR_BLOCK_DV1394*16 + video->id,
S_IFCHR | S_IRUGO | S_IWUGO,
- &dv1394_fops,
- (void*) video);
- p->devfs = video->devfs_handle;
-
- if (p->devfs == NULL) {
- printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/%s/%s\n",
- parent->name,
- (video->mode == MODE_RECEIVE ? "in" : "out"));
- goto err_free;
- }
-
- spin_lock( &dv1394_devfs_lock);
- INIT_LIST_HEAD(&p->list);
- list_add_tail(&p->list, &dv1394_devfs);
- spin_unlock( &dv1394_devfs_lock);
-
- return 0;
-
- err_free:
- kfree(p);
- err:
- return -ENOMEM;
-}
-
-static int
-dv1394_devfs_add_dir( char *name,
- struct dv1394_devfs_entry *parent,
- struct dv1394_devfs_entry **out)
-{
- struct dv1394_devfs_entry *p;
-
- p = kmalloc(sizeof(struct dv1394_devfs_entry), GFP_KERNEL);
- if(!p) {
- printk(KERN_ERR "dv1394: cannot allocate dv1394_devfs_entry\n");
- goto err;
- }
- memset(p, 0, sizeof(struct dv1394_devfs_entry));
-
- if (parent == NULL) {
- snprintf(p->name, sizeof(p->name), "%s", name);
- p->devfs = devfs_mk_dir(ieee1394_devfs_handle, name, NULL);
- } else {
- snprintf(p->name, sizeof(p->name), "%s/%s", parent->name, name);
- p->devfs = devfs_mk_dir(parent->devfs, name, NULL);
- }
- if (p->devfs == NULL) {
- printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/%s\n", p->name);
- goto err_free;
+ &dv1394_fops, video);
+ if (video->devfs_handle == NULL) {
+ printk(KERN_ERR "dv1394: unable to create /dev/%s\n", buf);
+ return -ENOMEM;
}
-
- p->parent = parent;
- if (out != NULL) *out = p;
-
- spin_lock( &dv1394_devfs_lock);
- INIT_LIST_HEAD(&p->list);
- list_add_tail(&p->list, &dv1394_devfs);
- spin_unlock( &dv1394_devfs_lock);
-
return 0;
-
- err_free:
- kfree(p);
- err:
- return -ENOMEM;
-}
-
-void dv1394_devfs_del( char *name)
-{
- struct dv1394_devfs_entry *p = dv1394_devfs_find(name);
- if (p != NULL) {
- devfs_unregister(p->devfs);
-
- spin_lock( &dv1394_devfs_lock);
- list_del(&p->list);
- spin_unlock( &dv1394_devfs_lock);
- kfree(p);
- }
}
#endif /* CONFIG_DEVFS_FS */
@@ -2664,7 +2543,7 @@
#ifdef CONFIG_DEVFS_FS
if (dv1394_devfs_add_entry(video) < 0)
- goto err_free;
+ goto err_free;
#endif
debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id);
@@ -2687,8 +2566,9 @@
(video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
(video->mode == MODE_RECEIVE ? "in" : "out")
);
+
#ifdef CONFIG_DEVFS_FS
- dv1394_devfs_del(buf);
+ devfs_remove("ieee1394/%s", buf);
#endif
#ifdef CONFIG_PROC_FS
dv1394_procfs_del(buf);
@@ -2726,13 +2606,11 @@
spin_unlock_irqrestore(&dv1394_cards_lock, flags);
n = (video->id >> 2);
+
#ifdef CONFIG_DEVFS_FS
- snprintf(buf, sizeof(buf), "dv/host%d/NTSC", n);
- dv1394_devfs_del(buf);
- snprintf(buf, sizeof(buf), "dv/host%d/PAL", n);
- dv1394_devfs_del(buf);
- snprintf(buf, sizeof(buf), "dv/host%d", n);
- dv1394_devfs_del(buf);
+ devfs_remove("ieee1394/dv/host%d/NTSC", n);
+ devfs_remove("ieee1394/dv/host%d/PAL", n);
+ devfs_remove("ieee1394/dv/host%d", n);
#endif
#ifdef CONFIG_PROC_FS
@@ -2770,15 +2648,12 @@
#endif
#ifdef CONFIG_DEVFS_FS
-{
- struct dv1394_devfs_entry *devfs_entry = dv1394_devfs_find("dv");
- if (devfs_entry != NULL) {
- snprintf(buf, sizeof(buf), "host%d", ohci->id);
- dv1394_devfs_add_dir(buf, devfs_entry, &devfs_entry);
- dv1394_devfs_add_dir("NTSC", devfs_entry, NULL);
- dv1394_devfs_add_dir("PAL", devfs_entry, NULL);
- }
-}
+ snprintf(buf, sizeof(buf), "ieee1394/dv/host%d", ohci->id);
+ devfs_mk_dir(NULL, buf, NULL);
+ snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/NTSC", ohci->id);
+ devfs_mk_dir(NULL, buf, NULL);
+ snprintf(buf, sizeof(buf), "ieee1394/dv/host%d/PAL", ohci->id);
+ devfs_mk_dir(NULL, buf, NULL);
#endif
dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE);
@@ -3028,7 +2903,7 @@
hpsb_unregister_highlevel (hl_handle);
ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
#ifdef CONFIG_DEVFS_FS
- dv1394_devfs_del("dv");
+ devfs_remove("ieee1394/dv");
#endif
#ifdef CONFIG_PROC_FS
dv1394_procfs_del("dv");
@@ -3047,8 +2922,7 @@
}
#ifdef CONFIG_DEVFS_FS
- ret = dv1394_devfs_add_dir("dv", NULL, NULL);
- if (ret < 0) {
+ if (!devfs_mk_dir(NULL, "ieee1394/dv", NULL)) {
printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/dv\n");
ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
return -ENOMEM;
@@ -3061,7 +2935,7 @@
printk(KERN_ERR "dv1394: unable to create /proc/bus/ieee1394/dv\n");
ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
#ifdef CONFIG_DEVFS_FS
- dv1394_devfs_del("dv");
+ devfs_remove("ieee1394/dv");
#endif
return -ENOMEM;
}
@@ -3072,7 +2946,7 @@
printk(KERN_ERR "dv1394: hpsb_register_highlevel failed\n");
ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394);
#ifdef CONFIG_DEVFS_FS
- dv1394_devfs_del("dv");
+ devfs_remove("ieee1394/dv");
#endif
#ifdef CONFIG_PROC_FS
dv1394_procfs_del("dv");
|
|
From: SVN U. <dde...@li...> - 2003-03-20 19:44:49
|
Author: ddennedy
Date: 2003-03-20 14:43:48 -0500 (Thu, 20 Mar 2003)
New Revision: 847
Modified:
branches/linux-2.4/nodemgr.c
branches/linux-2.4/nodemgr.h
branches/linux-2.4/sbp2.c
Log:
sbp2 multi-logical-unit support and better software_version checking on hotplug
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-03-20 14:43:49.000000000 -0500
@@ -92,7 +92,7 @@
list_for_each(lh, &node_list) {
struct list_head *l;
- int ud_count = 0;
+ int ud_count = 0, lud_count = 0;
ne = list_entry(lh, struct node_entry, list);
if (!ne)
@@ -135,7 +135,10 @@
struct unit_directory *ud = list_entry (l, struct unit_directory, node_list);
int printed = 0; // small hack
- PUTF(" Unit Directory %d:\n", ud_count++);
+ if (ud->parent == NULL)
+ PUTF(" Unit Directory %d:\n", lud_count++);
+ else
+ PUTF(" Logical Unit Directory %d:\n", ud_count++);
if (ud->flags & UNIT_DIRECTORY_VENDOR_ID) {
PUTF(" Vendor/Model ID: %s [%06x]",
ud->vendor_name ?: "Unknown", ud->vendor_id);
@@ -433,7 +436,7 @@
store? Only count immediate values and
CSR offsets for now. */
code &= CONFIG_ROM_KEY_TYPE_MASK;
- if ((code & 0x80) == 0)
+ if ((code & CONFIG_ROM_KEY_TYPE_LEAF) == 0)
count++;
break;
}
@@ -481,19 +484,23 @@
* software_version entries, in order to get driver autoloading working.
*/
-static void nodemgr_process_unit_directory(struct node_entry *ne,
- octlet_t address)
+static struct unit_directory * nodemgr_process_unit_directory
+ (struct node_entry *ne, octlet_t address, struct unit_directory *parent)
{
struct unit_directory *ud;
quadlet_t quad;
quadlet_t *infop;
int length;
-
+ struct unit_directory *ud_temp = NULL;
+
if (!(ud = nodemgr_scan_unit_directory(ne, address)))
goto unit_directory_error;
ud->ne = ne;
ud->address = address;
+
+ if (parent != NULL)
+ ud->parent = parent;
if (nodemgr_read_quadlet(ne->host, ne->nodeid, ne->generation,
address, &quad))
@@ -569,12 +576,48 @@
/* TODO: read strings... icons? */
break;
+ case CONFIG_ROM_LOGICAL_UNIT_DIRECTORY:
+ {
+ ud_temp = nodemgr_process_unit_directory(ne, address + value * 4, ud);
+ /* inherit unspecified values */
+ if (ud_temp != NULL )
+ {
+ ud->n_children++;
+ if ((ud->flags & UNIT_DIRECTORY_VENDOR_ID) &&
+ !(ud_temp->flags & UNIT_DIRECTORY_VENDOR_ID))
+ {
+ ud_temp->flags |= UNIT_DIRECTORY_VENDOR_ID;
+ ud_temp->vendor_id = ud->vendor_id;
+ }
+ if ((ud->flags & UNIT_DIRECTORY_MODEL_ID) &&
+ !(ud_temp->flags & UNIT_DIRECTORY_MODEL_ID))
+ {
+ ud_temp->flags |= UNIT_DIRECTORY_MODEL_ID;
+ ud_temp->model_id = ud->model_id;
+ }
+ if ((ud->flags & UNIT_DIRECTORY_SPECIFIER_ID) &&
+ !(ud_temp->flags & UNIT_DIRECTORY_SPECIFIER_ID))
+ {
+ ud_temp->flags |= UNIT_DIRECTORY_SPECIFIER_ID;
+ ud_temp->specifier_id = ud->specifier_id;
+ }
+ if ((ud->flags & UNIT_DIRECTORY_VERSION) &&
+ !(ud_temp->flags & UNIT_DIRECTORY_VERSION))
+ {
+ ud_temp->flags |= UNIT_DIRECTORY_VERSION;
+ ud_temp->version = ud->version;
+ }
+ }
+
+ }
+ break;
+
default:
/* Which types of quadlets do we want to
store? Only count immediate values and
CSR offsets for now. */
code &= CONFIG_ROM_KEY_TYPE_MASK;
- if ((code & 0x80) == 0)
+ if ((code & CONFIG_ROM_KEY_TYPE_LEAF) == 0)
*infop = quad;
break;
}
@@ -583,11 +626,12 @@
list_add_tail(&ud->node_list, &ne->unit_directories);
list_add_tail(&ud->driver_list, &unit_directory_list);
- return;
+ return ud;
unit_directory_error:
if (ud != NULL)
kfree(ud);
+ return NULL;
}
static void dump_directories (struct node_entry *ne)
@@ -670,7 +714,7 @@
break;
case CONFIG_ROM_UNIT_DIRECTORY:
- nodemgr_process_unit_directory(ne, address + value * 4);
+ nodemgr_process_unit_directory(ne, address + value * 4, NULL);
break;
case CONFIG_ROM_DESCRIPTOR_LEAF:
@@ -821,8 +865,9 @@
id->specifier_id != ud->specifier_id)
continue;
+ /* software version does a bitwise comparison instead of equality */
if ((id->match_flags & IEEE1394_MATCH_VERSION) &&
- id->version != ud->version)
+ !(id->version & ud->version))
continue;
return id;
Modified: branches/linux-2.4/nodemgr.h
==============================================================================
--- branches/linux-2.4/nodemgr.h (original)
+++ branches/linux-2.4/nodemgr.h 2003-03-20 14:43:49.000000000 -0500
@@ -53,6 +53,7 @@
#define CONFIG_ROM_MODEL_ID 0x17
#define CONFIG_ROM_NODE_CAPABILITES 0x0C
#define CONFIG_ROM_UNIT_DIRECTORY 0xd1
+#define CONFIG_ROM_LOGICAL_UNIT_DIRECTORY 0xd4
#define CONFIG_ROM_SPECIFIER_ID 0x12
#define CONFIG_ROM_UNIT_SW_VERSION 0x13
#define CONFIG_ROM_DESCRIPTOR_LEAF 0x81
@@ -114,6 +115,10 @@
/* For linking directories belonging to a node */
struct list_head node_list;
+
+ /* for tracking unit versus logical unit */
+ struct unit_directory *parent;
+ int n_children;
int count; /* Number of quadlets */
quadlet_t quadlets[0];
Modified: branches/linux-2.4/sbp2.c
==============================================================================
--- branches/linux-2.4/sbp2.c (original)
+++ branches/linux-2.4/sbp2.c 2003-03-20 14:43:49.000000000 -0500
@@ -1840,28 +1840,11 @@
return(0);
}
-/*
- * This function is called to parse sbp2 device's config rom unit
- * directory. Used to determine things like sbp2 management agent offset,
- * and command set used (SCSI or RBC).
- */
-static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id)
+static void sbp2_parse_logical_unit_directory
+ (struct scsi_id_instance_data *scsi_id, struct unit_directory *ud)
{
- struct unit_directory *ud;
int i;
-
- SBP2_DEBUG("sbp2_parse_unit_directory");
-
- /* Initialize some fields, in case an entry does not exist */
- scsi_id->sbp2_device_type_and_lun = SBP2_DEVICE_TYPE_LUN_UNINITIALIZED;
- scsi_id->sbp2_management_agent_addr = 0x0;
- scsi_id->sbp2_command_set_spec_id = 0x0;
- scsi_id->sbp2_command_set = 0x0;
- scsi_id->sbp2_unit_characteristics = 0x0;
- scsi_id->sbp2_firmware_revision = 0x0;
-
- ud = scsi_id->ud;
-
+
/* Handle different fields in the unit directory, based on keys */
for (i = 0; i < ud->count; i++) {
switch (CONFIG_ROM_KEY(ud->quadlets[i])) {
@@ -1923,11 +1906,44 @@
else SBP2_DEBUG("sbp2_firmware_revision = %x",
(unsigned int) scsi_id->sbp2_firmware_revision);
break;
-
+#if 0
+ case SBP2_LOGICAL_UNIT_DIRECTORY_OFFSET_KEY:
+ SBP2_DEBUG("sbp2_parse_unit_directory: found logical unit directory");
+ break;
+#endif
default:
break;
}
}
+}
+
+/*
+ * This function is called to parse sbp2 device's config rom unit
+ * directory. Used to determine things like sbp2 management agent offset,
+ * and command set used (SCSI or RBC).
+ */
+static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id)
+{
+ struct unit_directory *ud;
+ int i;
+
+ SBP2_DEBUG("sbp2_parse_unit_directory");
+
+ /* Initialize some fields, in case an entry does not exist */
+ scsi_id->sbp2_device_type_and_lun = SBP2_DEVICE_TYPE_LUN_UNINITIALIZED;
+ scsi_id->sbp2_management_agent_addr = 0x0;
+ scsi_id->sbp2_command_set_spec_id = 0x0;
+ scsi_id->sbp2_command_set = 0x0;
+ scsi_id->sbp2_unit_characteristics = 0x0;
+ scsi_id->sbp2_firmware_revision = 0x0;
+
+ ud = scsi_id->ud;
+ if (ud->parent != NULL)
+ sbp2_parse_logical_unit_directory(scsi_id, ud->parent);
+ if (ud->n_children == 0)
+ sbp2_parse_logical_unit_directory(scsi_id, ud);
+ else
+ return;
/* This is the start of our broken device checking. We try to hack
* around oddities and known defects. */
|
|
From: SVN U. <ben...@li...> - 2003-03-19 19:20:23
|
Author: bencollins
Date: 2003-03-19 14:19:33 -0500 (Wed, 19 Mar 2003)
New Revision: 846
Modified:
trunk/csr.c
trunk/ieee1394_core.c
trunk/nodemgr.c
trunk/ohci1394.c
trunk/pcilynx.c
trunk/sbp2.c
Log:
Convert to new module_param() interface since MODULE_PARM() is not
deprecated.
Modified: trunk/ieee1394_core.c
==============================================================================
--- trunk/ieee1394_core.c (original)
+++ trunk/ieee1394_core.c 2003-03-19 14:19:35.000000000 -0500
@@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/proc_fs.h>
#include <linux/bitops.h>
#include <asm/byteorder.h>
@@ -48,9 +49,9 @@
/*
* Disable the nodemgr detection and config rom reading functionality.
*/
-MODULE_PARM(disable_nodemgr, "i");
-MODULE_PARM_DESC(disable_nodemgr, "Disable nodemgr functionality.");
static int disable_nodemgr = 0;
+module_param(disable_nodemgr, int, 0444);
+MODULE_PARM_DESC(disable_nodemgr, "Disable nodemgr functionality.");
/* We are GPL, so treat us special */
MODULE_LICENSE("GPL");
Modified: trunk/ohci1394.c
==============================================================================
--- trunk/ohci1394.c (original)
+++ trunk/ohci1394.c 2003-03-19 14:19:35.000000000 -0500
@@ -90,6 +90,7 @@
#include <linux/wait.h>
#include <linux/errno.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/fs.h>
#include <linux/poll.h>
@@ -163,9 +164,9 @@
"$Rev$ Ben Collins <bco...@de...>";
/* Module Parameters */
-MODULE_PARM(phys_dma,"i");
-MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1).");
static int phys_dma = 1;
+module_param(phys_dma, int, 0644);
+MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1).");
static void dma_trm_tasklet(unsigned long data);
static void dma_trm_reset(struct dma_trm_ctx *d);
Modified: trunk/nodemgr.c
==============================================================================
--- trunk/nodemgr.c (original)
+++ trunk/nodemgr.c 2003-03-19 14:19:35.000000000 -0500
@@ -31,9 +31,12 @@
#include "nodemgr.h"
-#if 1
+#if BUS_ID_SIZE >= 20
+#define FW_BUS_ID_FMT "%016Lx"
+#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)(__ne->guid)
+#elif 1
#define FW_BUS_ID_FMT "%012Lx"
-#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)(__ne->guid & 0xffffffffffffL)
+#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)__ne->guid & 0xffffffffffffLL
#else
#define FW_BUS_ID_FMT "%d-" NODE_BUS_FMT
#define FW_BUS_ID_ARGS(__hi, __ne) __hi->id, NODE_BUS_ARGS(__ne->nodeid)
Modified: trunk/sbp2.c
==============================================================================
--- trunk/sbp2.c (original)
+++ trunk/sbp2.c 2003-03-19 14:19:35.000000000 -0500
@@ -33,16 +33,16 @@
*
* Module Load Options:
*
- * sbp2_max_speed - Force max speed allowed
- * (2 = 400mb, 1 = 200mb, 0 = 100mb. default = 2)
- * sbp2_serialize_io - Serialize all I/O coming down from the scsi drivers
- * (0 = deserialized, 1 = serialized, default = 0)
- * sbp2_max_sectors, - Change max sectors per I/O supported (default = 255)
- * sbp2_exclusive_login - Set to zero if you'd like to allow multiple hosts the ability
- * to log in at the same time. Sbp2 device must support this,
- * and you must know what you're doing (default = 1)
+ * max_speed - Force max speed allowed
+ * (2 = 400mb, 1 = 200mb, 0 = 100mb. default = 2)
+ * serialize_io - Serialize all I/O coming down from the scsi drivers
+ * (0 = deserialized, 1 = serialized, default = 0)
+ * max_sectors, - Change max sectors per I/O supported (default = 255)
+ * exclusive_login - Set to zero if you'd like to allow multiple hosts the ability
+ * to log in at the same time. Sbp2 device must support this,
+ * and you must know what you're doing (default = 1)
*
- * (e.g. insmod sbp2 sbp2_serialize_io = 1)
+ * (e.g. insmod sbp2 sbp2.serialize_io = 1)
*
*
* Current Support:
@@ -236,7 +236,7 @@
* * New packet dump debug define (CONFIG_IEEE1394_SBP2_PACKET_DUMP) which allows
* dumping of all sbp2 related packets sent and received. Especially effective
* when phys dma is disabled on ohci controller (e.g. insmod ohci1394 phys_dma=0).
- * * Added new sbp2 module load option (sbp2_exclusive_login) for allowing
+ * * Added new sbp2 module load option (exclusive_login) for allowing
* non-exclusive login to sbp2 device, for special multi-host applications.
* 04/23/02 - Fix for Sony CD-ROM drives. Only send fetch agent reset to sbp2 device if it
* returns the dead bit in status. Thanks to Chandan (ch...@to...) for this one.
@@ -263,6 +263,7 @@
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/sched.h>
@@ -304,7 +305,7 @@
*/
/*
- * Change sbp2_max_speed on module load if you have a bad IEEE-1394
+ * Change max_speed on module load if you have a bad IEEE-1394
* controller that has trouble running 2KB packets at 400mb.
*
* NOTE: On certain OHCI parts I have seen short packets on async transmit
@@ -312,34 +313,34 @@
* bump down the speed if you are running into problems.
*
* Valid values:
- * sbp2_max_speed = 2 (default: max speed 400mb)
- * sbp2_max_speed = 1 (max speed 200mb)
- * sbp2_max_speed = 0 (max speed 100mb)
+ * max_speed = 2 (default: max speed 400mb)
+ * max_speed = 1 (max speed 200mb)
+ * max_speed = 0 (max speed 100mb)
*/
-MODULE_PARM(sbp2_max_speed,"i");
-MODULE_PARM_DESC(sbp2_max_speed, "Force max speed (2 = 400mb default, 1 = 200mb, 0 = 100mb)");
-static int sbp2_max_speed = SPEED_400;
+static int max_speed = SPEED_400;
+module_param(max_speed, int, 0644);
+MODULE_PARM_DESC(max_speed, "Force max speed (2 = 400mb default, 1 = 200mb, 0 = 100mb)");
/*
- * Set sbp2_serialize_io to 1 if you'd like only one scsi command sent
+ * Set serialize_io to 1 if you'd like only one scsi command sent
* down to us at a time (debugging). This might be necessary for very
* badly behaved sbp2 devices.
*/
-MODULE_PARM(sbp2_serialize_io,"i");
-MODULE_PARM_DESC(sbp2_serialize_io, "Serialize all I/O coming down from the scsi drivers (default = 0)");
-static int sbp2_serialize_io = 0; /* serialize I/O - available for debugging purposes */
+static int serialize_io = 0;
+module_param(serialize_io, int, 0444);
+MODULE_PARM_DESC(serialize_io, "Serialize all I/O coming down from the scsi drivers (default = 0)");
/*
- * Bump up sbp2_max_sectors if you'd like to support very large sized
+ * Bump up max_sectors if you'd like to support very large sized
* transfers. Please note that some older sbp2 bridge chips are broken for
* transfers greater or equal to 128KB. Default is a value of 255
* sectors, or just under 128KB (at 512 byte sector size). I can note that
* the Oxsemi sbp2 chipsets have no problems supporting very large
* transfer sizes.
*/
-MODULE_PARM(sbp2_max_sectors,"i");
-MODULE_PARM_DESC(sbp2_max_sectors, "Change max sectors per I/O supported (default = 255)");
-static int sbp2_max_sectors = SBP2_MAX_SECTORS;
+static int max_sectors = SBP2_MAX_SECTORS;
+module_param(max_sectors, int, 0444);
+MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported (default = 255)");
/*
* Exclusive login to sbp2 device? In most cases, the sbp2 driver should
@@ -348,13 +349,13 @@
* etc.). If you're running an sbp2 device that supports multiple logins,
* and you're either running read-only filesystems or some sort of special
* filesystem supporting multiple hosts (one such filesystem is OpenGFS,
- * see opengfs.sourceforge.net for more info), then set sbp2_exclusive_login
+ * see opengfs.sourceforge.net for more info), then set exclusive_login
* to zero. Note: The Oxsemi OXFW911 sbp2 chipset supports up to four
* concurrent logins.
*/
-MODULE_PARM(sbp2_exclusive_login,"i");
-MODULE_PARM_DESC(sbp2_exclusive_login, "Exclusive login to sbp2 device (default = 1)");
-static int sbp2_exclusive_login = 1;
+static int exclusive_login = 1;
+module_param(exclusive_login, int, 0644);
+MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)");
/*
* SCSI inquiry hack for really badly behaved sbp2 devices. Turn this on
@@ -362,13 +363,13 @@
* This hack makes the inquiry look more like a typical MS Windows
* inquiry.
*
- * If sbp2_force_inquiry_hack=1 is required for your device to work,
+ * If force_inquiry_hack=1 is required for your device to work,
* please submit the logged sbp2_firmware_revision value of this device to
* the linux1394-devel mailing list.
*/
-MODULE_PARM(sbp2_force_inquiry_hack,"i");
-MODULE_PARM_DESC(sbp2_force_inquiry_hack, "Force SCSI inquiry hack (default = 0)");
-static int sbp2_force_inquiry_hack = 0;
+static int force_inquiry_hack = 0;
+module_param(force_inquiry_hack, int, 0444);
+MODULE_PARM_DESC(force_inquiry_hack, "Force SCSI inquiry hack (default = 0)");
/*
@@ -635,7 +636,7 @@
unsigned long flags, orbs;
struct sbp2_command_info *command;
- orbs = sbp2_serialize_io ? 2 : SBP2_MAX_COMMAND_ORBS;
+ orbs = serialize_io ? 2 : SBP2_MAX_COMMAND_ORBS;
spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
for (i = 0; i < orbs; i++) {
@@ -1325,7 +1326,7 @@
scsi_id->login_orb->lun_misc = ORB_SET_FUNCTION(LOGIN_REQUEST);
scsi_id->login_orb->lun_misc |= ORB_SET_RECONNECT(0); /* One second reconnect time */
- scsi_id->login_orb->lun_misc |= ORB_SET_EXCLUSIVE(sbp2_exclusive_login); /* Exclusive access to device */
+ scsi_id->login_orb->lun_misc |= ORB_SET_EXCLUSIVE(exclusive_login); /* Exclusive access to device */
scsi_id->login_orb->lun_misc |= ORB_SET_NOTIFY(1); /* Notify us of login complete */
/* Set the lun if we were able to pull it from the device's unit directory */
if (scsi_id->sbp2_device_type_and_lun != SBP2_DEVICE_TYPE_LUN_UNINITIALIZED) {
@@ -1673,7 +1674,7 @@
/* Firmware revision */
scsi_id->sbp2_firmware_revision
= CONFIG_ROM_VALUE(ud->quadlets[i]);
- if (sbp2_force_inquiry_hack)
+ if (force_inquiry_hack)
SBP2_INFO("sbp2_firmware_revision = %x",
(unsigned int) scsi_id->sbp2_firmware_revision);
else SBP2_DEBUG("sbp2_firmware_revision = %x",
@@ -1691,20 +1692,20 @@
/* If the vendor id is 0xa0b8 (Symbios vendor id), then we have a
* bridge with 128KB max transfer size limitation. For sanity, we
- * only voice this when the current sbp2_max_sectors setting
+ * only voice this when the current max_sectors setting
* exceeds the 128k limit. By default, that is not the case.
*
* It would be really nice if we could detect this before the scsi
* host gets initialized. That way we can down-force the
- * sbp2_max_sectors to account for it. That is not currently
+ * max_sectors to account for it. That is not currently
* possible. */
if ((scsi_id->sbp2_firmware_revision & 0xffff00) ==
SBP2_128KB_BROKEN_FIRMWARE &&
- (sbp2_max_sectors * 512) > (128*1024)) {
+ (max_sectors * 512) > (128*1024)) {
SBP2_WARN("Node " NODE_BUS_FMT ": Bridge only supports 128KB max transfer size.",
NODE_BUS_ARGS(scsi_id->ne->nodeid));
- SBP2_WARN("WARNING: Current sbp2_max_sectors setting is larger than 128KB (%d sectors)!",
- sbp2_max_sectors);
+ SBP2_WARN("WARNING: Current max_sectors setting is larger than 128KB (%d sectors)!",
+ max_sectors);
scsi_id->workarounds |= SBP2_BREAKAGE_128K_MAX_TRANSFER;
}
@@ -1742,8 +1743,8 @@
+ NODEID_TO_NODE(scsi_id->ne->nodeid)];
/* Bump down our speed if the user requested it */
- if (scsi_id->speed_code > sbp2_max_speed) {
- scsi_id->speed_code = sbp2_max_speed;
+ if (scsi_id->speed_code > max_speed) {
+ scsi_id->speed_code = max_speed;
SBP2_ERR("Forcing SBP-2 max speed down to %s",
hpsb_speedto_str[scsi_id->speed_code]);
}
@@ -2193,7 +2194,7 @@
* reject this inquiry command. Fix the request_bufflen.
*/
if (*cmd == INQUIRY) {
- if (sbp2_force_inquiry_hack || scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK)
+ if (force_inquiry_hack || scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK)
request_bufflen = cmd[4] = 0x24;
else
request_bufflen = cmd[4];
@@ -2935,10 +2936,10 @@
SPRINTF("Driver version : %s\n", version);
SPRINTF("\nModule options :\n");
- SPRINTF(" sbp2_max_speed : %s\n", hpsb_speedto_str[sbp2_max_speed]);
- SPRINTF(" sbp2_max_sectors : %d\n", sbp2_max_sectors);
- SPRINTF(" sbp2_serialize_io : %s\n", sbp2_serialize_io ? "yes" : "no");
- SPRINTF(" sbp2_exclusive_login : %s\n", sbp2_exclusive_login ? "yes" : "no");
+ SPRINTF(" max_speed : %s\n", hpsb_speedto_str[max_speed]);
+ SPRINTF(" max_sectors : %d\n", max_sectors);
+ SPRINTF(" serialize_io : %s\n", serialize_io ? "yes" : "no");
+ SPRINTF(" exclusive_login : %s\n", exclusive_login ? "yes" : "no");
SPRINTF("\nAttached devices : %s\n", !list_empty(&host->my_devices) ?
"" : "none");
@@ -3009,7 +3010,7 @@
/* Module load debug option to force one command at a time
* (serializing I/O) */
- if (sbp2_serialize_io) {
+ if (serialize_io) {
SBP2_ERR("Driver forced to serialize I/O (serialize_io = 1)");
scsi_driver_template.can_queue = 1;
scsi_driver_template.cmd_per_lun = 1;
@@ -3018,7 +3019,7 @@
/*
* Set max sectors (module load option). Default is 255 sectors.
*/
- scsi_driver_template.max_sectors = sbp2_max_sectors;
+ scsi_driver_template.max_sectors = max_sectors;
/*
Modified: trunk/pcilynx.c
==============================================================================
--- trunk/pcilynx.c (original)
+++ trunk/pcilynx.c 2003-03-19 14:19:35.000000000 -0500
@@ -37,6 +37,7 @@
#include <linux/wait.h>
#include <linux/errno.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/fs.h>
@@ -71,8 +72,8 @@
/* Module Parameters */
-MODULE_PARM(skip_eeprom,"i");
-MODULE_PARM_DESC(skip_eeprom, "Do not try to read bus info block from serial eeprom, but user generic one (default = 0).");
+module_param(skip_eeprom, int, 0444);
+MODULE_PARM_DESC(skip_eeprom, "Use generic bus info block instead of serial eeprom (default = 0).");
static int skip_eeprom = 0;
@@ -981,8 +982,9 @@
* on performance - the value 2400 was found by experiment and may not work
* everywhere as good as here - use mem_mindma option for modules to change
*/
-short mem_mindma = 2400;
-MODULE_PARM(mem_mindma, "h");
+static short mem_mindma = 2400;
+module_param(mem_mindma, short, 0444);
+MODULE_PARM_DESC(mem_mindma, "Minimum amount of data required to use DMA");
static ssize_t mem_dmaread(struct memdata *md, u32 physbuf, ssize_t count,
int offset)
Modified: trunk/csr.c
==============================================================================
--- trunk/csr.c (original)
+++ trunk/csr.c 2003-03-19 14:19:35.000000000 -0500
@@ -18,7 +18,8 @@
*/
#include <linux/string.h>
-#include <linux/module.h> /* needed for MODULE_PARM */
+#include <linux/module.h>
+#include <linux/moduleparam.h>
#include "ieee1394_types.h"
#include "hosts.h"
@@ -27,9 +28,10 @@
/* Module Parameters */
/* this module parameter can be used to disable mapping of the FCP registers */
-MODULE_PARM(fcp,"i");
-MODULE_PARM_DESC(fcp, "Map FCP registers (default = 1, disable = 0).");
+
static int fcp = 1;
+module_param(fcp, int, 0444);
+MODULE_PARM_DESC(fcp, "Map FCP registers (default = 1, disable = 0).");
static u16 csr_crc16(unsigned *data, int length)
{
|
|
From: SVN U. <ben...@li...> - 2003-03-15 15:02:35
|
Author: bencollins Date: 2003-03-15 10:01:43 -0500 (Sat, 15 Mar 2003) New Revision: 845 Modified: branches/linux-2.4/nodemgr.c Log: Fix another typo. I'm on a roll. Noticed by Olaf Hering. Modified: branches/linux-2.4/nodemgr.c ============================================================================== --- branches/linux-2.4/nodemgr.c (original) +++ branches/linux-2.4/nodemgr.c 2003-03-15 10:01:44.000000000 -0500 @@ -1149,8 +1149,8 @@ * were still on the bus. The bus reset increased hi->reset_sem, * so there's a bus scan pending which will do the clean up * eventually. */ - if (generation == get_hpsb_generation(hi->host)) - nodemgr_node_probe_cleanup(hi->host, generation); + if (generation == get_hpsb_generation(host)) + nodemgr_node_probe_cleanup(host, generation); return; } |
|
From: SVN U. <ben...@li...> - 2003-03-15 07:00:45
|
Author: bencollins
Date: 2003-03-15 02:00:04 -0500 (Sat, 15 Mar 2003)
New Revision: 844
Modified:
branches/linux-2.4/nodemgr.c
Log:
Oops, typo
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-03-15 02:00:05.000000000 -0500
@@ -1128,7 +1128,7 @@
{
int count;
struct selfid *sid = (struct selfid *)host->topology_map;
- nodeid_t nodeid = host->nodeid & BUS_MASK;
+ nodeid_t nodeid = LOCAL_BUS;
/* Scan each node on the bus */
for (count = host->selfid_count; count; count--, sid++) {
|
|
From: SVN U. <ben...@li...> - 2003-03-15 06:49:33
|
Author: bencollins
Date: 2003-03-15 01:48:52 -0500 (Sat, 15 Mar 2003)
New Revision: 843
Modified:
branches/linux-2.4/nodemgr.c
Log:
Backport supposed race fix.
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-03-15 01:48:53.000000000 -0500
@@ -1128,7 +1128,7 @@
{
int count;
struct selfid *sid = (struct selfid *)host->topology_map;
- nodeid_t nodeid = LOCAL_BUS;
+ nodeid_t nodeid = host->nodeid & BUS_MASK;
/* Scan each node on the bus */
for (count = host->selfid_count; count; count--, sid++) {
@@ -1143,6 +1143,15 @@
nodemgr_node_probe_one(host, nodeid++, generation);
}
+ /* If we had a bus reset while we were scanning the bus, it is
+ * possible that we did not probe all nodes. In that case, we
+ * skip the clean up for now, since we could remove nodes that
+ * were still on the bus. The bus reset increased hi->reset_sem,
+ * so there's a bus scan pending which will do the clean up
+ * eventually. */
+ if (generation == get_hpsb_generation(hi->host))
+ nodemgr_node_probe_cleanup(hi->host, generation);
+
return;
}
@@ -1234,16 +1243,6 @@
}
nodemgr_node_probe(hi->host, generation);
-
- /* If we had a bus reset while we were scanning the bus, it is
- * possible that we did not probe all nodes. In that case, we
- * skip the clean up for now, since we could remove nodes that
- * were still on the bus. The bus reset increased
- * hi->reset_sem, so there's a bus scan pending which will do
- * the clean up eventually. */
- if (generation == get_hpsb_generation(hi->host))
- nodemgr_node_probe_cleanup(hi->host, generation);
-
nodemgr_do_irm_duties(hi->host);
up(&nodemgr_serialize);
@@ -1350,6 +1349,8 @@
init_completion(&hi->exited);
sema_init(&hi->reset_sem, 0);
+ spin_lock_irqsave (&host_info_lock, flags);
+
hi->pid = kernel_thread(nodemgr_host_thread, hi,
CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
@@ -1357,11 +1358,12 @@
HPSB_ERR ("NodeMgr: failed to start NodeMgr thread for %s",
host->driver->name);
kfree(hi);
+ spin_unlock_irqrestore (&host_info_lock, flags);
return;
}
- spin_lock_irqsave (&host_info_lock, flags);
list_add_tail (&hi->list, &host_info_list);
+
spin_unlock_irqrestore (&host_info_lock, flags);
return;
@@ -1411,7 +1413,6 @@
break;
}
}
- spin_unlock_irqrestore (&host_info_lock, flags);
if (hi) {
if (hi->pid >= 0) {
@@ -1424,6 +1425,8 @@
HPSB_ERR("NodeMgr: host %s does not exist, cannot remove",
host->driver->name);
+ spin_unlock_irqrestore (&host_info_lock, flags);
+
down(&nodemgr_serialize);
/* Even if we fail the host_info part, remove all the node
|
|
From: SVN U. <ben...@li...> - 2003-03-15 06:41:05
|
Author: bencollins
Date: 2003-03-15 01:40:15 -0500 (Sat, 15 Mar 2003)
New Revision: 842
Modified:
trunk/nodemgr.c
Log:
Fix a thinko I introduced causing an oops on >1 host.
Also, add some more locks on host_list to get rid of a race. I can't cause
on oops when plugging/unplugging lots of times now (the last patch for the
1/4 second delay fix also helps).
Modified: trunk/nodemgr.c
==============================================================================
--- trunk/nodemgr.c (original)
+++ trunk/nodemgr.c 2003-03-15 01:40:16.000000000 -0500
@@ -33,7 +33,7 @@
#if 1
#define FW_BUS_ID_FMT "%012Lx"
-#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)__ne->guid & 0xffffffffffff
+#define FW_BUS_ID_ARGS(__hi, __ne) (unsigned long long)(__ne->guid & 0xffffffffffffL)
#else
#define FW_BUS_ID_FMT "%d-" NODE_BUS_FMT
#define FW_BUS_ID_ARGS(__hi, __ne) __hi->id, NODE_BUS_ARGS(__ne->nodeid)
@@ -319,6 +319,8 @@
}
+static struct node_entry *find_entry_by_nodeid(struct hpsb_host *host, nodeid_t nodeid);
+
static void nodemgr_update_host_dev_links(struct hpsb_host *host)
{
struct device *dev = &host->device;
@@ -328,11 +330,11 @@
sysfs_remove_link(&dev->kobj, "busmgr_id");
sysfs_remove_link(&dev->kobj, "host_id");
- if ((ne = hpsb_nodeid_get_entry(host, host->irm_id)))
+ if ((ne = find_entry_by_nodeid(host, host->irm_id)))
sysfs_create_link(&dev->kobj, &ne->device.kobj, "irm_id");
- if ((ne = hpsb_nodeid_get_entry(host, host->busmgr_id)))
+ if ((ne = find_entry_by_nodeid(host, host->busmgr_id)))
sysfs_create_link(&dev->kobj, &ne->device.kobj, "busmgr_id");
- if ((ne = hpsb_nodeid_get_entry(host, host->node_id)))
+ if ((ne = find_entry_by_nodeid(host, host->node_id)))
sysfs_create_link(&dev->kobj, &ne->device.kobj, "host_id");
}
@@ -1166,36 +1168,34 @@
#endif /* CONFIG_HOTPLUG */
-static struct host_info *nodemgr_find_host_by_num(int hostnum)
+static int nodemgr_alloc_host_num(void)
{
+ int hostnum = 0;
unsigned long flags;
struct list_head *lh;
- struct host_info *hi = NULL;
spin_lock_irqsave (&host_info_lock, flags);
- list_for_each(lh, &host_info_list) {
- struct host_info *myhi = list_entry(lh, struct host_info, list);
- if (hi->id == hostnum) {
- hi = myhi;
- break;
- }
- }
- spin_unlock_irqrestore (&host_info_lock, flags);
-
- return hi;
-}
+ while (1) {
+ int found = 0;
-static int nodemgr_alloc_host_num(void)
-{
- int hostnum = 0;
+ list_for_each(lh, &host_info_list) {
+ struct host_info *hi = list_entry(lh, struct host_info, list);
+ if (hi->id == hostnum) {
+ found = 1;
+ break;
+ }
+ }
- while (1) {
- if (!nodemgr_find_host_by_num(hostnum))
- return hostnum;
+ if (!found)
+ break;
hostnum++;
}
+
+ spin_unlock_irqrestore (&host_info_lock, flags);
+
+ return hostnum;
}
@@ -1606,11 +1606,13 @@
nodemgr_node_probe(hi, generation);
nodemgr_do_irm_duties(host);
- up(&nodemgr_serialize);
-
/* Update some of our sysfs symlinks */
nodemgr_update_host_dev_links(host);
+
+ up(&nodemgr_serialize);
}
+
+caught_signal:
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
HPSB_DEBUG ("NodeMgr: Exiting thread for %s", hi->host->driver->name);
#endif
@@ -1720,6 +1722,7 @@
/* Initialize the hostinfo here and start the thread. The
* thread blocks on the reset semaphore until a bus reset
* happens. */
+ memset(hi, 0, sizeof(*hi));
hi->host = host;
INIT_LIST_HEAD(&hi->list);
init_completion(&hi->exited);
@@ -1735,6 +1738,8 @@
sprintf(hi->daemon_name, "knodemgrd_%d", hi->id);
+ spin_lock_irqsave (&host_info_lock, flags);
+
hi->pid = kernel_thread(nodemgr_host_thread, hi,
CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
@@ -1742,11 +1747,12 @@
HPSB_ERR ("NodeMgr: failed to start %s thread for %s",
hi->daemon_name, host->driver->name);
kfree(hi);
+ spin_unlock_irqrestore (&host_info_lock, flags);
return;
}
- spin_lock_irqsave (&host_info_lock, flags);
list_add_tail (&hi->list, &host_info_list);
+
spin_unlock_irqrestore (&host_info_lock, flags);
return;
@@ -1795,7 +1801,6 @@
break;
}
}
- spin_unlock_irqrestore (&host_info_lock, flags);
if (hi) {
if (hi->pid >= 0) {
@@ -1809,6 +1814,8 @@
HPSB_ERR("NodeMgr: host %s does not exist, cannot remove",
host->driver->name);
+ spin_unlock_irqrestore (&host_info_lock, flags);
+
return;
}
|
|
From: SVN U. <ben...@li...> - 2003-03-15 02:50:32
|
Author: bencollins Date: 2003-03-14 21:49:43 -0500 (Fri, 14 Mar 2003) New Revision: 841 Removed: tags/linux-2.4-sync/ tags/linux-2.5-sync/ Log: No longer in sync. It's really too hard to know when Linus or Marcelo are going to accept my patch. |
|
From: SVN U. <ben...@li...> - 2003-03-14 21:57:22
|
Author: bencollins
Date: 2003-03-14 16:56:41 -0500 (Fri, 14 Mar 2003)
New Revision: 840
Modified:
trunk/nodemgr.c
Log:
Handle back-to-back resets better, and fix what appears to be a race in
the generation check. Also handle forced IRM reset better.
Patch from Jim Radford.
Modified: trunk/nodemgr.c
==============================================================================
--- trunk/nodemgr.c (original)
+++ trunk/nodemgr.c 2003-03-14 16:56:43.000000000 -0500
@@ -1455,27 +1455,12 @@
}
-static void nodemgr_node_probe(struct host_info *hi)
+static void nodemgr_node_probe(struct host_info *hi, int generation)
{
int count;
struct hpsb_host *host = hi->host;
struct selfid *sid = (struct selfid *)host->topology_map;
nodeid_t nodeid = LOCAL_BUS;
- unsigned int generation;
-
- /* Pause for 1/4 second, to make sure things settle down. If
- * schedule_timeout returns non-zero, it means we caught a signal
- * and need to return. */
- set_current_state(TASK_INTERRUPTIBLE);
- if (schedule_timeout (HZ/4))
- return;
-
- /* Now get the generation in which the node ID's we collect
- * are valid. During the bus scan we will use this generation
- * for the read transactions, so that if another reset occurs
- * during the scan the transactions will fail instead of
- * returning bogus data. */
- generation = get_hpsb_generation(host);
/* Scan each node on the bus */
for (count = host->selfid_count; count; count--, sid++) {
@@ -1588,6 +1573,29 @@
* happens when we get a bus reset. */
while (!down_interruptible(&hi->reset_sem) &&
!down_interruptible(&nodemgr_serialize)) {
+ unsigned int generation;
+
+ /* Many resets can happen while we are waiting below.
+ * Make sure we respond only to the most recent one. */
+ do {
+ /* Pause for 1/4 second, to make sure things
+ * settle down. If schedule_timeout returns
+ * non-zero, it means we caught a signal and that
+ * we should exit. */
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (schedule_timeout (HZ/4)) {
+ up(&nodemgr_serialize);
+ goto caught_signal;
+ }
+
+ /* Now get the generation in which the node ID's
+ * we collect are valid. During the bus scan we
+ * will use this generation for the read
+ * transactions, so that if another reset occurs
+ * during the scan the transactions will fail
+ * instead of returning bogus data. */
+ generation = get_hpsb_generation(hi->host);
+ } while (!down_trylock(&hi->reset_sem));
if (!nodemgr_check_root_capability(host)) {
/* Do nothing, we are resetting */
@@ -1595,7 +1603,7 @@
continue;
}
- nodemgr_node_probe(hi);
+ nodemgr_node_probe(hi, generation);
nodemgr_do_irm_duties(host);
up(&nodemgr_serialize);
|
|
From: SVN U. <ben...@li...> - 2003-03-14 21:50:00
|
Author: bencollins
Date: 2003-03-14 16:49:00 -0500 (Fri, 14 Mar 2003)
New Revision: 839
Modified:
branches/linux-2.4/nodemgr.c
Log:
Handle back-to-back resets better, and fix what appears to be a race in
the generation check. Also handle forced IRM reset better.
Patch from Jim Radford.
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-03-14 16:49:01.000000000 -0500
@@ -1124,26 +1124,11 @@
return;
}
-static void nodemgr_node_probe(struct hpsb_host *host)
+static void nodemgr_node_probe(struct hpsb_host *host, int generation)
{
int count;
struct selfid *sid = (struct selfid *)host->topology_map;
nodeid_t nodeid = LOCAL_BUS;
- unsigned int generation;
-
- /* Pause for 1/4 second, to make sure things settle down. If
- * schedule_timeout returns non-zero, it means we caught a signal
- * and need to return. */
- set_current_state(TASK_INTERRUPTIBLE);
- if (schedule_timeout (HZ/4))
- return;
-
- /* Now get the generation in which the node ID's we collect
- * are valid. During the bus scan we will use this generation
- * for the read transactions, so that if another reset occurs
- * during the scan the transactions will fail instead of
- * returning bogus data. */
- generation = get_hpsb_generation(host);
/* Scan each node on the bus */
for (count = host->selfid_count; count; count--, sid++) {
@@ -1158,15 +1143,6 @@
nodemgr_node_probe_one(host, nodeid++, generation);
}
- /* If we had a bus reset while we were scanning the bus, it is
- * possible that we did not probe all nodes. In that case, we
- * skip the clean up for now, since we could remove nodes that
- * were still on the bus. The bus reset increased
- * hi->reset_sem, so there's a bus scan pending which will do
- * the clean up eventually. */
- if (generation == get_hpsb_generation(host))
- nodemgr_node_probe_cleanup(host, generation);
-
return;
}
@@ -1229,6 +1205,27 @@
* happens when we get a bus reset. */
while (!down_interruptible(&hi->reset_sem) &&
!down_interruptible(&nodemgr_serialize)) {
+ unsigned int generation;
+
+ /* Many resets can happen while we are waiting below.
+ * Make sure we respond only to the most recent one. */
+ do {
+ /* Pause for 1/4 second, to make sure things settle down. If
+ * schedule_timeout returns non-zero, it means we caught a signal
+ * and that we should exit. */
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (schedule_timeout (HZ/4)) {
+ up(&nodemgr_serialize);
+ goto caught_signal;
+ }
+
+ /* Now get the generation in which the node ID's we collect
+ * are valid. During the bus scan we will use this generation
+ * for the read transactions, so that if another reset occurs
+ * during the scan the transactions will fail instead of
+ * returning bogus data. */
+ generation = get_hpsb_generation(hi->host);
+ } while(!down_trylock(&hi->reset_sem));
if (!nodemgr_check_root_capability(hi->host)) {
/* Do nothing, we are resetting */
@@ -1236,11 +1233,23 @@
continue;
}
- nodemgr_node_probe(hi->host);
+ nodemgr_node_probe(hi->host, generation);
+
+ /* If we had a bus reset while we were scanning the bus, it is
+ * possible that we did not probe all nodes. In that case, we
+ * skip the clean up for now, since we could remove nodes that
+ * were still on the bus. The bus reset increased
+ * hi->reset_sem, so there's a bus scan pending which will do
+ * the clean up eventually. */
+ if (generation == get_hpsb_generation(hi->host))
+ nodemgr_node_probe_cleanup(hi->host, generation);
+
nodemgr_do_irm_duties(hi->host);
up(&nodemgr_serialize);
}
+
+ caught_signal:
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
HPSB_DEBUG ("NodeMgr: Exiting thread for %s", hi->host->driver->name);
#endif
|
|
From: SVN U. <dm...@li...> - 2003-03-14 06:41:05
|
Author: dmaas
Date: 2003-03-14 01:40:24 -0500 (Fri, 14 Mar 2003)
New Revision: 838
Modified:
trunk/ohci1394.c
Log:
ohci1394 rawiso:
fix calculation of block_irq_interval
Thanks to Alberto Perez and Steve Kinneberg.
Modified: trunk/ohci1394.c
==============================================================================
--- trunk/ohci1394.c (original)
+++ trunk/ohci1394.c 2003-03-14 01:40:25.000000000 -0500
@@ -1190,10 +1190,11 @@
/* iso->irq_interval is in packets - translate that to blocks */
/* (err, sort of... 1 is always the safest value) */
recv->block_irq_interval = iso->irq_interval / recv->nblocks;
+ if(recv->block_irq_interval*4 > recv->nblocks)
+ recv->block_irq_interval = recv->nblocks/4;
if(recv->block_irq_interval < 1)
recv->block_irq_interval = 1;
- else if(recv->block_irq_interval*4 > recv->nblocks)
- recv->block_irq_interval = recv->nblocks/4;
+
} else {
int max_packet_size;
|
|
From: SVN U. <dm...@li...> - 2003-03-14 06:39:44
|
Author: dmaas
Date: 2003-03-14 01:38:45 -0500 (Fri, 14 Mar 2003)
New Revision: 837
Modified:
branches/linux-2.4/ohci1394.c
Log:
ohci1394 rawiso:
fix calculation of block_irq_interval
Thanks to Alberto Perez and Steve Kinneberg.
Modified: branches/linux-2.4/ohci1394.c
==============================================================================
--- branches/linux-2.4/ohci1394.c (original)
+++ branches/linux-2.4/ohci1394.c 2003-03-14 01:38:46.000000000 -0500
@@ -1207,10 +1207,11 @@
/* iso->irq_interval is in packets - translate that to blocks */
/* (err, sort of... 1 is always the safest value) */
recv->block_irq_interval = iso->irq_interval / recv->nblocks;
+ if(recv->block_irq_interval*4 > recv->nblocks)
+ recv->block_irq_interval = recv->nblocks/4;
if(recv->block_irq_interval < 1)
recv->block_irq_interval = 1;
- else if(recv->block_irq_interval*4 > recv->nblocks)
- recv->block_irq_interval = recv->nblocks/4;
+
} else {
int max_packet_size;
|