diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-10-10 15:33:22 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-10-10 15:33:58 -0400 |
commit | 5a0d0e65379256b4da2c9092e197a2c761f51c01 (patch) | |
tree | 4dbac2b5498ad7ce1bd88d8bdfe6303169b9560c /drivers/s390/cio/cio.c | |
parent | b2300b9efe1b8174833e17f37e975c9da00c388a (diff) |
[S390] Move private simple udelay function to arch/s390/lib/delay.c.
Move cio's private simple udelay function to lib/delay.c and turn it
into something much more readable. So we have all implementations
at one place.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/cio.c')
-rw-r--r-- | drivers/s390/cio/cio.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index c0cb72547256..3db2c386546f 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -859,19 +859,6 @@ __disable_subchannel_easy(struct subchannel_id schid, struct schib *schib) | |||
859 | return -EBUSY; /* uhm... */ | 859 | return -EBUSY; /* uhm... */ |
860 | } | 860 | } |
861 | 861 | ||
862 | /* we can't use the normal udelay here, since it enables external interrupts */ | ||
863 | |||
864 | static void udelay_reset(unsigned long usecs) | ||
865 | { | ||
866 | uint64_t start_cc, end_cc; | ||
867 | |||
868 | asm volatile ("STCK %0" : "=m" (start_cc)); | ||
869 | do { | ||
870 | cpu_relax(); | ||
871 | asm volatile ("STCK %0" : "=m" (end_cc)); | ||
872 | } while (((end_cc - start_cc)/4096) < usecs); | ||
873 | } | ||
874 | |||
875 | static int | 862 | static int |
876 | __clear_io_subchannel_easy(struct subchannel_id schid) | 863 | __clear_io_subchannel_easy(struct subchannel_id schid) |
877 | { | 864 | { |
@@ -887,7 +874,7 @@ __clear_io_subchannel_easy(struct subchannel_id schid) | |||
887 | if (schid_equal(&ti.schid, &schid)) | 874 | if (schid_equal(&ti.schid, &schid)) |
888 | return 0; | 875 | return 0; |
889 | } | 876 | } |
890 | udelay_reset(100); | 877 | udelay_simple(100); |
891 | } | 878 | } |
892 | return -EBUSY; | 879 | return -EBUSY; |
893 | } | 880 | } |
@@ -895,7 +882,7 @@ __clear_io_subchannel_easy(struct subchannel_id schid) | |||
895 | static void __clear_chsc_subchannel_easy(void) | 882 | static void __clear_chsc_subchannel_easy(void) |
896 | { | 883 | { |
897 | /* It seems we can only wait for a bit here :/ */ | 884 | /* It seems we can only wait for a bit here :/ */ |
898 | udelay_reset(100); | 885 | udelay_simple(100); |
899 | } | 886 | } |
900 | 887 | ||
901 | static int pgm_check_occured; | 888 | static int pgm_check_occured; |