<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/fpga/dfl.h, branch linux-5.9.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-06-28T19:43:16+00:00</updated>
<entry>
<title>fpga: dfl: introduce interrupt trigger setting API</title>
<updated>2020-06-28T19:43:16+00:00</updated>
<author>
<name>Xu Yilun</name>
<email>yilun.xu@intel.com</email>
</author>
<published>2020-06-16T04:08:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=322b598be4d9b9090cda560c4caab78704615ab4'/>
<id>urn:sha1:322b598be4d9b9090cda560c4caab78704615ab4</id>
<content type='text'>
FPGA user applications may be interested in interrupts generated by
DFL features. For example, users can implement their own FPGA
logics with interrupts enabled in AFU (Accelerated Function Unit,
dynamic region of DFL based FPGA). So user applications need to be
notified to handle these interrupts.

In order to allow userspace applications to monitor interrupts,
driver requires userspace to provide eventfds as interrupt
notification channels. Applications then poll/select on the eventfds
to get notified.

This patch introduces a generic helper functions to do eventfds binding
with given interrupts.

Sub feature drivers are expected to use XXX_GET_IRQ_NUM to query irq
info, and XXX_SET_IRQ to set eventfds for interrupts. This patch also
introduces helper functions for these 2 ioctls.

Signed-off-by: Luwei Kang &lt;luwei.kang@intel.com&gt;
Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Reviewed-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Acked-by: Wu Hao &lt;hao.wu@intel.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: parse interrupt info for feature devices on enumeration</title>
<updated>2020-06-28T19:42:29+00:00</updated>
<author>
<name>Xu Yilun</name>
<email>yilun.xu@intel.com</email>
</author>
<published>2020-06-16T04:08:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8d021039cbb5e358c7c07c562811253a61c8d551'/>
<id>urn:sha1:8d021039cbb5e358c7c07c562811253a61c8d551</id>
<content type='text'>
DFL based FPGA devices could support interrupts for different purposes,
but current DFL framework only supports feature device enumeration with
given MMIO resources information via common DFL headers. This patch
introduces one new API dfl_fpga_enum_info_add_irq for low level bus
drivers (e.g. PCIe device driver) to pass its interrupt resources
information to DFL framework for enumeration, and also adds interrupt
enumeration code in framework to parse and assign interrupt resources
for enumerated feature devices and their own sub features.

With this patch, DFL framework enumerates interrupt resources for core
features, including PORT Error Reporting, FME (FPGA Management Engine)
Error Reporting and also AFU User Interrupts.

Signed-off-by: Luwei Kang &lt;luwei.kang@intel.com&gt;
Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Reviewed-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Acked-by: Wu Hao &lt;hao.wu@intel.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: Use struct_size() in kzalloc()</title>
<updated>2020-06-19T01:22:12+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-06-17T22:10:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1d9ec3af3463c1721723f68403ee14214d0d2f6'/>
<id>urn:sha1:e1d9ec3af3463c1721723f68403ee14214d0d2f6</id>
<content type='text'>
Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes. Also, remove unnecessary
function dfl_feature_platform_data_size().

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'fpga-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next</title>
<updated>2020-05-15T14:09:24+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2020-05-15T14:09:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f877a18c08fa6674364e469f318a3069c68204d2'/>
<id>urn:sha1:f877a18c08fa6674364e469f318a3069c68204d2</id>
<content type='text'>
Moritz writes:

FPGA Manager changes for 5.8

Here's the first set of changes for the 5.8-rc1 merge window.

Dominic's change adds support for accessing AFU regions with gdb.
Gustavo's change is a cleanup patch regarding variable lenght arrays.
Richard's changes update dt-bindings and add support for stratix and agilex.
Sergiu's changes update spi transfers with the new delay field.
Xu's change addresses an issue with a wrong return value.
Shubhrajyoti's change makes the Zynq FPGA driver return -EPROBE_DEFER on
check of devm_clk_get failure.
Xu's change for DFL enables multiple opens.

