<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-obmc-linux/drivers/fsi, branch dev-4.13</title>
<subtitle>Talos™ II Linux sources for OpenBMC</subtitle>
<id>https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-4.13</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-4.13'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/'/>
<updated>2018-05-17T02:26:51+00:00</updated>
<entry>
<title>fsi/fsi-master-gpio: Delay sampling of FSI data input</title>
<updated>2018-05-17T02:26:51+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2018-05-15T13:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=28d817669a3e3ceea2379333eef7a7a37fc9432a'/>
<id>urn:sha1:28d817669a3e3ceea2379333eef7a7a37fc9432a</id>
<content type='text'>
Most SoC GPIO implementations, including the Aspeed one, have
synchronizers on the GPIO inputs. This means that the value
read from a GPIO is a couple of clocks old, from whatever clock
source feeds those synchronizers.

In practice, this means that in no-delay mode, we are using a
value that can potentially be a bit too old and too close to
the clock edge establishing the data on the other side of the link.

The voltage converters we use on some systems make this worse
and sensitive to things like voltage fluctuations etc... This is,
we believe, the cause of occasional CRC errors encountered during
heavy activity on the LPC bus.

This is fixed by introducing a dummy GPIO read before the actual
data read. It slows down SBEFIFO by about 15% (less than any delay
primitive) and the end result is so far solid.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reviewed-by: Christopher Bostic &lt;cbostic@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi/fsi-master-gpio: Reduce dpoll clocks</title>
<updated>2018-05-11T10:49:14+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2018-05-08T01:46:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=f34aca9c21da88ddeef215c49016f7c1786db205'/>
<id>urn:sha1:f34aca9c21da88ddeef215c49016f7c1786db205</id>
<content type='text'>
FSI_GPIO_DPOLL_CLOCKS is the number of clocks before sending
a DPOLL command after receiving a BUSY status. It should be
at least tSendDelay (16 clocks).

According to comments in the code, it needs to also be at least
21 clocks due to HW issues.

It's currently 100 clocks which impacts performances negatively
in some cases. Reduces it in half to 50 clocks which seems to
still be solid.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reviewed-by: Christopher Bostic &lt;cbostic@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi/fsi-master-gpio: Reduce turnaround clocks</title>
<updated>2018-05-11T10:48:18+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2018-05-08T01:06:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=f82fe12db2cc99e40a2a196e42e0169344bcd40d'/>
<id>urn:sha1:f82fe12db2cc99e40a2a196e42e0169344bcd40d</id>
<content type='text'>
FSI_GPIO_PRIME_SLAVE_CLOCKS is the number of clocks if the
"idle" phase between the end of a response and the beginning
of the next one. It corresponds to tSendDelay in the FSI
specification.

The default value in the slave is 16 clocks. 100 is way overkill
and significantly reduces the driver performance.

This changes it to 20 (which gives the HW a bit of margin still
just in case).

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reviewed-by: Christopher Bostic &lt;cbostic@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi/fsi-master-gpio: Add "no-gpio-delays" option</title>
<updated>2018-05-11T10:48:13+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2018-05-08T01:06:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=74a3c9c810f6774c0dc81486cc814d7b8a825ad5'/>
<id>urn:sha1:74a3c9c810f6774c0dc81486cc814d7b8a825ad5</id>
<content type='text'>
This adds support for an optional device-tree property that
makes the driver skip all the delays around clocking the
GPIOs and set it in the device-tree of common POWER9 based
OpenPower platforms.

This useful on chips like the AST2500 where the GPIO block is
running at a fairly low clock frequency (25Mhz typically). In
this case, the delays are unnecessary and due to the low
precision of the timers, actually quite harmful in terms of
performance.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reviewed-by: Christopher Bostic &lt;cbostic@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi/fsi-master-gpio: Sample input data on different clock phase</title>
<updated>2018-05-11T10:48:09+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2018-05-08T01:06:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=a5d232cd20cd64192c3c554b87b28f00771962f8'/>
<id>urn:sha1:a5d232cd20cd64192c3c554b87b28f00771962f8</id>
<content type='text'>
We currently sample the input data right after we toggle the
clock low, then high. The slave establishes the data on the
rising edge, so this is not ideal. We should sample it on
the low phase instead.

This currently works because we have an extra delay, but subsequent
patches will remove it.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reviewed-by: Christopher Bostic &lt;cbostic@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi: occ: Add check for OCC response checksum</title>
<updated>2018-05-07T11:34:09+00:00</updated>
<author>
<name>Eddie James</name>
<email>eajames@linux.vnet.ibm.com</email>
</author>
<published>2018-05-01T14:51:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=f7123755b3e103339a5adb81213e7fd8115966dc'/>
<id>urn:sha1:f7123755b3e103339a5adb81213e7fd8115966dc</id>
<content type='text'>
The OCC specification indicates that it is an error scenario if the
response checksum doesn't match the sum of the bytes of the response.
The driver needs to perform this calculation and check, and return an
error if it's a mismatch.

OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James &lt;eajames@linux.vnet.ibm.com&gt;
Acked-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi: occ: Use PutOCCSRAM in circular mode for OCC attention</title>
<updated>2018-05-01T03:28:43+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-04-27T14:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=d9f9f91767d9562f43bf939b7ee7e46898e9ec4e'/>
<id>urn:sha1:d9f9f91767d9562f43bf939b7ee7e46898e9ec4e</id>
<content type='text'>
We can't do SCOMs from the BMC when the host is booted in secure mode,
and without triggering the attention of the OCC our commands won't be
processed. Further, the SCOM operation fails, which causes the OCC
driver's probe to fail, which leads the BMC to think that the OCC has
failed.

