aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/chsc.c30
-rw-r--r--drivers/s390/cio/qdio.c36
2 files changed, 33 insertions, 33 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 6412b2c3edd3..72187e54dcac 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -242,28 +242,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
242 if (sch->vpm == mask) 242 if (sch->vpm == mask)
243 goto out_unreg; 243 goto out_unreg;
244 244
245 if ((sch->schib.scsw.actl & (SCSW_ACTL_CLEAR_PEND | 245 if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
246 SCSW_ACTL_HALT_PEND | 246 (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
247 SCSW_ACTL_START_PEND | 247 (sch->schib.pmcw.lpum == mask) &&
248 SCSW_ACTL_RESUME_PEND)) && 248 (sch->vpm == 0)) {
249 (sch->schib.pmcw.lpum == mask)) {
250 int cc = cio_cancel(sch);
251
252 if (cc == -ENODEV)
253 goto out_unreg;
254
255 if (cc == -EINVAL) {
256 cc = cio_clear(sch);
257 if (cc == -ENODEV)
258 goto out_unreg;
259 /* Call handler. */
260 if (sch->driver && sch->driver->termination)
261 sch->driver->termination(&sch->dev);
262 goto out_unlock;
263 }
264 } else if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
265 (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
266 (sch->schib.pmcw.lpum == mask)) {
267 int cc; 249 int cc;
268 250
269 cc = cio_clear(sch); 251 cc = cio_clear(sch);
@@ -653,13 +635,13 @@ __chp_add(struct subchannel_id schid, void *data)
653 if (sch->schib.pmcw.chpid[i] == chp->id) { 635 if (sch->schib.pmcw.chpid[i] == chp->id) {
654 if (stsch(sch->schid, &sch->schib) != 0) { 636 if (stsch(sch->schid, &sch->schib) != 0) {
655 /* Endgame. */ 637 /* Endgame. */
656 spin_unlock(&sch->lock); 638 spin_unlock_irq(&sch->lock);
657 return -ENXIO; 639 return -ENXIO;
658 } 640 }
659 break; 641 break;
660 } 642 }
661 if (i==8) { 643 if (i==8) {
662 spin_unlock(&sch->lock); 644 spin_unlock_irq(&sch->lock);
663 return 0; 645 return 0;
664 } 646 }
665 sch->lpm = ((sch->schib.pmcw.pim & 647 sch->lpm = ((sch->schib.pmcw.pim &
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 814f9258ce00..96f519281d92 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -38,6 +38,7 @@
38#include <linux/kernel.h> 38#include <linux/kernel.h>
39#include <linux/proc_fs.h> 39#include <linux/proc_fs.h>
40#include <linux/timer.h> 40#include <linux/timer.h>
41#include <linux/mempool.h>
41 42
42#include <asm/ccwdev.h> 43#include <asm/ccwdev.h>
43#include <asm/io.h> 44#include <asm/io.h>
@@ -80,6 +81,8 @@ static int indicator_used[INDICATORS_PER_CACHELINE];
80static __u32 * volatile indicators; 81static __u32 * volatile indicators;
81static __u32 volatile spare_indicator; 82static __u32 volatile spare_indicator;
82static atomic_t spare_indicator_usecount; 83static atomic_t spare_indicator_usecount;
84#define QDIO_MEMPOOL_SCSSC_ELEMENTS 2
85static mempool_t *qdio_mempool_scssc;
83 86
84static debug_info_t *qdio_dbf_setup; 87static debug_info_t *qdio_dbf_setup;
85static debug_info_t *qdio_dbf_sbal; 88static debug_info_t *qdio_dbf_sbal;
@@ -1637,7 +1640,7 @@ next:
1637 1640
1638 } 1641 }
1639 kfree(irq_ptr->qdr); 1642 kfree(irq_ptr->qdr);
1640 kfree(irq_ptr); 1643 free_page((unsigned long) irq_ptr);
1641} 1644}
1642 1645
1643static void 1646static void
@@ -2304,7 +2307,7 @@ qdio_get_ssqd_information(struct qdio_irq *irq_ptr)
2304 2307
2305 QDIO_DBF_TEXT0(0,setup,"getssqd"); 2308 QDIO_DBF_TEXT0(0,setup,"getssqd");
2306 qdioac = 0; 2309 qdioac = 0;
2307 ssqd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 2310 ssqd_area = mempool_alloc(qdio_mempool_scssc, GFP_ATOMIC);
2308 if (!ssqd_area) { 2311 if (!ssqd_area) {
2309 QDIO_PRINT_WARN("Could not get memory for chsc. Using all " \ 2312 QDIO_PRINT_WARN("Could not get memory for chsc. Using all " \
2310 "SIGAs for sch x%x.\n", irq_ptr->schid.sch_no); 2313 "SIGAs for sch x%x.\n", irq_ptr->schid.sch_no);
@@ -2364,7 +2367,7 @@ qdio_get_ssqd_information(struct qdio_irq *irq_ptr)
2364out: 2367out:
2365 qdio_check_subchannel_qebsm(irq_ptr, qdioac, 2368 qdio_check_subchannel_qebsm(irq_ptr, qdioac,
2366 ssqd_area->sch_token); 2369 ssqd_area->sch_token);
2367 free_page ((unsigned long) ssqd_area); 2370 mempool_free(ssqd_area, qdio_mempool_scssc);
2368 irq_ptr->qdioac = qdioac; 2371 irq_ptr->qdioac = qdioac;
2369} 2372}
2370 2373
@@ -2458,7 +2461,7 @@ tiqdio_set_subchannel_ind(struct qdio_irq *irq_ptr, int reset_to_zero)
2458 virt_to_phys((volatile void *)irq_ptr->dev_st_chg_ind); 2461 virt_to_phys((volatile void *)irq_ptr->dev_st_chg_ind);
2459 } 2462 }
2460 2463
2461 scssc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 2464 scssc_area = mempool_alloc(qdio_mempool_scssc, GFP_ATOMIC);
2462 if (!scssc_area) { 2465 if (!scssc_area) {
2463 QDIO_PRINT_WARN("No memory for setting indicators on " \ 2466 QDIO_PRINT_WARN("No memory for setting indicators on " \
2464 "subchannel 0.%x.%x.\n", 2467 "subchannel 0.%x.%x.\n",
@@ -2514,7 +2517,7 @@ tiqdio_set_subchannel_ind(struct qdio_irq *irq_ptr, int reset_to_zero)
2514 QDIO_DBF_HEX2(0,setup,&real_addr_dev_st_chg_ind,sizeof(unsigned long)); 2517 QDIO_DBF_HEX2(0,setup,&real_addr_dev_st_chg_ind,sizeof(unsigned long));
2515 result = 0; 2518 result = 0;
2516out: 2519out:
2517 free_page ((unsigned long) scssc_area); 2520 mempool_free(scssc_area, qdio_mempool_scssc);
2518 return result; 2521 return result;
2519 2522
2520} 2523}
@@ -2543,7 +2546,7 @@ tiqdio_set_delay_target(struct qdio_irq *irq_ptr, unsigned long delay_target)
2543 if (!irq_ptr->is_thinint_irq) 2546 if (!irq_ptr->is_thinint_irq)
2544 return -ENODEV; 2547 return -ENODEV;
2545 2548
2546 scsscf_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); 2549 scsscf_area = mempool_alloc(qdio_mempool_scssc, GFP_ATOMIC);
2547 if (!scsscf_area) { 2550 if (!scsscf_area) {
2548 QDIO_PRINT_WARN("No memory for setting delay target on " \ 2551 QDIO_PRINT_WARN("No memory for setting delay target on " \
2549 "subchannel 0.%x.%x.\n", 2552 "subchannel 0.%x.%x.\n",
@@ -2581,7 +2584,7 @@ tiqdio_set_delay_target(struct qdio_irq *irq_ptr, unsigned long delay_target)
2581 QDIO_DBF_HEX2(0,trace,&delay_target,sizeof(unsigned long)); 2584 QDIO_DBF_HEX2(0,trace,&delay_target,sizeof(unsigned long));
2582 result = 0; /* not critical */ 2585 result = 0; /* not critical */
2583out: 2586out:
2584 free_page ((unsigned long) scsscf_area); 2587 mempool_free(scsscf_area, qdio_mempool_scssc);
2585 return result; 2588 return result;
2586} 2589}
2587 2590
@@ -2980,7 +2983,7 @@ qdio_allocate(struct qdio_initialize *init_data)
2980 qdio_allocate_do_dbf(init_data); 2983 qdio_allocate_do_dbf(init_data);
2981 2984
2982 /* create irq */ 2985 /* create irq */
2983 irq_ptr = kzalloc(sizeof(struct qdio_irq), GFP_KERNEL | GFP_DMA); 2986 irq_ptr = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
2984 2987
2985 QDIO_DBF_TEXT0(0,setup,"irq_ptr:"); 2988 QDIO_DBF_TEXT0(0,setup,"irq_ptr:");
2986 QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*)); 2989 QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*));
@@ -2995,7 +2998,7 @@ qdio_allocate(struct qdio_initialize *init_data)
2995 /* QDR must be in DMA area since CCW data address is only 32 bit */ 2998 /* QDR must be in DMA area since CCW data address is only 32 bit */
2996 irq_ptr->qdr=kmalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA); 2999 irq_ptr->qdr=kmalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA);
2997 if (!(irq_ptr->qdr)) { 3000 if (!(irq_ptr->qdr)) {
2998 kfree(irq_ptr); 3001 free_page((unsigned long) irq_ptr);
2999 QDIO_PRINT_ERR("kmalloc of irq_ptr->qdr failed!\n"); 3002 QDIO_PRINT_ERR("kmalloc of irq_ptr->qdr failed!\n");
3000 return -ENOMEM; 3003 return -ENOMEM;
3001 } 3004 }
@@ -3780,6 +3783,16 @@ oom:
3780 return -ENOMEM; 3783 return -ENOMEM;
3781} 3784}
3782 3785
3786static void *qdio_mempool_alloc(gfp_t gfp_mask, void *size)
3787{
3788 return (void *) get_zeroed_page(gfp_mask|GFP_DMA);
3789}
3790
3791static void qdio_mempool_free(void *element, void *size)
3792{
3793 free_page((unsigned long) element);
3794}
3795
3783static int __init 3796static int __init
3784init_QDIO(void) 3797init_QDIO(void)
3785{ 3798{
@@ -3809,6 +3822,10 @@ init_QDIO(void)
3809 3822
3810 qdio_add_procfs_entry(); 3823 qdio_add_procfs_entry();
3811 3824
3825 qdio_mempool_scssc = mempool_create(QDIO_MEMPOOL_SCSSC_ELEMENTS,
3826 qdio_mempool_alloc,
3827 qdio_mempool_free, NULL);
3828
3812 if (tiqdio_check_chsc_availability()) 3829 if (tiqdio_check_chsc_availability())
3813 QDIO_PRINT_ERR("Not all CHSCs supported. Continuing.\n"); 3830 QDIO_PRINT_ERR("Not all CHSCs supported. Continuing.\n");
3814 3831
@@ -3824,6 +3841,7 @@ cleanup_QDIO(void)
3824 qdio_remove_procfs_entry(); 3841 qdio_remove_procfs_entry();
3825 qdio_release_qdio_memory(); 3842 qdio_release_qdio_memory();
3826 qdio_unregister_dbf_views(); 3843 qdio_unregister_dbf_views();
3844 mempool_destroy(qdio_mempool_scssc);
3827 3845
3828 printk("qdio: %s: module removed\n",version); 3846 printk("qdio: %s: module removed\n",version);
3829} 3847}