Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
a571a79a
Commit
a571a79a
authored
Aug 02, 2009
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'memhotplug-crash' into release
parents
6a614877
5d2619fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
drivers/acpi/acpi_memhotplug.c
drivers/acpi/acpi_memhotplug.c
+25
-9
No files found.
drivers/acpi/acpi_memhotplug.c
View file @
a571a79a
...
...
@@ -38,6 +38,9 @@
#define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT
#undef PREFIX
#define PREFIX "ACPI:memory_hp:"
ACPI_MODULE_NAME
(
"acpi_memhotplug"
);
MODULE_AUTHOR
(
"Naveen B S <naveen.b.s@intel.com>"
);
MODULE_DESCRIPTION
(
"Hotplug Mem Driver"
);
...
...
@@ -153,6 +156,7 @@ acpi_memory_get_device(acpi_handle handle,
acpi_handle
phandle
;
struct
acpi_device
*
device
=
NULL
;
struct
acpi_device
*
pdevice
=
NULL
;
int
result
;
if
(
!
acpi_bus_get_device
(
handle
,
&
device
)
&&
device
)
...
...
@@ -165,9 +169,9 @@ acpi_memory_get_device(acpi_handle handle,
}
/* Get the parent device */
status
=
acpi_bus_get_device
(
phandle
,
&
pdevice
);
if
(
ACPI_FAILURE
(
status
)
)
{
ACPI_EXCEPTION
((
AE_INFO
,
status
,
"Cannot get acpi bus device"
)
);
result
=
acpi_bus_get_device
(
phandle
,
&
pdevice
);
if
(
result
)
{
printk
(
KERN_WARNING
PREFIX
"Cannot get acpi bus device"
);
return
-
EINVAL
;
}
...
...
@@ -175,9 +179,9 @@ acpi_memory_get_device(acpi_handle handle,
* Now add the notified device. This creates the acpi_device
* and invokes .add function
*/
status
=
acpi_bus_add
(
&
device
,
pdevice
,
handle
,
ACPI_BUS_TYPE_DEVICE
);
if
(
ACPI_FAILURE
(
status
)
)
{
ACPI_EXCEPTION
((
AE_INFO
,
status
,
"Cannot add acpi bus"
)
);
result
=
acpi_bus_add
(
&
device
,
pdevice
,
handle
,
ACPI_BUS_TYPE_DEVICE
);
if
(
result
)
{
printk
(
KERN_WARNING
PREFIX
"Cannot add acpi bus"
);
return
-
EINVAL
;
}
...
...
@@ -238,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
num_enabled
++
;
continue
;
}
/*
* If the memory block size is zero, please ignore it.
* Don't try to do the following memory hotplug flowchart.
*/
if
(
!
info
->
length
)
continue
;
if
(
node
<
0
)
node
=
memory_add_physaddr_to_nid
(
info
->
start_addr
);
...
...
@@ -253,8 +262,15 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
mem_device
->
state
=
MEMORY_INVALID_STATE
;
return
-
EINVAL
;
}
return
result
;
/*
* Sometimes the memory device will contain several memory blocks.
* When one memory block is hot-added to the system memory, it will
* be regarded as a success.
* Otherwise if the last memory block can't be hot-added to the system
* memory, it will be failure and the memory device can't be bound with
* driver.
*/
return
0
;
}
static
int
acpi_memory_powerdown_device
(
struct
acpi_memory_device
*
mem_device
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment