Skip to content

Commit 748f7f3

Browse files
Martin SchwidefskyLinus Torvalds
authored andcommitted
[PATCH] s390 (2/7): common i/o layer.
- Remove atomic_read hack to test for presence of ccw device directory. - Add dummy release function to channel path object and cu3088 group devices. - Don't rely on the chaining bit of the channel report word. - Don't call schedule while holding a lock in read_dev_chars/read_conf_data.
1 parent 834bf64 commit 748f7f3

File tree

6 files changed

+39
-29
lines changed

6 files changed

+39
-29
lines changed

drivers/s390/cio/ccwgroup.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* drivers/s390/cio/ccwgroup.c
33
* bus driver for ccwgroup
4-
* $Revision: 1.15 $
4+
* $Revision: 1.17 $
55
*
66
* Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
77
* IBM Corporation
@@ -67,10 +67,7 @@ __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev)
6767
for (i = 0; i < gdev->count; i++) {
6868
sprintf(str, "cdev%d", i);
6969
sysfs_remove_link(&gdev->dev.kobj, str);
70-
/* Hack: Make sure we act on still valid subdirs. */
71-
if (atomic_read(&gdev->cdev[i]->dev.kobj.dentry->d_count))
72-
sysfs_remove_link(&gdev->cdev[i]->dev.kobj,
73-
"group_device");
70+
sysfs_remove_link(&gdev->cdev[i]->dev.kobj, "group_device");
7471
}
7572

7673
}
@@ -187,7 +184,7 @@ ccwgroup_create(struct device *root,
187184
.dev = {
188185
.bus = &ccwgroup_bus_type,
189186
.parent = root,
190-
.release = &ccwgroup_release,
187+
.release = ccwgroup_release,
191188
},
192189
};
193190

drivers/s390/cio/chsc.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* drivers/s390/cio/chsc.c
33
* S/390 common I/O routines -- channel subsystem call
4-
* $Revision: 1.77 $
4+
* $Revision: 1.78 $
55
*
66
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
77
* IBM Corporation
@@ -843,6 +843,12 @@ chp_status_write(struct device *dev, const char *buf, size_t count)
843843

844844
static DEVICE_ATTR(status, 0644, chp_status_show, chp_status_write);
845845

846+
847+
static void
848+
chp_release(struct device *dev)
849+
{
850+
}
851+
846852
/*
847853
* Entries for chpids on the system bus.
848854
* This replaces /proc/chpids.
@@ -863,8 +869,10 @@ new_channel_path(int chpid, int status)
863869
/* fill in status, etc. */
864870
chp->id = chpid;
865871
chp->state = status;
866-
chp->dev.parent = &css_bus_device;
867-
872+
chp->dev = (struct device) {
873+
.parent = &css_bus_device,
874+
.release = chp_release,
875+
};
868876
snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid);
869877

870878
/* make it known to the system */

drivers/s390/cio/device_ops.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ ccw_device_wake_up(struct ccw_device *cdev, unsigned long ip, struct irb *irb)
244244
}
245245