We have an alternative to the SCOM though: We can trigger the OCC by
writing the correct attention magic in circular buffer mode.

The PutOCCSRAM operation returns the written data length in the response
payload before the 0xCODE word, so the condition testing the success of
the operation is rearranged.

OpenBMC-Staging-Count: 1
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Matt Spinler mspinler@linux.vnet.ibm.com
Reviewed-by: Eddie James &lt;eajames@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi: gpio: Use a mutex to protect transfers</title>
<updated>2018-03-07T04:46:58+00:00</updated>
<author>
<name>Jeremy Kerr</name>
<email>jk@ozlabs.org</email>
</author>
<published>2018-02-20T04:18:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=2b6ff898efe5c8fa59ec0ac9978396b2e94d9d46'/>
<id>urn:sha1:2b6ff898efe5c8fa59ec0ac9978396b2e94d9d46</id>
<content type='text'>
Reduce time spent with interrupts disabled by limiting the critical
sections to bitbanging FSI symbols. We only need to ensure exclusive use
of the bus for an entire transfer, not that the transfer be performed in
atomic context.

OpenBMC-Staging-Count: 1
Signed-off-by: Jeremy Kerr &lt;jk@ozlabs.org&gt;
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi: gpio: Remove unused 'id' variable</title>
<updated>2018-03-07T04:46:57+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-02-20T04:18:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=0ada305ecaf4c64d713a290efea207f97a1b1275'/>
<id>urn:sha1:0ada305ecaf4c64d713a290efea207f97a1b1275</id>
<content type='text'>
OpenBMC-Staging-Count: 1
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
<entry>
<title>fsi: sbefifo: Switch list_lock from spinlock to mutex</title>
<updated>2018-03-07T04:46:57+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2018-02-20T04:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=df9ff551a1d4d7910520a11002511aadfc1c9977'/>
<id>urn:sha1:df9ff551a1d4d7910520a11002511aadfc1c9977</id>
<content type='text'>
We allocate GFP_KERNEL memory for a list element in sbefifo_enq_xfr()
(elided from the stack trace presumably by inlining) but do so under
list_lock, which was previously a spin lock. Enabling lock debugging
gives the following warning:

 BUG: sleeping function called from invalid context at mm/slab.h:408
 in_atomic(): 1, irqs_disabled(): 128, pid: 110, name: kworker/u2:9
 INFO: lockdep is turned off.
 irq event stamp: 9002
 hardirqs last  enabled at (9001): [&lt;801105bc&gt;] kmem_cache_alloc_trace+0x8c/0x284
 hardirqs last disabled at (9002): [&lt;8049458c&gt;] _raw_spin_lock_irqsave+0x2c/0xa0
 softirqs last  enabled at (5370): [&lt;8000987c&gt;] __do_softirq+0x38c/0x510
 softirqs last disabled at (5363): [&lt;8001f154&gt;] irq_exit+0x120/0x16c
 CPU: 0 PID: 110 Comm: kworker/u2:9 Tainted: G        W       4.10.17-00534-gb846201e7a2d #2277
 Hardware name: ASpeed SoC
 Workqueue: occ occ_worker
 [&lt;800108f8&gt;] (unwind_backtrace) from [&lt;8000e02c&gt;] (show_stack+0x20/0x24)
 [&lt;8000e02c&gt;] (show_stack) from [&lt;8022d1c0&gt;] (dump_stack+0x20/0x28)
 [&lt;8022d1c0&gt;] (dump_stack) from [&lt;80048bf8&gt;] (___might_sleep+0x174/0x2ac)
 [&lt;80048bf8&gt;] (___might_sleep) from [&lt;80048da0&gt;] (__might_sleep+0x70/0xb0)
 [&lt;80048da0&gt;] (__might_sleep) from [&lt;801106f8&gt;] (kmem_cache_alloc_trace+0x1c8/0x284)
 [&lt;801106f8&gt;] (kmem_cache_alloc_trace) from [&lt;803330e8&gt;] (sbefifo_write_common+0x228/0x4b4)
 [&lt;803330e8&gt;] (sbefifo_write_common) from [&lt;80333740&gt;] (sbefifo_drv_write+0x24/0x28)
 [&lt;80333740&gt;] (sbefifo_drv_write) from [&lt;80333b58&gt;] (occ_write_sbefifo+0x44/0x60)
 [&lt;80333b58&gt;] (occ_write_sbefifo) from [&lt;80334530&gt;] (occ_worker+0x38/0x4a0)
 [&lt;80334530&gt;] (occ_worker) from [&lt;80034a2c&gt;] (process_one_work+0x23c/0x6d4)
 [&lt;80034a2c&gt;] (process_one_work) from [&lt;80034f08&gt;] (worker_thread+0x44/0x528)
 [&lt;80034f08&gt;] (worker_thread) from [&lt;8003c8c0&gt;] (kthread+0x160/0x17c)
 [&lt;8003c8c0&gt;] (kthread) from [&lt;8000a888&gt;] (ret_from_fork+0x14/0x2c)

Avoid the warning (or using GFP_ATOMIC memory) by switching to a mutex,
as we only require mutual exclusion, not pre-emption be disabled
(occ_worker() is executed on a workqueue). This should also reduce the
latency impact of calling into the OCC.

OpenBMC-Staging-Count: 1
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Acked-by: Eddie James &lt;eajames@linux.vnet.ibm.com&gt;
Signed-off-by: Joel Stanley &lt;joel@jms.id.au&gt;
</content>
</entry>
</feed>
