[PATCH 01/10] soc: fujitsu: hwb: Add hardware barrier driver init/exit code
misono.tomohiro at fujitsu.com
misono.tomohiro at fujitsu.com
Tue Jan 12 05:49:30 EST 2021
> On Fri, Jan 8, 2021 at 11:32 AM Misono Tomohiro
> <misono.tomohiro at jp.fujitsu.com> wrote:
> > + *
> > + * This hardware barrier (HWB) driver provides a set of ioctls to realize synchronization
> > + * by PEs in the same Come Memory Group (CMG) by using implementation defined registers.
> > + * On A64FX, CMG is the same as L3 cache domain.
> > + *
> > + * The main purpose of the driver is setting up registers which cannot be accessed
> > + * from EL0. However, after initialization, BST_SYNC/LBSY_SYNC registers which is used
> > + * in synchronization main logic can be accessed from EL0 (therefore it is fast).
> > + *
> > + * Simplified barrier operation flow of user application is as follows:
> > + * (one PE)
> > + * 1. Call IOC_BB_ALLOC to setup INIT_SYNC register which is shared in a CMG.
> > + * This specifies which PEs join synchronization
> > + * (on each PE joining synchronization)
> > + * 2. Call IOC_BW_ASSIGN to setup ASSIGN_SYNC register per PE
> > + * 3. Barrier main logic (all logic runs in EL0)
> > + * a) Write 1 to BST_SYNC register
> > + * b) Read LBSY_SYNC register
> > + * c) If LBSY_SYNC value is 1, sync is finished, otherwise go back to b
> > + * (If all PEs joining synchronization write 1 to BST_SYNC, LBSY_SYNC becomes 1)
> > + * 4. Call IOC_BW_UNASSIGN to reset ASSIGN_SYNC register
> > + * (one PE)
> > + * 5. Call IOC_BB_FREE to reset INIT_SYNC register
> > + */
>
> On a very general note, I would like to see some background about how
> specific this functionality is to the specific design of A64fx. If there are
> other processors with a similar requirement, then it would be best to
> define a more abstract user API that can work for any such product.
As I said in reply to cover letter, I don't know any other product having similar features.
(reply: https://lore.kernel.org/linux-arm-kernel/20210108105241.1757799-1-misono.tomohiro@jp.fujitsu.com/T/#mdb9dd8f8cb8fd0b1ce24983efb8b616a38f4b8e8)
> > +static int __init hwb_init(void)
> > +{
> > + int ret;
> > +
> > + ret = setup_hwinfo();
> > + if (ret < 0) {
> > + pr_err("Unsupported CPU type\n");
> > + return ret;
> > + }
>
> Loading the module on a different machine should not print a warning:
> In general, we want it to be possible to have all hardware specific
> drivers built into the kernel, but not print any irritating messages
> when they are simply not used on the hardware.
>
> One way to avoid this would be to use a platform_driver() that
> only gets loaded when a corresponding hardware device of some
> sort is found, or ignored otherwise.
As far as I understand, to use platform_driver() the system needs to provide device tree or
ACPI entry for the driver. Target system uses ACPI but there is no corresponding ACPI HID
for this hardware barrier feature as that is an extension feature to the processor.
So, I thought it is not applicable to use platform_driver().
At least, I will remove this pr_err() If I send updated patch.
Regards,
Tomohiro
More information about the linux-arm-kernel
mailing list