s390/airq: pass more TPI info to airq handlers

A subsequent patch will introduce an airq handler that requires additional
TPI information beyond directed vs floating, so pass the entire tpi_info
structure via the handler.  Only pci actually uses this information today,
for the other airq handlers this is effectively a no-op.

Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20220606203325.110625-6-mjrosato@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
This commit is contained in:
Matthew Rosato 2022-06-06 16:33:09 -04:00 committed by Christian Borntraeger
parent b05a870c5e
commit d2197485a1
7 changed files with 26 additions and 11 deletions

View File

@ -12,10 +12,11 @@
#include <linux/bit_spinlock.h> #include <linux/bit_spinlock.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <asm/tpi.h>
struct airq_struct { struct airq_struct {
struct hlist_node list; /* Handler queueing. */ struct hlist_node list; /* Handler queueing. */
void (*handler)(struct airq_struct *airq, bool floating); void (*handler)(struct airq_struct *airq, struct tpi_info *tpi_info);
u8 *lsi_ptr; /* Local-Summary-Indicator pointer */ u8 *lsi_ptr; /* Local-Summary-Indicator pointer */
u8 lsi_mask; /* Local-Summary-Indicator mask */ u8 lsi_mask; /* Local-Summary-Indicator mask */
u8 isc; /* Interrupt-subclass */ u8 isc; /* Interrupt-subclass */

View File

@ -28,6 +28,7 @@
#include <asm/switch_to.h> #include <asm/switch_to.h>
#include <asm/nmi.h> #include <asm/nmi.h>
#include <asm/airq.h> #include <asm/airq.h>
#include <asm/tpi.h>
#include "kvm-s390.h" #include "kvm-s390.h"
#include "gaccess.h" #include "gaccess.h"
#include "trace-s390.h" #include "trace-s390.h"
@ -3311,7 +3312,8 @@ int kvm_s390_gisc_unregister(struct kvm *kvm, u32 gisc)
} }
EXPORT_SYMBOL_GPL(kvm_s390_gisc_unregister); EXPORT_SYMBOL_GPL(kvm_s390_gisc_unregister);
static void gib_alert_irq_handler(struct airq_struct *airq, bool floating) static void gib_alert_irq_handler(struct airq_struct *airq,
struct tpi_info *tpi_info)
{ {
inc_irq_stat(IRQIO_GAL); inc_irq_stat(IRQIO_GAL);
process_gib_alert_list(); process_gib_alert_list();

View File

@ -11,6 +11,7 @@
#include <asm/isc.h> #include <asm/isc.h>
#include <asm/airq.h> #include <asm/airq.h>
#include <asm/tpi.h>
static enum {FLOATING, DIRECTED} irq_delivery; static enum {FLOATING, DIRECTED} irq_delivery;
@ -216,8 +217,11 @@ static void zpci_handle_fallback_irq(void)
} }
} }
static void zpci_directed_irq_handler(struct airq_struct *airq, bool floating) static void zpci_directed_irq_handler(struct airq_struct *airq,
struct tpi_info *tpi_info)
{ {
bool floating = !tpi_info->directed_irq;
if (floating) { if (floating) {
inc_irq_stat(IRQIO_PCF); inc_irq_stat(IRQIO_PCF);
zpci_handle_fallback_irq(); zpci_handle_fallback_irq();
@ -227,7 +231,8 @@ static void zpci_directed_irq_handler(struct airq_struct *airq, bool floating)
} }
} }
static void zpci_floating_irq_handler(struct airq_struct *airq, bool floating) static void zpci_floating_irq_handler(struct airq_struct *airq,
struct tpi_info *tpi_info)
{ {
unsigned long si, ai; unsigned long si, ai;
struct airq_iv *aibv; struct airq_iv *aibv;

View File

@ -99,7 +99,7 @@ static irqreturn_t do_airq_interrupt(int irq, void *dummy)
rcu_read_lock(); rcu_read_lock();
hlist_for_each_entry_rcu(airq, head, list) hlist_for_each_entry_rcu(airq, head, list)
if ((*airq->lsi_ptr & airq->lsi_mask) != 0) if ((*airq->lsi_ptr & airq->lsi_mask) != 0)
airq->handler(airq, !tpi_info->directed_irq); airq->handler(airq, tpi_info);
rcu_read_unlock(); rcu_read_unlock();
return IRQ_HANDLED; return IRQ_HANDLED;

View File

@ -15,6 +15,7 @@
#include <asm/qdio.h> #include <asm/qdio.h>
#include <asm/airq.h> #include <asm/airq.h>
#include <asm/isc.h> #include <asm/isc.h>
#include <asm/tpi.h>
#include "cio.h" #include "cio.h"
#include "ioasm.h" #include "ioasm.h"
@ -93,9 +94,10 @@ static inline u32 clear_shared_ind(void)
/** /**
* tiqdio_thinint_handler - thin interrupt handler for qdio * tiqdio_thinint_handler - thin interrupt handler for qdio
* @airq: pointer to adapter interrupt descriptor * @airq: pointer to adapter interrupt descriptor
* @floating: flag to recognize floating vs. directed interrupts (unused) * @tpi_info: interrupt information (e.g. floating vs directed -- unused)
*/ */
static void tiqdio_thinint_handler(struct airq_struct *airq, bool floating) static void tiqdio_thinint_handler(struct airq_struct *airq,
struct tpi_info *tpi_info)
{ {
u64 irq_time = S390_lowcore.int_clock; u64 irq_time = S390_lowcore.int_clock;
u32 si_used = clear_shared_ind(); u32 si_used = clear_shared_ind();

View File

@ -27,6 +27,7 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <asm/airq.h> #include <asm/airq.h>
#include <asm/tpi.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/isc.h> #include <asm/isc.h>
#include <linux/hrtimer.h> #include <linux/hrtimer.h>
@ -131,7 +132,8 @@ static int ap_max_adapter_id = 63;
static struct bus_type ap_bus_type; static struct bus_type ap_bus_type;
/* Adapter interrupt definitions */ /* Adapter interrupt definitions */
static void ap_interrupt_handler(struct airq_struct *airq, bool floating); static void ap_interrupt_handler(struct airq_struct *airq,
struct tpi_info *tpi_info);
static bool ap_irq_flag; static bool ap_irq_flag;
@ -452,9 +454,10 @@ static enum hrtimer_restart ap_poll_timeout(struct hrtimer *unused)
/** /**
* ap_interrupt_handler() - Schedule ap_tasklet on interrupt * ap_interrupt_handler() - Schedule ap_tasklet on interrupt
* @airq: pointer to adapter interrupt descriptor * @airq: pointer to adapter interrupt descriptor
* @floating: ignored * @tpi_info: ignored
*/ */
static void ap_interrupt_handler(struct airq_struct *airq, bool floating) static void ap_interrupt_handler(struct airq_struct *airq,
struct tpi_info *tpi_info)
{ {
inc_irq_stat(IRQIO_APB); inc_irq_stat(IRQIO_APB);
tasklet_schedule(&ap_tasklet); tasklet_schedule(&ap_tasklet);

View File

@ -33,6 +33,7 @@
#include <asm/virtio-ccw.h> #include <asm/virtio-ccw.h>
#include <asm/isc.h> #include <asm/isc.h>
#include <asm/airq.h> #include <asm/airq.h>
#include <asm/tpi.h>
/* /*
* virtio related functions * virtio related functions
@ -204,7 +205,8 @@ static void drop_airq_indicator(struct virtqueue *vq, struct airq_info *info)
write_unlock_irqrestore(&info->lock, flags); write_unlock_irqrestore(&info->lock, flags);
} }
static void virtio_airq_handler(struct airq_struct *airq, bool floating) static void virtio_airq_handler(struct airq_struct *airq,
struct tpi_info *tpi_info)
{ {
struct airq_info *info = container_of(airq, struct airq_info, airq); struct airq_info *info = container_of(airq, struct airq_info, airq);
unsigned long ai; unsigned long ai;