diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-08-29 19:40:01 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-08-30 08:57:20 +0200 |
commit | 57b5918c33a0797930c3791fb602a8a9d46ef80c (patch) | |
tree | 47e3a5b503e8551f130fb722fbf1ae281e6ed292 /arch/s390/pci/pci_clp.c | |
parent | d03abe5882cc4815bf98c0e01a1deafa4a5d6730 (diff) |
s390/pci: update function handle after resume from hibernate
Function handles may change while the system was in hibernation
use list pci functions and update the function handles.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci_clp.c')
-rw-r--r-- | arch/s390/pci/pci_clp.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c index 3eaf63a6eca..475563c3d1e 100644 --- a/arch/s390/pci/pci_clp.c +++ b/arch/s390/pci/pci_clp.c @@ -319,6 +319,20 @@ static void __clp_rescan(struct clp_fh_list_entry *entry) } } +static void __clp_update(struct clp_fh_list_entry *entry) +{ + struct zpci_dev *zdev; + + if (!entry->vendor_id) + return; + + zdev = get_zdev_by_fid(entry->fid); + if (!zdev) + return; + + zdev->fh = entry->fh; +} + int clp_scan_pci_devices(void) { struct clp_req_rsp_list_pci *rrb; @@ -348,3 +362,18 @@ int clp_rescan_pci_devices(void) clp_free_block(rrb); return rc; } + +int clp_rescan_pci_devices_simple(void) +{ + struct clp_req_rsp_list_pci *rrb; + int rc; + + rrb = clp_alloc_block(GFP_NOWAIT); + if (!rrb) + return -ENOMEM; + + rc = clp_list_pci(rrb, __clp_update); + + clp_free_block(rrb); + return rc; +} |