[2.6.27] ehea: Fix memory hotplug support
Subsystems (2)
PATCH 1/1 [2.6.27] ehea: Fix memory hotplug support
This patch implements the memory notifier to update the busmap instantly instead of rebuilding the whole map. This is necessary because walk_memory_resource provides different information than required during memory hotplug.
---
This patch is based on upstream-fixes in the netdev-2.6.git.
drivers/net/ehea/ehea.h +2 -2
@@ -40,13 +40,13 @@#include <asm/io.h> #define DRV_NAME "ehea" -#define DRV_VERSION "EHEA_0092" +#define DRV_VERSION "EHEA_0094"/* eHEA capability flags */ #define DLPAR_PORT_ADD_REM 1#define DLPAR_MEM_ADD 2#define DLPAR_MEM_REM 4 -#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD) +#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD | DLPAR_MEM_REM)#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
drivers/net/ehea/ehea_main.c +14 -10
@@ -2863,7 +2863,7 @@ static void ehea_rereg_mrs(struct work_sstruct ehea_adapter *adapter;mutex_lock (&dlpar_mem_lock); -ehea_info ("LPAR memory enlarged - re-initializing driver" ); +ehea_info ("LPAR memory changed - re-initializing driver" );list_for_each_entry (adapter, &adapter_list, list)if (adapter->active_ports) {
@@ -2900,13 +2900,6 @@ static void ehea_rereg_mrs(struct work_s } } -ehea_destroy_busmap (); - ret =ehea_create_busmap (); -if (ret) { -ehea_error ("creating ehea busmap failed" ); - goto out; - } -clear_bit (__EHEA_STOP_XFER, &ehea_driver_flags);list_for_each_entry (adapter, &adapter_list, list)
@@ -3519,9 +3512,20 @@ void ehea_crash_handler(void)static int ehea_mem_notifier (struct notifier_block *nb,unsigned long action,void *data) { +struct memory_notify *arg = data;switch (action) { -case MEM_OFFLINE : -ehea_info ("memory has been removed" ); +case MEM_CANCEL_OFFLINE : +ehea_info ("memory offlining canceled" ); +case MEM_ONLINE : +ehea_info ("memory is going online" ); +if (ehea_add_sect_bmap (arg->start_pfn, arg->nr_pages)) +return NOTIFY_BAD ; +ehea_rereg_mrs (NULL ); +break ; +case MEM_GOING_OFFLINE : +ehea_info ("memory is going offline" ); +if (ehea_rem_sect_bmap (arg->start_pfn, arg->nr_pages)) +return NOTIFY_BAD ;ehea_rereg_mrs (NULL );break ;default :
drivers/net/ehea/ehea_qmr.c +53 -25
106 lines not on this page · raw message
drivers/net/ehea/ehea_qmr.h +2 -0
@@ -378,6 +378,8 @@ int ehea_rem_mr(struct ehea_mr *mr);void ehea_error_data (struct ehea_adapter *adapter,u64 res_handle); +int ehea_add_sect_bmap (unsigned long pfn,unsigned long nr_pages); +int ehea_rem_sect_bmap (unsigned long pfn,unsigned long nr_pages);int ehea_create_busmap (void );void ehea_destroy_busmap (void );u64 ehea_map_vaddr (void *caddr);
Quoted 6 lines · Hannes Hering
This patch implements the memory notifier to update the busmap instantly instead of rebuilding the whole map. This is necessary because
walk_memory_resourceprovides different information than required during memory hotplug.Signed-off-by Hannes Hering <[email protected]>
Jeff, please apply.
PATCH 1/1 ehea: Fix memory hotplug support
In reply to Hannes HeringThis patch implements the memory notifier to update the busmap instantly instead of rebuilding the whole map. This is necessary because walk_memory_resource provides different information than required during memory hotplug.
---
This patch is based on the current netdev-2.6-git. It supersedes the previous post "ehea: Fix memory hotplug support".
http://www.spinics.net/lists/netdev/msg75413.html
drivers/net/ehea/ehea.h +2 -2
@@ -40,13 +40,13 @@#include <asm/io.h> #define DRV_NAME "ehea" -#define DRV_VERSION "EHEA_0092" +#define DRV_VERSION "EHEA_0094"/* eHEA capability flags */ #define DLPAR_PORT_ADD_REM 1#define DLPAR_MEM_ADD 2#define DLPAR_MEM_REM 4 -#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD) +#define EHEA_CAPABILITIES (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD | DLPAR_MEM_REM)#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
drivers/net/ehea/ehea_main.c +15 -10
@@ -2863,7 +2863,7 @@ static void ehea_rereg_mrs(struct work_sstruct ehea_adapter *adapter;mutex_lock (&dlpar_mem_lock); -ehea_info ("LPAR memory enlarged - re-initializing driver" ); +ehea_info ("LPAR memory changed - re-initializing driver" );list_for_each_entry (adapter, &adapter_list, list)if (adapter->active_ports) {
@@ -2900,13 +2900,6 @@ static void ehea_rereg_mrs(struct work_s } } -ehea_destroy_busmap (); - ret =ehea_create_busmap (); -if (ret) { -ehea_error ("creating ehea busmap failed" ); - goto out; - } -clear_bit (__EHEA_STOP_XFER, &ehea_driver_flags);list_for_each_entry (adapter, &adapter_list, list)
@@ -3519,9 +3512,21 @@ void ehea_crash_handler(void)static int ehea_mem_notifier (struct notifier_block *nb,unsigned long action,void *data) { +struct memory_notify *arg = data;switch (action) { -case MEM_OFFLINE : -ehea_info ("memory has been removed" ); +case MEM_CANCEL_OFFLINE : +ehea_info ("memory offlining canceled" ); +/* Readd canceled memory block */ +case MEM_ONLINE : +ehea_info ("memory is going online" ); +if (ehea_add_sect_bmap (arg->start_pfn, arg->nr_pages)) +return NOTIFY_BAD ; +ehea_rereg_mrs (NULL ); +break ; +case MEM_GOING_OFFLINE : +ehea_info ("memory is going offline" ); +if (ehea_rem_sect_bmap (arg->start_pfn, arg->nr_pages)) +return NOTIFY_BAD ;ehea_rereg_mrs (NULL );break ;default :
drivers/net/ehea/ehea_qmr.c +101 -29
167 lines not on this page · raw message
drivers/net/ehea/ehea_qmr.h +2 -0
@@ -378,6 +378,8 @@ int ehea_rem_mr(struct ehea_mr *mr);void ehea_error_data (struct ehea_adapter *adapter,u64 res_handle); +int ehea_add_sect_bmap (unsigned long pfn,unsigned long nr_pages); +int ehea_rem_sect_bmap (unsigned long pfn,unsigned long nr_pages);int ehea_create_busmap (void );void ehea_destroy_busmap (void );u64 ehea_map_vaddr (void *caddr);
Re: [PATCH] ehea: Fix memory hotplug support
Quoted 10 lines · Hannes Hering
This patch implements the memory notifier to update the busmap instantly instead of rebuilding the whole map. This is necessary because
walk_memory_resourceprovides different information than required during memory hotplug.Signed-off-by Hannes Hering <[email protected]>---
This patch is based on the current netdev-2.6-git. It supersedes the previous post "ehea: Fix memory hotplug support".
http://www.spinics.net/lists/netdev/msg75413.html
Due to vacation, netdev-2.6.git is stale. Please regenerate this patch against davem's net-2.6.git.
Jeff
PATCH 1/1 ehea: Fix memory hotplug support
This patch implements the memory notifier to update the busmap instantly instead of rebuilding the whole map. This is necessary because walk_memory_resource provides different information than required during memory hotplug.
---
Jeff, as requested, this patch is now based on davem's net-2.6.git.
drivers/net/ehea/ehea.h +1 -1
@@ -40,7 +40,7 @@#include <asm/io.h> #define DRV_NAME "ehea" -#define DRV_VERSION "EHEA_0093" +#define DRV_VERSION "EHEA_0094"/* eHEA capability flags */ #define DLPAR_PORT_ADD_REM 1
drivers/net/ehea/ehea_main.c +15 -10
@@ -2863,7 +2863,7 @@ static void ehea_rereg_mrs(struct work_sstruct ehea_adapter *adapter;mutex_lock (&dlpar_mem_lock); -ehea_info ("LPAR memory enlarged - re-initializing driver" ); +ehea_info ("LPAR memory changed - re-initializing driver" );list_for_each_entry (adapter, &adapter_list, list)if (adapter->active_ports) {
@@ -2900,13 +2900,6 @@ static void ehea_rereg_mrs(struct work_s } } -ehea_destroy_busmap (); - ret =ehea_create_busmap (); -if (ret) { -ehea_error ("creating ehea busmap failed" ); - goto out; - } -clear_bit (__EHEA_STOP_XFER, &ehea_driver_flags);list_for_each_entry (adapter, &adapter_list, list)
@@ -3519,9 +3512,21 @@ void ehea_crash_handler(void)static int ehea_mem_notifier (struct notifier_block *nb,unsigned long action,void *data) { +struct memory_notify *arg = data;switch (action) { -case MEM_OFFLINE : -ehea_info ("memory has been removed" ); +case MEM_CANCEL_OFFLINE : +ehea_info ("memory offlining canceled" ); +/* Readd canceled memory block */ +case MEM_ONLINE : +ehea_info ("memory is going online" ); +if (ehea_add_sect_bmap (arg->start_pfn, arg->nr_pages)) +return NOTIFY_BAD ; +ehea_rereg_mrs (NULL ); +break ; +case MEM_GOING_OFFLINE : +ehea_info ("memory is going offline" ); +if (ehea_rem_sect_bmap (arg->start_pfn, arg->nr_pages)) +return NOTIFY_BAD ;ehea_rereg_mrs (NULL );break ;default :
drivers/net/ehea/ehea_qmr.c +101 -30
168 lines not on this page · raw message
drivers/net/ehea/ehea_qmr.h +2 -0
@@ -378,6 +378,8 @@ int ehea_rem_mr(struct ehea_mr *mr);void ehea_error_data (struct ehea_adapter *adapter,u64 res_handle); +int ehea_add_sect_bmap (unsigned long pfn,unsigned long nr_pages); +int ehea_rem_sect_bmap (unsigned long pfn,unsigned long nr_pages);int ehea_create_busmap (void );void ehea_destroy_busmap (void );u64 ehea_map_vaddr (void *caddr);
Jeff Garzik
AppliedRe: [PATCH] ehea: Fix memory hotplug support
Quoted 8 lines · Hannes Hering
This patch implements the memory notifier to update the busmap instantly instead of rebuilding the whole map. This is necessary because
walk_memory_resourceprovides different information than required during memory hotplug.Signed-off-by Hannes Hering <[email protected]>---
Jeff, as requested, this patch is now based on davem's net-2.6.git.
applied