<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/misc/xilinx_sdfec.c, branch dev-5.4</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.4</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2020-06-24T15:50:35+00:00</updated>
<entry>
<title>misc: xilinx-sdfec: improve get_user_pages_fast() error handling</title>
<updated>2020-06-24T15:50:35+00:00</updated>
<author>
<name>John Hubbard</name>
<email>jhubbard@nvidia.com</email>
</author>
<published>2020-05-27T01:26:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=3302d17ef6ea0dd94b5a4acdf831f12f3e72d0c6'/>
<id>urn:sha1:3302d17ef6ea0dd94b5a4acdf831f12f3e72d0c6</id>
<content type='text'>
[ Upstream commit 57343d51613227373759f5b0f2eede257fd4b82e ]

This fixes the case of get_user_pages_fast() returning a -errno.
The result needs to be stored in a signed integer. And for safe
signed/unsigned comparisons, it's best to keep everything signed.
And get_user_pages_fast() also expects a signed value for number
of pages to pin.

Therefore, change most relevant variables, from u32 to int. Leave
"n" unsigned, for convenience in checking for overflow. And provide
a WARN_ON_ONCE() and early return, if overflow occurs.

Also, as long as we're tidying up: rename the page array from page,
to pages, in order to match the conventions used in most other call
sites.

Fixes: 20ec628e8007e ("misc: xilinx_sdfec: Add ability to configure LDPC")
Cc: Derek Kiernan &lt;derek.kiernan@xilinx.com&gt;
Cc: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Michal Simek &lt;michal.simek@xilinx.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: John Hubbard &lt;jhubbard@nvidia.com&gt;
Link: https://lore.kernel.org/r/20200527012628.1100649-2-jhubbard@nvidia.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: fix xsdfec_poll()'s return type</title>
<updated>2020-02-24T07:36:47+00:00</updated>
<author>
<name>Luc Van Oostenryck</name>
<email>luc.vanoostenryck@gmail.com</email>
</author>
<published>2019-12-09T21:36:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=83f964dd14a7d3e3636cbe1e1f4d3aa16bbe8032'/>
<id>urn:sha1:83f964dd14a7d3e3636cbe1e1f4d3aa16bbe8032</id>
<content type='text'>
[ Upstream commit fa4e7fc1386078edcfddd8848cb0374f4af74fe7 ]

xsdfec_poll() is defined as returning 'unsigned int' but the
.poll method is declared as returning '__poll_t', a bitwise type.

Fix this by using the proper return type and using the EPOLL
constants instead of the POLL ones, as required for __poll_t.

CC: Derek Kiernan &lt;derek.kiernan@xilinx.com&gt;
CC: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Signed-off-by: Luc Van Oostenryck &lt;luc.vanoostenryck@gmail.com&gt;
Acked-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/20191209213655.57985-1-luc.vanoostenryck@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: fix spelling mistake: "Schdule" -&gt; "Schedule"</title>
<updated>2019-08-22T21:28:10+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-08-19T09:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=3b420aeb7525db8e19ee48fdb1a2fc1d430765d5'/>
<id>urn:sha1:3b420aeb7525db8e19ee48fdb1a2fc1d430765d5</id>
<content type='text'>
There is a spelling mistake in a dev_dbg message, fix it.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Reviewed-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/20190819094137.390-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Prevent integer overflow in xsdfec_table_write()</title>
<updated>2019-08-22T21:28:10+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-21T07:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6123f1fe53985645992b2ff648b3087b77b3ed16'/>
<id>urn:sha1:6123f1fe53985645992b2ff648b3087b77b3ed16</id>
<content type='text'>
The checking here needs to handle integer overflows because "offset" and
"len" come from the user.

Fixes: 20ec628e8007 ("misc: xilinx_sdfec: Add ability to configure LDPC")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Michal Simek &lt;michal.simek@xilinx.com&gt;
Reviewed-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/20190821071122.GD26957@mwanda
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Prevent a divide by zero in xsdfec_reg0_write()</title>
<updated>2019-08-22T21:28:10+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-21T07:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=56a635c0ec14950bd6a5bfb4d9d497897f64179f'/>
<id>urn:sha1:56a635c0ec14950bd6a5bfb4d9d497897f64179f</id>
<content type='text'>
The "psize" value comes from the user so we need to verify that it's
non-zero before we check if "n % psize" or it will crash.

Fixes: 20ec628e8007 ("misc: xilinx_sdfec: Add ability to configure LDPC")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Michal Simek &lt;michal.simek@xilinx.com&gt;
Link: https://lore.kernel.org/r/20190821070953.GC26957@mwanda
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Return -EFAULT if copy_from_user() fails</title>
<updated>2019-08-22T21:28:10+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-22T08:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=129c3b082c636087a72a30b17c87c57d197f08f5'/>
<id>urn:sha1:129c3b082c636087a72a30b17c87c57d197f08f5</id>
<content type='text'>
The copy_from_user() function returns the number of bytes remaining to
be copied but we want to return -EFAULT to the user.

