Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review/opal irq #185

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
202648a
powerpc: Constify irq_domain_ops
krzk Apr 27, 2015
2222ce0
powerpc/pseries: Fix possible leaked device node reference
nfont Apr 30, 2015
f1e7c20
powerpc: Make STRICT_MM_TYPECHECKS a config option
mpe Mar 25, 2015
5af7a6f
powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y
mpe Apr 10, 2015
5c0aebf
powerpc: Show utsname->machine in boot-up banner
mpe Apr 15, 2015
e79c838
powerpc: Don't do gcc version checks if we're building with clang
mpe Apr 21, 2015
60e065f
powerpc: Reject binutils 2.24 when building little endian
mpe Apr 23, 2015
63da88d
powerpc/vdso: Remove unused debug code
mpe Apr 22, 2015
6e5c077
powerpc/vdso: Combine start/size variables
mpe Apr 22, 2015
e0d0059
powerpc/vdso: Disable building the 32-bit VDSO on little endian
mpe May 11, 2015
a14ab6b
powerpc/cell: Drop cbe-oss-dev mailing list from MAINTAINERS
mpe May 1, 2015
38c0488
powerpc/powernv: Silence SYSPARAM warning on boot
shenki Apr 30, 2015
ed3e81f
powerpc/eeh: Move PE state constants around
Mar 26, 2015
ec33d36
powerpc/eeh: Introduce eeh_pe_inject_err()
Mar 26, 2015
68cbbc3
drivers/vfio: Support EEH error injection
Mar 26, 2015
3721352
powerpc/eeh: fix start/end/flags type in struct pci_io_addr_range{}
Apr 27, 2015
2ac3990
powerpc/eeh: fix comment for wait_state()
Apr 27, 2015
e17866d
powerpc/eeh: fix powernv_eeh_wait_state delay logic
Apr 27, 2015
f77ceb7
powerpc/eeh: remove unused macro IS_BRIDGE
Apr 27, 2015
636f0ca
powerpc/powernv: Reorder OPAL subsystem initialisation
apopple May 15, 2015
48d4d6a
powerpc/powernv: Add a virtual irqchip for opal events
apopple May 15, 2015
982209d
ipmi/powernv: Convert to irq event interface
apopple May 15, 2015
581db24
hvc: Convert to using interrupts instead of opal events
apopple May 15, 2015
d08367d
powernv/eeh: Update the EEH code to use the opal irq domain
apopple May 15, 2015
b43cd82
powernv/opal: Convert opal message events to opal irq domain
apopple May 15, 2015
f363354
powernv/elog: Convert elog to opal irq domain
apopple May 15, 2015
6afa005
powernv/opal-dump: Convert to irq domain
apopple May 15, 2015
ab7937e
opal: Remove events notifier
apopple May 15, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Documentation/vfio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,18 @@ The code flow from the example above should be slightly changed:

....

/* Inject EEH error, which is expected to be caused by 32-bits
* config load.
*/
pe_op.op = VFIO_EEH_PE_INJECT_ERR;
pe_op.err.type = EEH_ERR_TYPE_32;
pe_op.err.func = EEH_ERR_FUNC_LD_CFG_ADDR;
pe_op.err.addr = 0ul;
pe_op.err.mask = 0ul;
ioctl(container, VFIO_EEH_PE_OP, &pe_op);

....

