[PATCH v3 03/18] cxl: Define process problem state area at attach time only

Frederic Barrat fbarrat at linux.vnet.ibm.com
Fri Feb 12 01:40:07 AEDT 2016



Le 10/02/2016 07:32, Ian Munsie a écrit :
> It might be a reasonable idea to make cxl_psa_map fail outright if it is
> called on a context that has not been attached yet like we do in the
> user api, but I trust kernel devs to get this right more than userspace
> so I'm not too worried :)


The net effect will be the same (we return a NULL pointer, which will 
need to be handled properly by the caller), but I like your suggestion 
of checking whether the context is attached first, which avoids calling 
ioremap() with null parameters.

Pushing it further: if we don't allow mapping the psa before attaching, 
then I believe the call to cxl_afu_check_and_enable() is no longer 
useful, since the AFU will be enabled on the first attach()

[ the very existence of the call to cxl_afu_check_and_enable() confirms 
my first impression: allowing to map the psa before attaching was 
deliberate ]

   Fred



More information about the Linuxppc-dev mailing list