All of these patches have been reviewed, have appropriate Acked-by's and
have been in the last few linux-next releases without issues.

Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;

* tag 'fpga-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga:
  fpga: dfl: afu: support debug access to memory-mapped afu regions
  fpga: dfl.h: Replace zero-length array with flexible-array member
  arm64: dts: agilex: correct service layer driver's compatible value
  dt-bindings, firmware: add compatible value Intel Stratix10 service layer binding
  fpga: stratix10-soc: add compatible property value for intel agilex
  arm64: dts: agilex: correct FPGA manager driver's compatible value
  dt-bindings: fpga: add compatible value to Stratix10 SoC FPGA manager binding
  fpga: machxo2-spi: Use new structure for SPI transfer delays
  fpga: ice40-spi: Use new structure for SPI transfer delays
  fpga: dfl: support multiple opens on feature device node.
</content>
</entry>
<entry>
<title>fpga: dfl.h: Replace zero-length array with flexible-array member</title>
<updated>2020-04-30T03:37:12+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2020-03-19T21:21:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a53881580f90a5e4404954af16a5646ee9d7842'/>
<id>urn:sha1:5a53881580f90a5e4404954af16a5646ee9d7842</id>
<content type='text'>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: support multiple opens on feature device node.</title>
<updated>2020-04-30T03:37:07+00:00</updated>
<author>
<name>Xu Yilun</name>
<email>yilun.xu@intel.com</email>
</author>
<published>2019-11-18T05:20:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b6862193ca12e4bce6a18f31bb36eaa6d801b377'/>
<id>urn:sha1:b6862193ca12e4bce6a18f31bb36eaa6d801b377</id>
<content type='text'>
Each DFL functional block, e.g. AFU (Accelerated Function Unit) and FME
(FPGA Management Engine), could implement more than one function within
its region, but current driver only allows one user application to access
it by exclusive open on device node. So this is not convenient and
flexible for userspace applications, as they have to combine lots of
different functions into one single application.

This patch removes the limitation here to allow multiple opens to each
feature device node for AFU and FME from userspace applications. If user
still needs exclusive access to these device node, O_EXCL flag must be
issued together with open.

Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: fme: add performance reporting support</title>
<updated>2020-04-28T13:49:28+00:00</updated>
<author>
<name>Wu Hao</name>
<email>hao.wu@intel.com</email>
</author>
<published>2020-04-27T01:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=724142f8c42a7b01dbf9738eb00d7addbad6f862'/>
<id>urn:sha1:724142f8c42a7b01dbf9738eb00d7addbad6f862</id>
<content type='text'>
This patch adds support for performance reporting private feature
for FPGA Management Engine (FME). Now it supports several different
performance counters, including 'basic', 'cache', 'fabric', 'vtd'
and 'vtd_sip'. It allows user to use standard linux tools to access
these performance counters.

e.g. List all events by "perf list"

  perf list | grep fme

  dfl_fme0/cache_read_hit/                     [Kernel PMU event]
  dfl_fme0/cache_read_miss/                    [Kernel PMU event]
  ...

  dfl_fme0/fab_mmio_read/                      [Kernel PMU event]
  dfl_fme0/fab_mmio_write/                     [Kernel PMU event]
  ...

  dfl_fme0/fab_port_mmio_read,portid=?/        [Kernel PMU event]
  dfl_fme0/fab_port_mmio_write,portid=?/       [Kernel PMU event]
  ...

  dfl_fme0/vtd_port_devtlb_1g_fill,portid=?/   [Kernel PMU event]
  dfl_fme0/vtd_port_devtlb_2m_fill,portid=?/   [Kernel PMU event]
  ...

  dfl_fme0/vtd_sip_iotlb_1g_hit/               [Kernel PMU event]
  dfl_fme0/vtd_sip_iotlb_1g_miss/              [Kernel PMU event]
  ...

  dfl_fme0/clock                               [Kernel PMU event]
  ...

