Skip to content

Commit

Permalink
s390/pci: no msleep in potential IRQ context
Browse files Browse the repository at this point in the history
The PCI instructions may be used in IRQ context so scheduling is forbidden.
Use udelay and shorten the delay since we are now polling.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Dec 5, 2012
1 parent bafff17 commit c59b9f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/s390/include/asm/pci_insn.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <linux/delay.h>

#define ZPCI_INSN_BUSY_DELAY 1 /* 1 millisecond */
#define ZPCI_INSN_BUSY_DELAY 1 /* 1 microsecond */

/* Load/Store status codes */
#define ZPCI_PCI_ST_FUNC_NOT_ENABLED 4
Expand Down Expand Up @@ -138,7 +138,7 @@ static inline int rpcit_instr(u64 fn, u64 addr, u64 range)
do {
cc = __rpcit(fn, addr, range, &status);
if (cc == 2)
msleep(ZPCI_INSN_BUSY_DELAY);
udelay(ZPCI_INSN_BUSY_DELAY);
} while (cc == 2);

if (cc)
Expand Down Expand Up @@ -198,7 +198,7 @@ static inline int pcilg_instr(u64 *data, u64 req, u64 offset)
do {
cc = __pcilg(data, req, offset, &status);
if (cc == 2)
msleep(ZPCI_INSN_BUSY_DELAY);
udelay(ZPCI_INSN_BUSY_DELAY);
} while (cc == 2);

if (cc) {
Expand Down Expand Up @@ -236,7 +236,7 @@ static inline int pcistg_instr(u64 data, u64 req, u64 offset)
do {
cc = __pcistg(data, req, offset, &status);
if (cc == 2)
msleep(ZPCI_INSN_BUSY_DELAY);
udelay(ZPCI_INSN_BUSY_DELAY);
} while (cc == 2);

if (cc)
Expand Down Expand Up @@ -268,7 +268,7 @@ static inline int pcistb_instr(const u64 *data, u64 req, u64 offset)
do {
cc = __pcistb(data, req, offset, &status);
if (cc == 2)
msleep(ZPCI_INSN_BUSY_DELAY);
udelay(ZPCI_INSN_BUSY_DELAY);
} while (cc == 2);

if (cc)
Expand Down

0 comments on commit c59b9f9

Please sign in to comment.