/* When 0xFF's returned from reading PCI config space or IO BARs
* of the PCI device. Check the PE's state to see if that has been
* frozen.
Expand Down
7 changes: 2 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,6 @@ F: Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
CELL BROADBAND ENGINE ARCHITECTURE
M: Arnd Bergmann <arnd@arndb.de>
L: linuxppc-dev@lists.ozlabs.org
L: cbe-oss-dev@lists.ozlabs.org
W: http://www.ibm.com/developerworks/power/cell/
S: Supported
F: arch/powerpc/include/asm/cell*.h
Expand Down Expand Up @@ -7840,14 +7839,13 @@ F: drivers/net/wireless/prism54/
PS3 NETWORK SUPPORT
M: Geoff Levand <geoff@infradead.org>
L: netdev@vger.kernel.org
L: cbe-oss-dev@lists.ozlabs.org
L: linuxppc-dev@lists.ozlabs.org
S: Maintained
F: drivers/net/ethernet/toshiba/ps3_gelic_net.*

PS3 PLATFORM SUPPORT
M: Geoff Levand <geoff@infradead.org>
L: linuxppc-dev@lists.ozlabs.org
L: cbe-oss-dev@lists.ozlabs.org
S: Maintained
F: arch/powerpc/boot/ps3*
F: arch/powerpc/include/asm/lv1call.h
Expand All @@ -7861,7 +7859,7 @@ F: sound/ppc/snd_ps3*

PS3VRAM DRIVER
M: Jim Paris <jim@jtan.com>
L: cbe-oss-dev@lists.ozlabs.org
L: linuxppc-dev@lists.ozlabs.org
S: Maintained
F: drivers/block/ps3vram.c

Expand Down Expand Up @@ -9337,7 +9335,6 @@ F: drivers/net/ethernet/toshiba/spider_net*
SPU FILE SYSTEM
M: Jeremy Kerr <jk@ozlabs.org>
L: linuxppc-dev@lists.ozlabs.org
L: cbe-oss-dev@lists.ozlabs.org
W: http://www.ibm.com/developerworks/power/cell/
S: Supported
F: Documentation/filesystems/spufs.txt
Expand Down
8 changes: 8 additions & 0 deletions arch/powerpc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ config PPC_WERROR
depends on !PPC_DISABLE_WERROR
default y

config STRICT_MM_TYPECHECKS
bool "Do extra type checking on mm types"
default n
help
This option turns on extra type checking for some mm related types.

If you don't know what this means, say N.

config PRINT_STACK_DEPTH
int "Stack depth to print" if DEBUG_KERNEL
default 64
Expand Down
17 changes: 14 additions & 3 deletions arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,28 +314,39 @@ TOUT := .tmp_gas_check
# - Require gcc 4.0 or above on 64-bit
# - gcc-4.2.0 has issues compiling modules on 64-bit
checkbin:
@if test "$(cc-version)" = "0304" ; then \
@if test "${COMPILER}" != "clang" \
&& test "$(cc-version)" = "0304" ; then \
if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
echo 'correctly with gcc-3.4 and your version of binutils.'; \
echo '*** Please upgrade your binutils or downgrade your gcc'; \
false; \
fi ; \
fi
@if test "$(cc-version)" -lt "0400" \
@if test "${COMPILER}" != "clang" \
&& test "$(cc-version)" -lt "0400" \
&& test "x${CONFIG_PPC64}" = "xy" ; then \
echo -n "Sorry, GCC v4.0 or above is required to build " ; \
echo "the 64-bit powerpc kernel." ; \
false ; \
fi
@if test "$(cc-fullversion)" = "040200" \
@if test "${COMPILER}" != "clang" \
&& test "$(cc-fullversion)" = "040200" \
&& test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
echo 'kernel with modules enabled.' ; \
echo -n '*** Please use a different GCC version or ' ; \
echo 'disable kernel modules' ; \
false ; \
fi
@if test "x${CONFIG_CPU_LITTLE_ENDIAN}" = "xy" \
&& $(LD) --version | head -1 | grep ' 2\.24$$' >/dev/null ; then \
echo -n '*** binutils 2.24 miscompiles weak symbols ' ; \
echo 'in some circumstances.' ; \
echo -n '*** Please use a different binutils version.' ; \
false ; \
fi


CLEAN_FILES += $(TOUT)

9 changes: 4 additions & 5 deletions arch/powerpc/include/asm/eeh.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <linux/time.h>
#include <linux/atomic.h>

#include <uapi/asm/eeh.h>

struct pci_dev;
struct pci_bus;
struct pci_dn;
Expand Down Expand Up @@ -185,11 +187,6 @@ enum {
#define EEH_STATE_DMA_ACTIVE (1 << 4) /* Active DMA */
#define EEH_STATE_MMIO_ENABLED (1 << 5) /* MMIO enabled */
#define EEH_STATE_DMA_ENABLED (1 << 6) /* DMA enabled */
#define EEH_PE_STATE_NORMAL 0 /* Normal state */
#define EEH_PE_STATE_RESET 1 /* PE reset asserted */
#define EEH_PE_STATE_STOPPED_IO_DMA 2 /* Frozen PE */
#define EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA, Enabled IO */
#define EEH_PE_STATE_UNAVAIL 5 /* Unavailable */
#define EEH_RESET_DEACTIVATE 0 /* Deactivate the PE reset */
#define EEH_RESET_HOT 1 /* Hot reset */
#define EEH_RESET_FUNDAMENTAL 3 /* Fundamental reset */
Expand Down Expand Up @@ -294,6 +291,8 @@ int eeh_pe_set_option(struct eeh_pe *pe, int option);
int eeh_pe_get_state(struct eeh_pe *pe);
int eeh_pe_reset(struct eeh_pe *pe, int option);
int eeh_pe_configure(struct eeh_pe *pe);
int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
unsigned long addr, unsigned long mask);

