Re: [RFC PATCH 08/13] fwctl/cxl: Add driver for CXL mailbox for handling CXL features commands

Dave Jiang
2024-09-26T20:26:04Z

On 9/26/24 10:37 AM, Jason Gunthorpe wrote:
> On Tue, Sep 24, 2024 at 04:44:19PM -0700, Dave Jiang wrote:
>
>>>> @@ -1030,6 +1032,7 @@ static const struct file_operations cxl_memdev_fops = {
>>>> struct cxl_memdev *devm_cxl_add_memdev(struct device *host,
>>>> struct cxl_dev_state *cxlds)
>>>> {
>>>> + struct auxiliary_device *adev;
>>>
>>> Why an auxdev? It can be any convienient dev to which a driver
>>> will bind. Why not spin one on the CXL bus for this purpose?
>
> IMHO bus members should adhere to some kinds of rules about the bus
> itself. Devices should have the same set of paramters/etc. I don't
> know what cxl_bus is, but I'd be surprised that something with that
> name has SW only entities on it as devices??

So I did do the conversion yesterday and it ended up looking something like this [1]. cxl_bus has cxl objects that are hardware representations (endpoints, ports, decoders, pmu, etc) or software representations (regions). So it's probably ok to keep all the cxl stuff on the same bus. I don't have a strong feeling on whether use cxl bus that already exists or using aux bus.

>
> aux bus was specifically for SW only entities that are just for
> linking software components.
>
> Jason

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git/commit/?h=cxl/fwctl&id=231da137a959331cc5bc80ef4acb3d7e667bfbad