Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110822
b: refs/heads/master
c: 5a0d0e6
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Oct 10, 2008
1 parent 4dd3e71 commit 57966ed
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2300b9efe1b8174833e17f37e975c9da00c388a
refs/heads/master: 5a0d0e65379256b4da2c9092e197a2c761f51c01
1 change: 1 addition & 0 deletions trunk/arch/s390/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define _S390_DELAY_H

extern void __udelay(unsigned long usecs);
extern void udelay_simple(unsigned long usecs);
extern void __delay(unsigned long loops);

#define udelay(n) __udelay(n)
Expand Down
13 changes: 13 additions & 0 deletions trunk/arch/s390/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,16 @@ void __udelay(unsigned long usecs)
local_irq_restore(flags);
preempt_enable();
}

/*
* Simple udelay variant. To be used on startup and reboot
* when the interrupt handler isn't working.
*/
void udelay_simple(unsigned long usecs)
{
u64 end;

end = get_clock() + ((u64) usecs << 12);
while (get_clock() < end)
cpu_relax();
}
17 changes: 2 additions & 15 deletions trunk/drivers/s390/cio/cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,19 +859,6 @@ __disable_subchannel_easy(struct subchannel_id schid, struct schib *schib)
return -EBUSY; /* uhm... */
}

/* we can't use the normal udelay here, since it enables external interrupts */

static void udelay_reset(unsigned long usecs)
{
uint64_t start_cc, end_cc;

asm volatile ("STCK %0" : "=m" (start_cc));
do {
cpu_relax();
asm volatile ("STCK %0" : "=m" (end_cc));
} while (((end_cc - start_cc)/4096) < usecs);
}

static int
__clear_io_subchannel_easy(struct subchannel_id schid)
{
Expand All @@ -887,15 +874,15 @@ __clear_io_subchannel_easy(struct subchannel_id schid)
if (schid_equal(&ti.schid, &schid))
return 0;
}
udelay_reset(100);
udelay_simple(100);
}
return -EBUSY;
}

static void __clear_chsc_subchannel_easy(void)
{
/* It seems we can only wait for a bit here :/ */
udelay_reset(100);
udelay_simple(100);
}

static int pgm_check_occured;
Expand Down

0 comments on commit 57966ed

Please sign in to comment.