246246
static inline int
247-
__ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic,
248-
unsigned long flags)
247+
__ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic)
249248
{
250249
int ret;
251250
struct subchannel *sch;
@@ -255,20 +254,22 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic,
255254
ret = cio_start (sch, ccw, magic, 0);
256255
if ((ret == -EBUSY) || (ret == -EACCES)) {
257256
/* Try again later. */
257+
spin_unlock_irq(&sch->lock);
258258
schedule_timeout(1);
259+
spin_lock_irq(&sch->lock);
259260
continue;
260261
}
261262
if (ret != 0)
262263
/* Non-retryable error. */
263264
break;
264265
/* Wait for end of request. */
265266
cdev->private->intparm = magic;
266-
spin_unlock_irqrestore(&sch->lock, flags);
267+
spin_unlock_irq(&sch->lock);
267268
wait_event(cdev->private->wait_q,
268269
(cdev->private->intparm == -EIO) ||
269270
(cdev->private->intparm == -EAGAIN) ||
270271
(cdev->private->intparm == 0));
271-
spin_lock_irqsave(&sch->lock, flags);
272+
spin_lock_irq(&sch->lock);
272273
/* Check at least for channel end / device end */
273274
if (cdev->private->intparm == -EIO) {
274275
/* Non-retryable error. */
@@ -279,7 +280,9 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic,
279280
/* Success. */
280281
break;
281282
/* Try again later. */
283+
spin_unlock_irq(&sch->lock);
282284
schedule_timeout(1);
285+
spin_lock_irq(&sch->lock);
283286
} while (1);
284287

285288
return ret;
@@ -300,7 +303,6 @@ read_dev_chars (struct ccw_device *cdev, void **buffer, int length)
300303
{
301304
void (*handler)(struct ccw_device *, unsigned long, struct irb *);
302305
char dbf_txt[15];
303-
unsigned long flags;
304306
struct subchannel *sch;
305307
int ret;
306308
struct ccw1 *rdc_ccw;
@@ -327,7 +329,7 @@ read_dev_chars (struct ccw_device *cdev, void **buffer, int length)
327329
return ret;
328330
}
329331

330-
spin_lock_irqsave(&sch->lock, flags);
332+
spin_lock_irq(&sch->lock);
331333
/* Save interrupt handler. */
332334
handler = cdev->handler;
333335
/* Temporarily install own handler. */
@@ -338,11 +340,11 @@ read_dev_chars (struct ccw_device *cdev, void **buffer, int length)
338340
ret = -EBUSY;
339341
else
340342
/* 0x00D9C4C3 == ebcdic "RDC" */
341-
ret = __ccw_device_retry_loop(cdev, rdc_ccw, 0x00D9C4C3, flags);
343+
ret = __ccw_device_retry_loop(cdev, rdc_ccw, 0x00D9C4C3);
342344

343345
/* Restore interrupt handler. */
344346
cdev->handler = handler;
345-
spin_unlock_irqrestore(&sch->lock, flags);
347+
spin_unlock_irq(&sch->lock);
346348

347349
clear_normalized_cda (rdc_ccw);
348350
kfree(rdc_ccw);
@@ -360,7 +362,6 @@ read_conf_data (struct ccw_device *cdev, void **buffer, int *length)
360362
char dbf_txt[15];
361363
struct subchannel *sch;
362364
struct ciw *ciw;
363-
unsigned long flags;
364365
char *rcd_buf;
365366
int ret;
366367
struct ccw1 *rcd_ccw;
@@ -396,7 +397,7 @@ read_conf_data (struct ccw_device *cdev, void **buffer, int *length)
396397
rcd_ccw->count = ciw->count;
397398
rcd_ccw->flags = CCW_FLAG_SLI;
398399

399-
spin_lock_irqsave(&sch->lock, flags);
400+
spin_lock_irq(&sch->lock);
400401
/* Save interrupt handler. */
401402
handler = cdev->handler;
402403
/* Temporarily install own handler. */
@@ -407,11 +408,11 @@ read_conf_data (struct ccw_device *cdev, void **buffer, int *length)
407408
ret = -EBUSY;
408409
else
409410
/* 0x00D9C3C4 == ebcdic "RCD" */
410-
ret = __ccw_device_retry_loop(cdev, rcd_ccw, 0x00D9C3C4, flags);
411+
ret = __ccw_device_retry_loop(cdev, rcd_ccw, 0x00D9C3C4);
411412

412413
/* Restore interrupt handler. */
413414
cdev->handler = handler;
414-
spin_unlock_irqrestore(&sch->lock, flags);
415+
spin_unlock_irq(&sch->lock);
415416

416417
/*
417418
* on success we update the user input parms

drivers/s390/cio/qdio.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <asm/io.h>
4444
#include <asm/atomic.h>
4545
#include <asm/semaphore.h>
46+
#include <asm/timex.h>
4647

4748
#include <asm/debug.h>
4849
#include <asm/qdio.h>
@@ -55,7 +56,7 @@
5556
#include "ioasm.h"
5657
#include "chsc.h"
5758

58-
#define VERSION_QDIO_C "$Revision: 1.61 $"
59+
#define VERSION_QDIO_C "$Revision: 1.62 $"
5960

6061
/****************** MODULE PARAMETER VARIABLES ********************/
6162
MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>");
@@ -112,10 +113,7 @@ qdio_min(int a,int b)
112113
static inline volatile __u64
113114
qdio_get_micros(void)
114115
{
115-
__u64 time;
116-
117-
asm volatile ("STCK %0" : "=m" (time));
118-
return time>>12; /* time>>12 is microseconds*/
116+
return (get_clock() >> 12); /* time>>12 is microseconds */
119117
}
120118

121119
/*

drivers/s390/net/cu3088.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: cu3088.c,v 1.30 2003/08/28 11:14:11 cohuck Exp $
2+
* $Id: cu3088.c,v 1.31 2003/09/29 15:24:27 cohuck Exp $
33
*
44
* CTC / LCS ccw_device driver
55
*
@@ -55,8 +55,14 @@ static struct ccw_device_id cu3088_ids[] = {
5555

5656
static struct ccw_driver cu3088_driver;
5757

58+
static void
59+
cu3088_root_dev_release (struct device *dev)
60+
{
61+
}
62+
5863
struct device cu3088_root_dev = {
5964
.bus_id = "cu3088",
65+
.release = cu3088_root_dev_release,
6066
};
6167

6268
static ssize_t

drivers/s390/s390mach.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ s390_collect_crw_info(void)
4444
struct crw crw;
4545
int ccode;
4646

47-
do {
47+
while (1) {
4848
ccode = stcrw(&crw);
4949
if (ccode != 0)
5050
break;
@@ -85,7 +85,7 @@ s390_collect_crw_info(void)
8585
pr_debug("unknown source\n");
8686
break;
8787
}
88-
} while (crw.chn);
88+
}
8989
}
9090

9191
/*

0 commit comments

Comments
 (0)