From: Andrew Jeffery <andrew@codeconstruct.com.au>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: minyard@acm.org, openipmi-developer@lists.sourceforge.net,
linux-kernel@vger.kernel.org, aladyshev22@gmail.com,
jk@codeconstruct.com.au
Subject: Re: [PATCH 08/10] ipmi: kcs_bmc: Track clients in core
Date: Mon, 27 Nov 2023 13:32:57 +1030 [thread overview]
Message-ID: <4e355b4b19d49753d900094c900f2586d283179e.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20231120124001.00003cbc@Huawei.com>
On Mon, 2023-11-20 at 12:40 +0000, Jonathan Cameron wrote:
> On Mon, 06 Nov 2023 10:26:38 +1030
> Andrew Jeffery <andrew@codeconstruct.com.au> wrote:
>
> > On Fri, 2023-11-03 at 15:05 +0000, Jonathan Cameron wrote:
> > > On Fri, 3 Nov 2023 16:45:20 +1030
> > > Andrew Jeffery <andrew@codeconstruct.com.au> wrote:
> > >
> > > > I ran out of spoons before I could come up with a better client tracking
> > > > scheme back in the original refactoring series:
> > > >
> > > > https://lore.kernel.org/all/20210608104757.582199-1-andrew@aj.id.au/
> > > >
> > > > Jonathan prodded Konstantin about the issue in a review of Konstantin's
> > > > MCTP patches[1], prompting an attempt to clean it up.
> > > >
> > > > [1]: https://lore.kernel.org/all/20230929120835.0000108e@Huawei.com/
> > > >
> > > > Prevent client modules from having to track their own instances by
> > > > requiring they return a pointer to a client object from their
> > > > add_device() implementation. We can then track this in the core, and
> > > > provide it as the argument to the remove_device() implementation to save
> > > > the client module from further work. The usual container_of() pattern
> > > > gets the client module access to its private data.
> > > >
> > > > Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
> > >
> > > Hi Andrew,
> > >
> > > A few comments inline.
> > > More generally, whilst this is definitely an improvement I'd have been tempted
> > > to make more use of the linux device model for this with the clients added
> > > as devices with a parent of the kcs_bmc_device. That would then allow for
> > > simple dependency tracking, binding of individual drivers and all that.
> > >
> > > What you have here feels fine though and is a much less invasive change.
> >
> Sorry for slow reply, been traveling.
No worries, I've just got back from travel myself :)
>
> > Yeah, I had this debate with myself before posting the patches. My
> > reasoning for the current approach is that the clients don't typically
> > represent a device, rather a protocol implementation that is
> > communicated over a KCS device (maybe more like pairing a line
> > discipline with a UART). It was unclear to me whether associating a
> > `struct device` with a protocol implementation was stretching the
> > abstraction a bit, or whether I haven't considered some other
> > perspective hard enough - maybe we treat the client as the remote
> > device, similar to e.g. a `struct i2c_client`?
>
> That was my thinking. The protocol is used to talk to someone - the endpoint
> (similar to i2c_client) so represent that. If that device is handling multiple
> protocols (no idea if that is possible) - that is fine as well, it just becomes
> like having multiple i2c_clients in a single package (fairly common for sensors),
> or the many other cases where we use a struct device to represent just part
> of a larger device that operates largely independently of other parts (or with
> well defined boundaries).
Alright, let me think about that a bit more.
Thanks for the feedback,
Andrew
next prev parent reply other threads:[~2023-11-27 3:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 6:15 [PATCH 00/10] ipmi: kcs_bmc: Miscellaneous cleanups Andrew Jeffery
2023-11-03 6:15 ` [PATCH 01/10] ipmi: kcs_bmc: Update module description Andrew Jeffery
2023-11-03 14:34 ` Jonathan Cameron
2023-11-03 6:15 ` [PATCH 02/10] ipmi: kcs_bmc: Include spinlock.h Andrew Jeffery
2023-11-03 14:36 ` Jonathan Cameron
2023-11-05 22:47 ` Andrew Jeffery
2023-11-03 6:15 ` [PATCH 03/10] ipmi: kcs_bmc: Make kcs_bmc_update_event_mask() static Andrew Jeffery
2023-11-03 14:40 ` Jonathan Cameron
2023-11-05 22:52 ` Andrew Jeffery
2023-11-03 6:15 ` [PATCH 04/10] ipmi: kcs_bmc: Make remove_device() callback return void Andrew Jeffery
2023-11-03 14:43 ` Jonathan Cameron
2023-11-05 22:54 ` Andrew Jeffery
2023-11-03 6:15 ` [PATCH 05/10] ipmi: kcs_bmc: Define client actions in terms of kcs_bmc_client Andrew Jeffery
2023-11-03 15:16 ` Jonathan Cameron
2023-11-07 6:32 ` Andrew Jeffery
2023-11-03 6:15 ` [PATCH 06/10] ipmi: kcs_bmc: Integrate buffers into driver struct Andrew Jeffery
2023-11-03 14:45 ` Jonathan Cameron
2023-11-05 22:55 ` Andrew Jeffery
2023-11-03 6:15 ` [PATCH 07/10] ipmi: kcs_bmc: Disassociate client from device lifetimes Andrew Jeffery
2023-11-03 14:51 ` Jonathan Cameron
2023-11-05 23:01 ` Andrew Jeffery
2023-11-03 6:15 ` [PATCH 08/10] ipmi: kcs_bmc: Track clients in core Andrew Jeffery
2023-11-03 15:05 ` Jonathan Cameron
2023-11-05 23:56 ` Andrew Jeffery
2023-11-20 12:40 ` Jonathan Cameron
2023-11-27 3:02 ` Andrew Jeffery [this message]
2023-11-03 6:15 ` [PATCH 09/10] ipmi: kcs_bmc: Add module_kcs_bmc_driver() Andrew Jeffery
2023-11-03 15:06 ` Jonathan Cameron
2023-11-03 6:15 ` [PATCH 10/10] ipmi: kcs_bmc: Add subsystem kerneldoc Andrew Jeffery
2023-11-03 15:12 ` Jonathan Cameron
2023-11-06 0:05 ` Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e355b4b19d49753d900094c900f2586d283179e.camel@codeconstruct.com.au \
--to=andrew@codeconstruct.com.au \
--cc=Jonathan.Cameron@Huawei.com \
--cc=aladyshev22@gmail.com \
--cc=jk@codeconstruct.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=minyard@acm.org \
--cc=openipmi-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome