Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: [PATCH] Lock adapter modules when devices areopen



The patch attached adds a couple of debug lines to say:
- What module has been registered for locking
- Each time the module gets locked and unlocked.

This works fine for me on linux-2.6.0-test5. I'm fairly sure it worked a couple of days ago when I tested it on 2.4 as well.

Here is a log from me running tzap on a budget card:

ttpci_eeprom: module license 'unspecified' taints kernel.
saa7146: register extension 'budget_ci dvb'.
saa7146: found saa7146 @ mem df8f7000 (revision 1, irq 18) (0x13c2,0x1011).
DVB: registering new adapter (budget_ci: TT-Budget/WinTV-NOVA-T PCI).
TT-Budget/WinTV-NOVA-T PCI adapter 0 has MAC addr = 00:d0:5c:22:22:b4
tda1004x: Detected Philips TDA10045H.
tda1004x: Detected Philips TDM1316L tuner.
DVB: registering frontend 0:0 (Philips TDA10045H)...
[[ TZAP started here ]]
DVB: Device opened, locking module budget_ci
DVB: Device opened, locking module budget_ci
DVB: Device opened, locking module budget_ci
[[ TZAP stopped here ]]
DVB: Device closed, unlocking module budget_ci
DVB: Device closed, unlocking module budget_ci
DVB: Device closed, unlocking module budget_ci


Module list after load:
Module Size Used by
tda1004x 13060 1
budget_ci 5376 0
budget_core 5760 1 budget_ci
dvb_core 65664 2 tda1004x,budget_core
saa7146 15432 2 budget_ci,budget_core
ttpci_eeprom 2432 1 budget_core

When tzap is running the budget_ci module is locked against removal:
Module Size Used by
tda1004x 13060 1
budget_ci 5376 3
budget_core 5760 1 budget_ci
dvb_core 65920 8 tda1004x,budget_core
saa7146 15432 2 budget_ci,budget_core
ttpci_eeprom 2432 1 budget_core


--- linux-2.6.0-test5-dxr3/drivers/media/dvb/dvb-core/dvbdev.c~	2003-09-17 23:33:56.000000000 +0100
+++ linux-2.6.0-test5-dxr3/drivers/media/dvb/dvb-core/dvbdev.c	2003-09-20 15:50:09.960583408 +0100
@@ -91,6 +91,9 @@
 	        fops_put(file->f_op);
 	        file->f_op = fops_get(old_fops);
 	        module_put(dvbdev->adapter->module);
+	} else {
+	        printk("DVB: Device opened, locking module %s\n", 
+		       module_name(dvbdev->adapter->module));
 	}
 	fops_put(old_fops);
 	return err;
@@ -102,6 +105,8 @@
 void dvb_device_release(struct dvb_device *dvbdev)
 {
         if (dvbdev && dvbdev->adapter) {
+	        printk("DVB: Device closed, unlocking module %s\n", 
+		       module_name(dvbdev->adapter->module));
 	        module_put(dvbdev->adapter->module);        
         }
 }
@@ -285,7 +290,7 @@
 	memset (adap, 0, sizeof(struct dvb_adapter));
 	INIT_LIST_HEAD (&adap->device_list);
 
-	printk ("DVB: registering new adapter (%s).\n", name);
+	printk ("DVB: registering new adapter (%s: %s).\n", module_name(module), name);
 	
 	devfs_mk_dir("dvb/adapter%d", num);
 	adap->num = num;

Home | Main Index | Thread Index