Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194316
b: refs/heads/master
c: a7c561f
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Klein authored and David S. Miller committed Apr 22, 2010
1 parent 3477fcc commit 9740214
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 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: ea96ceac80cc82cb1c54a37bb8aaf4e695e87d0a
refs/heads/master: a7c561f2e32f98b477f5fe670b3f294be6b1eae2
2 changes: 1 addition & 1 deletion trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0102"
#define DRV_VERSION "EHEA_0103"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down
19 changes: 14 additions & 5 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,6 @@ static void ehea_rereg_mrs(struct work_struct *work)
int ret, i;
struct ehea_adapter *adapter;

mutex_lock(&dlpar_mem_lock);
ehea_info("LPAR memory changed - re-initializing driver");

list_for_each_entry(adapter, &adapter_list, list)
Expand Down Expand Up @@ -2959,7 +2958,6 @@ static void ehea_rereg_mrs(struct work_struct *work)
}
ehea_info("re-initializing driver complete");
out:
mutex_unlock(&dlpar_mem_lock);
return;
}

Expand Down Expand Up @@ -3542,7 +3540,14 @@ void ehea_crash_handler(void)
static int ehea_mem_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{
int ret = NOTIFY_BAD;
struct memory_notify *arg = data;

if (!mutex_trylock(&dlpar_mem_lock)) {
ehea_info("ehea_mem_notifier must not be called parallelized");
goto out;
}

switch (action) {
case MEM_CANCEL_OFFLINE:
ehea_info("memory offlining canceled");
Expand All @@ -3551,23 +3556,27 @@ static int ehea_mem_notifier(struct notifier_block *nb,
ehea_info("memory is going online");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages))
return NOTIFY_BAD;
goto out_unlock;
ehea_rereg_mrs(NULL);
break;
case MEM_GOING_OFFLINE:
ehea_info("memory is going offline");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages))
return NOTIFY_BAD;
goto out_unlock;
ehea_rereg_mrs(NULL);
break;
default:
break;
}

ehea_update_firmware_handles();
ret = NOTIFY_OK;

return NOTIFY_OK;
out_unlock:
mutex_unlock(&dlpar_mem_lock);
out:
return ret;
}

static struct notifier_block ehea_mem_nb = {
Expand Down

0 comments on commit 9740214

Please sign in to comment.