Skip to content

Commit

Permalink
s390: fix setting of mio addressing control
Browse files Browse the repository at this point in the history
Move enablement of mio addressing control from detect_machine_facilities
to pci_base_init. detect_machine_facilities runs so early that the
static branches have not been toggled yet, thus mio addressing control
was always off. In pci_base_init we have to use the SMP aware
ctl_set_bit though.

Fixes: 833b441 ("s390: enable processes for mio instructions")
Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
  • Loading branch information
Sebastian Ott authored and Vasily Gorbik committed Jul 11, 2019
1 parent 1b2be20 commit 9964f39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions arch/s390/include/asm/pci_insn.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,4 @@ static inline int zpci_set_irq_ctrl(u16 ctl, u8 isc)
return __zpci_set_irq_ctrl(ctl, isc, &iib);
}

#ifdef CONFIG_PCI
static inline void enable_mio_ctl(void)
{
if (static_branch_likely(&have_mio))
__ctl_set_bit(2, 5);
}
#else /* CONFIG_PCI */
static inline void enable_mio_ctl(void) {}
#endif /* CONFIG_PCI */

#endif
2 changes: 0 additions & 2 deletions arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <asm/sclp.h>
#include <asm/facility.h>
#include <asm/boot_data.h>
#include <asm/pci_insn.h>
#include "entry.h"

/*
Expand Down Expand Up @@ -236,7 +235,6 @@ static __init void detect_machine_facilities(void)
clock_comparator_max = -1ULL >> 1;
__ctl_set_bit(0, 53);
}
enable_mio_ctl();
}

static inline void save_vector_registers(void)
Expand Down
4 changes: 3 additions & 1 deletion arch/s390/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,10 @@ static int __init pci_base_init(void)
if (!test_facility(69) || !test_facility(71))
return 0;

if (test_facility(153) && !s390_pci_no_mio)
if (test_facility(153) && !s390_pci_no_mio) {
static_branch_enable(&have_mio);
ctl_set_bit(2, 5);
}

rc = zpci_debug_init();
if (rc)
Expand Down

0 comments on commit 9964f39

Please sign in to comment.