diff options
Diffstat (limited to 'drivers/char')
54 files changed, 650 insertions, 300 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 43d0cb19ef6a..4f27e5519296 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -735,7 +735,7 @@ config SGI_IP27_RTC | |||
735 | 735 | ||
736 | config GEN_RTC | 736 | config GEN_RTC |
737 | tristate "Generic /dev/rtc emulation" | 737 | tristate "Generic /dev/rtc emulation" |
738 | depends on RTC!=y && !IA64 && !ARM | 738 | depends on RTC!=y && !IA64 && !ARM && !PPC64 |
739 | ---help--- | 739 | ---help--- |
740 | If you say Y here and create a character special file /dev/rtc with | 740 | If you say Y here and create a character special file /dev/rtc with |
741 | major number 10 and minor number 135 using mknod ("man mknod"), you | 741 | major number 10 and minor number 135 using mknod ("man mknod"), you |
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index c1fe013c64f3..b4af87c6f9c8 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h | |||
@@ -143,6 +143,7 @@ struct agp_bridge_data { | |||
143 | char major_version; | 143 | char major_version; |
144 | char minor_version; | 144 | char minor_version; |
145 | struct list_head list; | 145 | struct list_head list; |
146 | u32 apbase_config; | ||
146 | }; | 147 | }; |
147 | 148 | ||
148 | #define KB(x) ((x) * 1024) | 149 | #define KB(x) ((x) * 1024) |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 51266d6b4d78..1f7d415f432c 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -1047,9 +1047,15 @@ static int intel_845_configure(void) | |||
1047 | /* aperture size */ | 1047 | /* aperture size */ |
1048 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 1048 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
1049 | 1049 | ||
1050 | /* address to map to */ | 1050 | if (agp_bridge->apbase_config != 0) { |
1051 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 1051 | pci_write_config_dword(agp_bridge->dev, AGP_APBASE, |
1052 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 1052 | agp_bridge->apbase_config); |
1053 | } else { | ||
1054 | /* address to map to */ | ||
1055 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | ||
1056 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | ||
1057 | agp_bridge->apbase_config = temp; | ||
1058 | } | ||
1053 | 1059 | ||
1054 | /* attbase - aperture base */ | 1060 | /* attbase - aperture base */ |
1055 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 1061 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
diff --git a/drivers/char/drm/via_dma.c b/drivers/char/drm/via_dma.c index 82f839451622..4f60f7f4193d 100644 --- a/drivers/char/drm/via_dma.c +++ b/drivers/char/drm/via_dma.c | |||
@@ -231,7 +231,7 @@ int via_dma_init(DRM_IOCTL_ARGS) | |||
231 | drm_via_dma_init_t init; | 231 | drm_via_dma_init_t init; |
232 | int retcode = 0; | 232 | int retcode = 0; |
233 | 233 | ||
234 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t *) data, | 234 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t __user *) data, |
235 | sizeof(init)); | 235 | sizeof(init)); |
236 | 236 | ||
237 | switch (init.func) { | 237 | switch (init.func) { |
@@ -343,7 +343,7 @@ int via_cmdbuffer(DRM_IOCTL_ARGS) | |||
343 | 343 | ||
344 | LOCK_TEST_WITH_RETURN( dev, filp ); | 344 | LOCK_TEST_WITH_RETURN( dev, filp ); |
345 | 345 | ||
346 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data, | 346 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data, |
347 | sizeof(cmdbuf)); | 347 | sizeof(cmdbuf)); |
348 | 348 | ||
349 | DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size); | 349 | DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size); |
@@ -386,7 +386,7 @@ int via_pci_cmdbuffer(DRM_IOCTL_ARGS) | |||
386 | 386 | ||
387 | LOCK_TEST_WITH_RETURN( dev, filp ); | 387 | LOCK_TEST_WITH_RETURN( dev, filp ); |
388 | 388 | ||
389 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data, | 389 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data, |
390 | sizeof(cmdbuf)); | 390 | sizeof(cmdbuf)); |
391 | 391 | ||
392 | DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf, | 392 | DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf, |
@@ -701,7 +701,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS) | |||
701 | return DRM_ERR(EFAULT); | 701 | return DRM_ERR(EFAULT); |
702 | } | 702 | } |
703 | 703 | ||
704 | DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t *) data, | 704 | DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t __user *) data, |
705 | sizeof(d_siz)); | 705 | sizeof(d_siz)); |
706 | 706 | ||
707 | 707 | ||
@@ -735,7 +735,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS) | |||
735 | } | 735 | } |
736 | d_siz.size = tmp_size; | 736 | d_siz.size = tmp_size; |
737 | 737 | ||
738 | DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t *) data, d_siz, | 738 | DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t __user *) data, d_siz, |
739 | sizeof(d_siz)); | 739 | sizeof(d_siz)); |
740 | return ret; | 740 | return ret; |
741 | } | 741 | } |
diff --git a/drivers/char/drm/via_drm.h b/drivers/char/drm/via_drm.h index 4588c9bd1816..be346bb0a26a 100644 --- a/drivers/char/drm/via_drm.h +++ b/drivers/char/drm/via_drm.h | |||
@@ -158,7 +158,7 @@ typedef struct _drm_via_dma_init { | |||
158 | } drm_via_dma_init_t; | 158 | } drm_via_dma_init_t; |
159 | 159 | ||
160 | typedef struct _drm_via_cmdbuffer { | 160 | typedef struct _drm_via_cmdbuffer { |
161 | char *buf; | 161 | char __user *buf; |
162 | unsigned long size; | 162 | unsigned long size; |
163 | } drm_via_cmdbuffer_t; | 163 | } drm_via_cmdbuffer_t; |
164 | 164 | ||
diff --git a/drivers/char/drm/via_ds.c b/drivers/char/drm/via_ds.c index daf3df75a20e..5c71e089246c 100644 --- a/drivers/char/drm/via_ds.c +++ b/drivers/char/drm/via_ds.c | |||
@@ -133,7 +133,7 @@ memHeap_t *via_mmInit(int ofs, int size) | |||
133 | PMemBlock blocks; | 133 | PMemBlock blocks; |
134 | 134 | ||
135 | if (size <= 0) | 135 | if (size <= 0) |
136 | return 0; | 136 | return NULL; |
137 | 137 | ||
138 | blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); | 138 | blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); |
139 | 139 | ||
@@ -143,7 +143,7 @@ memHeap_t *via_mmInit(int ofs, int size) | |||
143 | blocks->free = 1; | 143 | blocks->free = 1; |
144 | return (memHeap_t *) blocks; | 144 | return (memHeap_t *) blocks; |
145 | } else | 145 | } else |
146 | return 0; | 146 | return NULL; |
147 | } | 147 | } |
148 | 148 | ||
149 | static TMemBlock *SliceBlock(TMemBlock * p, | 149 | static TMemBlock *SliceBlock(TMemBlock * p, |
diff --git a/drivers/char/drm/via_ds.h b/drivers/char/drm/via_ds.h index be9c7f9f1aee..d2bb9f37ca38 100644 --- a/drivers/char/drm/via_ds.h +++ b/drivers/char/drm/via_ds.h | |||
@@ -61,8 +61,8 @@ struct mem_block_t { | |||
61 | struct mem_block_t *heap; | 61 | struct mem_block_t *heap; |
62 | int ofs, size; | 62 | int ofs, size; |
63 | int align; | 63 | int align; |
64 | int free:1; | 64 | unsigned int free:1; |
65 | int reserved:1; | 65 | unsigned int reserved:1; |
66 | }; | 66 | }; |
67 | typedef struct mem_block_t TMemBlock; | 67 | typedef struct mem_block_t TMemBlock; |
68 | typedef struct mem_block_t *PMemBlock; | 68 | typedef struct mem_block_t *PMemBlock; |
diff --git a/drivers/char/drm/via_map.c b/drivers/char/drm/via_map.c index 0be829b6ec65..bb171139e737 100644 --- a/drivers/char/drm/via_map.c +++ b/drivers/char/drm/via_map.c | |||
@@ -95,7 +95,8 @@ int via_map_init(DRM_IOCTL_ARGS) | |||
95 | 95 | ||
96 | DRM_DEBUG("%s\n", __FUNCTION__); | 96 | DRM_DEBUG("%s\n", __FUNCTION__); |
97 | 97 | ||
98 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t *) data, sizeof(init)); | 98 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t __user *) data, |
99 | sizeof(init)); | ||
99 | 100 | ||
100 | switch (init.func) { | 101 | switch (init.func) { |
101 | case VIA_INIT_MAP: | 102 | case VIA_INIT_MAP: |
diff --git a/drivers/char/drm/via_mm.c b/drivers/char/drm/via_mm.c index c22712f44d42..13921f3c0ec2 100644 --- a/drivers/char/drm/via_mm.c +++ b/drivers/char/drm/via_mm.c | |||
@@ -76,7 +76,8 @@ int via_agp_init(DRM_IOCTL_ARGS) | |||
76 | { | 76 | { |
77 | drm_via_agp_t agp; | 77 | drm_via_agp_t agp; |
78 | 78 | ||
79 | DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t *) data, sizeof(agp)); | 79 | DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t __user *) data, |
80 | sizeof(agp)); | ||
80 | 81 | ||
81 | AgpHeap = via_mmInit(agp.offset, agp.size); | 82 | AgpHeap = via_mmInit(agp.offset, agp.size); |
82 | 83 | ||
@@ -92,7 +93,7 @@ int via_fb_init(DRM_IOCTL_ARGS) | |||
92 | { | 93 | { |
93 | drm_via_fb_t fb; | 94 | drm_via_fb_t fb; |
94 | 95 | ||
95 | DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t *) data, sizeof(fb)); | 96 | DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t __user *) data, sizeof(fb)); |
96 | 97 | ||
97 | FBHeap = via_mmInit(fb.offset, fb.size); | 98 | FBHeap = via_mmInit(fb.offset, fb.size); |
98 | 99 | ||
@@ -193,19 +194,20 @@ int via_mem_alloc(DRM_IOCTL_ARGS) | |||
193 | { | 194 | { |
194 | drm_via_mem_t mem; | 195 | drm_via_mem_t mem; |
195 | 196 | ||
196 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem)); | 197 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data, |
198 | sizeof(mem)); | ||
197 | 199 | ||
198 | switch (mem.type) { | 200 | switch (mem.type) { |
199 | case VIDEO: | 201 | case VIDEO: |
200 | if (via_fb_alloc(&mem) < 0) | 202 | if (via_fb_alloc(&mem) < 0) |
201 | return -EFAULT; | 203 | return -EFAULT; |
202 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem, | 204 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem, |
203 | sizeof(mem)); | 205 | sizeof(mem)); |
204 | return 0; | 206 | return 0; |
205 | case AGP: | 207 | case AGP: |
206 | if (via_agp_alloc(&mem) < 0) | 208 | if (via_agp_alloc(&mem) < 0) |
207 | return -EFAULT; | 209 | return -EFAULT; |
208 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem, | 210 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem, |
209 | sizeof(mem)); | 211 | sizeof(mem)); |
210 | return 0; | 212 | return 0; |
211 | } | 213 | } |
@@ -289,7 +291,8 @@ int via_mem_free(DRM_IOCTL_ARGS) | |||
289 | { | 291 | { |
290 | drm_via_mem_t mem; | 292 | drm_via_mem_t mem; |
291 | 293 | ||
292 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem)); | 294 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data, |
295 | sizeof(mem)); | ||
293 | 296 | ||
294 | switch (mem.type) { | 297 | switch (mem.type) { |
295 | 298 | ||
diff --git a/drivers/char/drm/via_video.c b/drivers/char/drm/via_video.c index 37a61c67b292..1e2d444587bf 100644 --- a/drivers/char/drm/via_video.c +++ b/drivers/char/drm/via_video.c | |||
@@ -76,7 +76,8 @@ via_decoder_futex(DRM_IOCTL_ARGS) | |||
76 | 76 | ||
77 | DRM_DEBUG("%s\n", __FUNCTION__); | 77 | DRM_DEBUG("%s\n", __FUNCTION__); |
78 | 78 | ||
79 | DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t *) data, sizeof(fx)); | 79 | DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t __user *) data, |
80 | sizeof(fx)); | ||
80 | 81 | ||
81 | if (fx.lock > VIA_NR_XVMC_LOCKS) | 82 | if (fx.lock > VIA_NR_XVMC_LOCKS) |
82 | return -EFAULT; | 83 | return -EFAULT; |
diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 78e650fc5b41..81d811edf3c5 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c | |||
@@ -173,7 +173,7 @@ static void hangcheck_fire(unsigned long data) | |||
173 | } | 173 | } |
174 | if (hangcheck_reboot) { | 174 | if (hangcheck_reboot) { |
175 | printk(KERN_CRIT "Hangcheck: hangcheck is restarting the machine.\n"); | 175 | printk(KERN_CRIT "Hangcheck: hangcheck is restarting the machine.\n"); |
176 | machine_restart(NULL); | 176 | emergency_restart(); |
177 | } else { | 177 | } else { |
178 | printk(KERN_CRIT "Hangcheck: hangcheck value past margin!\n"); | 178 | printk(KERN_CRIT "Hangcheck: hangcheck value past margin!\n"); |
179 | } | 179 | } |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 298574e16061..a44b97304e95 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -1726,7 +1726,7 @@ static int dmi_table(u32 base, int len, int num) | |||
1726 | return status; | 1726 | return status; |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | inline static int dmi_checksum(u8 *buf) | 1729 | static inline int dmi_checksum(u8 *buf) |
1730 | { | 1730 | { |
1731 | u8 sum=0; | 1731 | u8 sum=0; |
1732 | int a; | 1732 | int a; |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index fcd1c02a32cb..d35a953961cb 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -131,11 +131,7 @@ | |||
131 | #define WDIOC_GET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 22, int) | 131 | #define WDIOC_GET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 22, int) |
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 134 | static int nowayout = WATCHDOG_NOWAYOUT; |
135 | static int nowayout = 1; | ||
136 | #else | ||
137 | static int nowayout; | ||
138 | #endif | ||
139 | 135 | ||
140 | static ipmi_user_t watchdog_user = NULL; | 136 | static ipmi_user_t watchdog_user = NULL; |
141 | 137 | ||
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 7b19e02f112f..523fd3c8bbaa 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -198,10 +198,10 @@ int setkeycode(unsigned int scancode, unsigned int keycode) | |||
198 | 198 | ||
199 | if (scancode >= dev->keycodemax) | 199 | if (scancode >= dev->keycodemax) |
200 | return -EINVAL; | 200 | return -EINVAL; |
201 | if (keycode > KEY_MAX) | ||
202 | return -EINVAL; | ||
203 | if (keycode < 0 || keycode > KEY_MAX) | 201 | if (keycode < 0 || keycode > KEY_MAX) |
204 | return -EINVAL; | 202 | return -EINVAL; |
203 | if (keycode >> (dev->keycodesize * 8)) | ||
204 | return -EINVAL; | ||
205 | 205 | ||
206 | oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); | 206 | oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); |
207 | 207 | ||
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c index a8be11dfcba3..34cbb13aad4b 100644 --- a/drivers/char/rio/rioboot.c +++ b/drivers/char/rio/rioboot.c | |||
@@ -902,7 +902,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
902 | (HostP->Mapping[entry].RtaUniqueNum==RtaUniq)) | 902 | (HostP->Mapping[entry].RtaUniqueNum==RtaUniq)) |
903 | { | 903 | { |
904 | HostP->Mapping[entry].Flags |= RTA_BOOTED|RTA_NEWBOOT; | 904 | HostP->Mapping[entry].Flags |= RTA_BOOTED|RTA_NEWBOOT; |
905 | #if NEED_TO_FIX | 905 | #ifdef NEED_TO_FIX |
906 | RIO_SV_BROADCAST(HostP->svFlags[entry]); | 906 | RIO_SV_BROADCAST(HostP->svFlags[entry]); |
907 | #endif | 907 | #endif |
908 | if ( (sysport=HostP->Mapping[entry].SysPort) != NO_PORT ) | 908 | if ( (sysport=HostP->Mapping[entry].SysPort) != NO_PORT ) |
@@ -918,7 +918,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
918 | { | 918 | { |
919 | entry2 = HostP->Mapping[entry].ID2 - 1; | 919 | entry2 = HostP->Mapping[entry].ID2 - 1; |
920 | HostP->Mapping[entry2].Flags |= RTA_BOOTED|RTA_NEWBOOT; | 920 | HostP->Mapping[entry2].Flags |= RTA_BOOTED|RTA_NEWBOOT; |
921 | #if NEED_TO_FIX | 921 | #ifdef NEED_TO_FIX |
922 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); | 922 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); |
923 | #endif | 923 | #endif |
924 | sysport = HostP->Mapping[entry2].SysPort; | 924 | sysport = HostP->Mapping[entry2].SysPort; |
@@ -1143,7 +1143,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1143 | CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN ); | 1143 | CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN ); |
1144 | HostP->Mapping[entry].Flags = | 1144 | HostP->Mapping[entry].Flags = |
1145 | SLOT_IN_USE | RTA_BOOTED | RTA_NEWBOOT; | 1145 | SLOT_IN_USE | RTA_BOOTED | RTA_NEWBOOT; |
1146 | #if NEED_TO_FIX | 1146 | #ifdef NEED_TO_FIX |
1147 | RIO_SV_BROADCAST(HostP->svFlags[entry]); | 1147 | RIO_SV_BROADCAST(HostP->svFlags[entry]); |
1148 | #endif | 1148 | #endif |
1149 | RIOReMapPorts( p, HostP, &HostP->Mapping[entry] ); | 1149 | RIOReMapPorts( p, HostP, &HostP->Mapping[entry] ); |
@@ -1159,7 +1159,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1159 | "This RTA has a tentative entry on another host - delete that entry (1)\n"); | 1159 | "This RTA has a tentative entry on another host - delete that entry (1)\n"); |
1160 | HostP->Mapping[entry].Flags = | 1160 | HostP->Mapping[entry].Flags = |
1161 | SLOT_TENTATIVE | RTA_BOOTED | RTA_NEWBOOT; | 1161 | SLOT_TENTATIVE | RTA_BOOTED | RTA_NEWBOOT; |
1162 | #if NEED_TO_FIX | 1162 | #ifdef NEED_TO_FIX |
1163 | RIO_SV_BROADCAST(HostP->svFlags[entry]); | 1163 | RIO_SV_BROADCAST(HostP->svFlags[entry]); |
1164 | #endif | 1164 | #endif |
1165 | } | 1165 | } |
@@ -1169,7 +1169,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1169 | { | 1169 | { |
1170 | HostP->Mapping[entry2].Flags = SLOT_IN_USE | | 1170 | HostP->Mapping[entry2].Flags = SLOT_IN_USE | |
1171 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; | 1171 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; |
1172 | #if NEED_TO_FIX | 1172 | #ifdef NEED_TO_FIX |
1173 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); | 1173 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); |
1174 | #endif | 1174 | #endif |
1175 | HostP->Mapping[entry2].SysPort = MapP2->SysPort; | 1175 | HostP->Mapping[entry2].SysPort = MapP2->SysPort; |
@@ -1188,7 +1188,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1188 | else | 1188 | else |
1189 | HostP->Mapping[entry2].Flags = SLOT_TENTATIVE | | 1189 | HostP->Mapping[entry2].Flags = SLOT_TENTATIVE | |
1190 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; | 1190 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; |
1191 | #if NEED_TO_FIX | 1191 | #ifdef NEED_TO_FIX |
1192 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); | 1192 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); |
1193 | #endif | 1193 | #endif |
1194 | bzero( (caddr_t)MapP2, sizeof(struct Map) ); | 1194 | bzero( (caddr_t)MapP2, sizeof(struct Map) ); |
diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c index 106b31f48a21..e9564c9fb37c 100644 --- a/drivers/char/rio/rioroute.c +++ b/drivers/char/rio/rioroute.c | |||
@@ -1023,7 +1023,7 @@ RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit) | |||
1023 | if (link < LINKS_PER_UNIT) | 1023 | if (link < LINKS_PER_UNIT) |
1024 | return 1; | 1024 | return 1; |
1025 | 1025 | ||
1026 | #if NEED_TO_FIX_THIS | 1026 | #ifdef NEED_TO_FIX_THIS |
1027 | /* Ok so all the links are disconnected. But we may have only just | 1027 | /* Ok so all the links are disconnected. But we may have only just |
1028 | ** made this slot tentative and not yet received a topology update. | 1028 | ** made this slot tentative and not yet received a topology update. |
1029 | ** Lets check how long ago we made it tentative. | 1029 | ** Lets check how long ago we made it tentative. |
diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c index 8fb26ad2aa12..e45bc275907a 100644 --- a/drivers/char/rio/riotable.c +++ b/drivers/char/rio/riotable.c | |||
@@ -771,7 +771,7 @@ int RIOAssignRta( struct rio_info *p, struct Map *MapP ) | |||
771 | if ((MapP->Flags & RTA16_SECOND_SLOT) == 0) | 771 | if ((MapP->Flags & RTA16_SECOND_SLOT) == 0) |
772 | CCOPY( MapP->Name, HostMapP->Name, MAX_NAME_LEN ); | 772 | CCOPY( MapP->Name, HostMapP->Name, MAX_NAME_LEN ); |
773 | HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED; | 773 | HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED; |
774 | #if NEED_TO_FIX | 774 | #ifdef NEED_TO_FIX |
775 | RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID-1]); | 775 | RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID-1]); |
776 | #endif | 776 | #endif |
777 | if (MapP->Flags & RTA16_SECOND_SLOT) | 777 | if (MapP->Flags & RTA16_SECOND_SLOT) |
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index f463d6baa685..5b1d3680c8ab 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -355,7 +355,7 @@ static void rp_do_receive(struct r_port *info, | |||
355 | ToRecv = space; | 355 | ToRecv = space; |
356 | 356 | ||
357 | if (ToRecv <= 0) | 357 | if (ToRecv <= 0) |
358 | return; | 358 | goto done; |
359 | 359 | ||
360 | /* | 360 | /* |
361 | * if status indicates there are errored characters in the | 361 | * if status indicates there are errored characters in the |
@@ -437,6 +437,7 @@ static void rp_do_receive(struct r_port *info, | |||
437 | } | 437 | } |
438 | /* Push the data up to the tty layer */ | 438 | /* Push the data up to the tty layer */ |
439 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); | 439 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); |
440 | done: | ||
440 | tty_ldisc_deref(ld); | 441 | tty_ldisc_deref(ld); |
441 | } | 442 | } |
442 | 443 | ||
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index fd042060809a..cefbe985e55c 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -439,6 +439,11 @@ static struct { | |||
439 | { 0, 0 }, | 439 | { 0, 0 }, |
440 | }; | 440 | }; |
441 | 441 | ||
442 | struct sonypi_keypress { | ||
443 | struct input_dev *dev; | ||
444 | int key; | ||
445 | }; | ||
446 | |||
442 | static struct sonypi_device { | 447 | static struct sonypi_device { |
443 | struct pci_dev *dev; | 448 | struct pci_dev *dev; |
444 | struct platform_device *pdev; | 449 | struct platform_device *pdev; |
@@ -710,22 +715,61 @@ static void sonypi_setbluetoothpower(u8 state) | |||
710 | 715 | ||
711 | static void input_keyrelease(void *data) | 716 | static void input_keyrelease(void *data) |
712 | { | 717 | { |
713 | struct input_dev *input_dev; | 718 | struct sonypi_keypress kp; |
714 | int key; | ||
715 | |||
716 | while (1) { | ||
717 | if (kfifo_get(sonypi_device.input_fifo, | ||
718 | (unsigned char *)&input_dev, | ||
719 | sizeof(input_dev)) != sizeof(input_dev)) | ||
720 | return; | ||
721 | if (kfifo_get(sonypi_device.input_fifo, | ||
722 | (unsigned char *)&key, | ||
723 | sizeof(key)) != sizeof(key)) | ||
724 | return; | ||
725 | 719 | ||
720 | while (kfifo_get(sonypi_device.input_fifo, (unsigned char *)&kp, | ||
721 | sizeof(kp)) == sizeof(kp)) { | ||
726 | msleep(10); | 722 | msleep(10); |
727 | input_report_key(input_dev, key, 0); | 723 | input_report_key(kp.dev, kp.key, 0); |
728 | input_sync(input_dev); | 724 | input_sync(kp.dev); |
725 | } | ||
726 | } | ||
727 | |||
728 | static void sonypi_report_input_event(u8 event) | ||
729 | { | ||
730 | struct input_dev *jog_dev = &sonypi_device.input_jog_dev; | ||
731 | struct input_dev *key_dev = &sonypi_device.input_key_dev; | ||
732 | struct sonypi_keypress kp = { NULL }; | ||
733 | int i; | ||
734 | |||
735 | switch (event) { | ||
736 | case SONYPI_EVENT_JOGDIAL_UP: | ||
737 | case SONYPI_EVENT_JOGDIAL_UP_PRESSED: | ||
738 | input_report_rel(jog_dev, REL_WHEEL, 1); | ||
739 | input_sync(jog_dev); | ||
740 | break; | ||
741 | |||
742 | case SONYPI_EVENT_JOGDIAL_DOWN: | ||
743 | case SONYPI_EVENT_JOGDIAL_DOWN_PRESSED: | ||
744 | input_report_rel(jog_dev, REL_WHEEL, -1); | ||
745 | input_sync(jog_dev); | ||
746 | break; | ||
747 | |||
748 | case SONYPI_EVENT_JOGDIAL_PRESSED: | ||
749 | kp.key = BTN_MIDDLE; | ||
750 | kp.dev = jog_dev; | ||
751 | break; | ||
752 | |||
753 | case SONYPI_EVENT_FNKEY_RELEASED: | ||
754 | /* Nothing, not all VAIOs generate this event */ | ||
755 | break; | ||
756 | |||
757 | default: | ||
758 | for (i = 0; sonypi_inputkeys[i].sonypiev; i++) | ||
759 | if (event == sonypi_inputkeys[i].sonypiev) { | ||
760 | kp.dev = key_dev; | ||
761 | kp.key = sonypi_inputkeys[i].inputev; | ||
762 | break; | ||
763 | } | ||
764 | break; | ||
765 | } | ||
766 | |||
767 | if (kp.dev) { | ||
768 | input_report_key(kp.dev, kp.key, 1); | ||
769 | input_sync(kp.dev); | ||
770 | kfifo_put(sonypi_device.input_fifo, | ||
771 | (unsigned char *)&kp, sizeof(kp)); | ||
772 | schedule_work(&sonypi_device.input_work); | ||
729 | } | 773 | } |
730 | } | 774 | } |
731 | 775 | ||
@@ -768,51 +812,8 @@ found: | |||
768 | printk(KERN_INFO | 812 | printk(KERN_INFO |
769 | "sonypi: event port1=0x%02x,port2=0x%02x\n", v1, v2); | 813 | "sonypi: event port1=0x%02x,port2=0x%02x\n", v1, v2); |
770 | 814 | ||
771 | if (useinput) { | 815 | if (useinput) |
772 | struct input_dev *input_jog_dev = &sonypi_device.input_jog_dev; | 816 | sonypi_report_input_event(event); |
773 | struct input_dev *input_key_dev = &sonypi_device.input_key_dev; | ||
774 | switch (event) { | ||
775 | case SONYPI_EVENT_JOGDIAL_UP: | ||
776 | case SONYPI_EVENT_JOGDIAL_UP_PRESSED: | ||
777 | input_report_rel(input_jog_dev, REL_WHEEL, 1); | ||
778 | break; | ||
779 | case SONYPI_EVENT_JOGDIAL_DOWN: | ||
780 | case SONYPI_EVENT_JOGDIAL_DOWN_PRESSED: | ||
781 | input_report_rel(input_jog_dev, REL_WHEEL, -1); | ||
782 | break; | ||
783 | case SONYPI_EVENT_JOGDIAL_PRESSED: { | ||
784 | int key = BTN_MIDDLE; | ||
785 | input_report_key(input_jog_dev, key, 1); | ||
786 | kfifo_put(sonypi_device.input_fifo, | ||
787 | (unsigned char *)&input_jog_dev, | ||
788 | sizeof(input_jog_dev)); | ||
789 | kfifo_put(sonypi_device.input_fifo, | ||
790 | (unsigned char *)&key, sizeof(key)); | ||
791 | break; | ||
792 | } | ||
793 | case SONYPI_EVENT_FNKEY_RELEASED: | ||
794 | /* Nothing, not all VAIOs generate this event */ | ||
795 | break; | ||
796 | } | ||
797 | input_sync(input_jog_dev); | ||
798 | |||
799 | for (i = 0; sonypi_inputkeys[i].sonypiev; i++) { | ||
800 | int key; | ||
801 | |||
802 | if (event != sonypi_inputkeys[i].sonypiev) | ||
803 | continue; | ||
804 | |||
805 | key = sonypi_inputkeys[i].inputev; | ||
806 | input_report_key(input_key_dev, key, 1); | ||
807 | kfifo_put(sonypi_device.input_fifo, | ||
808 | (unsigned char *)&input_key_dev, | ||
809 | sizeof(input_key_dev)); | ||
810 | kfifo_put(sonypi_device.input_fifo, | ||
811 | (unsigned char *)&key, sizeof(key)); | ||
812 | } | ||
813 | input_sync(input_key_dev); | ||
814 | schedule_work(&sonypi_device.input_work); | ||
815 | } | ||
816 | 817 | ||
817 | kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event)); | 818 | kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event)); |
818 | kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN); | 819 | kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN); |
@@ -1227,14 +1228,7 @@ static int __devinit sonypi_probe(void) | |||
1227 | sonypi_device.input_jog_dev.keybit[LONG(BTN_MOUSE)] = | 1228 | sonypi_device.input_jog_dev.keybit[LONG(BTN_MOUSE)] = |
1228 | BIT(BTN_MIDDLE); | 1229 | BIT(BTN_MIDDLE); |
1229 | sonypi_device.input_jog_dev.relbit[0] = BIT(REL_WHEEL); | 1230 | sonypi_device.input_jog_dev.relbit[0] = BIT(REL_WHEEL); |
1230 | sonypi_device.input_jog_dev.name = | 1231 | sonypi_device.input_jog_dev.name = SONYPI_JOG_INPUTNAME; |
1231 | kmalloc(sizeof(SONYPI_JOG_INPUTNAME), GFP_KERNEL); | ||
1232 | if (!sonypi_device.input_jog_dev.name) { | ||
1233 | printk(KERN_ERR "sonypi: kmalloc failed\n"); | ||
1234 | ret = -ENOMEM; | ||
1235 | goto out_inkmallocinput1; | ||
1236 | } | ||
1237 | sprintf(sonypi_device.input_jog_dev.name, SONYPI_JOG_INPUTNAME); | ||
1238 | sonypi_device.input_jog_dev.id.bustype = BUS_ISA; | 1232 | sonypi_device.input_jog_dev.id.bustype = BUS_ISA; |
1239 | sonypi_device.input_jog_dev.id.vendor = PCI_VENDOR_ID_SONY; | 1233 | sonypi_device.input_jog_dev.id.vendor = PCI_VENDOR_ID_SONY; |
1240 | 1234 | ||
@@ -1248,14 +1242,7 @@ static int __devinit sonypi_probe(void) | |||
1248 | if (sonypi_inputkeys[i].inputev) | 1242 | if (sonypi_inputkeys[i].inputev) |
1249 | set_bit(sonypi_inputkeys[i].inputev, | 1243 | set_bit(sonypi_inputkeys[i].inputev, |
1250 | sonypi_device.input_key_dev.keybit); | 1244 | sonypi_device.input_key_dev.keybit); |
1251 | sonypi_device.input_key_dev.name = | 1245 | sonypi_device.input_key_dev.name = SONYPI_KEY_INPUTNAME; |
1252 | kmalloc(sizeof(SONYPI_KEY_INPUTNAME), GFP_KERNEL); | ||
1253 | if (!sonypi_device.input_key_dev.name) { | ||
1254 | printk(KERN_ERR "sonypi: kmalloc failed\n"); | ||
1255 | ret = -ENOMEM; | ||
1256 | goto out_inkmallocinput2; | ||
1257 | } | ||
1258 | sprintf(sonypi_device.input_key_dev.name, SONYPI_KEY_INPUTNAME); | ||
1259 | sonypi_device.input_key_dev.id.bustype = BUS_ISA; | 1246 | sonypi_device.input_key_dev.id.bustype = BUS_ISA; |
1260 | sonypi_device.input_key_dev.id.vendor = PCI_VENDOR_ID_SONY; | 1247 | sonypi_device.input_key_dev.id.vendor = PCI_VENDOR_ID_SONY; |
1261 | 1248 | ||
@@ -1313,11 +1300,7 @@ out_platformdev: | |||
1313 | kfifo_free(sonypi_device.input_fifo); | 1300 | kfifo_free(sonypi_device.input_fifo); |
1314 | out_infifo: | 1301 | out_infifo: |
1315 | input_unregister_device(&sonypi_device.input_key_dev); | 1302 | input_unregister_device(&sonypi_device.input_key_dev); |
1316 | kfree(sonypi_device.input_key_dev.name); | ||
1317 | out_inkmallocinput2: | ||
1318 | input_unregister_device(&sonypi_device.input_jog_dev); | 1303 | input_unregister_device(&sonypi_device.input_jog_dev); |
1319 | kfree(sonypi_device.input_jog_dev.name); | ||
1320 | out_inkmallocinput1: | ||
1321 | free_irq(sonypi_device.irq, sonypi_irq); | 1304 | free_irq(sonypi_device.irq, sonypi_irq); |
1322 | out_reqirq: | 1305 | out_reqirq: |
1323 | release_region(sonypi_device.ioport1, sonypi_device.region_size); | 1306 | release_region(sonypi_device.ioport1, sonypi_device.region_size); |
@@ -1337,13 +1320,14 @@ static void __devexit sonypi_remove(void) | |||
1337 | { | 1320 | { |
1338 | sonypi_disable(); | 1321 | sonypi_disable(); |
1339 | 1322 | ||
1323 | synchronize_sched(); /* Allow sonypi interrupt to complete. */ | ||
1324 | flush_scheduled_work(); | ||
1325 | |||
1340 | platform_device_unregister(sonypi_device.pdev); | 1326 | platform_device_unregister(sonypi_device.pdev); |
1341 | 1327 | ||
1342 | if (useinput) { | 1328 | if (useinput) { |
1343 | input_unregister_device(&sonypi_device.input_key_dev); | 1329 | input_unregister_device(&sonypi_device.input_key_dev); |
1344 | kfree(sonypi_device.input_key_dev.name); | ||
1345 | input_unregister_device(&sonypi_device.input_jog_dev); | 1330 | input_unregister_device(&sonypi_device.input_jog_dev); |
1346 | kfree(sonypi_device.input_jog_dev.name); | ||
1347 | kfifo_free(sonypi_device.input_fifo); | 1331 | kfifo_free(sonypi_device.input_fifo); |
1348 | } | 1332 | } |
1349 | 1333 | ||
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 12d563c648f7..feb25158c8ee 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -115,7 +115,7 @@ static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs, | |||
115 | struct tty_struct *tty) | 115 | struct tty_struct *tty) |
116 | { | 116 | { |
117 | local_irq_enable(); | 117 | local_irq_enable(); |
118 | machine_restart(NULL); | 118 | emergency_restart(); |
119 | } | 119 | } |
120 | 120 | ||
121 | static struct sysrq_key_op sysrq_reboot_op = { | 121 | static struct sysrq_key_op sysrq_reboot_op = { |
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c index 5413f2908859..eb7058cbf015 100644 --- a/drivers/char/tb0219.c +++ b/drivers/char/tb0219.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | #include <asm/reboot.h> | 26 | #include <asm/reboot.h> |
27 | #include <asm/vr41xx/giu.h> | ||
28 | #include <asm/vr41xx/tb0219.h> | ||
27 | 29 | ||
28 | MODULE_AUTHOR("Yoichi Yuasa <yuasa@hh.iij4u.or.jp>"); | 30 | MODULE_AUTHOR("Yoichi Yuasa <yuasa@hh.iij4u.or.jp>"); |
29 | MODULE_DESCRIPTION("TANBAC TB0219 base board driver"); | 31 | MODULE_DESCRIPTION("TANBAC TB0219 base board driver"); |
@@ -266,6 +268,21 @@ static void tb0219_restart(char *command) | |||
266 | tb0219_write(TB0219_RESET, 0); | 268 | tb0219_write(TB0219_RESET, 0); |
267 | } | 269 | } |
268 | 270 | ||
271 | static void tb0219_pci_irq_init(void) | ||
272 | { | ||
273 | /* PCI Slot 1 */ | ||
274 | vr41xx_set_irq_trigger(TB0219_PCI_SLOT1_PIN, IRQ_TRIGGER_LEVEL, IRQ_SIGNAL_THROUGH); | ||
275 | vr41xx_set_irq_level(TB0219_PCI_SLOT1_PIN, IRQ_LEVEL_LOW); | ||
276 | |||
277 | /* PCI Slot 2 */ | ||
278 | vr41xx_set_irq_trigger(TB0219_PCI_SLOT2_PIN, IRQ_TRIGGER_LEVEL, IRQ_SIGNAL_THROUGH); | ||
279 | vr41xx_set_irq_level(TB0219_PCI_SLOT2_PIN, IRQ_LEVEL_LOW); | ||
280 | |||
281 | /* PCI Slot 3 */ | ||
282 | vr41xx_set_irq_trigger(TB0219_PCI_SLOT3_PIN, IRQ_TRIGGER_LEVEL, IRQ_SIGNAL_THROUGH); | ||
283 | vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); | ||
284 | } | ||
285 | |||
269 | static int tb0219_probe(struct device *dev) | 286 | static int tb0219_probe(struct device *dev) |
270 | { | 287 | { |
271 | int retval; | 288 | int retval; |
@@ -292,6 +309,8 @@ static int tb0219_probe(struct device *dev) | |||
292 | old_machine_restart = _machine_restart; | 309 | old_machine_restart = _machine_restart; |
293 | _machine_restart = tb0219_restart; | 310 | _machine_restart = tb0219_restart; |
294 | 311 | ||
312 | tb0219_pci_irq_init(); | ||
313 | |||
295 | if (major == 0) { | 314 | if (major == 0) { |
296 | major = retval; | 315 | major = retval; |
297 | printk(KERN_INFO "TB0219: major number %d\n", major); | 316 | printk(KERN_INFO "TB0219: major number %d\n", major); |
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 7a969778915a..94a3b3e20bf9 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -35,5 +35,16 @@ config TCG_ATMEL | |||
35 | will be accessible from within Linux. To compile this driver | 35 | will be accessible from within Linux. To compile this driver |
36 | as a module, choose M here; the module will be called tpm_atmel. | 36 | as a module, choose M here; the module will be called tpm_atmel. |
37 | 37 | ||
38 | config TCG_INFINEON | ||
39 | tristate "Infineon Technologies SLD 9630 TPM Interface" | ||
40 | depends on TCG_TPM | ||
41 | ---help--- | ||
42 | If you have a TPM security chip from Infineon Technologies | ||
43 | say Yes and it will be accessible from within Linux. To | ||
44 | compile this driver as a module, choose M here; the module | ||
45 | will be called tpm_infineon. | ||
46 | Further information on this driver and the supported hardware | ||
47 | can be found at http://www.prosec.rub.de/tpm | ||
48 | |||
38 | endmenu | 49 | endmenu |
39 | 50 | ||
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile index 736d3df266f5..2392e404e8d1 100644 --- a/drivers/char/tpm/Makefile +++ b/drivers/char/tpm/Makefile | |||
@@ -4,4 +4,4 @@ | |||
4 | obj-$(CONFIG_TCG_TPM) += tpm.o | 4 | obj-$(CONFIG_TCG_TPM) += tpm.o |
5 | obj-$(CONFIG_TCG_NSC) += tpm_nsc.o | 5 | obj-$(CONFIG_TCG_NSC) += tpm_nsc.o |
6 | obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o | 6 | obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o |
7 | 7 | obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o | |
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c new file mode 100644 index 000000000000..0e3241645c19 --- /dev/null +++ b/drivers/char/tpm/tpm_infineon.c | |||
@@ -0,0 +1,467 @@ | |||
1 | /* | ||
2 | * Description: | ||
3 | * Device Driver for the Infineon Technologies | ||
4 | * SLD 9630 TT Trusted Platform Module | ||
5 | * Specifications at www.trustedcomputinggroup.org | ||
6 | * | ||
7 | * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> | ||
8 | * Applied Data Security Group, Ruhr-University Bochum, Germany | ||
9 | * Project-Homepage: http://www.prosec.rub.de/tpm | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License as | ||
13 | * published by the Free Software Foundation, version 2 of the | ||
14 | * License. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include "tpm.h" | ||
19 | |||
20 | /* Infineon specific definitions */ | ||
21 | /* maximum number of WTX-packages */ | ||
22 | #define TPM_MAX_WTX_PACKAGES 50 | ||
23 | /* msleep-Time for WTX-packages */ | ||
24 | #define TPM_WTX_MSLEEP_TIME 20 | ||
25 | /* msleep-Time --> Interval to check status register */ | ||
26 | #define TPM_MSLEEP_TIME 3 | ||
27 | /* gives number of max. msleep()-calls before throwing timeout */ | ||
28 | #define TPM_MAX_TRIES 5000 | ||
29 | #define TCPA_INFINEON_DEV_VEN_VALUE 0x15D1 | ||
30 | #define TPM_DATA (TPM_ADDR + 1) & 0xff | ||
31 | |||
32 | /* TPM header definitions */ | ||
33 | enum infineon_tpm_header { | ||
34 | TPM_VL_VER = 0x01, | ||
35 | TPM_VL_CHANNEL_CONTROL = 0x07, | ||
36 | TPM_VL_CHANNEL_PERSONALISATION = 0x0A, | ||
37 | TPM_VL_CHANNEL_TPM = 0x0B, | ||
38 | TPM_VL_CONTROL = 0x00, | ||
39 | TPM_INF_NAK = 0x15, | ||
40 | TPM_CTRL_WTX = 0x10, | ||
41 | TPM_CTRL_WTX_ABORT = 0x18, | ||
42 | TPM_CTRL_WTX_ABORT_ACK = 0x18, | ||
43 | TPM_CTRL_ERROR = 0x20, | ||
44 | TPM_CTRL_CHAININGACK = 0x40, | ||
45 | TPM_CTRL_CHAINING = 0x80, | ||
46 | TPM_CTRL_DATA = 0x04, | ||
47 | TPM_CTRL_DATA_CHA = 0x84, | ||
48 | TPM_CTRL_DATA_CHA_ACK = 0xC4 | ||
49 | }; | ||
50 | |||
51 | enum infineon_tpm_register { | ||
52 | WRFIFO = 0x00, | ||
53 | RDFIFO = 0x01, | ||
54 | STAT = 0x02, | ||
55 | CMD = 0x03 | ||
56 | }; | ||
57 | |||
58 | enum infineon_tpm_command_bits { | ||
59 | CMD_DIS = 0x00, | ||
60 | CMD_LP = 0x01, | ||
61 | CMD_RES = 0x02, | ||
62 | CMD_IRQC = 0x06 | ||
63 | }; | ||
64 | |||
65 | enum infineon_tpm_status_bits { | ||
66 | STAT_XFE = 0x00, | ||
67 | STAT_LPA = 0x01, | ||
68 | STAT_FOK = 0x02, | ||
69 | STAT_TOK = 0x03, | ||
70 | STAT_IRQA = 0x06, | ||
71 | STAT_RDA = 0x07 | ||
72 | }; | ||
73 | |||
74 | /* some outgoing values */ | ||
75 | enum infineon_tpm_values { | ||
76 | CHIP_ID1 = 0x20, | ||
77 | CHIP_ID2 = 0x21, | ||
78 | TPM_DAR = 0x30, | ||
79 | RESET_LP_IRQC_DISABLE = 0x41, | ||
80 | ENABLE_REGISTER_PAIR = 0x55, | ||
81 | IOLIMH = 0x60, | ||
82 | IOLIML = 0x61, | ||
83 | DISABLE_REGISTER_PAIR = 0xAA, | ||
84 | IDVENL = 0xF1, | ||
85 | IDVENH = 0xF2, | ||
86 | IDPDL = 0xF3, | ||
87 | IDPDH = 0xF4 | ||
88 | }; | ||
89 | |||
90 | static int number_of_wtx; | ||
91 | |||
92 | static int empty_fifo(struct tpm_chip *chip, int clear_wrfifo) | ||
93 | { | ||
94 | int status; | ||
95 | int check = 0; | ||
96 | int i; | ||
97 | |||
98 | if (clear_wrfifo) { | ||
99 | for (i = 0; i < 4096; i++) { | ||
100 | status = inb(chip->vendor->base + WRFIFO); | ||
101 | if (status == 0xff) { | ||
102 | if (check == 5) | ||
103 | break; | ||
104 | else | ||
105 | check++; | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | /* Note: The values which are currently in the FIFO of the TPM | ||
110 | are thrown away since there is no usage for them. Usually, | ||
111 | this has nothing to say, since the TPM will give its answer | ||
112 | immediately or will be aborted anyway, so the data here is | ||
113 | usually garbage and useless. | ||
114 | We have to clean this, because the next communication with | ||
115 | the TPM would be rubbish, if there is still some old data | ||
116 | in the Read FIFO. | ||
117 | */ | ||
118 | i = 0; | ||
119 | do { | ||
120 | status = inb(chip->vendor->base + RDFIFO); | ||
121 | status = inb(chip->vendor->base + STAT); | ||
122 | i++; | ||
123 | if (i == TPM_MAX_TRIES) | ||
124 | return -EIO; | ||
125 | } while ((status & (1 << STAT_RDA)) != 0); | ||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | static int wait(struct tpm_chip *chip, int wait_for_bit) | ||
130 | { | ||
131 | int status; | ||
132 | int i; | ||
133 | for (i = 0; i < TPM_MAX_TRIES; i++) { | ||
134 | status = inb(chip->vendor->base + STAT); | ||
135 | /* check the status-register if wait_for_bit is set */ | ||
136 | if (status & 1 << wait_for_bit) | ||
137 | break; | ||
138 | msleep(TPM_MSLEEP_TIME); | ||
139 | } | ||
140 | if (i == TPM_MAX_TRIES) { /* timeout occurs */ | ||
141 | if (wait_for_bit == STAT_XFE) | ||
142 | dev_err(&chip->pci_dev->dev, | ||
143 | "Timeout in wait(STAT_XFE)\n"); | ||
144 | if (wait_for_bit == STAT_RDA) | ||
145 | dev_err(&chip->pci_dev->dev, | ||
146 | "Timeout in wait(STAT_RDA)\n"); | ||
147 | return -EIO; | ||
148 | } | ||
149 | return 0; | ||
150 | }; | ||
151 | |||
152 | static void wait_and_send(struct tpm_chip *chip, u8 sendbyte) | ||
153 | { | ||
154 | wait(chip, STAT_XFE); | ||
155 | outb(sendbyte, chip->vendor->base + WRFIFO); | ||
156 | } | ||
157 | |||
158 | /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more | ||
159 | calculation time, it sends a WTX-package, which has to be acknowledged | ||
160 | or aborted. This usually occurs if you are hammering the TPM with key | ||
161 | creation. Set the maximum number of WTX-packages in the definitions | ||
162 | above, if the number is reached, the waiting-time will be denied | ||
163 | and the TPM command has to be resend. | ||
164 | */ | ||
165 | |||
166 | static void tpm_wtx(struct tpm_chip *chip) | ||
167 | { | ||
168 | number_of_wtx++; | ||
169 | dev_info(&chip->pci_dev->dev, "Granting WTX (%02d / %02d)\n", | ||
170 | number_of_wtx, TPM_MAX_WTX_PACKAGES); | ||
171 | wait_and_send(chip, TPM_VL_VER); | ||
172 | wait_and_send(chip, TPM_CTRL_WTX); | ||
173 | wait_and_send(chip, 0x00); | ||
174 | wait_and_send(chip, 0x00); | ||
175 | msleep(TPM_WTX_MSLEEP_TIME); | ||
176 | } | ||
177 | |||
178 | static void tpm_wtx_abort(struct tpm_chip *chip) | ||
179 | { | ||
180 | dev_info(&chip->pci_dev->dev, "Aborting WTX\n"); | ||
181 | wait_and_send(chip, TPM_VL_VER); | ||
182 | wait_and_send(chip, TPM_CTRL_WTX_ABORT); | ||
183 | wait_and_send(chip, 0x00); | ||
184 | wait_and_send(chip, 0x00); | ||
185 | number_of_wtx = 0; | ||
186 | msleep(TPM_WTX_MSLEEP_TIME); | ||
187 | } | ||
188 | |||
189 | static int tpm_inf_recv(struct tpm_chip *chip, u8 * buf, size_t count) | ||
190 | { | ||
191 | int i; | ||
192 | int ret; | ||
193 | u32 size = 0; | ||
194 | |||
195 | recv_begin: | ||
196 | /* start receiving header */ | ||
197 | for (i = 0; i < 4; i++) { | ||
198 | ret = wait(chip, STAT_RDA); | ||
199 | if (ret) | ||
200 | return -EIO; | ||
201 | buf[i] = inb(chip->vendor->base + RDFIFO); | ||
202 | } | ||
203 | |||
204 | if (buf[0] != TPM_VL_VER) { | ||
205 | dev_err(&chip->pci_dev->dev, | ||
206 | "Wrong transport protocol implementation!\n"); | ||
207 | return -EIO; | ||
208 | } | ||
209 | |||
210 | if (buf[1] == TPM_CTRL_DATA) { | ||
211 | /* size of the data received */ | ||
212 | size = ((buf[2] << 8) | buf[3]); | ||
213 | |||
214 | for (i = 0; i < size; i++) { | ||
215 | wait(chip, STAT_RDA); | ||
216 | buf[i] = inb(chip->vendor->base + RDFIFO); | ||
217 | } | ||
218 | |||
219 | if ((size == 0x6D00) && (buf[1] == 0x80)) { | ||
220 | dev_err(&chip->pci_dev->dev, | ||
221 | "Error handling on vendor layer!\n"); | ||
222 | return -EIO; | ||
223 | } | ||
224 | |||
225 | for (i = 0; i < size; i++) | ||
226 | buf[i] = buf[i + 6]; | ||
227 | |||
228 | size = size - 6; | ||
229 | return size; | ||
230 | } | ||
231 | |||
232 | if (buf[1] == TPM_CTRL_WTX) { | ||
233 | dev_info(&chip->pci_dev->dev, "WTX-package received\n"); | ||
234 | if (number_of_wtx < TPM_MAX_WTX_PACKAGES) { | ||
235 | tpm_wtx(chip); | ||
236 | goto recv_begin; | ||
237 | } else { | ||
238 | tpm_wtx_abort(chip); | ||
239 | goto recv_begin; | ||
240 | } | ||
241 | } | ||
242 | |||
243 | if (buf[1] == TPM_CTRL_WTX_ABORT_ACK) { | ||
244 | dev_info(&chip->pci_dev->dev, "WTX-abort acknowledged\n"); | ||
245 | return size; | ||
246 | } | ||
247 | |||
248 | if (buf[1] == TPM_CTRL_ERROR) { | ||
249 | dev_err(&chip->pci_dev->dev, "ERROR-package received:\n"); | ||
250 | if (buf[4] == TPM_INF_NAK) | ||
251 | dev_err(&chip->pci_dev->dev, | ||
252 | "-> Negative acknowledgement" | ||
253 | " - retransmit command!\n"); | ||
254 | return -EIO; | ||
255 | } | ||
256 | return -EIO; | ||
257 | } | ||
258 | |||
259 | static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count) | ||
260 | { | ||
261 | int i; | ||
262 | int ret; | ||
263 | u8 count_high, count_low, count_4, count_3, count_2, count_1; | ||
264 | |||
265 | /* Disabling Reset, LP and IRQC */ | ||
266 | outb(RESET_LP_IRQC_DISABLE, chip->vendor->base + CMD); | ||
267 | |||
268 | ret = empty_fifo(chip, 1); | ||
269 | if (ret) { | ||
270 | dev_err(&chip->pci_dev->dev, "Timeout while clearing FIFO\n"); | ||
271 | return -EIO; | ||
272 | } | ||
273 | |||
274 | ret = wait(chip, STAT_XFE); | ||
275 | if (ret) | ||
276 | return -EIO; | ||
277 | |||
278 | count_4 = (count & 0xff000000) >> 24; | ||
279 | count_3 = (count & 0x00ff0000) >> 16; | ||
280 | count_2 = (count & 0x0000ff00) >> 8; | ||
281 | count_1 = (count & 0x000000ff); | ||
282 | count_high = ((count + 6) & 0xffffff00) >> 8; | ||
283 | count_low = ((count + 6) & 0x000000ff); | ||
284 | |||
285 | /* Sending Header */ | ||
286 | wait_and_send(chip, TPM_VL_VER); | ||
287 | wait_and_send(chip, TPM_CTRL_DATA); | ||
288 | wait_and_send(chip, count_high); | ||
289 | wait_and_send(chip, count_low); | ||
290 | |||
291 | /* Sending Data Header */ | ||
292 | wait_and_send(chip, TPM_VL_VER); | ||
293 | wait_and_send(chip, TPM_VL_CHANNEL_TPM); | ||
294 | wait_and_send(chip, count_4); | ||
295 | wait_and_send(chip, count_3); | ||
296 | wait_and_send(chip, count_2); | ||
297 | wait_and_send(chip, count_1); | ||
298 | |||
299 | /* Sending Data */ | ||
300 | for (i = 0; i < count; i++) { | ||
301 | wait_and_send(chip, buf[i]); | ||
302 | } | ||
303 | return count; | ||
304 | } | ||
305 | |||
306 | static void tpm_inf_cancel(struct tpm_chip *chip) | ||
307 | { | ||
308 | /* Nothing yet! | ||
309 | This has something to do with the internal functions | ||
310 | of the TPM. Abort isn't really necessary... | ||
311 | */ | ||
312 | } | ||
313 | |||
314 | static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); | ||
315 | static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL); | ||
316 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); | ||
317 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | ||
318 | |||
319 | static struct attribute *inf_attrs[] = { | ||
320 | &dev_attr_pubek.attr, | ||
321 | &dev_attr_pcrs.attr, | ||
322 | &dev_attr_caps.attr, | ||
323 | &dev_attr_cancel.attr, | ||
324 | NULL, | ||
325 | }; | ||
326 | |||
327 | static struct attribute_group inf_attr_grp = {.attrs = inf_attrs }; | ||
328 | |||
329 | static struct file_operations inf_ops = { | ||
330 | .owner = THIS_MODULE, | ||
331 | .llseek = no_llseek, | ||
332 | .open = tpm_open, | ||
333 | .read = tpm_read, | ||
334 | .write = tpm_write, | ||
335 | .release = tpm_release, | ||
336 | }; | ||
337 | |||
338 | static struct tpm_vendor_specific tpm_inf = { | ||
339 | .recv = tpm_inf_recv, | ||
340 | .send = tpm_inf_send, | ||
341 | .cancel = tpm_inf_cancel, | ||
342 | .req_complete_mask = 0, | ||
343 | .req_complete_val = 0, | ||
344 | .attr_group = &inf_attr_grp, | ||
345 | .miscdev = {.fops = &inf_ops,}, | ||
346 | }; | ||
347 | |||
348 | static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, | ||
349 | const struct pci_device_id *pci_id) | ||
350 | { | ||
351 | int rc = 0; | ||
352 | u8 iol, ioh; | ||
353 | int vendorid[2]; | ||
354 | int version[2]; | ||
355 | int productid[2]; | ||
356 | |||
357 | if (pci_enable_device(pci_dev)) | ||
358 | return -EIO; | ||
359 | |||
360 | dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); | ||
361 | |||
362 | /* query chip for its vendor, its version number a.s.o. */ | ||
363 | outb(ENABLE_REGISTER_PAIR, TPM_ADDR); | ||
364 | outb(IDVENL, TPM_ADDR); | ||
365 | vendorid[1] = inb(TPM_DATA); | ||
366 | outb(IDVENH, TPM_ADDR); | ||
367 | vendorid[0] = inb(TPM_DATA); | ||
368 | outb(IDPDL, TPM_ADDR); | ||
369 | productid[1] = inb(TPM_DATA); | ||
370 | outb(IDPDH, TPM_ADDR); | ||
371 | productid[0] = inb(TPM_DATA); | ||
372 | outb(CHIP_ID1, TPM_ADDR); | ||
373 | version[1] = inb(TPM_DATA); | ||
374 | outb(CHIP_ID2, TPM_ADDR); | ||
375 | version[0] = inb(TPM_DATA); | ||
376 | |||
377 | if ((vendorid[0] << 8 | vendorid[1]) == (TCPA_INFINEON_DEV_VEN_VALUE)) { | ||
378 | |||
379 | /* read IO-ports from TPM */ | ||
380 | outb(IOLIMH, TPM_ADDR); | ||
381 | ioh = inb(TPM_DATA); | ||
382 | outb(IOLIML, TPM_ADDR); | ||
383 | iol = inb(TPM_DATA); | ||
384 | tpm_inf.base = (ioh << 8) | iol; | ||
385 | |||
386 | if (tpm_inf.base == 0) { | ||
387 | dev_err(&pci_dev->dev, "No IO-ports set!\n"); | ||
388 | pci_disable_device(pci_dev); | ||
389 | return -ENODEV; | ||
390 | } | ||
391 | |||
392 | /* activate register */ | ||
393 | outb(TPM_DAR, TPM_ADDR); | ||
394 | outb(0x01, TPM_DATA); | ||
395 | outb(DISABLE_REGISTER_PAIR, TPM_ADDR); | ||
396 | |||
397 | /* disable RESET, LP and IRQC */ | ||
398 | outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); | ||
399 | |||
400 | /* Finally, we're done, print some infos */ | ||
401 | dev_info(&pci_dev->dev, "TPM found: " | ||
402 | "io base 0x%x, " | ||
403 | "chip version %02x%02x, " | ||
404 | "vendor id %x%x (Infineon), " | ||
405 | "product id %02x%02x" | ||
406 | "%s\n", | ||
407 | tpm_inf.base, | ||
408 | version[0], version[1], | ||
409 | vendorid[0], vendorid[1], | ||
410 | productid[0], productid[1], ((productid[0] == 0) | ||
411 | && (productid[1] == | ||
412 | 6)) ? | ||
413 | " (SLD 9630 TT 1.1)" : ""); | ||
414 | |||
415 | rc = tpm_register_hardware(pci_dev, &tpm_inf); | ||
416 | if (rc < 0) { | ||
417 | pci_disable_device(pci_dev); | ||
418 | return -ENODEV; | ||
419 | } | ||
420 | return 0; | ||
421 | } else { | ||
422 | dev_info(&pci_dev->dev, "No Infineon TPM found!\n"); | ||
423 | pci_disable_device(pci_dev); | ||
424 | return -ENODEV; | ||
425 | } | ||
426 | } | ||
427 | |||
428 | static struct pci_device_id tpm_pci_tbl[] __devinitdata = { | ||
429 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0)}, | ||
430 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12)}, | ||
431 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0)}, | ||
432 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12)}, | ||
433 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0)}, | ||
434 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0)}, | ||
435 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1)}, | ||
436 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2)}, | ||
437 | {0,} | ||
438 | }; | ||
439 | |||
440 | MODULE_DEVICE_TABLE(pci, tpm_pci_tbl); | ||
441 | |||
442 | static struct pci_driver inf_pci_driver = { | ||
443 | .name = "tpm_inf", | ||
444 | .id_table = tpm_pci_tbl, | ||
445 | .probe = tpm_inf_probe, | ||
446 | .remove = __devexit_p(tpm_remove), | ||
447 | .suspend = tpm_pm_suspend, | ||
448 | .resume = tpm_pm_resume, | ||
449 | }; | ||
450 | |||
451 | static int __init init_inf(void) | ||
452 | { | ||
453 | return pci_register_driver(&inf_pci_driver); | ||
454 | } | ||
455 | |||
456 | static void __exit cleanup_inf(void) | ||
457 | { | ||
458 | pci_unregister_driver(&inf_pci_driver); | ||
459 | } | ||
460 | |||
461 | module_init(init_inf); | ||
462 | module_exit(cleanup_inf); | ||
463 | |||
464 | MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); | ||
465 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT"); | ||
466 | MODULE_VERSION("1.4"); | ||
467 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index d7aa7a29f67e..30d96739fb23 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2796,7 +2796,7 @@ void do_blank_screen(int entering_gfx) | |||
2796 | return; | 2796 | return; |
2797 | 2797 | ||
2798 | if (vesa_off_interval) { | 2798 | if (vesa_off_interval) { |
2799 | blank_state = blank_vesa_wait, | 2799 | blank_state = blank_vesa_wait; |
2800 | mod_timer(&console_timer, jiffies + vesa_off_interval); | 2800 | mod_timer(&console_timer, jiffies + vesa_off_interval); |
2801 | } | 2801 | } |
2802 | 2802 | ||
diff --git a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c index 8f302121741b..7289f4af93d0 100644 --- a/drivers/char/watchdog/acquirewdt.c +++ b/drivers/char/watchdog/acquirewdt.c | |||
@@ -82,12 +82,7 @@ static int wdt_start = 0x443; | |||
82 | module_param(wdt_start, int, 0); | 82 | module_param(wdt_start, int, 0); |
83 | MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); | 83 | MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); |
84 | 84 | ||
85 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 85 | static int nowayout = WATCHDOG_NOWAYOUT; |
86 | static int nowayout = 1; | ||
87 | #else | ||
88 | static int nowayout = 0; | ||
89 | #endif | ||
90 | |||
91 | module_param(nowayout, int, 0); | 86 | module_param(nowayout, int, 0); |
92 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 87 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
93 | 88 | ||
diff --git a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c index ea73c8379bdd..194a3fd36b91 100644 --- a/drivers/char/watchdog/advantechwdt.c +++ b/drivers/char/watchdog/advantechwdt.c | |||
@@ -73,12 +73,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds */ | |||
73 | module_param(timeout, int, 0); | 73 | module_param(timeout, int, 0); |
74 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); | 74 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); |
75 | 75 | ||
76 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 76 | static int nowayout = WATCHDOG_NOWAYOUT; |
77 | static int nowayout = 1; | ||
78 | #else | ||
79 | static int nowayout = 0; | ||
80 | #endif | ||
81 | |||
82 | module_param(nowayout, int, 0); | 77 | module_param(nowayout, int, 0); |
83 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 78 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
84 | 79 | ||
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c index 35dcbf8be7d1..8338ca300e2e 100644 --- a/drivers/char/watchdog/alim1535_wdt.c +++ b/drivers/char/watchdog/alim1535_wdt.c | |||
@@ -38,12 +38,7 @@ static int timeout = WATCHDOG_TIMEOUT; | |||
38 | module_param(timeout, int, 0); | 38 | module_param(timeout, int, 0); |
39 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 39 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
40 | 40 | ||
41 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 41 | static int nowayout = WATCHDOG_NOWAYOUT; |
42 | static int nowayout = 1; | ||
43 | #else | ||
44 | static int nowayout = 0; | ||
45 | #endif | ||
46 | |||
47 | module_param(nowayout, int, 0); | 42 | module_param(nowayout, int, 0); |
48 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 43 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
49 | 44 | ||
@@ -317,7 +312,7 @@ static int ali_notify_sys(struct notifier_block *this, unsigned long code, void | |||
317 | */ | 312 | */ |
318 | 313 | ||
319 | static struct pci_device_id ali_pci_tbl[] = { | 314 | static struct pci_device_id ali_pci_tbl[] = { |
320 | { PCI_VENDOR_ID_AL, 1535, PCI_ANY_ID, PCI_ANY_ID,}, | 315 | { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,}, |
321 | { 0, }, | 316 | { 0, }, |
322 | }; | 317 | }; |
323 | MODULE_DEVICE_TABLE(pci, ali_pci_tbl); | 318 | MODULE_DEVICE_TABLE(pci, ali_pci_tbl); |
diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c index 90c091d9e0f5..c05ac188a4d7 100644 --- a/drivers/char/watchdog/alim7101_wdt.c +++ b/drivers/char/watchdog/alim7101_wdt.c | |||
@@ -75,12 +75,7 @@ static unsigned long wdt_is_open; | |||
75 | static char wdt_expect_close; | 75 | static char wdt_expect_close; |
76 | static struct pci_dev *alim7101_pmu; | 76 | static struct pci_dev *alim7101_pmu; |
77 | 77 | ||
78 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 78 | static int nowayout = WATCHDOG_NOWAYOUT; |
79 | static int nowayout = 1; | ||
80 | #else | ||
81 | static int nowayout = 0; | ||
82 | #endif | ||
83 | |||
84 | module_param(nowayout, int, 0); | 79 | module_param(nowayout, int, 0); |
85 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 80 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
86 | 81 | ||
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c index d10e554a14d6..25c2f2575611 100644 --- a/drivers/char/watchdog/eurotechwdt.c +++ b/drivers/char/watchdog/eurotechwdt.c | |||
@@ -72,12 +72,7 @@ static char *ev = "int"; | |||
72 | 72 | ||
73 | #define WDT_TIMEOUT 60 /* 1 minute */ | 73 | #define WDT_TIMEOUT 60 /* 1 minute */ |
74 | 74 | ||
75 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 75 | static int nowayout = WATCHDOG_NOWAYOUT; |
76 | static int nowayout = 1; | ||
77 | #else | ||
78 | static int nowayout = 0; | ||
79 | #endif | ||
80 | |||
81 | module_param(nowayout, int, 0); | 76 | module_param(nowayout, int, 0); |
82 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 77 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
83 | 78 | ||
@@ -167,7 +162,7 @@ static irqreturn_t eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
167 | printk(KERN_CRIT "Would Reboot.\n"); | 162 | printk(KERN_CRIT "Would Reboot.\n"); |
168 | #else | 163 | #else |
169 | printk(KERN_CRIT "Initiating system reboot.\n"); | 164 | printk(KERN_CRIT "Initiating system reboot.\n"); |
170 | machine_restart(NULL); | 165 | emergency_restart(); |
171 | #endif | 166 | #endif |
172 | return IRQ_HANDLED; | 167 | return IRQ_HANDLED; |
173 | } | 168 | } |
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index 5d07ee59679d..f975dab1ddf9 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -105,12 +105,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ | |||
105 | module_param(heartbeat, int, 0); | 105 | module_param(heartbeat, int, 0); |
106 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 106 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
107 | 107 | ||
108 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 108 | static int nowayout = WATCHDOG_NOWAYOUT; |
109 | static int nowayout = 1; | ||
110 | #else | ||
111 | static int nowayout = 0; | ||
112 | #endif | ||
113 | |||
114 | module_param(nowayout, int, 0); | 109 | module_param(nowayout, int, 0); |
115 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 110 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
116 | 111 | ||
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c index d974f16e84d2..cf60329eec85 100644 --- a/drivers/char/watchdog/ib700wdt.c +++ b/drivers/char/watchdog/ib700wdt.c | |||
@@ -117,12 +117,7 @@ static int wd_times[] = { | |||
117 | 117 | ||
118 | static int wd_margin = WD_TIMO; | 118 | static int wd_margin = WD_TIMO; |
119 | 119 | ||
120 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 120 | static int nowayout = WATCHDOG_NOWAYOUT; |
121 | static int nowayout = 1; | ||
122 | #else | ||
123 | static int nowayout = 0; | ||
124 | #endif | ||
125 | |||
126 | module_param(nowayout, int, 0); | 121 | module_param(nowayout, int, 0); |
127 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 122 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
128 | 123 | ||
diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c index 6af2c799b57e..b4b94daba67e 100644 --- a/drivers/char/watchdog/indydog.c +++ b/drivers/char/watchdog/indydog.c | |||
@@ -29,14 +29,9 @@ | |||
29 | #define PFX "indydog: " | 29 | #define PFX "indydog: " |
30 | static int indydog_alive; | 30 | static int indydog_alive; |
31 | 31 | ||
32 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | ||
33 | static int nowayout = 1; | ||
34 | #else | ||
35 | static int nowayout = 0; | ||
36 | #endif | ||
37 | |||
38 | #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ | 32 | #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ |
39 | 33 | ||
34 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
40 | module_param(nowayout, int, 0); | 35 | module_param(nowayout, int, 0); |
41 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 36 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
42 | 37 | ||
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c index 4b039516cc86..e7640bc4904b 100644 --- a/drivers/char/watchdog/ixp2000_wdt.c +++ b/drivers/char/watchdog/ixp2000_wdt.c | |||
@@ -30,11 +30,7 @@ | |||
30 | #include <asm/hardware.h> | 30 | #include <asm/hardware.h> |
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | 32 | ||
33 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 33 | static int nowayout = WATCHDOG_NOWAYOUT; |
34 | static int nowayout = 1; | ||
35 | #else | ||
36 | static int nowayout = 0; | ||
37 | #endif | ||
38 | static unsigned int heartbeat = 60; /* (secs) Default is 1 minute */ | 34 | static unsigned int heartbeat = 60; /* (secs) Default is 1 minute */ |
39 | static unsigned long wdt_status; | 35 | static unsigned long wdt_status; |
40 | 36 | ||
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c index 83df369113a4..8d916afbf4fa 100644 --- a/drivers/char/watchdog/ixp4xx_wdt.c +++ b/drivers/char/watchdog/ixp4xx_wdt.c | |||
@@ -27,11 +27,7 @@ | |||
27 | #include <asm/hardware.h> | 27 | #include <asm/hardware.h> |
28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
29 | 29 | ||
30 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 30 | static int nowayout = WATCHDOG_NOWAYOUT; |
31 | static int nowayout = 1; | ||
32 | #else | ||
33 | static int nowayout = 0; | ||
34 | #endif | ||
35 | static int heartbeat = 60; /* (secs) Default is 1 minute */ | 31 | static int heartbeat = 60; /* (secs) Default is 1 minute */ |
36 | static unsigned long wdt_status; | 32 | static unsigned long wdt_status; |
37 | static unsigned long boot_status; | 33 | static unsigned long boot_status; |
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 9da395fa7794..a9a20aad61e7 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c | |||
@@ -94,12 +94,7 @@ MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); | |||
94 | MODULE_LICENSE("GPL"); | 94 | MODULE_LICENSE("GPL"); |
95 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 95 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
96 | 96 | ||
97 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 97 | static int nowayout = WATCHDOG_NOWAYOUT; |
98 | static int nowayout = 1; | ||
99 | #else | ||
100 | static int nowayout = 0; | ||
101 | #endif | ||
102 | |||
103 | module_param(nowayout, int, 0); | 98 | module_param(nowayout, int, 0); |
104 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 99 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
105 | 100 | ||
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c index 3143e4a07535..c9b301dccec3 100644 --- a/drivers/char/watchdog/mixcomwd.c +++ b/drivers/char/watchdog/mixcomwd.c | |||
@@ -62,12 +62,7 @@ static int mixcomwd_timer_alive; | |||
62 | static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0); | 62 | static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0); |
63 | static char expect_close; | 63 | static char expect_close; |
64 | 64 | ||
65 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 65 | static int nowayout = WATCHDOG_NOWAYOUT; |
66 | static int nowayout = 1; | ||
67 | #else | ||
68 | static int nowayout = 0; | ||
69 | #endif | ||
70 | |||
71 | module_param(nowayout, int, 0); | 66 | module_param(nowayout, int, 0); |
72 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 67 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
73 | 68 | ||
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c index 592dca108866..427ad51b7a35 100644 --- a/drivers/char/watchdog/pcwd.c +++ b/drivers/char/watchdog/pcwd.c | |||
@@ -146,12 +146,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; | |||
146 | module_param(heartbeat, int, 0); | 146 | module_param(heartbeat, int, 0); |
147 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 147 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
148 | 148 | ||
149 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 149 | static int nowayout = WATCHDOG_NOWAYOUT; |
150 | static int nowayout = 1; | ||
151 | #else | ||
152 | static int nowayout = 0; | ||
153 | #endif | ||
154 | |||
155 | module_param(nowayout, int, 0); | 150 | module_param(nowayout, int, 0); |
156 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 151 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
157 | 152 | ||
@@ -344,7 +339,7 @@ static int pcwd_get_status(int *status) | |||
344 | *status |= WDIOF_OVERHEAT; | 339 | *status |= WDIOF_OVERHEAT; |
345 | if (temp_panic) { | 340 | if (temp_panic) { |
346 | printk (KERN_INFO PFX "Temperature overheat trip!\n"); | 341 | printk (KERN_INFO PFX "Temperature overheat trip!\n"); |
347 | machine_power_off(); | 342 | kernel_power_off(); |
348 | } | 343 | } |
349 | } | 344 | } |
350 | } else { | 345 | } else { |
@@ -355,7 +350,7 @@ static int pcwd_get_status(int *status) | |||
355 | *status |= WDIOF_OVERHEAT; | 350 | *status |= WDIOF_OVERHEAT; |
356 | if (temp_panic) { | 351 | if (temp_panic) { |
357 | printk (KERN_INFO PFX "Temperature overheat trip!\n"); | 352 | printk (KERN_INFO PFX "Temperature overheat trip!\n"); |
358 | machine_power_off(); | 353 | kernel_power_off(); |
359 | } | 354 | } |
360 | } | 355 | } |
361 | } | 356 | } |
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c index 8ce066627326..2b13afb09c5d 100644 --- a/drivers/char/watchdog/pcwd_pci.c +++ b/drivers/char/watchdog/pcwd_pci.c | |||
@@ -103,12 +103,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; | |||
103 | module_param(heartbeat, int, 0); | 103 | module_param(heartbeat, int, 0); |
104 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 104 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
105 | 105 | ||
106 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 106 | static int nowayout = WATCHDOG_NOWAYOUT; |
107 | static int nowayout = 1; | ||
108 | #else | ||
109 | static int nowayout = 0; | ||
110 | #endif | ||
111 | |||
112 | module_param(nowayout, int, 0); | 107 | module_param(nowayout, int, 0); |
113 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 108 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
114 | 109 | ||
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c index 1127201d73b8..092e9b133750 100644 --- a/drivers/char/watchdog/pcwd_usb.c +++ b/drivers/char/watchdog/pcwd_usb.c | |||
@@ -79,12 +79,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; | |||
79 | module_param(heartbeat, int, 0); | 79 | module_param(heartbeat, int, 0); |
80 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 80 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
81 | 81 | ||
82 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 82 | static int nowayout = WATCHDOG_NOWAYOUT; |
83 | static int nowayout = 1; | ||
84 | #else | ||
85 | static int nowayout = 0; | ||
86 | #endif | ||
87 | |||
88 | module_param(nowayout, int, 0); | 83 | module_param(nowayout, int, 0); |
89 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 84 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
90 | 85 | ||
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index 1699d2c28ce5..f85ac898a49a 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -62,12 +62,7 @@ | |||
62 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) | 62 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) |
63 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) | 63 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) |
64 | 64 | ||
65 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 65 | static int nowayout = WATCHDOG_NOWAYOUT; |
66 | static int nowayout = 1; | ||
67 | #else | ||
68 | static int nowayout = 0; | ||
69 | #endif | ||
70 | |||
71 | static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; | 66 | static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; |
72 | static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; | 67 | static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; |
73 | static int soft_noboot = 0; | 68 | static int soft_noboot = 0; |
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c index 34e8f7b15e30..1b2132617dc3 100644 --- a/drivers/char/watchdog/sa1100_wdt.c +++ b/drivers/char/watchdog/sa1100_wdt.c | |||
@@ -42,11 +42,7 @@ static unsigned long sa1100wdt_users; | |||
42 | static int expect_close; | 42 | static int expect_close; |
43 | static int pre_margin; | 43 | static int pre_margin; |
44 | static int boot_status; | 44 | static int boot_status; |
45 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 45 | static int nowayout = WATCHDOG_NOWAYOUT; |
46 | static int nowayout = 1; | ||
47 | #else | ||
48 | static int nowayout = 0; | ||
49 | #endif | ||
50 | 46 | ||
51 | /* | 47 | /* |
52 | * Allow only one person to hold it open | 48 | * Allow only one person to hold it open |
diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c index d7de9880605a..ed0bd55fbfc1 100644 --- a/drivers/char/watchdog/sbc60xxwdt.c +++ b/drivers/char/watchdog/sbc60xxwdt.c | |||
@@ -98,12 +98,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ t | |||
98 | module_param(timeout, int, 0); | 98 | module_param(timeout, int, 0); |
99 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 99 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
100 | 100 | ||
101 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 101 | static int nowayout = WATCHDOG_NOWAYOUT; |
102 | static int nowayout = 1; | ||
103 | #else | ||
104 | static int nowayout = 0; | ||
105 | #endif | ||
106 | |||
107 | module_param(nowayout, int, 0); | 102 | module_param(nowayout, int, 0); |
108 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 103 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
109 | 104 | ||
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c index 24401e84729e..515ce7572049 100644 --- a/drivers/char/watchdog/sc1200wdt.c +++ b/drivers/char/watchdog/sc1200wdt.c | |||
@@ -91,12 +91,7 @@ MODULE_PARM_DESC(io, "io port"); | |||
91 | module_param(timeout, int, 0); | 91 | module_param(timeout, int, 0); |
92 | MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1"); | 92 | MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1"); |
93 | 93 | ||
94 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 94 | static int nowayout = WATCHDOG_NOWAYOUT; |
95 | static int nowayout = 1; | ||
96 | #else | ||
97 | static int nowayout = 0; | ||
98 | #endif | ||
99 | |||
100 | module_param(nowayout, int, 0); | 95 | module_param(nowayout, int, 0); |
101 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 96 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
102 | 97 | ||
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c index f6d143e1900d..72501be79b0c 100644 --- a/drivers/char/watchdog/sc520_wdt.c +++ b/drivers/char/watchdog/sc520_wdt.c | |||
@@ -94,12 +94,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ t | |||
94 | module_param(timeout, int, 0); | 94 | module_param(timeout, int, 0); |
95 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 95 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
96 | 96 | ||
97 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 97 | static int nowayout = WATCHDOG_NOWAYOUT; |
98 | static int nowayout = 1; | ||
99 | #else | ||
100 | static int nowayout = 0; | ||
101 | #endif | ||
102 | |||
103 | module_param(nowayout, int, 0); | 98 | module_param(nowayout, int, 0); |
104 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 99 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
105 | 100 | ||
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c index b569670e4ed5..c4568569f3a8 100644 --- a/drivers/char/watchdog/scx200_wdt.c +++ b/drivers/char/watchdog/scx200_wdt.c | |||
@@ -39,15 +39,11 @@ MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); | |||
39 | MODULE_LICENSE("GPL"); | 39 | MODULE_LICENSE("GPL"); |
40 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 40 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
41 | 41 | ||
42 | #ifndef CONFIG_WATCHDOG_NOWAYOUT | ||
43 | #define CONFIG_WATCHDOG_NOWAYOUT 0 | ||
44 | #endif | ||
45 | |||
46 | static int margin = 60; /* in seconds */ | 42 | static int margin = 60; /* in seconds */ |
47 | module_param(margin, int, 0); | 43 | module_param(margin, int, 0); |
48 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); | 44 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); |
49 | 45 | ||
50 | static int nowayout = CONFIG_WATCHDOG_NOWAYOUT; | 46 | static int nowayout = WATCHDOG_NOWAYOUT; |
51 | module_param(nowayout, int, 0); | 47 | module_param(nowayout, int, 0); |
52 | MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); | 48 | MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); |
53 | 49 | ||
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c index 3bc9272a474c..1f4cab55b2ef 100644 --- a/drivers/char/watchdog/shwdt.c +++ b/drivers/char/watchdog/shwdt.c | |||
@@ -75,11 +75,7 @@ static unsigned long next_heartbeat; | |||
75 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ | 75 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ |
76 | static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ | 76 | static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ |
77 | 77 | ||
78 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 78 | static int nowayout = WATCHDOG_NOWAYOUT; |
79 | static int nowayout = 1; | ||
80 | #else | ||
81 | static int nowayout = 0; | ||
82 | #endif | ||
83 | 79 | ||
84 | /** | 80 | /** |
85 | * sh_wdt_start - Start the Watchdog | 81 | * sh_wdt_start - Start the Watchdog |
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c index 117903498a01..4d7ed931f5c6 100644 --- a/drivers/char/watchdog/softdog.c +++ b/drivers/char/watchdog/softdog.c | |||
@@ -56,12 +56,7 @@ static int soft_margin = TIMER_MARGIN; /* in seconds */ | |||
56 | module_param(soft_margin, int, 0); | 56 | module_param(soft_margin, int, 0); |
57 | MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")"); | 57 | MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")"); |
58 | 58 | ||
59 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 59 | static int nowayout = WATCHDOG_NOWAYOUT; |
60 | static int nowayout = 1; | ||
61 | #else | ||
62 | static int nowayout = 0; | ||
63 | #endif | ||
64 | |||
65 | module_param(nowayout, int, 0); | 60 | module_param(nowayout, int, 0); |
66 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 61 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
67 | 62 | ||
@@ -97,7 +92,7 @@ static void watchdog_fire(unsigned long data) | |||
97 | else | 92 | else |
98 | { | 93 | { |
99 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); | 94 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); |
100 | machine_restart(NULL); | 95 | emergency_restart(); |
101 | printk(KERN_CRIT PFX "Reboot didn't ?????\n"); | 96 | printk(KERN_CRIT PFX "Reboot didn't ?????\n"); |
102 | } | 97 | } |
103 | } | 98 | } |
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c index 813c97038f84..465e0fd0423d 100644 --- a/drivers/char/watchdog/w83627hf_wdt.c +++ b/drivers/char/watchdog/w83627hf_wdt.c | |||
@@ -54,12 +54,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds */ | |||
54 | module_param(timeout, int, 0); | 54 | module_param(timeout, int, 0); |
55 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); | 55 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); |
56 | 56 | ||
57 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 57 | static int nowayout = WATCHDOG_NOWAYOUT; |
58 | static int nowayout = 1; | ||
59 | #else | ||
60 | static int nowayout = 0; | ||
61 | #endif | ||
62 | |||
63 | module_param(nowayout, int, 0); | 58 | module_param(nowayout, int, 0); |
64 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 59 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
65 | 60 | ||
diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c index bccbd4d6ac2d..52a8bd0a5988 100644 --- a/drivers/char/watchdog/w83877f_wdt.c +++ b/drivers/char/watchdog/w83877f_wdt.c | |||
@@ -85,12 +85,7 @@ module_param(timeout, int, 0); | |||
85 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 85 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
86 | 86 | ||
87 | 87 | ||
88 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 88 | static int nowayout = WATCHDOG_NOWAYOUT; |
89 | static int nowayout = 1; | ||
90 | #else | ||
91 | static int nowayout = 0; | ||
92 | #endif | ||
93 | |||
94 | module_param(nowayout, int, 0); | 89 | module_param(nowayout, int, 0); |
95 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 90 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
96 | 91 | ||
diff --git a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c index abb0bea45c02..7cf6c9bbf486 100644 --- a/drivers/char/watchdog/wafer5823wdt.c +++ b/drivers/char/watchdog/wafer5823wdt.c | |||
@@ -63,12 +63,7 @@ static int timeout = WD_TIMO; /* in seconds */ | |||
63 | module_param(timeout, int, 0); | 63 | module_param(timeout, int, 0); |
64 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) "."); | 64 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) "."); |
65 | 65 | ||
66 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 66 | static int nowayout = WATCHDOG_NOWAYOUT; |
67 | static int nowayout = 1; | ||
68 | #else | ||
69 | static int nowayout = 0; | ||
70 | #endif | ||
71 | |||
72 | module_param(nowayout, int, 0); | 67 | module_param(nowayout, int, 0); |
73 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 68 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
74 | 69 | ||
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c index 5684aa379886..ec7e401228ee 100644 --- a/drivers/char/watchdog/wdt.c +++ b/drivers/char/watchdog/wdt.c | |||
@@ -63,12 +63,7 @@ static int wd_heartbeat; | |||
63 | module_param(heartbeat, int, 0); | 63 | module_param(heartbeat, int, 0); |
64 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); | 64 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); |
65 | 65 | ||
66 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 66 | static int nowayout = WATCHDOG_NOWAYOUT; |
67 | static int nowayout = 1; | ||
68 | #else | ||
69 | static int nowayout = 0; | ||
70 | #endif | ||
71 | |||
72 | module_param(nowayout, int, 0); | 67 | module_param(nowayout, int, 0); |
73 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 68 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
74 | 69 | ||
@@ -266,7 +261,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
266 | printk(KERN_CRIT "Would Reboot.\n"); | 261 | printk(KERN_CRIT "Would Reboot.\n"); |
267 | #else | 262 | #else |
268 | printk(KERN_CRIT "Initiating system reboot.\n"); | 263 | printk(KERN_CRIT "Initiating system reboot.\n"); |
269 | machine_restart(NULL); | 264 | emergency_restart(); |
270 | #endif | 265 | #endif |
271 | #else | 266 | #else |
272 | printk(KERN_CRIT "Reset in 5ms.\n"); | 267 | printk(KERN_CRIT "Reset in 5ms.\n"); |
diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c index 072e9b214759..44d49dfacbb3 100644 --- a/drivers/char/watchdog/wdt977.c +++ b/drivers/char/watchdog/wdt977.c | |||
@@ -53,12 +53,7 @@ MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=" __M | |||
53 | module_param(testmode, int, 0); | 53 | module_param(testmode, int, 0); |
54 | MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0"); | 54 | MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0"); |
55 | 55 | ||
56 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 56 | static int nowayout = WATCHDOG_NOWAYOUT; |
57 | static int nowayout = 1; | ||
58 | #else | ||
59 | static int nowayout = 0; | ||
60 | #endif | ||
61 | |||
62 | module_param(nowayout, int, 0); | 57 | module_param(nowayout, int, 0); |
63 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 58 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
64 | 59 | ||
diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c index 7651deda928c..4b3311993d48 100644 --- a/drivers/char/watchdog/wdt_pci.c +++ b/drivers/char/watchdog/wdt_pci.c | |||
@@ -89,12 +89,7 @@ static int wd_heartbeat; | |||
89 | module_param(heartbeat, int, 0); | 89 | module_param(heartbeat, int, 0); |
90 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); | 90 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); |
91 | 91 | ||
92 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 92 | static int nowayout = WATCHDOG_NOWAYOUT; |
93 | static int nowayout = 1; | ||
94 | #else | ||
95 | static int nowayout = 0; | ||
96 | #endif | ||
97 | |||
98 | module_param(nowayout, int, 0); | 93 | module_param(nowayout, int, 0); |
99 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 94 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
100 | 95 | ||
@@ -311,7 +306,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
311 | printk(KERN_CRIT PFX "Would Reboot.\n"); | 306 | printk(KERN_CRIT PFX "Would Reboot.\n"); |
312 | #else | 307 | #else |
313 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); | 308 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); |
314 | machine_restart(NULL); | 309 | emergency_restart(NULL); |
315 | #endif | 310 | #endif |
316 | #else | 311 | #else |
317 | printk(KERN_CRIT PFX "Reset in 5ms.\n"); | 312 | printk(KERN_CRIT PFX "Reset in 5ms.\n"); |