diff options
author | Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com> | 2007-01-09 12:04:14 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-01-09 17:14:24 -0500 |
commit | f2d9136133de257abbd97fec6f624d3a73d1e1fd (patch) | |
tree | eece9275aaab3755855d49bbbaef9ec430fdd634 /drivers/infiniband/hw/ehca/ehca_main.c | |
parent | 98714cb161b4b1a5d0c5bd0337a8578196b73677 (diff) |
IB/ehca: Use proper GFP_ flags for get_zeroed_page()
Here is a patch for ehca to use proper flag, ie. GFP_ATOMIC
resp. GFP_KERNEL, when calling get_zeroed_page() to prevent "Bug:
scheduling while atomic...". This error does not cause a kernel panic
but makes ipoib un-usable afterwards. It is reproducible on
2.6.20-rc4 if one does ifconfig down during a flood ping test. I have
not observed this error in earlier releases incl. 2.6.20-rc1.
This error occurs when a qp event/irq is received and ehca event
handler allocates a control block/page to obtain HCA error data block.
Use of GFP_ATOMIC when in interrupt context prevents this issue.
Signed-off-by Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_main.c')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index cc47e4c13a18..6574fbbaead5 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -106,9 +106,9 @@ static struct timer_list poll_eqs_timer; | |||
106 | #ifdef CONFIG_PPC_64K_PAGES | 106 | #ifdef CONFIG_PPC_64K_PAGES |
107 | static struct kmem_cache *ctblk_cache = NULL; | 107 | static struct kmem_cache *ctblk_cache = NULL; |
108 | 108 | ||
109 | void *ehca_alloc_fw_ctrlblock(void) | 109 | void *ehca_alloc_fw_ctrlblock(gfp_t flags) |
110 | { | 110 | { |
111 | void *ret = kmem_cache_zalloc(ctblk_cache, GFP_KERNEL); | 111 | void *ret = kmem_cache_zalloc(ctblk_cache, flags); |
112 | if (!ret) | 112 | if (!ret) |
113 | ehca_gen_err("Out of memory for ctblk"); | 113 | ehca_gen_err("Out of memory for ctblk"); |
114 | return ret; | 114 | return ret; |
@@ -206,7 +206,7 @@ int ehca_sense_attributes(struct ehca_shca *shca) | |||
206 | u64 h_ret; | 206 | u64 h_ret; |
207 | struct hipz_query_hca *rblock; | 207 | struct hipz_query_hca *rblock; |
208 | 208 | ||
209 | rblock = ehca_alloc_fw_ctrlblock(); | 209 | rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); |
210 | if (!rblock) { | 210 | if (!rblock) { |
211 | ehca_gen_err("Cannot allocate rblock memory."); | 211 | ehca_gen_err("Cannot allocate rblock memory."); |
212 | return -ENOMEM; | 212 | return -ENOMEM; |
@@ -258,7 +258,7 @@ static int init_node_guid(struct ehca_shca *shca) | |||
258 | int ret = 0; | 258 | int ret = 0; |
259 | struct hipz_query_hca *rblock; | 259 | struct hipz_query_hca *rblock; |
260 | 260 | ||
261 | rblock = ehca_alloc_fw_ctrlblock(); | 261 | rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); |
262 | if (!rblock) { | 262 | if (!rblock) { |
263 | ehca_err(&shca->ib_device, "Can't allocate rblock memory."); | 263 | ehca_err(&shca->ib_device, "Can't allocate rblock memory."); |
264 | return -ENOMEM; | 264 | return -ENOMEM; |
@@ -469,7 +469,7 @@ static ssize_t ehca_show_##name(struct device *dev, \ | |||
469 | \ | 469 | \ |
470 | shca = dev->driver_data; \ | 470 | shca = dev->driver_data; \ |
471 | \ | 471 | \ |
472 | rblock = ehca_alloc_fw_ctrlblock(); \ | 472 | rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \ |
473 | if (!rblock) { \ | 473 | if (!rblock) { \ |
474 | dev_err(dev, "Can't allocate rblock memory."); \ | 474 | dev_err(dev, "Can't allocate rblock memory."); \ |
475 | return 0; \ | 475 | return 0; \ |