diff options
author | Cornelia Huck <cohuck@de.ibm.com> | 2006-01-06 03:19:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:51 -0500 |
commit | a8237fc4108060402d904bea5e1062e22e731969 (patch) | |
tree | fc19e33ea8bbe664c33fba6c78b34e497f2cc478 /drivers/s390/cio/blacklist.c | |
parent | 8129ee164267dc030b8e1d541ee3643c0b9f2fa1 (diff) |
[PATCH] s390: introduce struct subchannel_id
This patch introduces a struct subchannel_id containing the subchannel number
(formerly referred to as "irq") and switches code formerly relying on the
subchannel number over to it.
While we're touching inline assemblies anyway, make sure they have correct
memory constraints.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio/blacklist.c')
-rw-r--r-- | drivers/s390/cio/blacklist.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index a1c52a682191..a4b03031ff50 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | /* 65536 bits to indicate if a devno is blacklisted or not */ | 37 | /* 65536 bits to indicate if a devno is blacklisted or not */ |
38 | #define __BL_DEV_WORDS ((__MAX_SUBCHANNELS + (8*sizeof(long) - 1)) / \ | 38 | #define __BL_DEV_WORDS ((__MAX_SUBCHANNEL + (8*sizeof(long) - 1)) / \ |
39 | (8*sizeof(long))) | 39 | (8*sizeof(long))) |
40 | static unsigned long bl_dev[__BL_DEV_WORDS]; | 40 | static unsigned long bl_dev[__BL_DEV_WORDS]; |
41 | typedef enum {add, free} range_action; | 41 | typedef enum {add, free} range_action; |
@@ -50,7 +50,7 @@ blacklist_range (range_action action, unsigned int from, unsigned int to) | |||
50 | if (!to) | 50 | if (!to) |
51 | to = from; | 51 | to = from; |
52 | 52 | ||
53 | if (from > to || to > __MAX_SUBCHANNELS) { | 53 | if (from > to || to > __MAX_SUBCHANNEL) { |
54 | printk (KERN_WARNING "Invalid blacklist range " | 54 | printk (KERN_WARNING "Invalid blacklist range " |
55 | "0x%04x to 0x%04x, skipping\n", from, to); | 55 | "0x%04x to 0x%04x, skipping\n", from, to); |
56 | return; | 56 | return; |
@@ -143,7 +143,7 @@ blacklist_parse_parameters (char *str, range_action action) | |||
143 | if (strncmp(str,"all,",4) == 0 || strcmp(str,"all") == 0 || | 143 | if (strncmp(str,"all,",4) == 0 || strcmp(str,"all") == 0 || |
144 | strncmp(str,"all\n",4) == 0 || strncmp(str,"all ",4) == 0) { | 144 | strncmp(str,"all\n",4) == 0 || strncmp(str,"all ",4) == 0) { |
145 | from = 0; | 145 | from = 0; |
146 | to = __MAX_SUBCHANNELS; | 146 | to = __MAX_SUBCHANNEL; |
147 | str += 3; | 147 | str += 3; |
148 | } else { | 148 | } else { |
149 | int rc; | 149 | int rc; |
@@ -226,20 +226,21 @@ is_blacklisted (int devno) | |||
226 | static inline void | 226 | static inline void |
227 | s390_redo_validation (void) | 227 | s390_redo_validation (void) |
228 | { | 228 | { |
229 | unsigned int irq; | 229 | struct subchannel_id schid; |
230 | 230 | ||
231 | CIO_TRACE_EVENT (0, "redoval"); | 231 | CIO_TRACE_EVENT (0, "redoval"); |
232 | for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) { | 232 | init_subchannel_id(&schid); |
233 | do { | ||
233 | int ret; | 234 | int ret; |
234 | struct subchannel *sch; | 235 | struct subchannel *sch; |
235 | 236 | ||
236 | sch = get_subchannel_by_schid(irq); | 237 | sch = get_subchannel_by_schid(schid); |
237 | if (sch) { | 238 | if (sch) { |
238 | /* Already known. */ | 239 | /* Already known. */ |
239 | put_device(&sch->dev); | 240 | put_device(&sch->dev); |
240 | continue; | 241 | continue; |
241 | } | 242 | } |
242 | ret = css_probe_device(irq); | 243 | ret = css_probe_device(schid); |
243 | if (ret == -ENXIO) | 244 | if (ret == -ENXIO) |
244 | break; /* We're through. */ | 245 | break; /* We're through. */ |
245 | if (ret == -ENOMEM) | 246 | if (ret == -ENOMEM) |
@@ -248,7 +249,7 @@ s390_redo_validation (void) | |||
248 | * panic. | 249 | * panic. |
249 | */ | 250 | */ |
250 | break; | 251 | break; |
251 | } | 252 | } while (schid.sch_no++ < __MAX_SUBCHANNEL); |
252 | } | 253 | } |
253 | 254 | ||
254 | /* | 255 | /* |
@@ -289,12 +290,12 @@ static int cio_ignore_read (char *page, char **start, off_t off, | |||
289 | len = 0; | 290 | len = 0; |
290 | for (devno = off; /* abuse the page variable | 291 | for (devno = off; /* abuse the page variable |
291 | * as counter, see fs/proc/generic.c */ | 292 | * as counter, see fs/proc/generic.c */ |
292 | devno < __MAX_SUBCHANNELS && len + entry_size < count; devno++) { | 293 | devno < __MAX_SUBCHANNEL && len + entry_size < count; devno++) { |
293 | if (!test_bit(devno, bl_dev)) | 294 | if (!test_bit(devno, bl_dev)) |
294 | continue; | 295 | continue; |
295 | len += sprintf(page + len, "0.0.%04lx", devno); | 296 | len += sprintf(page + len, "0.0.%04lx", devno); |
296 | if (test_bit(devno + 1, bl_dev)) { /* print range */ | 297 | if (test_bit(devno + 1, bl_dev)) { /* print range */ |
297 | while (++devno < __MAX_SUBCHANNELS) | 298 | while (++devno < __MAX_SUBCHANNEL) |
298 | if (!test_bit(devno, bl_dev)) | 299 | if (!test_bit(devno, bl_dev)) |
299 | break; | 300 | break; |
300 | len += sprintf(page + len, "-0.0.%04lx", --devno); | 301 | len += sprintf(page + len, "-0.0.%04lx", --devno); |
@@ -302,7 +303,7 @@ static int cio_ignore_read (char *page, char **start, off_t off, | |||
302 | len += sprintf(page + len, "\n"); | 303 | len += sprintf(page + len, "\n"); |
303 | } | 304 | } |
304 | 305 | ||
305 | if (devno < __MAX_SUBCHANNELS) | 306 | if (devno < __MAX_SUBCHANNEL) |
306 | *eof = 1; | 307 | *eof = 1; |
307 | *start = (char *) (devno - off); /* number of checked entries */ | 308 | *start = (char *) (devno - off); /* number of checked entries */ |
308 | return len; | 309 | return len; |