<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/misc/xilinx_sdfec.c, branch v5.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-05-27T09:09:26Z</updated>
<entry>
<title>misc: xilinx-sdfec: convert get_user_pages() --&gt; pin_user_pages()</title>
<updated>2020-05-27T09:09:26Z</updated>
<author>
<name>John Hubbard</name>
<email>jhubbard@nvidia.com</email>
</author>
<published>2020-05-27T01:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=03358b0f7bc7b5868bbb30f47224a937e2e4d6d3'/>
<id>urn:sha1:03358b0f7bc7b5868bbb30f47224a937e2e4d6d3</id>
<content type='text'>
This code was using get_user_pages*(), in approximately a "Case 1"
scenario (Direct IO), using the categorization from [1]. That means
that it's time to convert the get_user_pages*() + put_page() calls to
pin_user_pages*() + unpin_user_pages() calls.

There is some helpful background in [2]: basically, this is a small
part of fixing a long-standing disconnect between pinning pages, and
file systems' use of those pages.

[1] Documentation/core-api/pin_user_pages.rst

[2] "Explicit pinning of user-space pages":
    https://lwn.net/Articles/807108/

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-4-jhubbard@nvidia.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx-sdfec: cleanup return value in xsdfec_table_write()</title>
<updated>2020-05-27T09:09:26Z</updated>
<author>
<name>John Hubbard</name>
<email>jhubbard@nvidia.com</email>
</author>
<published>2020-05-27T01:26:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d25594d764613ad58656bbe74a86706204813a9f'/>
<id>urn:sha1:d25594d764613ad58656bbe74a86706204813a9f</id>
<content type='text'>
Return 0 for success, rather than the value of an incrementing
"reg" index. The reg value was never actually used, so this
simplifies the caller slightly.

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-3-jhubbard@nvidia.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx-sdfec: improve get_user_pages_fast() error handling</title>
<updated>2020-05-27T09:09:26Z</updated>
<author>
<name>John Hubbard</name>
<email>jhubbard@nvidia.com</email>
</author>
<published>2020-05-27T01:26:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=57343d51613227373759f5b0f2eede257fd4b82e'/>
<id>urn:sha1:57343d51613227373759f5b0f2eede257fd4b82e</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>misc: xilinx-sdfec: convert to module_platform_driver()</title>
<updated>2020-05-15T14:20:01Z</updated>
<author>
<name>Harshal Chaudhari</name>
<email>harshalchau04@gmail.com</email>
</author>
<published>2020-05-10T16:43:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=286adb4cce00d2ed37eb20a19ce366d1d58adf42'/>
<id>urn:sha1:286adb4cce00d2ed37eb20a19ce366d1d58adf42</id>
<content type='text'>
The driver init and exit function don't do anything besides registering
and unregistering the platform driver, so the module_platform_driver()
macro could just be used instead of having separate functions.

Signed-off-by: Harshal Chaudhari &lt;harshalchau04@gmail.com&gt;
Acked-by: Dragan Cvetic &lt;dragan.cvetic@xilinx.com&gt;
Link: https://lore.kernel.org/r/20200510164308.31358-1-harshalchau04@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: Use memdup_user() as a cleanup</title>
<updated>2020-04-23T14:32:51Z</updated>
<author>
<name>Zou Wei</name>
<email>zou_wei@huawei.com</email>
</author>
<published>2020-04-22T02:58:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15665c062b8c529d162479b306af23bc37bb6a12'/>
<id>urn:sha1:15665c062b8c529d162479b306af23bc37bb6a12</id>
<content type='text'>
Fix coccicheck warning which recommends to use memdup_user().

This patch fixes the following coccicheck warnings:

drivers/misc/xilinx_sdfec.c:652:8-15: WARNING opportunity for memdup_user

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zou Wei &lt;zou_wei@huawei.com&gt;
Link: https://lore.kernel.org/r/1587524330-119776-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: fix xsdfec_poll()'s return type</title>
<updated>2020-01-14T14:16:51Z</updated>
<author>
<name>Luc Van Oostenryck</name>
<email>luc.vanoostenryck@gmail.com</email>
</author>
<published>2019-12-09T21:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fa4e7fc1386078edcfddd8848cb0374f4af74fe7'/>
<id>urn:sha1:fa4e7fc1386078edcfddd8848cb0374f4af74fe7</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: add missing __user annotation</title>
<updated>2020-01-14T14:16:51Z</updated>
<author>
<name>Luc Van Oostenryck</name>
<email>luc.vanoostenryck@gmail.com</email>
</author>
<published>2019-12-09T21:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a6b07e89fd8530b943217ccd4909d1bf65acc45d'/>
<id>urn:sha1:a6b07e89fd8530b943217ccd4909d1bf65acc45d</id>
<content type='text'>
The second arg of xsdfec_set_order() is a 'void __user *'
and this pointer is then used in get_user() which expect
a __user pointer.

But get_user() can't be used with a void pointer, it a
pointer to the effective type. This is done here by casting
the argument to a pointer to the effective type but the
__user is missing in the cast.

Fix this by adding the missing __user in the cast.

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/20191209213719.58037-1-luc.vanoostenryck@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: xilinx_sdfec: fix spelling mistake: "Schdule" -&gt; "Schedule"</title>
<updated>2019-08-22T21:28:10Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-08-19T09:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:10Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-21T07:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:10Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-21T07:09:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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>
</feed>