e.g. check increased counter value after run one application using
"perf stat" command.

 perf stat -e dfl_fme0/fab_mmio_read/,dfl_fme0/fab_mmio_write/ ./test

 Performance counter stats for './test':

                 1      dfl_fme0/fab_mmio_read/
                 2      dfl_fme0/fab_mmio_write/

       1.009496520 seconds time elapsed

Please note that fabric counters support both fab_* and fab_port_*, but
actually they are sharing one set of performance counters in hardware.
If user wants to monitor overall data events on fab_* then fab_port_*
can't be supported at the same time, see example below:

perf stat -e dfl_fme0/fab_mmio_read/,dfl_fme0/fab_port_mmio_write,portid=0/

 Performance counter stats for 'system wide':

                 0      dfl_fme0/fab_mmio_read/
   &lt;not supported&gt;      dfl_fme0/fab_port_mmio_write,portid=0/

       2.141064085 seconds time elapsed

Signed-off-by: Luwei Kang &lt;luwei.kang@intel.com&gt;
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Link: https://lore.kernel.org/r/1587949583-12058-3-git-send-email-hao.wu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: afu: add userclock sysfs interfaces.</title>
<updated>2019-09-04T02:35:41+00:00</updated>
<author>
<name>Wu Hao</name>
<email>hao.wu@intel.com</email>
</author>
<published>2019-08-12T02:49:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f09991adfb3454530598586424ece3082e95fb0b'/>
<id>urn:sha1:f09991adfb3454530598586424ece3082e95fb0b</id>
<content type='text'>
This patch introduces userclock sysfs interfaces for AFU, user
could use these interfaces for clock setting to AFU.

Please note that, this is only working for port header feature
with revision 0, for later revisions, userclock setting is moved
to a separated private feature, so one revision sysfs interface
is exposed to userspace application for this purpose too.

Signed-off-by: Ananda Ravuri &lt;ananda.ravuri@intel.com&gt;
Signed-off-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Acked-by: Alan Tull &lt;atull@kernel.org&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: add id_table for dfl private feature driver</title>
<updated>2019-08-05T16:01:24+00:00</updated>
<author>
<name>Wu Hao</name>
<email>hao.wu@intel.com</email>
</author>
<published>2019-08-04T10:20:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15bbb300fcef4e62e4f6063cc29e698796027b98'/>
<id>urn:sha1:15bbb300fcef4e62e4f6063cc29e698796027b98</id>
<content type='text'>
This patch adds id_table for each dfl private feature driver,
it allows to reuse same private feature driver to match and support
multiple dfl private features.

Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Acked-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Acked-by: Alan Tull &lt;atull@kernel.org&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Link: https://lore.kernel.org/r/1564914022-3710-6-git-send-email-hao.wu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: afu: add AFU state related sysfs interfaces</title>
<updated>2019-08-05T15:56:47+00:00</updated>
<author>
<name>Wu Hao</name>
<email>hao.wu@intel.com</email>
</author>
<published>2019-08-04T10:20:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2ad5ac1cda7c30c9ded04d0e21aba528f1f96ec'/>
<id>urn:sha1:d2ad5ac1cda7c30c9ded04d0e21aba528f1f96ec</id>
<content type='text'>
This patch introduces more sysfs interfaces for Accelerated
Function Unit (AFU). These interfaces allow users to read
current AFU Power State (APx), read / clear AFU Power (APx)
events which are sticky to identify transient APx state,
and manage AFU's LTR (latency tolerance reporting).

Signed-off-by: Ananda Ravuri &lt;ananda.ravuri@intel.com&gt;
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Acked-by: Alan Tull &lt;atull@kernel.org&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Link: https://lore.kernel.org/r/1564914022-3710-4-git-send-email-hao.wu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
