Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343401
b: refs/heads/master
c: 9a4da8a
h: refs/heads/master
i:
  343399: 6e4dd95
v: v3
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Nov 30, 2012
1 parent dc1e2ec commit 3e09084
Show file tree
Hide file tree
Showing 12 changed files with 684 additions and 8 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: e56e4e87e370a0f121450d52337969aa1be21ff7
refs/heads/master: 9a4da8a5b109906a64bed5aaeb83bf4edb1f5888
22 changes: 22 additions & 0 deletions trunk/arch/s390/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef _HW_IRQ_H
#define _HW_IRQ_H

#include <linux/msi.h>
#include <linux/pci.h>

static inline struct msi_desc *irq_get_msi_desc(unsigned int irq)
{
return __irq_get_msi_desc(irq);
}

/* Must be called with msi map lock held */
static inline int irq_set_msi_desc(unsigned int irq, struct msi_desc *msi)
{
if (!msi)
return -EINVAL;

msi->irq = irq;
return 0;
}

#endif
12 changes: 12 additions & 0 deletions trunk/arch/s390/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ enum interruption_class {
IOINT_APB,
IOINT_ADM,
IOINT_CSC,
IOINT_PCI,
IOINT_MSI,
NMI_NMI,
NR_IRQS,
};
Expand All @@ -51,4 +53,14 @@ void service_subclass_irq_unregister(void);
void measurement_alert_subclass_register(void);
void measurement_alert_subclass_unregister(void);

#ifdef CONFIG_LOCKDEP
# define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
# define disable_irq_nosync_lockdep_irqsave(irq, flags) \
disable_irq_nosync(irq)
# define disable_irq_lockdep(irq) disable_irq(irq)
# define enable_irq_lockdep(irq) enable_irq(irq)
# define enable_irq_lockdep_irqrestore(irq, flags) \
enable_irq(irq)
#endif

#endif /* _ASM_IRQ_H */
1 change: 1 addition & 0 deletions trunk/arch/s390/include/asm/isc.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define CHSC_SCH_ISC 7 /* CHSC subchannels */
/* Adapter interrupts. */
#define QDIO_AIRQ_ISC IO_SCH_ISC /* I/O subchannel in qdio mode */
#define PCI_ISC 2 /* PCI I/O subchannels */
#define AP_ISC 6 /* adjunct processor (crypto) devices */

/* Functions for registration of I/O interruption subclasses */
Expand Down
27 changes: 27 additions & 0 deletions trunk/arch/s390/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ void pci_iounmap(struct pci_dev *, void __iomem *);
int pci_domain_nr(struct pci_bus *);
int pci_proc_domain(struct pci_bus *);

/* MSI arch hooks */
#define arch_setup_msi_irqs arch_setup_msi_irqs
#define arch_teardown_msi_irqs arch_teardown_msi_irqs

#define ZPCI_BUS_NR 0 /* default bus number */
#define ZPCI_DEVFN 0 /* default device number */

Expand All @@ -29,6 +33,15 @@ int pci_proc_domain(struct pci_bus *);
#define ZPCI_FC_BLOCKED 0x20
#define ZPCI_FC_DMA_ENABLED 0x10

struct msi_map {
unsigned long irq;
struct msi_desc *msi;
struct hlist_node msi_chain;
};

#define ZPCI_NR_MSI_VECS 64
#define ZPCI_MSI_MASK (ZPCI_NR_MSI_VECS - 1)

enum zpci_state {
ZPCI_FN_STATE_RESERVED,
ZPCI_FN_STATE_STANDBY,
Expand Down Expand Up @@ -56,6 +69,12 @@ struct zpci_dev {
u8 pfgid; /* function group ID */
u16 domain;

/* IRQ stuff */
u64 msi_addr; /* MSI address */
struct zdev_irq_map *irq_map;
struct msi_map *msi_map[ZPCI_NR_MSI_VECS];
unsigned int aisb; /* number of the summary bit */

struct zpci_bar_struct bars[PCI_BAR_COUNT];

enum pci_bus_speed max_bus_speed;
Expand Down Expand Up @@ -83,6 +102,14 @@ int clp_add_pci_device(u32, u32, int);
int clp_enable_fh(struct zpci_dev *, u8);
int clp_disable_fh(struct zpci_dev *);

/* MSI */
struct msi_desc *__irq_get_msi_desc(unsigned int);
int zpci_msi_set_mask_bits(struct msi_desc *, u32, u32);
int zpci_setup_msi_irq(struct zpci_dev *, struct msi_desc *, unsigned int, int);
void zpci_teardown_msi_irq(struct zpci_dev *, struct msi_desc *);
int zpci_msihash_init(void);
void zpci_msihash_exit(void);

/* Helpers */
struct zpci_dev *get_zdev(struct pci_dev *);
struct zpci_dev *get_zdev_by_fid(u32);
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/s390/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ static const struct irq_class intrclass_names[] = {
[IOINT_APB] = {.name = "APB", .desc = "[I/O] AP Bus"},
[IOINT_ADM] = {.name = "ADM", .desc = "[I/O] EADM Subchannel"},
[IOINT_CSC] = {.name = "CSC", .desc = "[I/O] CHSC Subchannel"},
[IOINT_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" },
[IOINT_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" },
[NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"},
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Makefile for the s390 PCI subsystem.
#

obj-$(CONFIG_PCI) += pci.o pci_clp.o
obj-$(CONFIG_PCI) += pci.o pci_clp.o pci_msi.o
Loading

0 comments on commit 3e09084

Please sign in to comment.