/**
* EEH_POSSIBLE_ERROR() -- test for possible MMIO failure.
Expand Down
6 changes: 6 additions & 0 deletions arch/powerpc/include/asm/opal.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ extern int opal_elog_init(void);
extern void opal_platform_dump_init(void);
extern void opal_sys_param_init(void);
extern void opal_msglog_init(void);
extern int opal_async_comp_init(void);
extern int opal_sensor_init(void);
extern int opal_hmi_handler_init(void);
extern int opal_event_init(void);

extern int opal_machine_check(struct pt_regs *regs);
extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
Expand All @@ -250,6 +254,8 @@ extern int opal_resync_timebase(void);

extern void opal_lpc_init(void);

extern int opal_event_request(unsigned int opal_event_nr);

struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
unsigned long vmalloc_size);
void opal_free_sg_list(struct opal_sg_list *sg);
Expand Down
4 changes: 1 addition & 3 deletions arch/powerpc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ extern long long virt_phys_offset;

#ifndef __ASSEMBLY__

#undef STRICT_MM_TYPECHECKS

#ifdef STRICT_MM_TYPECHECKS
#ifdef CONFIG_STRICT_MM_TYPECHECKS
/* These are used to make use of C type-checking. */

/* PTE level */
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/pgtable-ppc64.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
*/
#ifndef __real_pte

#ifdef STRICT_MM_TYPECHECKS
#ifdef CONFIG_STRICT_MM_TYPECHECKS
#define __real_pte(e,p) ((real_pte_t){(e)})
#define __rpte_to_pte(r) ((r).pte)
#else
Expand Down
56 changes: 56 additions & 0 deletions arch/powerpc/include/uapi/asm/eeh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright IBM Corp. 2015
*
* Authors: Gavin Shan <gwshan@linux.vnet.ibm.com>
*/

#ifndef _ASM_POWERPC_EEH_H
#define _ASM_POWERPC_EEH_H

/* PE states */
#define EEH_PE_STATE_NORMAL 0 /* Normal state */
#define EEH_PE_STATE_RESET 1 /* PE reset asserted */
#define EEH_PE_STATE_STOPPED_IO_DMA 2 /* Frozen PE */
#define EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */
#define EEH_PE_STATE_UNAVAIL 5 /* Unavailable */

/* EEH error types and functions */
#define EEH_ERR_TYPE_32 0 /* 32-bits error */
#define EEH_ERR_TYPE_64 1 /* 64-bits error */
#define EEH_ERR_FUNC_MIN 0
#define EEH_ERR_FUNC_LD_MEM_ADDR 0 /* Memory load */
#define EEH_ERR_FUNC_LD_MEM_DATA 1
#define EEH_ERR_FUNC_LD_IO_ADDR 2 /* IO load */
#define EEH_ERR_FUNC_LD_IO_DATA 3
#define EEH_ERR_FUNC_LD_CFG_ADDR 4 /* Config load */
#define EEH_ERR_FUNC_LD_CFG_DATA 5
#define EEH_ERR_FUNC_ST_MEM_ADDR 6 /* Memory store */
#define EEH_ERR_FUNC_ST_MEM_DATA 7
#define EEH_ERR_FUNC_ST_IO_ADDR 8 /* IO store */
#define EEH_ERR_FUNC_ST_IO_DATA 9
#define EEH_ERR_FUNC_ST_CFG_ADDR 10 /* Config store */
#define EEH_ERR_FUNC_ST_CFG_DATA 11
#define EEH_ERR_FUNC_DMA_RD_ADDR 12 /* DMA read */
#define EEH_ERR_FUNC_DMA_RD_DATA 13
#define EEH_ERR_FUNC_DMA_RD_MASTER 14
#define EEH_ERR_FUNC_DMA_RD_TARGET 15
#define EEH_ERR_FUNC_DMA_WR_ADDR 16 /* DMA write */
#define EEH_ERR_FUNC_DMA_WR_DATA 17
#define EEH_ERR_FUNC_DMA_WR_MASTER 18
#define EEH_ERR_FUNC_DMA_WR_TARGET 19
#define EEH_ERR_FUNC_MAX 19