Fixes: 20ec628e8007 ("misc: xilinx_sdfec: Add ability to configure LDPC")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Michal Simek &lt;michal.simek@xilinx.com&gt;
Reviewed-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/20190822083105.GI3964@kadam
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Fix a couple small information leaks</title>
<updated>2019-08-22T21:28:09+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-21T07:06:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=dac4f1964a9cbfbf81df8d31caa04ced0d7613b5'/>
<id>urn:sha1:dac4f1964a9cbfbf81df8d31caa04ced0d7613b5</id>
<content type='text'>
These structs have holes in them so we end up disclosing a few bytes of
uninitialized stack data.

drivers/misc/xilinx_sdfec.c:305 xsdfec_get_status() warn: check that 'status' doesn't leak information (struct has a hole after 'activity')
drivers/misc/xilinx_sdfec.c:449 xsdfec_get_turbo() warn: check that 'turbo_params' doesn't leak information (struct has a hole after 'scale')

We need to zero out the holes with memset().

Fixes: 6bd6a690c2e7 ("misc: xilinx_sdfec: Add stats &amp; status ioctls")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Reviewed-by: Michal Simek &lt;michal.simek@xilinx.com&gt;
Link: https://lore.kernel.org/r/20190821070606.GA26957@mwanda
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xilinx_sdfec: Convert to IDA</title>
<updated>2019-08-15T15:58:37+00:00</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
<email>willy@infradead.org</email>
</author>
<published>2019-08-07T02:50:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9bfe54e3b70e1d594a7fdc1e50043ab32e29eea7'/>
<id>urn:sha1:9bfe54e3b70e1d594a7fdc1e50043ab32e29eea7</id>
<content type='text'>
This driver does not use the lookup abilities of the IDR, so convert it
to the more space-efficient IDA.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Link: https://lore.kernel.org/r/20190807025050.28367-1-willy@infradead.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Add stats &amp; status ioctls</title>
<updated>2019-08-15T15:54:38+00:00</updated>
<author>
<name>Dragan Cvetic</name>
<email>dragan.cvetic@xilinx.com</email>
</author>
<published>2019-07-27T08:33:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6bd6a690c2e7e710aa7ccefa4edc83f14099907e'/>
<id>urn:sha1:6bd6a690c2e7e710aa7ccefa4edc83f14099907e</id>
<content type='text'>
SD-FEC statistic data are:
- count of data interface errors (isr_err_count)
- count of Correctable ECC errors (cecc_count)
- count of Uncorrectable ECC errors (uecc_count)

Add support:
1. clear stats ioctl callback which clears collected
statistic data,
2. get stats ioctl callback which reads a collected
statistic data,
3. set default configuration ioctl callback,
4. start ioctl callback enables SD-FEC HW,
5. stop ioctl callback disables SD-FEC HW.

In a failed state driver enables the following ioctls:
- get status
- get statistics
- clear stats
- set default SD-FEC device configuration

Tested-by: Santhosh Dyavanapally &lt;SDYAVANA@xilinx.com&gt;
Tested by: Punnaiah Choudary Kalluri &lt;punnaia@xilinx.com&gt;
Tested-by: Derek Kiernan &lt;derek.kiernan@xilinx.com&gt;
Tested-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Signed-off-by: Derek Kiernan &lt;derek.kiernan@xilinx.com&gt;
Signed-off-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/1564216438-322406-7-git-send-email-dragan.cvetic@xilinx.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Support poll file operation</title>
<updated>2019-08-15T15:54:38+00:00</updated>
<author>
<name>Dragan Cvetic</name>
<email>dragan.cvetic@xilinx.com</email>
</author>
<published>2019-07-27T08:33:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=cc538f609dee49b73545569c49e3abd891fdd8b3'/>
<id>urn:sha1:cc538f609dee49b73545569c49e3abd891fdd8b3</id>
<content type='text'>
Support monitoring and detecting the SD-FEC error events
through IRQ and poll file operation.

The SD-FEC device can detect one-error or multi-error events.
An error triggers an interrupt which creates and run the ONE_SHOT
IRQ thread.
The ONE_SHOT IRQ thread detects type of error and pass that
information to the poll function.
The file_operation callback poll(), collects the events and
updates the statistics accordingly.
The function poll blocks() on waiting queue which can be
unblocked by ONE_SHOT IRQ handling thread.

Support SD-FEC interrupt set ioctl callback.
The SD-FEC can detect two type of errors: coding errors (ECC) and
a data interface errors (TLAST).
The errors are  events which can trigger an IRQ if enabled.
The driver can monitor and detect these errors through IRQ.
Also the driver updates the statistical data.

Tested-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Signed-off-by: Derek Kiernan &lt;derek.kiernan@xilinx.com&gt;
Signed-off-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/1564216438-322406-6-git-send-email-dragan.cvetic@xilinx.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
