Revision d3ac0778801708caecb2b172328064255a350432 authored by Arjan Mels on 20 May 2011, 21:25:46 UTC, committed by Greg Kroah-Hartman on 07 June 2011, 19:28:41 UTC
Implemented pre_reset and post_reset methods of the driver to prevent the driver from being unbound upon a device reset. Because of this also the asynchronous reset introduced to prevent a race condition is no longer necessary (and sometimes causes problems, because it comes later then expected). Signed-off-by: Arjan Mels <arjan.mels@gmx.net> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net> Cc: Max Vozeler <max@vozeler.com> Cc: usbip-devel <usbip-devel@lists.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent c11c4ee
cpu-notifier-error-inject.c
#include <linux/kernel.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/notifier.h>
static int priority;
static int cpu_up_prepare_error;
static int cpu_down_prepare_error;
module_param(priority, int, 0);
MODULE_PARM_DESC(priority, "specify cpu notifier priority");
module_param(cpu_up_prepare_error, int, 0644);
MODULE_PARM_DESC(cpu_up_prepare_error,
"specify error code to inject CPU_UP_PREPARE action");
module_param(cpu_down_prepare_error, int, 0644);
MODULE_PARM_DESC(cpu_down_prepare_error,
"specify error code to inject CPU_DOWN_PREPARE action");
static int err_inject_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
int err = 0;
switch (action) {
case CPU_UP_PREPARE:
case CPU_UP_PREPARE_FROZEN:
err = cpu_up_prepare_error;
break;
case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
err = cpu_down_prepare_error;
break;
}
if (err)
printk(KERN_INFO "Injecting error (%d) at cpu notifier\n", err);
return notifier_from_errno(err);
}
static struct notifier_block err_inject_cpu_notifier = {
.notifier_call = err_inject_cpu_callback,
};
static int err_inject_init(void)
{
err_inject_cpu_notifier.priority = priority;
return register_hotcpu_notifier(&err_inject_cpu_notifier);
}
static void err_inject_exit(void)
{
unregister_hotcpu_notifier(&err_inject_cpu_notifier);
}
module_init(err_inject_init);
module_exit(err_inject_exit);
MODULE_DESCRIPTION("CPU notifier error injection module");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>");
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...