#endif /* _ASM_POWERPC_EEH_H */
3 changes: 2 additions & 1 deletion arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ obj-y := cputable.o ptrace.o syscalls.o \
signal.o sysfs.o cacheinfo.o time.o \
prom.o traps.o setup-common.o \
udbg.o misc.o io.o dma.o \
misc_$(CONFIG_WORD_SIZE).o vdso32/ \
misc_$(CONFIG_WORD_SIZE).o \
of_platform.o prom_parse.o
obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
signal_64.o ptrace32.o \
paca.o nvram_64.o firmware.o
obj-$(CONFIG_VDSO32) += vdso32/
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o
Expand Down
37 changes: 35 additions & 2 deletions arch/powerpc/kernel/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ struct eeh_stats {

static struct eeh_stats eeh_stats;

#define IS_BRIDGE(class_code) (((class_code)<<16) == PCI_BASE_CLASS_BRIDGE)

static int __init eeh_setup(char *str)
{
if (!strcmp(str, "off"))
Expand Down Expand Up @@ -1647,6 +1645,41 @@ int eeh_pe_configure(struct eeh_pe *pe)
}
EXPORT_SYMBOL_GPL(eeh_pe_configure);

/**
* eeh_pe_inject_err - Injecting the specified PCI error to the indicated PE
* @pe: the indicated PE
* @type: error type
* @function: error function
* @addr: address
* @mask: address mask
*
* The routine is called to inject the specified PCI error, which
* is determined by @type and @function, to the indicated PE for
* testing purpose.
*/
int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
unsigned long addr, unsigned long mask)
{
/* Invalid PE ? */
if (!pe)
return -ENODEV;

/* Unsupported operation ? */
if (!eeh_ops || !eeh_ops->err_inject)
return -ENOENT;

/* Check on PCI error type */
if (type != EEH_ERR_TYPE_32 && type != EEH_ERR_TYPE_64)
return -EINVAL;

/* Check on PCI error function */
if (func < EEH_ERR_FUNC_MIN || func > EEH_ERR_FUNC_MAX)
return -EINVAL;

return eeh_ops->err_inject(pe, type, func, addr, mask);
}
EXPORT_SYMBOL_GPL(eeh_pe_inject_err);

static int proc_eeh_show(struct seq_file *m, void *v)
{
if (!eeh_enabled()) {
Expand Down
16 changes: 8 additions & 8 deletions arch/powerpc/kernel/eeh_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
*/
struct pci_io_addr_range {
struct rb_node rb_node;
unsigned long addr_lo;
unsigned long addr_hi;
resource_size_t addr_lo;
resource_size_t addr_hi;
struct eeh_dev *edev;
struct pci_dev *pcidev;
unsigned int flags;
unsigned long flags;
};

static struct pci_io_addr_cache {
Expand Down Expand Up @@ -125,8 +125,8 @@ static void eeh_addr_cache_print(struct pci_io_addr_cache *cache)

/* Insert address range into the rb tree. */
static struct pci_io_addr_range *
eeh_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
unsigned long ahi, unsigned int flags)
eeh_addr_cache_insert(struct pci_dev *dev, resource_size_t alo,
resource_size_t ahi, unsigned long flags)
{
struct rb_node **p = &pci_io_addr_cache_root.rb_root.rb_node;
struct rb_node *parent = NULL;
Expand Down Expand Up @@ -197,9 +197,9 @@ static void __eeh_addr_cache_insert_dev(struct pci_dev *dev)

/* Walk resources on this device, poke them into the tree */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
unsigned long start = pci_resource_start(dev,i);
unsigned long end = pci_resource_end(dev,i);
unsigned int flags = pci_resource_flags(dev,i);
resource_size_t start = pci_resource_start(dev,i);
resource_size_t end = pci_resource_end(dev,i);
unsigned long flags = pci_resource_flags(dev,i);

/* We are interested only bus addresses, not dma or other stuff */
if (0 == (flags & (IORESOURCE_IO | IORESOURCE_MEM)))
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/eeh_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ static void eeh_handle_normal_event(struct eeh_pe *pe)
eeh_pe_dev_traverse(pe, eeh_report_error, &result);

/* Get the current PCI slot state. This can take a long time,
* sometimes over 3 seconds for certain systems.
* sometimes over 300 seconds for certain systems.
*/
rc = eeh_ops->wait_state(pe, MAX_WAIT_FOR_RECOVERY*1000);
if (rc < 0 || rc == EEH_STATE_NOT_SUPPORT) {
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ void __init setup_system(void)
smp_release_cpus();
#endif

pr_info("Starting Linux PPC64 %s\n", init_utsname()->version);
pr_info("Starting Linux %s %s\n", init_utsname()->machine,
init_utsname()->version);

pr_info("-----------------------------------------------------\n");
pr_info("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
Expand Down
Loading