Re: [Openipmi-developer] [PATCH 5/6] ipmi: kcs_bmc_aspeed: Convert to platform remove callback returning void

2024-03-05 Thread Andrew Jeffery
> are converted, .remove_new() will be renamed to .remove(). > > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. > > Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Jeffery Thanks! ___

Re: [Openipmi-developer] [PATCH] ipmi: kcs: Update OBF poll timeout to reduce latency

2024-02-20 Thread Andrew Jeffery
On Tue, 2024-02-20 at 13:33 -0600, Corey Minyard wrote: > On Tue, Feb 20, 2024 at 04:51:21PM +0100, Paul Menzel wrote: > > Dear Andrew, > > > > > > Thank you for your patch. Some style suggestions. > > > > Am 20.02.24 um 13:36 schrieb Andrew Geissler: > > > From: Andrew Geissler > > > > (Oh no

Re: [Openipmi-developer] [PATCH 08/10] ipmi: kcs_bmc: Track clients in core

2023-11-26 Thread Andrew Jeffery
On Mon, 2023-11-20 at 12:40 +, Jonathan Cameron wrote: > On Mon, 06 Nov 2023 10:26:38 +1030 > Andrew Jeffery wrote: > > > On Fri, 2023-11-03 at 15:05 +, Jonathan Cameron wrote: > > > On Fri, 3 Nov 2023 16:45:20 +1030 > > > Andrew Jeffery wrote: >

Re: [Openipmi-developer] [PATCH 05/10] ipmi: kcs_bmc: Define client actions in terms of kcs_bmc_client

2023-11-06 Thread Andrew Jeffery
On Fri, 2023-11-03 at 15:16 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:17 +1030 > Andrew Jeffery wrote: > > > Operations such as reading and writing from hardware and updating the > > events of interest are operations in which the client is interested, but &

Re: [Openipmi-developer] [PATCH 10/10] ipmi: kcs_bmc: Add subsystem kerneldoc

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 15:12 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:22 +1030 > Andrew Jeffery wrote: > > > Provide kerneldoc describing the relationships between and the > > behaviours of the structures and functions of the KCS subsystem. > > > &

Re: [Openipmi-developer] [PATCH 08/10] ipmi: kcs_bmc: Track clients in core

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 15:05 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:20 +1030 > Andrew Jeffery wrote: > > > I ran out of spoons before I could come up with a better client tracking > > scheme back in the original refactoring series: > > >

Re: [Openipmi-developer] [PATCH 07/10] ipmi: kcs_bmc: Disassociate client from device lifetimes

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 14:51 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:19 +1030 > Andrew Jeffery wrote: > > > KCS client modules may be removed by actions unrelated to KCS devices. > > As usual, removing a KCS client module requires unbinding all client &

Re: [Openipmi-developer] [PATCH 06/10] ipmi: kcs_bmc: Integrate buffers into driver struct

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 14:45 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:18 +1030 > Andrew Jeffery wrote: > > > Consolidate several necessary allocations into one to reduce the number > > of possible error paths. > > > > Signed-off-by: Andrew J

Re: [Openipmi-developer] [PATCH 04/10] ipmi: kcs_bmc: Make remove_device() callback return void

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 14:43 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:16 +1030 > Andrew Jeffery wrote: > > > Don't pretend there's a valid failure path when there's not. > > > > Signed-off-by: Andrew Jeffery > > Whilst I a

Re: [Openipmi-developer] [PATCH 03/10] ipmi: kcs_bmc: Make kcs_bmc_update_event_mask() static

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 14:40 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:15 +1030 > Andrew Jeffery wrote: > > > There were no users outside the subsystem core, so let's not expose it. > > > > Signed-off-by: Andrew Jeffery > Is it worth havin

Re: [Openipmi-developer] [PATCH 02/10] ipmi: kcs_bmc: Include spinlock.h

2023-11-05 Thread Andrew Jeffery
On Fri, 2023-11-03 at 14:36 +, Jonathan Cameron wrote: > On Fri, 3 Nov 2023 16:45:14 +1030 > Andrew Jeffery wrote: > > > struct kcs_bmc_device defines a spinlock member but the header in which > > it is defined failed to include the spinlock header. In the spirit of >

[Openipmi-developer] [PATCH 06/10] ipmi: kcs_bmc: Integrate buffers into driver struct

2023-11-03 Thread Andrew Jeffery
Consolidate several necessary allocations into one to reduce the number of possible error paths. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 25 - 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/char/ipmi

[Openipmi-developer] [PATCH 02/10] ipmi: kcs_bmc: Include spinlock.h

2023-11-03 Thread Andrew Jeffery
struct kcs_bmc_device defines a spinlock member but the header in which it is defined failed to include the spinlock header. In the spirit of include-what-you-use, do what's necessary. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.h | 1 + 1 file changed, 1 insertion(+)

[Openipmi-developer] [PATCH 05/10] ipmi: kcs_bmc: Define client actions in terms of kcs_bmc_client

2023-11-03 Thread Andrew Jeffery
types in the core of the KCS subsystem. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 67 ++- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 50 ++-- drivers/char/ipmi/kcs_bmc_client.h| 15 +++--- drivers/char/ipmi/kcs_bmc_serio.c

[Openipmi-developer] [PATCH 08/10] ipmi: kcs_bmc: Track clients in core

2023-11-03 Thread Andrew Jeffery
de 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 --- drivers/char/ipmi/kcs_bmc.c | 68 --- dr

[Openipmi-developer] [PATCH 04/10] ipmi: kcs_bmc: Make remove_device() callback return void

2023-11-03 Thread Andrew Jeffery
Don't pretend there's a valid failure path when there's not. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 12 ++-- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 6 ++ drivers/char/ipmi/kcs_bmc_client.h| 2 +- drivers/char/ipmi/kcs_bmc_s

[Openipmi-developer] [PATCH 10/10] ipmi: kcs_bmc: Add subsystem kerneldoc

2023-11-03 Thread Andrew Jeffery
Provide kerneldoc describing the relationships between and the behaviours of the structures and functions of the KCS subsystem. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.h| 39 drivers/char/ipmi/kcs_bmc_client.h | 151 + drivers

[Openipmi-developer] [PATCH 03/10] ipmi: kcs_bmc: Make kcs_bmc_update_event_mask() static

2023-11-03 Thread Andrew Jeffery
There were no users outside the subsystem core, so let's not expose it. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c| 11 +-- drivers/char/ipmi/kcs_bmc_client.h | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/char/ipmi/kcs_bm

[Openipmi-developer] [PATCH 09/10] ipmi: kcs_bmc: Add module_kcs_bmc_driver()

2023-11-03 Thread Andrew Jeffery
Remove some cruft in the client modules by adding the usual module macro for the KCS subsystem. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 4 +++- drivers/char/ipmi/kcs_bmc.h | 1 + drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 15 +-- drivers

[Openipmi-developer] [PATCH 00/10] ipmi: kcs_bmc: Miscellaneous cleanups

2023-11-03 Thread Andrew Jeffery
ed I expect we'll have to either take these KCS patches through netdev or the MCTP patches through the IPMI tree. We should figure out which way we want to go, but netdev's not open right now and so that's not a pressing concern. Please review! Thanks, Andrew Andrew Jeff

[Openipmi-developer] [PATCH 07/10] ipmi: kcs_bmc: Disassociate client from device lifetimes

2023-11-03 Thread Andrew Jeffery
tch to explicit kmalloc()/kfree() to align expectations with the intent of the code. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_cdev_ipmi.c | 28 ++- drivers/char/ipmi/kcs_bmc_serio.c | 20 --- 2 files changed, 32 insertions(+), 16 deletions

[Openipmi-developer] [PATCH 01/10] ipmi: kcs_bmc: Update module description

2023-11-03 Thread Andrew Jeffery
KCS devices are often used for IPMI, but they're not constrained to it. Update the subsystem module description to reflect its more general capabilities. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

Re: [Openipmi-developer] [PATCH 3/3] mctp: Add MCTP-over-KCS transport binding

2023-10-03 Thread Andrew Jeffery
Hi Jonathan, On Fri, 29 Sep 2023, at 20:38, Jonathan Cameron wrote: > On Thu, 28 Sep 2023 15:30:09 +0300 > Konstantin Aladyshev wrote: > >> This change adds a MCTP KCS transport binding, as defined by the DMTF >> specificiation DSP0254 - "MCTP KCS Transport Binding". >> A MCTP protocol network de

openipmi-developer@lists.sourceforge.net

2023-07-05 Thread Andrew Jeffery
On Tue, 4 Jul 2023, at 23:57, Corey Minyard wrote: > On Fri, Jun 30, 2023 at 10:31:02AM +0930, Andrew Jeffery wrote: >> Hi Corey, Chengfeng, >> >> On Wed, 28 Jun 2023, at 21:17, Corey Minyard wrote: >> > Indeed, this looks like an issue. >> > >>

openipmi-developer@lists.sourceforge.net

2023-06-29 Thread Andrew Jeffery
Hi Corey, Chengfeng, On Wed, 28 Jun 2023, at 21:17, Corey Minyard wrote: > Indeed, this looks like an issue. > > Andrew, any opinions on this? The attached patch will work, the other > option would be to disable interrupts when calling > kcs_bmc_handle_event() in the timer handler. But then you

Re: [Openipmi-developer] [PATCH] dt-bindings: ipmi: aspeed, ast2400-kcs-bmc: drop unneeded quotes

2023-06-09 Thread Andrew Jeffery
On Fri, 9 Jun 2023, at 23:37, Krzysztof Kozlowski wrote: > Cleanup bindings dropping unneeded quotes. Once all these are fixed, > checking for this can be enabled in yamllint. > > Signed-off-by: Krzysztof Kozlowski Acked-by: Andrew Jeffery > --- > .../devicetree/bi

Re: [Openipmi-developer] [PATCH] ipmi: ipmi-bmc: Improve errno returned to userspace

2023-04-20 Thread Andrew Jeffery
Hi Corey, On Thu, 20 Apr 2023, at 21:40, Corey Minyard wrote: > Andrew, what do you think? I'm a bit short on details of the IPMI KCS state machine and expectations of userspace in this exact case. I've added Vernon who is one of the IPMI maintainers for OpenBMC. I've also added Zev who's an i

Re: [Openipmi-developer] [PATCH] ipmi: kcs: Poll OBF briefly to reduce OBE latency

2022-10-05 Thread Andrew Jeffery
On Thu, 6 Oct 2022, at 10:20, Joel Stanley wrote: > On Fri, 12 Aug 2022 at 14:48, Andrew Jeffery wrote: >> >> The ASPEED KCS devices don't provide a BMC-side interrupt for the host >> reading the output data register (ODR). The act of the host reading ODR >> cl

Re: [Openipmi-developer] [PATCH] ipmi: kcs: Poll OBF briefly to reduce OBE latency

2022-10-05 Thread Andrew Jeffery
On Thu, 6 Oct 2022, at 10:24, Corey Minyard wrote: > On Thu, Oct 06, 2022 at 09:42:57AM +1030, Andrew Jeffery wrote: >> Hi Corey, >> >> On Sat, 13 Aug 2022, at 00:17, Andrew Jeffery wrote: >> > The ASPEED KCS devices don't provide a BMC-side interrupt for th

Re: [Openipmi-developer] [PATCH] ipmi: kcs: Poll OBF briefly to reduce OBE latency

2022-10-05 Thread Andrew Jeffery
Hi Corey, On Sat, 13 Aug 2022, at 00:17, Andrew Jeffery wrote: > The ASPEED KCS devices don't provide a BMC-side interrupt for the host > reading the output data register (ODR). The act of the host reading ODR > clears the output buffer full (OBF) flag in the status register (STR

[Openipmi-developer] [PATCH] ipmi: kcs: Poll OBF briefly to reduce OBE latency

2022-08-12 Thread Andrew Jeffery
lient must enable the OBE event *and* perform a subsequent read of STR anyway to avoid races - the polling provides a window for the host to read ODR if data was freshly written while minimising BMC-side latency. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c

Re: [Openipmi-developer] [PATCH -next 3/4] ARM: dts: aspeed: add LCLK setting into LPC KCS nodes

2021-11-02 Thread Andrew Jeffery
On Tue, 2 Nov 2021, at 10:07, jae.hyun@intel.com wrote: > From: Jae Hyun Yoo > > Add LCLK clock setting into LPC KCS nodes to enable the LCLK by > individual LPC sub drivers. > > Signed-off-by: Jae Hyun Yoo Reviewed-

Re: [Openipmi-developer] [PATCH -next 1/4] ARM: dts: aspeed: add LCLK setting into LPC IBT node

2021-11-02 Thread Andrew Jeffery
On Tue, 2 Nov 2021, at 10:07, jae.hyun@intel.com wrote: > From: Jae Hyun Yoo > > Add LCLK clock setting into LPC IBT node to enable the LCLK by > individual LPC sub drivers. > > Signed-off-by: Jae Hyun Yoo Reviewed-

Re: [Openipmi-developer] [PATCH -next 2/4] ipmi: bt: add clock control logic

2021-11-02 Thread Andrew Jeffery
> individually so this patch adds clock control logic into the LPC > BT driver. > > Fixes: 54f9c4d0778b ("ipmi: add an Aspeed BT IPMI BMC driver") > Signed-off-by: Jae Hyun Yoo Reviewed-by: Andrew Jeffery ___ Openipmi-deve

Re: [Openipmi-developer] [PATCH] ipmi: kcs_bmc: Fix a memory leak in the error handling path of 'kcs_bmc_serio_add_device()'

2021-10-28 Thread Andrew Jeffery
ot;ipmi: kcs_bmc: Add serio adaptor") > Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Jeffery Sorry for the delay > --- > drivers/char/ipmi/kcs_bmc_serio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/char/ipmi/kcs_bmc_serio

Re: [Openipmi-developer] [PATCH][next] ipmi: kcs_bmc_aspeed: Fix less than zero comparison of a unsigned int

2021-06-16 Thread Andrew Jeffery
On Thu, 17 Jun 2021, at 01:59, Colin King wrote: > From: Colin Ian King > > The comparisons of the unsigned int hw_type to less than zero always > false because it is unsigned. Fix this by using an int for the > assignment and less than zero check. > > Addresses-Coverity: ("Unsigned compared

Re: [Openipmi-developer] [PATCH v4 00/16] ipmi: Allow raw access to KCS devices

2021-06-15 Thread Andrew Jeffery
On Wed, 16 Jun 2021, at 04:16, Corey Minyard wrote: > On Tue, Jun 08, 2021 at 08:17:41PM +0930, Andrew Jeffery wrote: > > > > Hello, > > > > This is the 4th spin of the series refactoring the keyboard-controller-style > > device drivers in the IPMI su

[Openipmi-developer] [PATCH v4 16/16] ipmi: kcs_bmc_aspeed: Optionally apply status address

2021-06-08 Thread Andrew Jeffery
addressing scheme. Allow these requests where possible if the devicetree specifies the status register address. Signed-off-by: Andrew Jeffery Reviewed-by: Chia-Wei Wang --- drivers/char/ipmi/kcs_bmc_aspeed.c | 116 + 1 file changed, 83 insertions(+), 33 deletions

[Openipmi-developer] [PATCH v4 03/16] ipmi: kcs_bmc: Rename {read, write}_{status, data}() functions

2021-06-08 Thread Andrew Jeffery
Rename the functions in preparation for separating the IPMI chardev out from the KCS BMC core. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 52 ++--- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a

[Openipmi-developer] [PATCH v4 06/16] ipmi: kcs_bmc: Split headers into device and client

2021-06-08 Thread Andrew Jeffery
Strengthen the distinction between code that abstracts the implementation of the KCS behaviours (device drivers) and code that exploits KCS behaviours (clients). Neither needs to know about the APIs required by the other, so provide separate headers. Signed-off-by: Andrew Jeffery --- drivers

[Openipmi-developer] [PATCH v4 05/16] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-06-08 Thread Andrew Jeffery
layer off the onion and turn the data-structures inside out by exploiting container_of() and embedding `struct kcs_device` in the driver private data. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 17 ++-- drivers/char/ipmi/kcs_bmc.h

[Openipmi-developer] [PATCH v4 08/16] ipmi: kcs_bmc: Decouple the IPMI chardev from the core

2021-06-08 Thread Andrew Jeffery
Now that we have untangled the data-structures, split the userspace interface out into its own module. Userspace interfaces and drivers are registered to the KCS BMC core to support arbitrary binding of either. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/Kconfig | 13

[Openipmi-developer] [PATCH v4 14/16] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-06-08 Thread Andrew Jeffery
Apply the SerIRQ ID and level/sense behaviours from the devicetree if provided. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 182 - 1 file changed, 180 insertions(+), 2 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers

[Openipmi-developer] [PATCH v4 02/16] ipmi: kcs_bmc: Make status update atomic

2021-06-08 Thread Andrew Jeffery
Enable more efficient implementation of read-modify-write sequences. Both device drivers for the KCS BMC stack use regmaps. The new callback allows us to exploit regmap_update_bits(). Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 7

[Openipmi-developer] [PATCH v4 09/16] ipmi: kcs_bmc: Allow clients to control KCS IRQ state

2021-06-08 Thread Andrew Jeffery
pport an OBE interrupt for the BMC. Instead we pretend it has one by polling the status register waiting for the Output Buffer Full (OBF) bit to clear, and generating an event when OBE is observed. Cc: CS20 KWLiu Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_

[Openipmi-developer] [PATCH v4 15/16] ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet

2021-06-08 Thread Andrew Jeffery
Input Buffer Full Interrupt Enable (IBFIE) is typoed as IBFIF for some registers in the datasheet. Fix the driver to use the sensible acronym. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc_aspeed.c | 24 1 file changed, 12

[Openipmi-developer] [PATCH v4 04/16] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi

2021-06-08 Thread Andrew Jeffery
file. The code continues to build into the same module. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/Makefile| 2 +- drivers/char/ipmi/kcs_bmc.c | 423 + drivers/char/ipmi/kcs_bmc.h | 10 +- drivers/char/ipmi

[Openipmi-developer] [PATCH v4 13/16] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices

2021-06-08 Thread Andrew Jeffery
r KCS devices to describe SerIRQ properties. Signed-off-by: Andrew Jeffery Reviewed-by: Rob Herring --- .../bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/ipmi/aspeed,ast2400-kcs-bmc.ya

[Openipmi-developer] [PATCH v4 07/16] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc

2021-06-08 Thread Andrew Jeffery
slate as required. Finally, now that it is free of client data, `struct kcs_bmc` is renamed to `struct kcs_bmc_device` to contrast `struct kcs_bmc_client`. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 70 - drivers/char/ipmi/kcs_

[Openipmi-developer] [PATCH v4 11/16] ipmi: kcs_bmc: Add serio adaptor

2021-06-08 Thread Andrew Jeffery
kcs_bmc_serio acts as a bridge between the KCS drivers in the IPMI subsystem and the existing userspace interfaces available through the serio subsystem. This is useful when userspace would like to make use of the BMC KCS devices for purposes that aren't IPMI. Signed-off-by: Andrew Je

[Openipmi-developer] [PATCH v4 12/16] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-06-08 Thread Andrew Jeffery
Given the deprecated binding, improve the ability to detect issues in the platform devicetrees. Further, a subsequent patch will introduce a new interrupts property for specifying SerIRQ behaviour, so convert before we do any further additions. Signed-off-by: Andrew Jeffery Reviewed-by: Rob

[Openipmi-developer] [PATCH v4 10/16] ipmi: kcs_bmc: Enable IBF on open

2021-06-08 Thread Andrew Jeffery
This way devices don't get delivered IRQs when no-one is interested. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 25 ++--- drivers/char/ipmi/kcs_bmc_aspeed.c | 3 +-- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 3 +-- 3 files changed, 12 inser

[Openipmi-developer] [PATCH v4 01/16] ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties

2021-06-08 Thread Andrew Jeffery
Unpack and remove the aspeed_kcs_probe_of_v[12]() functions to aid rearranging how the private device-driver memory is allocated. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 154 ++--- 1 file changed, 77 insertions(+), 77 deletions(-) diff

[Openipmi-developer] [PATCH v4 00/16] ipmi: Allow raw access to KCS devices

2021-06-08 Thread Andrew Jeffery
the IPMI chardev * Fixes addressing Rob's feedback on the conversion of the ASPEED KCS binding to dt-schema * Fixes addressing Rob's feedback on the new aspeed,lpc-interrupts property definition for the ASPEED KCS binding Please test and review! Andrew Andrew Jeffery (16): ipmi

Re: [Openipmi-developer] [PATCH v3 14/16] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-06-07 Thread Andrew Jeffery
On Tue, 8 Jun 2021, at 10:11, Andrew Jeffery wrote: > > > On Fri, 21 May 2021, at 16:51, Zev Weiss wrote: > > On Mon, May 10, 2021 at 12:42:11AM CDT, Andrew Jeffery wrote: > > >Apply the SerIRQ ID and level/sense behaviours from the devicetree if > > >p

Re: [Openipmi-developer] [PATCH v3 14/16] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-06-07 Thread Andrew Jeffery
On Fri, 21 May 2021, at 16:51, Zev Weiss wrote: > On Mon, May 10, 2021 at 12:42:11AM CDT, Andrew Jeffery wrote: > >Apply the SerIRQ ID and level/sense behaviours from the devicetree if > >provided. > > > >Signed-off-by: Andrew Jeffery > >--- > > d

Re: [Openipmi-developer] [PATCH v3 11/16] ipmi: kcs_bmc: Add serio adaptor

2021-06-07 Thread Andrew Jeffery
On Fri, 21 May 2021, at 16:50, Zev Weiss wrote: > On Mon, May 10, 2021 at 12:42:08AM CDT, Andrew Jeffery wrote: > >kcs_bmc_serio acts as a bridge between the KCS drivers in the IPMI > >subsystem and the existing userspace interfaces available through the > >serio subsystem

Re: [Openipmi-developer] [PATCH v3 05/16] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-05-24 Thread Andrew Jeffery
On Tue, 25 May 2021, at 01:11, Corey Minyard wrote: > On Mon, May 24, 2021 at 10:23:36AM +0930, Andrew Jeffery wrote: > > > > > > On Sat, 22 May 2021, at 02:44, Corey Minyard wrote: > > > On Mon, May 10, 2021 at 03:12:02PM +0930, Andrew Jeffery wrote: >

Re: [Openipmi-developer] [PATCH v3 05/16] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-05-23 Thread Andrew Jeffery
On Sat, 22 May 2021, at 02:44, Corey Minyard wrote: > On Mon, May 10, 2021 at 03:12:02PM +0930, Andrew Jeffery wrote: > > Make the KCS device drivers responsible for allocating their own memory. > > > > Until now the private data for the device driver was allocated intern

Re: [Openipmi-developer] [PATCH v3 10/16] ipmi: kcs_bmc: Don't enforce single-open policy in the kernel

2021-05-23 Thread Andrew Jeffery
On Sat, 22 May 2021, at 03:00, Corey Minyard wrote: > On Mon, May 10, 2021 at 03:12:07PM +0930, Andrew Jeffery wrote: > > Soon it will be possible for one KCS device to have multiple associated > > chardevs exposed to userspace (for IPMI and raw-style access). However, &g

Re: [Openipmi-developer] [PATCH v3 00/16] ipmi: Allow raw access to KCS devices

2021-05-23 Thread Andrew Jeffery
Hi Corey, On Sat, 22 May 2021, at 03:06, Corey Minyard wrote: > On Mon, May 10, 2021 at 03:11:57PM +0930, Andrew Jeffery wrote: > > Hello, > > > > This is the 3rd spin of the series refactoring the keyboard-controller-style > > device drivers in the IPMI subsystem.

Re: [Openipmi-developer] [PATCH v3 00/16] ipmi: Allow raw access to KCS devices

2021-05-19 Thread Andrew Jeffery
Hi Corey, On Mon, 10 May 2021, at 15:11, Andrew Jeffery wrote: > Hello, > > This is the 3rd spin of the series refactoring the keyboard-controller-style > device drivers in the IPMI subsystem. > > v2 can be found (in two parts because yay patch workflow mistakes) at: > &g

[Openipmi-developer] [PATCH v3 16/16] ipmi: kcs_bmc_aspeed: Optionally apply status address

2021-05-09 Thread Andrew Jeffery
addressing scheme. Allow these requests where possible if the devicetree specifies the status register address. Signed-off-by: Andrew Jeffery Reviewed-by: Chia-Wei Wang --- drivers/char/ipmi/kcs_bmc_aspeed.c | 110 - 1 file changed, 78 insertions(+), 32 deletions

[Openipmi-developer] [PATCH v3 14/16] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-05-09 Thread Andrew Jeffery
Apply the SerIRQ ID and level/sense behaviours from the devicetree if provided. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 182 - 1 file changed, 180 insertions(+), 2 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers

[Openipmi-developer] [PATCH v3 15/16] ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet

2021-05-09 Thread Andrew Jeffery
Input Buffer Full Interrupt Enable (IBFIE) is typoed as IBFIF for some registers in the datasheet. Fix the driver to use the sensible acronym. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc_aspeed.c | 24 1 file changed, 12

[Openipmi-developer] [PATCH v3 13/16] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices

2021-05-09 Thread Andrew Jeffery
r KCS devices to describe SerIRQ properties. Signed-off-by: Andrew Jeffery Reviewed-by: Rob Herring --- .../bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/ipmi/aspeed,ast2400-kcs-bmc.ya

[Openipmi-developer] [PATCH v3 12/16] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-05-09 Thread Andrew Jeffery
Given the deprecated binding, improve the ability to detect issues in the platform devicetrees. Further, a subsequent patch will introduce a new interrupts property for specifying SerIRQ behaviour, so convert before we do any further additions. Signed-off-by: Andrew Jeffery Reviewed-by: Rob

[Openipmi-developer] [PATCH v3 10/16] ipmi: kcs_bmc: Don't enforce single-open policy in the kernel

2021-05-09 Thread Andrew Jeffery
ceive notification of events. However, any fd on any chardev may race their accesses to the data and status registers. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 34 ++--- drivers/char/ipmi/kcs_bmc_aspeed.c | 3 +-- drivers/char/ipmi/kcs_bmc_npcm7xx.c

[Openipmi-developer] [PATCH v3 11/16] ipmi: kcs_bmc: Add serio adaptor

2021-05-09 Thread Andrew Jeffery
kcs_bmc_serio acts as a bridge between the KCS drivers in the IPMI subsystem and the existing userspace interfaces available through the serio subsystem. This is useful when userspace would like to make use of the BMC KCS devices for purposes that aren't IPMI. Signed-off-by: Andrew Je

[Openipmi-developer] [PATCH v3 09/16] ipmi: kcs_bmc: Allow clients to control KCS IRQ state

2021-05-09 Thread Andrew Jeffery
pport an OBE interrupt for the BMC. Instead we pretend it has one by polling the status register waiting for the Output Buffer Full (OBF) bit to clear, and generating an event when OBE is observed. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 6 ++ drivers/char

[Openipmi-developer] [PATCH v3 08/16] ipmi: kcs_bmc: Decouple the IPMI chardev from the core

2021-05-09 Thread Andrew Jeffery
Now that we have untangled the data-structures, split the userspace interface out into its own module. Userspace interfaces and drivers are registered to the KCS BMC core to support arbitrary binding of either. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/Kconfig | 13

[Openipmi-developer] [PATCH v3 07/16] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc

2021-05-09 Thread Andrew Jeffery
slate as required. Finally, now that it is free of client data, `struct kcs_bmc` is renamed to `struct kcs_bmc_device` to contrast `struct kcs_bmc_client`. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc.c | 70 - drivers/char/ipmi/kcs_bmc.h | 83 + dr

[Openipmi-developer] [PATCH v3 06/16] ipmi: kcs_bmc: Split headers into device and client

2021-05-09 Thread Andrew Jeffery
Strengthen the distinction between code that abstracts the implementation of the KCS behaviours (device drivers) and code that exploits KCS behaviours (clients). Neither needs to know about the APIs required by the other, so provide separate headers. Signed-off-by: Andrew Jeffery --- drivers

[Openipmi-developer] [PATCH v3 05/16] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-05-09 Thread Andrew Jeffery
layer off the onion and turn the data-structures inside out by exploiting container_of() and embedding `struct kcs_device` in the driver private data. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 19 +++-- drivers/char/ipmi/kcs_bmc.h

[Openipmi-developer] [PATCH v3 04/16] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi

2021-05-09 Thread Andrew Jeffery
file. The code continues to build into the same module. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/Makefile| 2 +- drivers/char/ipmi/kcs_bmc.c | 423 + drivers/char/ipmi/kcs_bmc.h | 10 +- drivers/char/ipmi

[Openipmi-developer] [PATCH v3 03/16] ipmi: kcs_bmc: Rename {read, write}_{status, data}() functions

2021-05-09 Thread Andrew Jeffery
Rename the functions in preparation for separating the IPMI chardev out from the KCS BMC core. Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 52 ++--- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a

[Openipmi-developer] [PATCH v3 00/16] ipmi: Allow raw access to KCS devices

2021-05-09 Thread Andrew Jeffery
e existing single-open constraint of the IPMI chardev * Fixes addressing Rob's feedback on the conversion of the ASPEED KCS binding to dt-schema * Fixes addressing Rob's feedback on the new aspeed,lpc-interrupts property definition for the ASPEED KCS binding Please test and review! A

[Openipmi-developer] [PATCH v3 02/16] ipmi: kcs_bmc: Make status update atomic

2021-05-09 Thread Andrew Jeffery
Enable more efficient implementation of read-modify-write sequences. Both device drivers for the KCS BMC stack use regmaps. The new callback allows us to exploit regmap_update_bits(). Signed-off-by: Andrew Jeffery Reviewed-by: Zev Weiss --- drivers/char/ipmi/kcs_bmc.c | 7

[Openipmi-developer] [PATCH v3 01/16] ipmi: kcs_bmc_aspeed: Use of match data to extract KCS properties

2021-05-09 Thread Andrew Jeffery
Unpack and remove the aspeed_kcs_probe_of_v[12]() functions to aid rearranging how the private device-driver memory is allocated. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 154 ++--- 1 file changed, 76 insertions(+), 78 deletions(-) diff

Re: [Openipmi-developer] [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-14 Thread Andrew Jeffery
On Tue, 13 Apr 2021, at 17:52, Arnd Bergmann wrote: > On Tue, Apr 13, 2021 at 1:45 AM Andrew Jeffery wrote: > > On Mon, 12 Apr 2021, at 18:18, Arnd Bergmann wrote: > > > On Mon, Apr 12, 2021 at 3:33 AM Andrew Jeffery wrote: > > > > On Fri, 9 Apr 2021,

Re: [Openipmi-developer] [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-12 Thread Andrew Jeffery
On Mon, 12 Apr 2021, at 18:18, Arnd Bergmann wrote: > On Mon, Apr 12, 2021 at 3:33 AM Andrew Jeffery wrote: > > On Fri, 9 Apr 2021, at 17:25, Arnd Bergmann wrote: > > > On Fri, Mar 19, 2021 at 7:31 AM Andrew Jeffery wrote: > > > > > > > > The existi

Re: [Openipmi-developer] [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-11 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 17:25, Arnd Bergmann wrote: > On Fri, Mar 19, 2021 at 7:31 AM Andrew Jeffery wrote: > > > > The existing IPMI chardev encodes IPMI behaviours as the name suggests. > > However, KCS devices are useful beyond IPMI (or keyboards), as they > > provi

Re: [Openipmi-developer] [PATCH v2 10/21] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-04-11 Thread Andrew Jeffery
On Sat, 10 Apr 2021, at 04:56, Zev Weiss wrote: > On Fri, Apr 09, 2021 at 01:25:26AM CDT, Zev Weiss wrote: > >On Fri, Apr 09, 2021 at 12:59:09AM CDT, Andrew Jeffery wrote: > >>On Fri, 9 Apr 2021, at 13:27, Zev Weiss wrote: > >>>On Fri, Mar 19, 2021 at 01:27:

Re: [Openipmi-developer] [PATCH v2 16/21] ipmi: kcs_bmc: Add a "raw" character device interface

2021-04-09 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:47, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:47AM CDT, Andrew Jeffery wrote: > >The existing IPMI chardev encodes IPMI behaviours as the name suggests. > >However, KCS devices are useful beyond IPMI (or keyboards), as they > >provide a m

Re: [Openipmi-developer] [PATCH v2 14/21] ipmi: kcs_bmc: Allow clients to control KCS IRQ state

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:07, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:45AM CDT, Andrew Jeffery wrote: > >Add a mechanism for controlling whether the client associated with a > >KCS device will receive Input Buffer Full (IBF) and Output Buffer Empty > >(OBE) ev

Re: [Openipmi-developer] [PATCH v2 13/21] ipmi: kcs_bmc: Decouple the IPMI chardev from the core

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:05, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:44AM CDT, Andrew Jeffery wrote: > >Now that we have untangled the data-structures, split the userspace > >interface out into its own module. Userspace interfaces and drivers are > >registered t

Re: [Openipmi-developer] [PATCH v2 12/21] ipmi: kcs_bmc: Strip private client data from struct kcs_bmc

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:37, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:43AM CDT, Andrew Jeffery wrote: > >Move all client-private data out of `struct kcs_bmc` into the KCS client > >implementation. > > > >With this change the KCS BMC core code now only conce

Re: [Openipmi-developer] [PATCH v2 11/21] ipmi: kcs_bmc: Split headers into device and client

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:31, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:42AM CDT, Andrew Jeffery wrote: > >Strengthen the distinction between code that abstracts the > >implementation of the KCS behaviours (device drivers) and code that > >exploits KCS behaviours (cl

Re: [Openipmi-developer] [PATCH v2 10/21] ipmi: kcs_bmc: Turn the driver data-structures inside-out

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:27, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:41AM CDT, Andrew Jeffery wrote: > >Make the KCS device drivers responsible for allocating their own memory. > > > >Until now the private data for the device driver was allocated internal >

Re: [Openipmi-developer] [PATCH v2 09/21] ipmi: kcs_bmc: Split out kcs_bmc_cdev_ipmi

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:26, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:40AM CDT, Andrew Jeffery wrote: > >Take steps towards defining a coherent API to separate the KCS device > >drivers from the userspace interface. Decreasing the coupling will > >improve the separ

Re: [Openipmi-developer] [PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 13:37, Joel Stanley wrote: > On Thu, 8 Apr 2021 at 23:47, Andrew Jeffery wrote: > > On Thu, 8 Apr 2021, at 21:44, Corey Minyard wrote: > > > On Thu, Apr 08, 2021 at 10:27:46AM +0930, Andrew Jeffery wrote: > > > > > > 1. It begins with

Re: [Openipmi-developer] [PATCH v2 17/21] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 14:45, Zev Weiss wrote: > On Fri, Mar 19, 2021 at 01:27:48AM CDT, Andrew Jeffery wrote: > >Given the deprecated binding, improve the ability to detect issues in > >the platform devicetrees. Further, a subsequent patch will introduce a > >new in

Re: [Openipmi-developer] [PATCH v2 01/21] dt-bindings: aspeed-lpc: Remove LPC partitioning

2021-04-08 Thread Andrew Jeffery
On Fri, 9 Apr 2021, at 12:48, Joel Stanley wrote: > On Fri, 19 Mar 2021 at 06:28, Andrew Jeffery wrote: > > > > From: "Chia-Wei, Wang" > > > > The LPC controller has no concept of the BMC and the Host partitions. > > This patch fixes the docum

Re: [Openipmi-developer] [PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-04-08 Thread Andrew Jeffery
On Thu, 8 Apr 2021, at 21:44, Corey Minyard wrote: > On Thu, Apr 08, 2021 at 10:27:46AM +0930, Andrew Jeffery wrote: > > Hi Corey, > > > > On Fri, 19 Mar 2021, at 16:49, Andrew Jeffery wrote: > > > Hello, > > > > > > This series is a bit o

Re: [Openipmi-developer] [PATCH v2 00/21] ipmi: Allow raw access to KCS devices

2021-04-07 Thread Andrew Jeffery
Hi Corey, On Fri, 19 Mar 2021, at 16:49, Andrew Jeffery wrote: > Hello, > > This series is a bit of a mix of things, but its primary purpose is to > expose BMC KCS IPMI devices to userspace in a way that enables userspace > to talk to host firmware using protocols that are not IP

[Openipmi-developer] [PATCH v2 21/21] ipmi: kcs_bmc_aspeed: Optionally apply status address

2021-03-18 Thread Andrew Jeffery
addressing scheme. Allow these requests where possible if the devicetree specifies the status register address. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 113 + 1 file changed, 81 insertions(+), 32 deletions(-) diff --git a/drivers/char

[Openipmi-developer] [PATCH v2 17/21] dt-bindings: ipmi: Convert ASPEED KCS binding to schema

2021-03-18 Thread Andrew Jeffery
Given the deprecated binding, improve the ability to detect issues in the platform devicetrees. Further, a subsequent patch will introduce a new interrupts property for specifying SerIRQ behaviour, so convert before we do any further additions. Signed-off-by: Andrew Jeffery --- .../bindings

[Openipmi-developer] [PATCH v2 19/21] ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration

2021-03-18 Thread Andrew Jeffery
Apply the SerIRQ ID and level/sense behaviours from the devicetree if provided. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 179 - 1 file changed, 177 insertions(+), 2 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers

[Openipmi-developer] [PATCH v2 20/21] ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet

2021-03-18 Thread Andrew Jeffery
Input Buffer Full Interrupt Enable (IBFIE) is typoed as IBFIF for some registers in the datasheet. Fix the driver to use the sensible acronym. Signed-off-by: Andrew Jeffery --- drivers/char/ipmi/kcs_bmc_aspeed.c | 24 1 file changed, 12 insertions(+), 12 deletions

[Openipmi-developer] [PATCH v2 18/21] dt-bindings: ipmi: Add optional SerIRQ property to ASPEED KCS devices

2021-03-18 Thread Andrew Jeffery
r KCS devices to describe SerIRQ properties. Signed-off-by: Andrew Jeffery --- .../bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/ipmi/aspeed,ast2400-kcs-bmc.yaml b/Documentation/devicetree/bindings

  1   2   >