]> git.karo-electronics.de Git - linux-beck.git/commit
cxl: Refactor AFU init/teardown
authorDaniel Axtens <dja@axtens.net>
Fri, 14 Aug 2015 07:41:23 +0000 (17:41 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 14 Aug 2015 11:32:07 +0000 (21:32 +1000)
commitd76427b0d89524fdb623774a22a005ba5c400134
tree5053cc9f7734153dfa48dadf091133327d6ff0a6
parentc044c4154247372c86b468644de88a4e48f903e9
cxl: Refactor AFU init/teardown

As with an adapter, some aspects of initialisation are done only once
in the lifetime of an AFU: for example, allocating memory, or setting
up sysfs/debugfs files.

However, we may want to be able to do some parts of the initialisation
multiple times: for example, in error recovery we want to be able to
tear down and then re-map IO memory and IRQs.

Therefore, refactor AFU init/teardown as follows.

 - Create two new functions: 'cxl_configure_afu', and its pair
   'cxl_deconfigure_afu'. As with the adapter functions,
   these (de)configure resources that do not need to last the entire
   lifetime of the AFU.

 - Allocating and releasing memory remain the task of 'cxl_alloc_afu'
   and 'cxl_release_afu'.

 - Once-only functions that do not involve allocating/releasing memory
   stay in the overarching 'cxl_init_afu'/'cxl_remove_afu' pair.
   However, the task of picking an AFU mode and activating it has been
   broken out.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/pci.c