diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2008-01-26 08:10:44 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:11:00 -0500 |
commit | 4e8e56c6713398f417317d449f50c08bf2756c66 (patch) | |
tree | 61c87e58f13faa93de725120cedb2540f058ae32 /drivers/s390/cio/qdio.c | |
parent | cd6b4f27b9bb2a6a5ec82b96b87c85421257be6c (diff) |
[S390] cio: Extend adapter interrupt interface.
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Change the adapter interrupt interface in order to allow multiple
adapter interrupt handlers to be registered. Indicators are now
allocated by cio instead of the device driver.
The qdio parts have been
Acked-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/qdio.c')
-rw-r--r-- | drivers/s390/cio/qdio.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 40a3208c7cf3..7a353db8564f 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -48,11 +48,11 @@ | |||
48 | #include <asm/debug.h> | 48 | #include <asm/debug.h> |
49 | #include <asm/s390_rdev.h> | 49 | #include <asm/s390_rdev.h> |
50 | #include <asm/qdio.h> | 50 | #include <asm/qdio.h> |
51 | #include <asm/airq.h> | ||
51 | 52 | ||
52 | #include "cio.h" | 53 | #include "cio.h" |
53 | #include "css.h" | 54 | #include "css.h" |
54 | #include "device.h" | 55 | #include "device.h" |
55 | #include "airq.h" | ||
56 | #include "qdio.h" | 56 | #include "qdio.h" |
57 | #include "ioasm.h" | 57 | #include "ioasm.h" |
58 | #include "chsc.h" | 58 | #include "chsc.h" |
@@ -96,7 +96,7 @@ static debug_info_t *qdio_dbf_slsb_in; | |||
96 | static volatile struct qdio_q *tiq_list=NULL; /* volatile as it could change | 96 | static volatile struct qdio_q *tiq_list=NULL; /* volatile as it could change |
97 | during a while loop */ | 97 | during a while loop */ |
98 | static DEFINE_SPINLOCK(ttiq_list_lock); | 98 | static DEFINE_SPINLOCK(ttiq_list_lock); |
99 | static int register_thinint_result; | 99 | static void *tiqdio_ind; |
100 | static void tiqdio_tl(unsigned long); | 100 | static void tiqdio_tl(unsigned long); |
101 | static DECLARE_TASKLET(tiqdio_tasklet,tiqdio_tl,0); | 101 | static DECLARE_TASKLET(tiqdio_tasklet,tiqdio_tl,0); |
102 | 102 | ||
@@ -399,7 +399,7 @@ qdio_get_indicator(void) | |||
399 | { | 399 | { |
400 | int i; | 400 | int i; |
401 | 401 | ||
402 | for (i=1;i<INDICATORS_PER_CACHELINE;i++) | 402 | for (i = 0; i < INDICATORS_PER_CACHELINE; i++) |
403 | if (!indicator_used[i]) { | 403 | if (!indicator_used[i]) { |
404 | indicator_used[i]=1; | 404 | indicator_used[i]=1; |
405 | return indicators+i; | 405 | return indicators+i; |
@@ -1911,8 +1911,7 @@ qdio_fill_thresholds(struct qdio_irq *irq_ptr, | |||
1911 | } | 1911 | } |
1912 | } | 1912 | } |
1913 | 1913 | ||
1914 | static int | 1914 | static void tiqdio_thinint_handler(void *ind, void *drv_data) |
1915 | tiqdio_thinint_handler(void) | ||
1916 | { | 1915 | { |
1917 | QDIO_DBF_TEXT4(0,trace,"thin_int"); | 1916 | QDIO_DBF_TEXT4(0,trace,"thin_int"); |
1918 | 1917 | ||
@@ -1925,7 +1924,6 @@ tiqdio_thinint_handler(void) | |||
1925 | tiqdio_clear_global_summary(); | 1924 | tiqdio_clear_global_summary(); |
1926 | 1925 | ||
1927 | tiqdio_inbound_checks(); | 1926 | tiqdio_inbound_checks(); |
1928 | return 0; | ||
1929 | } | 1927 | } |
1930 | 1928 | ||
1931 | static void | 1929 | static void |
@@ -2445,7 +2443,7 @@ tiqdio_set_subchannel_ind(struct qdio_irq *irq_ptr, int reset_to_zero) | |||
2445 | real_addr_dev_st_chg_ind=0; | 2443 | real_addr_dev_st_chg_ind=0; |
2446 | } else { | 2444 | } else { |
2447 | real_addr_local_summary_bit= | 2445 | real_addr_local_summary_bit= |
2448 | virt_to_phys((volatile void *)indicators); | 2446 | virt_to_phys((volatile void *)tiqdio_ind); |
2449 | real_addr_dev_st_chg_ind= | 2447 | real_addr_dev_st_chg_ind= |
2450 | virt_to_phys((volatile void *)irq_ptr->dev_st_chg_ind); | 2448 | virt_to_phys((volatile void *)irq_ptr->dev_st_chg_ind); |
2451 | } | 2449 | } |
@@ -3740,23 +3738,25 @@ static void | |||
3740 | tiqdio_register_thinints(void) | 3738 | tiqdio_register_thinints(void) |
3741 | { | 3739 | { |
3742 | char dbf_text[20]; | 3740 | char dbf_text[20]; |
3743 | register_thinint_result= | 3741 | |
3744 | s390_register_adapter_interrupt(&tiqdio_thinint_handler); | 3742 | tiqdio_ind = |
3745 | if (register_thinint_result) { | 3743 | s390_register_adapter_interrupt(&tiqdio_thinint_handler, NULL); |
3746 | sprintf(dbf_text,"regthn%x",(register_thinint_result&0xff)); | 3744 | if (IS_ERR(tiqdio_ind)) { |
3745 | sprintf(dbf_text, "regthn%lx", PTR_ERR(tiqdio_ind)); | ||
3747 | QDIO_DBF_TEXT0(0,setup,dbf_text); | 3746 | QDIO_DBF_TEXT0(0,setup,dbf_text); |
3748 | QDIO_PRINT_ERR("failed to register adapter handler " \ | 3747 | QDIO_PRINT_ERR("failed to register adapter handler " \ |
3749 | "(rc=%i).\nAdapter interrupts might " \ | 3748 | "(rc=%li).\nAdapter interrupts might " \ |
3750 | "not work. Continuing.\n", | 3749 | "not work. Continuing.\n", |
3751 | register_thinint_result); | 3750 | PTR_ERR(tiqdio_ind)); |
3751 | tiqdio_ind = NULL; | ||
3752 | } | 3752 | } |
3753 | } | 3753 | } |
3754 | 3754 | ||
3755 | static void | 3755 | static void |
3756 | tiqdio_unregister_thinints(void) | 3756 | tiqdio_unregister_thinints(void) |
3757 | { | 3757 | { |
3758 | if (!register_thinint_result) | 3758 | if (tiqdio_ind) |
3759 | s390_unregister_adapter_interrupt(&tiqdio_thinint_handler); | 3759 | s390_unregister_adapter_interrupt(tiqdio_ind); |
3760 | } | 3760 | } |
3761 | 3761 | ||
3762 | static int | 3762 | static int |
@@ -3768,8 +3768,8 @@ qdio_get_qdio_memory(void) | |||
3768 | for (i=1;i<INDICATORS_PER_CACHELINE;i++) | 3768 | for (i=1;i<INDICATORS_PER_CACHELINE;i++) |
3769 | indicator_used[i]=0; | 3769 | indicator_used[i]=0; |
3770 | indicators = kzalloc(sizeof(__u32)*(INDICATORS_PER_CACHELINE), | 3770 | indicators = kzalloc(sizeof(__u32)*(INDICATORS_PER_CACHELINE), |
3771 | GFP_KERNEL); | 3771 | GFP_KERNEL); |
3772 | if (!indicators) | 3772 | if (!indicators) |
3773 | return -ENOMEM; | 3773 | return -ENOMEM; |
3774 | return 0; | 3774 | return 0; |
3775 | } | 3775 | } |
@@ -3780,7 +3780,6 @@ qdio_release_qdio_memory(void) | |||
3780 | kfree(indicators); | 3780 | kfree(indicators); |
3781 | } | 3781 | } |
3782 | 3782 | ||
3783 | |||
3784 | static void | 3783 | static void |
3785 | qdio_unregister_dbf_views(void) | 3784 | qdio_unregister_dbf_views(void) |
3786 | { | 3785 | { |