Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a8b5b670
Commit
a8b5b670
authored
May 04, 2004
by
Greg Kroah-Hartman
Committed by
Deepak Saxena
May 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PCI Hotplug: revert broken PCI Express hotplug patch
parent
01e05019
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
34 deletions
+32
-34
drivers/pci/hotplug/pciehp_core.c
drivers/pci/hotplug/pciehp_core.c
+32
-34
No files found.
drivers/pci/hotplug/pciehp_core.c
View file @
a8b5b670
...
@@ -66,7 +66,7 @@ MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");
...
@@ -66,7 +66,7 @@ MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");
#define PCIE_MODULE_NAME "pciehp"
#define PCIE_MODULE_NAME "pciehp"
static
int
pcie_start_thread
(
void
);
static
int
pcie_start_thread
(
void
);
static
int
set_attention_status
(
struct
hotplug_slot
*
slot
,
u8
value
);
static
int
set_attention_status
(
struct
hotplug_slot
*
slot
,
u8
value
);
static
int
enable_slot
(
struct
hotplug_slot
*
slot
);
static
int
enable_slot
(
struct
hotplug_slot
*
slot
);
static
int
disable_slot
(
struct
hotplug_slot
*
slot
);
static
int
disable_slot
(
struct
hotplug_slot
*
slot
);
...
@@ -142,19 +142,14 @@ static int init_slots(struct controller *ctrl)
...
@@ -142,19 +142,14 @@ static int init_slots(struct controller *ctrl)
make_slot_name
(
new_slot
->
hotplug_slot
->
name
,
SLOT_NAME_SIZE
,
new_slot
);
make_slot_name
(
new_slot
->
hotplug_slot
->
name
,
SLOT_NAME_SIZE
,
new_slot
);
new_slot
->
hotplug_slot
->
ops
=
&
pciehp_hotplug_slot_ops
;
new_slot
->
hotplug_slot
->
ops
=
&
pciehp_hotplug_slot_ops
;
new_slot
->
hpc_ops
->
get_power_status
(
new_slot
,
new_slot
->
hpc_ops
->
get_power_status
(
new_slot
,
&
(
new_slot
->
hotplug_slot
->
info
->
power_status
));
&
(
new_slot
->
hotplug_slot
->
info
->
power_status
));
new_slot
->
hpc_ops
->
get_attention_status
(
new_slot
,
&
(
new_slot
->
hotplug_slot
->
info
->
attention_status
));
new_slot
->
hpc_ops
->
get_attention_status
(
new_slot
,
new_slot
->
hpc_ops
->
get_latch_status
(
new_slot
,
&
(
new_slot
->
hotplug_slot
->
info
->
latch_status
));
&
(
new_slot
->
hotplug_slot
->
info
->
attention_status
));
new_slot
->
hpc_ops
->
get_adapter_status
(
new_slot
,
&
(
new_slot
->
hotplug_slot
->
info
->
adapter_status
));
new_slot
->
hpc_ops
->
get_latch_status
(
new_slot
,
&
(
new_slot
->
hotplug_slot
->
info
->
latch_status
));
new_slot
->
hpc_ops
->
get_adapter_status
(
new_slot
,
&
(
new_slot
->
hotplug_slot
->
info
->
adapter_status
));
dbg
(
"Registering bus=%x dev=%x hp_slot=%x sun=%x slot_device_offset=%x
\n
"
,
dbg
(
"Registering bus=%x dev=%x hp_slot=%x sun=%x slot_device_offset=%x
\n
"
,
new_slot
->
bus
,
new_slot
->
device
,
new_slot
->
hp_slot
,
new_slot
->
bus
,
new_slot
->
device
,
new_slot
->
hp_slot
,
new_slot
->
number
,
ctrl
->
slot_device_offset
);
new_slot
->
number
,
ctrl
->
slot_device_offset
);
result
=
pci_hp_register
(
new_slot
->
hotplug_slot
);
result
=
pci_hp_register
(
new_slot
->
hotplug_slot
);
if
(
result
)
{
if
(
result
)
{
err
(
"pci_hp_register failed with error %d
\n
"
,
result
);
err
(
"pci_hp_register failed with error %d
\n
"
,
result
);
goto
error_name
;
goto
error_name
;
...
@@ -183,7 +178,7 @@ static int init_slots(struct controller *ctrl)
...
@@ -183,7 +178,7 @@ static int init_slots(struct controller *ctrl)
}
}
static
int
cleanup_slots
(
struct
controller
*
ctrl
)
static
int
cleanup_slots
(
struct
controller
*
ctrl
)
{
{
struct
slot
*
old_slot
,
*
next_slot
;
struct
slot
*
old_slot
,
*
next_slot
;
...
@@ -192,7 +187,7 @@ static int cleanup_slots(struct controller * ctrl)
...
@@ -192,7 +187,7 @@ static int cleanup_slots(struct controller * ctrl)
while
(
old_slot
)
{
while
(
old_slot
)
{
next_slot
=
old_slot
->
next
;
next_slot
=
old_slot
->
next
;
pci_hp_deregister
(
old_slot
->
hotplug_slot
);
pci_hp_deregister
(
old_slot
->
hotplug_slot
);
kfree
(
old_slot
->
hotplug_slot
->
info
);
kfree
(
old_slot
->
hotplug_slot
->
info
);
kfree
(
old_slot
->
hotplug_slot
->
name
);
kfree
(
old_slot
->
hotplug_slot
->
name
);
kfree
(
old_slot
->
hotplug_slot
);
kfree
(
old_slot
->
hotplug_slot
);
...
@@ -213,11 +208,9 @@ static int get_ctlr_slot_config(struct controller *ctrl)
...
@@ -213,11 +208,9 @@ static int get_ctlr_slot_config(struct controller *ctrl)
int
rc
;
int
rc
;
int
flags
;
/* Not needed */
int
flags
;
/* Not needed */
rc
=
pcie_get_ctlr_slot_config
(
ctrl
,
&
num_ctlr_slots
,
&
first_device_num
,
rc
=
pcie_get_ctlr_slot_config
(
ctrl
,
&
num_ctlr_slots
,
&
first_device_num
,
&
physical_slot_num
,
&
updown
,
&
flags
);
&
physical_slot_num
,
&
updown
,
&
flags
);
if
(
rc
)
{
if
(
rc
)
{
err
(
"%s: get_ctlr_slot_config fail for b:d (%x:%x)
\n
"
,
err
(
"%s: get_ctlr_slot_config fail for b:d (%x:%x)
\n
"
,
__FUNCTION__
,
ctrl
->
bus
,
ctrl
->
device
);
__FUNCTION__
,
ctrl
->
bus
,
ctrl
->
device
);
return
(
-
1
);
return
(
-
1
);
}
}
...
@@ -227,8 +220,8 @@ static int get_ctlr_slot_config(struct controller *ctrl)
...
@@ -227,8 +220,8 @@ static int get_ctlr_slot_config(struct controller *ctrl)
ctrl
->
slot_num_inc
=
updown
;
/* Not needed */
/* either -1 or 1 */
ctrl
->
slot_num_inc
=
updown
;
/* Not needed */
/* either -1 or 1 */
dbg
(
"%s: bus(0x%x) num_slot(0x%x) 1st_dev(0x%x) psn(0x%x) updown(%d) for b:d (%x:%x)
\n
"
,
dbg
(
"%s: bus(0x%x) num_slot(0x%x) 1st_dev(0x%x) psn(0x%x) updown(%d) for b:d (%x:%x)
\n
"
,
__FUNCTION__
,
ctrl
->
slot_bus
,
num_ctlr_slots
,
first_device_num
,
__FUNCTION__
,
ctrl
->
slot_bus
,
num_ctlr_slots
,
first_device_num
,
physical_slot_num
,
updown
,
physical_slot_num
,
updown
,
ctrl
->
bus
,
ctrl
->
device
);
ctrl
->
bus
,
ctrl
->
device
);
return
(
0
);
return
(
0
);
}
}
...
@@ -392,15 +385,14 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
...
@@ -392,15 +385,14 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto
err_out_unmap_mmio_region
;
goto
err_out_unmap_mmio_region
;
}
}
dbg
(
"%s: ctrl->pci_bus %p
\n
"
,
__FUNCTION__
,
ctrl
->
pci_bus
);
dbg
(
"%s: ctrl->pci_bus %p
\n
"
,
__FUNCTION__
,
ctrl
->
pci_bus
);
memcpy
(
ctrl
->
pci_bus
,
pdev
->
bus
,
sizeof
(
*
ctrl
->
pci_bus
));
memcpy
(
ctrl
->
pci_bus
,
pdev
->
bus
,
sizeof
(
*
ctrl
->
pci_bus
));
ctrl
->
bus
=
pdev
->
bus
->
number
;
/* ctrl bus */
ctrl
->
bus
=
pdev
->
bus
->
number
;
/* ctrl bus */
ctrl
->
slot_bus
=
pdev
->
subordinate
->
number
;
/* bus controlled by this HPC */
ctrl
->
slot_bus
=
pdev
->
subordinate
->
number
;
/* bus controlled by this HPC */
ctrl
->
device
=
PCI_SLOT
(
pdev
->
devfn
);
ctrl
->
device
=
PCI_SLOT
(
pdev
->
devfn
);
ctrl
->
function
=
PCI_FUNC
(
pdev
->
devfn
);
ctrl
->
function
=
PCI_FUNC
(
pdev
->
devfn
);
dbg
(
"%s: ctrl bus=0x%x, device=%x, function=%x, irq=%x
\n
"
,
dbg
(
"%s: ctrl bus=0x%x, device=%x, function=%x, irq=%x
\n
"
,
__FUNCTION__
,
__FUNCTION__
,
ctrl
->
bus
,
ctrl
->
device
,
ctrl
->
bus
,
ctrl
->
device
,
ctrl
->
function
,
pdev
->
irq
);
ctrl
->
function
,
pdev
->
irq
);
/*
/*
* Save configuration headers for this and subordinate PCI buses
* Save configuration headers for this and subordinate PCI buses
...
@@ -417,11 +409,9 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
...
@@ -417,11 +409,9 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Store PCI Config Space for all devices on this bus */
/* Store PCI Config Space for all devices on this bus */
dbg
(
"%s: Before calling pciehp_save_config, ctrl->bus %x,ctrl->slot_bus %x
\n
"
,
dbg
(
"%s: Before calling pciehp_save_config, ctrl->bus %x,ctrl->slot_bus %x
\n
"
,
__FUNCTION__
,
ctrl
->
bus
,
ctrl
->
slot_bus
);
__FUNCTION__
,
ctrl
->
bus
,
ctrl
->
slot_bus
);
rc
=
pciehp_save_config
(
ctrl
,
ctrl
->
slot_bus
,
num_ctlr_slots
,
rc
=
pciehp_save_config
(
ctrl
,
ctrl
->
slot_bus
,
num_ctlr_slots
,
first_device_num
);
first_device_num
);
if
(
rc
)
{
if
(
rc
)
{
err
(
"%s: unable to save PCI configuration data, error %d
\n
"
,
err
(
"%s: unable to save PCI configuration data, error %d
\n
"
,
__FUNCTION__
,
rc
);
__FUNCTION__
,
rc
);
goto
err_out_free_ctrl_bus
;
goto
err_out_free_ctrl_bus
;
}
}
...
@@ -448,23 +438,31 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
...
@@ -448,23 +438,31 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Finish setting up the hot plug ctrl device */
/* Finish setting up the hot plug ctrl device */
ctrl
->
next_event
=
0
;
ctrl
->
next_event
=
0
;
pciehp_ctrl_list
=
ctrl
;
if
(
!
pciehp_ctrl_list
)
{
ctrl
->
next
=
NULL
;
pciehp_ctrl_list
=
ctrl
;
ctrl
->
next
=
NULL
;
}
else
{
ctrl
->
next
=
pciehp_ctrl_list
;
pciehp_ctrl_list
=
ctrl
;
}
/* Wait for exclusive access to hardware */
down
(
&
ctrl
->
crit_sect
);
down
(
&
ctrl
->
crit_sect
);
t_slot
->
hpc_ops
->
get_adapter_status
(
t_slot
,
&
value
);
/* Check if slot is occupied */
t_slot
->
hpc_ops
->
get_adapter_status
(
t_slot
,
&
value
);
/* Check if slot is occupied */
dbg
(
"%s: adpater value %x
\n
"
,
__FUNCTION__
,
value
);
dbg
(
"%s: adpater value %x
\n
"
,
__FUNCTION__
,
value
);
if
(
!
value
)
{
if
(
!
value
)
{
rc
=
t_slot
->
hpc_ops
->
power_off_slot
(
t_slot
);
rc
=
t_slot
->
hpc_ops
->
power_off_slot
(
t_slot
);
/* Power off slot if not occupied*/
if
(
rc
)
{
if
(
rc
)
{
/* Done with exclusive hardware access */
up
(
&
ctrl
->
crit_sect
);
up
(
&
ctrl
->
crit_sect
);
goto
err_out_free_ctrl_slot
;
goto
err_out_free_ctrl_slot
;
}
else
}
else
/* Wait for the command to complete */
/* Wait for the command to complete */
wait_for_ctrl_irq
(
ctrl
);
wait_for_ctrl_irq
(
ctrl
);
}
}
/* Done with exclusive hardware access */
up
(
&
ctrl
->
crit_sect
);
up
(
&
ctrl
->
crit_sect
);
return
0
;
return
0
;
...
@@ -482,10 +480,10 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
...
@@ -482,10 +480,10 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
}
static
int
__init
pcie_start_thread
(
void
)
static
int
pcie_start_thread
(
void
)
{
{
int
loop
;
int
loop
;
int
retval
;
int
retval
=
0
;
dbg
(
"Initialize + Start the notification/polling mechanism
\n
"
);
dbg
(
"Initialize + Start the notification/polling mechanism
\n
"
);
...
...
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