diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/hangcheck-timer.c | 2 | ||||
-rw-r--r-- | drivers/char/hw_random.c | 70 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 4 | ||||
-rw-r--r-- | drivers/char/watchdog/Kconfig | 2 |
5 files changed, 73 insertions, 7 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 84e68cdd451b..5ebd06b1b4ca 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -985,7 +985,7 @@ config HPET_MMAP | |||
985 | 985 | ||
986 | config HANGCHECK_TIMER | 986 | config HANGCHECK_TIMER |
987 | tristate "Hangcheck timer" | 987 | tristate "Hangcheck timer" |
988 | depends on X86 || IA64 || PPC64 || ARCH_S390 | 988 | depends on X86 || IA64 || PPC64 || S390 |
989 | help | 989 | help |
990 | The hangcheck-timer module detects when the system has gone | 990 | The hangcheck-timer module detects when the system has gone |
991 | out to lunch past a certain margin. It can reboot the system | 991 | out to lunch past a certain margin. It can reboot the system |
diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 66e53dd450ff..40a67c86420c 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c | |||
@@ -120,7 +120,7 @@ __setup("hcheck_dump_tasks", hangcheck_parse_dump_tasks); | |||
120 | #if defined(CONFIG_X86) | 120 | #if defined(CONFIG_X86) |
121 | # define HAVE_MONOTONIC | 121 | # define HAVE_MONOTONIC |
122 | # define TIMER_FREQ 1000000000ULL | 122 | # define TIMER_FREQ 1000000000ULL |
123 | #elif defined(CONFIG_ARCH_S390) | 123 | #elif defined(CONFIG_S390) |
124 | /* FA240000 is 1 Second in the IBM time universe (Page 4-38 Principles of Op for zSeries */ | 124 | /* FA240000 is 1 Second in the IBM time universe (Page 4-38 Principles of Op for zSeries */ |
125 | # define TIMER_FREQ 0xFA240000ULL | 125 | # define TIMER_FREQ 0xFA240000ULL |
126 | #elif defined(CONFIG_IA64) | 126 | #elif defined(CONFIG_IA64) |
diff --git a/drivers/char/hw_random.c b/drivers/char/hw_random.c index 6f673d2de0b1..49769f59ea1b 100644 --- a/drivers/char/hw_random.c +++ b/drivers/char/hw_random.c | |||
@@ -1,4 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | Added support for the AMD Geode LX RNG | ||
3 | (c) Copyright 2004-2005 Advanced Micro Devices, Inc. | ||
4 | |||
5 | derived from | ||
6 | |||
2 | Hardware driver for the Intel/AMD/VIA Random Number Generators (RNG) | 7 | Hardware driver for the Intel/AMD/VIA Random Number Generators (RNG) |
3 | (c) Copyright 2003 Red Hat Inc <jgarzik@redhat.com> | 8 | (c) Copyright 2003 Red Hat Inc <jgarzik@redhat.com> |
4 | 9 | ||
@@ -95,6 +100,11 @@ static unsigned int via_data_present (void); | |||
95 | static u32 via_data_read (void); | 100 | static u32 via_data_read (void); |
96 | #endif | 101 | #endif |
97 | 102 | ||
103 | static int __init geode_init(struct pci_dev *dev); | ||
104 | static void geode_cleanup(void); | ||
105 | static unsigned int geode_data_present (void); | ||
106 | static u32 geode_data_read (void); | ||
107 | |||
98 | struct rng_operations { | 108 | struct rng_operations { |
99 | int (*init) (struct pci_dev *dev); | 109 | int (*init) (struct pci_dev *dev); |
100 | void (*cleanup) (void); | 110 | void (*cleanup) (void); |
@@ -122,6 +132,7 @@ enum { | |||
122 | rng_hw_intel, | 132 | rng_hw_intel, |
123 | rng_hw_amd, | 133 | rng_hw_amd, |
124 | rng_hw_via, | 134 | rng_hw_via, |
135 | rng_hw_geode, | ||
125 | }; | 136 | }; |
126 | 137 | ||
127 | static struct rng_operations rng_vendor_ops[] = { | 138 | static struct rng_operations rng_vendor_ops[] = { |
@@ -139,6 +150,9 @@ static struct rng_operations rng_vendor_ops[] = { | |||
139 | /* rng_hw_via */ | 150 | /* rng_hw_via */ |
140 | { via_init, via_cleanup, via_data_present, via_data_read, 1 }, | 151 | { via_init, via_cleanup, via_data_present, via_data_read, 1 }, |
141 | #endif | 152 | #endif |
153 | |||
154 | /* rng_hw_geode */ | ||
155 | { geode_init, geode_cleanup, geode_data_present, geode_data_read, 4 } | ||
142 | }; | 156 | }; |
143 | 157 | ||
144 | /* | 158 | /* |
@@ -159,6 +173,9 @@ static struct pci_device_id rng_pci_tbl[] = { | |||
159 | { 0x8086, 0x244e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, rng_hw_intel }, | 173 | { 0x8086, 0x244e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, rng_hw_intel }, |
160 | { 0x8086, 0x245e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, rng_hw_intel }, | 174 | { 0x8086, 0x245e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, rng_hw_intel }, |
161 | 175 | ||
176 | { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LX_AES, | ||
177 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, rng_hw_geode }, | ||
178 | |||
162 | { 0, }, /* terminate list */ | 179 | { 0, }, /* terminate list */ |
163 | }; | 180 | }; |
164 | MODULE_DEVICE_TABLE (pci, rng_pci_tbl); | 181 | MODULE_DEVICE_TABLE (pci, rng_pci_tbl); |
@@ -460,6 +477,57 @@ static void via_cleanup(void) | |||
460 | } | 477 | } |
461 | #endif | 478 | #endif |
462 | 479 | ||
480 | /*********************************************************************** | ||
481 | * | ||
482 | * AMD Geode RNG operations | ||
483 | * | ||
484 | */ | ||
485 | |||
486 | static void __iomem *geode_rng_base = NULL; | ||
487 | |||
488 | #define GEODE_RNG_DATA_REG 0x50 | ||
489 | #define GEODE_RNG_STATUS_REG 0x54 | ||
490 | |||
491 | static u32 geode_data_read(void) | ||
492 | { | ||
493 | u32 val; | ||
494 | |||
495 | assert(geode_rng_base != NULL); | ||
496 | val = readl(geode_rng_base + GEODE_RNG_DATA_REG); | ||
497 | return val; | ||
498 | } | ||
499 | |||
500 | static unsigned int geode_data_present(void) | ||
501 | { | ||
502 | u32 val; | ||
503 | |||
504 | assert(geode_rng_base != NULL); | ||
505 | val = readl(geode_rng_base + GEODE_RNG_STATUS_REG); | ||
506 | return val; | ||
507 | } | ||
508 | |||
509 | static void geode_cleanup(void) | ||
510 | { | ||
511 | iounmap(geode_rng_base); | ||
512 | geode_rng_base = NULL; | ||
513 | } | ||
514 | |||
515 | static int geode_init(struct pci_dev *dev) | ||
516 | { | ||
517 | unsigned long rng_base = pci_resource_start(dev, 0); | ||
518 | |||
519 | if (rng_base == 0) | ||
520 | return 1; | ||
521 | |||
522 | geode_rng_base = ioremap(rng_base, 0x58); | ||
523 | |||
524 | if (geode_rng_base == NULL) { | ||
525 | printk(KERN_ERR PFX "Cannot ioremap RNG memory\n"); | ||
526 | return -EBUSY; | ||
527 | } | ||
528 | |||
529 | return 0; | ||
530 | } | ||
463 | 531 | ||
464 | /*********************************************************************** | 532 | /*********************************************************************** |
465 | * | 533 | * |
@@ -574,7 +642,7 @@ static int __init rng_init (void) | |||
574 | 642 | ||
575 | DPRINTK ("ENTER\n"); | 643 | DPRINTK ("ENTER\n"); |
576 | 644 | ||
577 | /* Probe for Intel, AMD RNGs */ | 645 | /* Probe for Intel, AMD, Geode RNGs */ |
578 | for_each_pci_dev(pdev) { | 646 | for_each_pci_dev(pdev) { |
579 | ent = pci_match_id(rng_pci_tbl, pdev); | 647 | ent = pci_match_id(rng_pci_tbl, pdev); |
580 | if (ent) { | 648 | if (ent) { |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 1f56b4cf0f58..561430ed94af 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -787,7 +787,6 @@ int ipmi_destroy_user(ipmi_user_t user) | |||
787 | int i; | 787 | int i; |
788 | unsigned long flags; | 788 | unsigned long flags; |
789 | struct cmd_rcvr *rcvr; | 789 | struct cmd_rcvr *rcvr; |
790 | struct list_head *entry1, *entry2; | ||
791 | struct cmd_rcvr *rcvrs = NULL; | 790 | struct cmd_rcvr *rcvrs = NULL; |
792 | 791 | ||
793 | user->valid = 1; | 792 | user->valid = 1; |
@@ -812,8 +811,7 @@ int ipmi_destroy_user(ipmi_user_t user) | |||
812 | * synchronize_rcu()) then free everything in that list. | 811 | * synchronize_rcu()) then free everything in that list. |
813 | */ | 812 | */ |
814 | down(&intf->cmd_rcvrs_lock); | 813 | down(&intf->cmd_rcvrs_lock); |
815 | list_for_each_safe_rcu(entry1, entry2, &intf->cmd_rcvrs) { | 814 | list_for_each_entry_rcu(rcvr, &intf->cmd_rcvrs, link) { |
816 | rcvr = list_entry(entry1, struct cmd_rcvr, link); | ||
817 | if (rcvr->user == user) { | 815 | if (rcvr->user == user) { |
818 | list_del_rcu(&rcvr->link); | 816 | list_del_rcu(&rcvr->link); |
819 | rcvr->next = rcvrs; | 817 | rcvr->next = rcvrs; |
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig index 344001b45af9..a6544790af60 100644 --- a/drivers/char/watchdog/Kconfig +++ b/drivers/char/watchdog/Kconfig | |||
@@ -438,7 +438,7 @@ config INDYDOG | |||
438 | 438 | ||
439 | config ZVM_WATCHDOG | 439 | config ZVM_WATCHDOG |
440 | tristate "z/VM Watchdog Timer" | 440 | tristate "z/VM Watchdog Timer" |
441 | depends on WATCHDOG && ARCH_S390 | 441 | depends on WATCHDOG && S390 |
442 | help | 442 | help |
443 | IBM s/390 and zSeries machines running under z/VM 5.1 or later | 443 | IBM s/390 and zSeries machines running under z/VM 5.1 or later |
444 | provide a virtual watchdog timer to their guest that cause a | 444 | provide a virtual watchdog timer to their guest that cause a |