[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211110174356.000000d1@Huawei.com>
Date: Wed, 10 Nov 2021 17:43:56 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ben Widawsky <ben.widawsky@...el.com>
CC: Dan Williams <dan.j.williams@...el.com>,
<linux-cxl@...r.kernel.org>, "Ira Weiny" <ira.weiny@...el.com>,
<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 07/10] cxl/pci: Split cxl_pci_setup_regs()
On Wed, 10 Nov 2021 09:30:40 -0800
Ben Widawsky <ben.widawsky@...el.com> wrote:
> On 21-11-10 17:14:37, Jonathan Cameron wrote:
> > On Fri, 15 Oct 2021 16:30:42 -0700
> > Dan Williams <dan.j.williams@...el.com> wrote:
> >
> > > From: Ben Widawsky <ben.widawsky@...el.com>
> > >
> > > In preparation for moving parts of register mapping to cxl_core, split
> > > cxl_pci_setup_regs() into a helper that finds register blocks,
> > > (cxl_find_regblock()), and a generic wrapper that probes the precise
> > > register sets within a block (cxl_setup_regs()).
> > >
> > > Move the actual mapping (cxl_map_regs()) of the only register-set that
> > > cxl_pci cares about (memory device registers) up a level from the former
> > > cxl_pci_setup_regs() into cxl_pci_probe().
> > >
> > > With this change the unused component registers are no longer mapped,
> > > but the helpers are primed to move into the core.
> > >
> > > [djbw: drop cxl_map_regs() for component registers]
> > >
> > > Signed-off-by: Ben Widawsky <ben.widawsky@...el.com>
> > > [djbw: rebase on the cxl_register_map refactor]
> > > Reviewed-by: Ira Weiny <ira.weiny@...el.com>
> > > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> > > Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> >
> > Hi Ben / all,
> >
> > This is probably the best patch to comment on for this
> > (note it is not a comment about this patch, but more the state we end up
> > in after it).
> >
> > cxl_map_regs() is a generic function, but with the new split approach
> > as a result of this patch, we now always know at the caller which of
> > the types of map we are doing.
> >
> > I think it would be clearer to embrace that situation and drop cxl_map_regs()
> > in favor of directly calling the relevant specific versions such as
> > cxl_map_device_regs(). I can't immediately see how the generic cxl_map_regs()
> > will be useful to us going forwards.
> >
> > Jonathan
>
> I completely agree. Long term, something like cxl_map_regs() might be desirable
> for a Type2 device, but we have no such user today. Patches welcome?
Sure, will do.
J
Powered by blists - more mailing lists