<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/char/ipmi/kcs_bmc_aspeed.c, branch v5.16</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ipmi: kcs_bmc_aspeed: Fix less than zero comparison of a unsigned int</title>
<updated>2021-06-22T00:50:36+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2021-06-16T16:29:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5b32dd281ee0a269f39ecf6b48f0cd3f37264842'/>
<id>5b32dd281ee0a269f39ecf6b48f0cd3f37264842</id>
<content type='text'>
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 against 0")
Fixes: 9d2df9a0ad80 ("ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Message-Id: &lt;20210616162913.15259-1-colin.king@canonical.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 against 0")
Fixes: 9d2df9a0ad80 ("ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Message-Id: &lt;20210616162913.15259-1-colin.king@canonical.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc_aspeed: Optionally apply status address</title>
<updated>2021-06-22T00:50:35+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d0ec795c8c275ceca2076861f7fe3cc5f18da348'/>
<id>d0ec795c8c275ceca2076861f7fe3cc5f18da348</id>
<content type='text'>
Some Aspeed KCS devices can derive the status register address from the
address of the data register. As such, the address of the status
register can be implicit in the configuration if desired. On the other
hand, sometimes address schemes might be requested that are incompatible
with the default addressing scheme. Allow these requests where possible
if the devicetree specifies the status register address.

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Chia-Wei Wang &lt;chiawei_wang@aspeedtech.com&gt;
Message-Id: &lt;20210608104757.582199-17-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some Aspeed KCS devices can derive the status register address from the
address of the data register. As such, the address of the status
register can be implicit in the configuration if desired. On the other
hand, sometimes address schemes might be requested that are incompatible
with the default addressing scheme. Allow these requests where possible
if the devicetree specifies the status register address.

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Chia-Wei Wang &lt;chiawei_wang@aspeedtech.com&gt;
Message-Id: &lt;20210608104757.582199-17-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc_aspeed: Fix IBFIE typo from datasheet</title>
<updated>2021-06-22T00:50:35+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=78ff5a1666cd4a1129ca53dad5c68700fe63ab6a'/>
<id>78ff5a1666cd4a1129ca53dad5c68700fe63ab6a</id>
<content type='text'>
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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-16-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-16-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc_aspeed: Implement KCS SerIRQ configuration</title>
<updated>2021-06-22T00:50:34+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a5e4236d560579a20e2bc870f6e6f32e4e7c0354'/>
<id>a5e4236d560579a20e2bc870f6e6f32e4e7c0354</id>
<content type='text'>
Apply the SerIRQ ID and level/sense behaviours from the devicetree if
provided.

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Message-Id: &lt;20210608104757.582199-15-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply the SerIRQ ID and level/sense behaviours from the devicetree if
provided.

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Message-Id: &lt;20210608104757.582199-15-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc: Enable IBF on open</title>
<updated>2021-06-22T00:50:28+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb6379f524ff56314fa857bb5c84bd22eee41eb7'/>
<id>fb6379f524ff56314fa857bb5c84bd22eee41eb7</id>
<content type='text'>
This way devices don't get delivered IRQs when no-one is interested.

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Message-Id: &lt;20210608104757.582199-11-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This way devices don't get delivered IRQs when no-one is interested.

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Message-Id: &lt;20210608104757.582199-11-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc: Allow clients to control KCS IRQ state</title>
<updated>2021-06-22T00:50:28+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=28651e6c4237f4aee5e0744ce37d3a50e7b1f36b'/>
<id>28651e6c4237f4aee5e0744ce37d3a50e7b1f36b</id>
<content type='text'>
Add a mechanism for controlling whether the client associated with a
KCS device will receive Input Buffer Full (IBF) and Output Buffer Empty
(OBE) events. This enables an abstract implementation of poll() for KCS
devices.

A wart in the implementation is that the ASPEED KCS devices don't
support 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 &lt;KWLIU@nuvoton.com&gt;
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-10-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a mechanism for controlling whether the client associated with a
KCS device will receive Input Buffer Full (IBF) and Output Buffer Empty
(OBE) events. This enables an abstract implementation of poll() for KCS
devices.

A wart in the implementation is that the ASPEED KCS devices don't
support 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 &lt;KWLIU@nuvoton.com&gt;
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-10-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc: Strip private client data from struct kcs_bmc</title>
<updated>2021-06-22T00:50:22+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d4e7ac68f771addc19352121706d8584eb0166cd'/>
<id>d4e7ac68f771addc19352121706d8584eb0166cd</id>
<content type='text'>
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 concerns itself with
abstract `struct kcs_bmc` and `struct kcs_bmc_client` types, achieving
expected separation of concerns. Further, the change clears the path for
implementation of alternative userspace interfaces.

The chardev data-structures are rearranged in the same manner applied to
the KCS device driver data-structures in an earlier patch - `struct
kcs_bmc_client` is embedded in the client's private data and we exploit
container_of() to translate 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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-8-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 concerns itself with
abstract `struct kcs_bmc` and `struct kcs_bmc_client` types, achieving
expected separation of concerns. Further, the change clears the path for
implementation of alternative userspace interfaces.

The chardev data-structures are rearranged in the same manner applied to
the KCS device driver data-structures in an earlier patch - `struct
kcs_bmc_client` is embedded in the client's private data and we exploit
container_of() to translate 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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-8-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc: Split headers into device and client</title>
<updated>2021-06-22T00:50:13+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=faae6e391eda73a5b9870c78349064282a625bfa'/>
<id>faae6e391eda73a5b9870c78349064282a625bfa</id>
<content type='text'>
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 &lt;andrew@aj.id.au&gt;
Message-Id: &lt;20210608104757.582199-7-andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andrew@aj.id.au&gt;
Message-Id: &lt;20210608104757.582199-7-andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc: Turn the driver data-structures inside-out</title>
<updated>2021-06-22T00:50:13+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d7096970075ef47c9906fd241cc4939cc11ddd01'/>
<id>d7096970075ef47c9906fd241cc4939cc11ddd01</id>
<content type='text'>
Make the KCS device drivers responsible for allocating their own memory.

Until now the private data for the device driver was allocated internal
to the private data for the chardev interface. This coupling required
the slightly awkward API of passing through the struct size for the
driver private data to the chardev constructor, and then retrieving a
pointer to the driver private data from the allocated chardev memory.

In addition to being awkward, the arrangement prevents the
implementation of alternative userspace interfaces as the device driver
private data is not independent.

Peel a 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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-6-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the KCS device drivers responsible for allocating their own memory.

Until now the private data for the device driver was allocated internal
to the private data for the chardev interface. This coupling required
the slightly awkward API of passing through the struct size for the
driver private data to the chardev constructor, and then retrieving a
pointer to the driver private data from the allocated chardev memory.

In addition to being awkward, the arrangement prevents the
implementation of alternative userspace interfaces as the device driver
private data is not independent.

Peel a 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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-6-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: kcs_bmc: Make status update atomic</title>
<updated>2021-06-22T00:50:12+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2021-06-08T10:47:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ec6f0cf17a639743e622d4156b0a5009263fd479'/>
<id>ec6f0cf17a639743e622d4156b0a5009263fd479</id>
<content type='text'>
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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-3-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andrew@aj.id.au&gt;
Reviewed-by: Zev Weiss &lt;zweiss@equinix.com&gt;
Message-Id: &lt;20210608104757.582199-3-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
