read() on device file results in errno 512 “Unknown Error” - what does it mean?
up vote
-1
down vote
favorite
I have a x86 64bit (AMD A8-3870) based PC, running Ubuntu 14.04.
Connected to the PCI-e slot, there is a Xilinx FPGA eval board (AC701). The reference driver provided by Xilinx, XDMA, with its counterpart IP core being in the FPGA, was compiled against this kernel. It loads and claims to have found the connected XDMA-enabled FPGA.
Xilinx also provides some test programs/scripts with the driver.
On this system, they run, but terminate unsuccessfully, outputting "Unknown error 512" a few times.
My own test program also gets this error when attempting to read() from an open device file that's DMA enabled (/dev/xdma0_c2h0).
(output via perror() right after it failed).
What I found about this are some referenes in some forums claiming that 512 is not a valid error number, it's a kernel internal error and should not "leak" to userspace - indicating a kernel bug.
What could I do about that / how to find out the cause?
Some additional info:
My own program did not have this error on an ARM Cortex A15 based system, where I was able to read from the FPGA this way. (just that there were other problems, and since the xdma driver is spec'd for x86 systems only, I wanted to see if there's a difference in behavior on a x86 system - so there is, just not the way I imagined...)
Edit: Upgraded to Ubuntu 16 (4.4.0.-139-generic), same behavior. (I initially used Ubuntu 14.04 as it's closer to what I (need to) use on the mentioned ARM system I started out with).
Reading from / writing to the FPGA design's exposed registers via another device file provided by the xdma driver for single accesses without DMA, does work, and does set things in motion inside the FPGA as I expect.
So only the DMA-enabled device file has this mysterious error 512, so far - from my program, and still as well for the Xilinx provided test program.
linux-kernel linux-device-driver fpga xilinx pci-e
add a comment |
up vote
-1
down vote
favorite
I have a x86 64bit (AMD A8-3870) based PC, running Ubuntu 14.04.
Connected to the PCI-e slot, there is a Xilinx FPGA eval board (AC701). The reference driver provided by Xilinx, XDMA, with its counterpart IP core being in the FPGA, was compiled against this kernel. It loads and claims to have found the connected XDMA-enabled FPGA.
Xilinx also provides some test programs/scripts with the driver.
On this system, they run, but terminate unsuccessfully, outputting "Unknown error 512" a few times.
My own test program also gets this error when attempting to read() from an open device file that's DMA enabled (/dev/xdma0_c2h0).
(output via perror() right after it failed).
What I found about this are some referenes in some forums claiming that 512 is not a valid error number, it's a kernel internal error and should not "leak" to userspace - indicating a kernel bug.
What could I do about that / how to find out the cause?
Some additional info:
My own program did not have this error on an ARM Cortex A15 based system, where I was able to read from the FPGA this way. (just that there were other problems, and since the xdma driver is spec'd for x86 systems only, I wanted to see if there's a difference in behavior on a x86 system - so there is, just not the way I imagined...)
Edit: Upgraded to Ubuntu 16 (4.4.0.-139-generic), same behavior. (I initially used Ubuntu 14.04 as it's closer to what I (need to) use on the mentioned ARM system I started out with).
Reading from / writing to the FPGA design's exposed registers via another device file provided by the xdma driver for single accesses without DMA, does work, and does set things in motion inside the FPGA as I expect.
So only the DMA-enabled device file has this mysterious error 512, so far - from my program, and still as well for the Xilinx provided test program.
linux-kernel linux-device-driver fpga xilinx pci-e
You'll need to look at the driver source code. There's nothing magic abouterrno
values, they're just integers. Ordinarily, a driver returns one of the pre-defined ones (that are#define
d in<errno.h>
and have a text translation in libc) but there's no requirement for that. The driver is free to return whatever error value it likes and AFAIK, the kernel does not restrict the range. Since 512 isn't one of the usual ones, there's no way to predict what that error value might mean. (And whether it constitutes a bug is a matter of opinion.)
– Gil Hamilton
yesterday
Try running the application withstrace
and see what error code is returned by the kernel. If it's "wrong", look in the driver source. Otherwise in the userspace side.
– Luca Ceresoli
23 hours ago
Ah, thanks for those hints, clear some things up. The driver code, alas, does not do anything with a 512 as an error number. Maybe I'll see with strace where it comes from. I wonder what the downvote was for. It's always great when people do that without explaining what's supposedly wrong with a question, a real help...
– sktpin
21 hours ago
Stack Overflow is a Question/Answer site. But... what would be an answer to your question? Fixes in the driver's code? - But you even don't show that code. Note, that Stack Overflow is not a forum, and it doesn't suited for long discussions. What you see in the comments, it is just an attempt to make the question clear, so it can be answered.
– Tsyvarev
10 hours ago
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a x86 64bit (AMD A8-3870) based PC, running Ubuntu 14.04.
Connected to the PCI-e slot, there is a Xilinx FPGA eval board (AC701). The reference driver provided by Xilinx, XDMA, with its counterpart IP core being in the FPGA, was compiled against this kernel. It loads and claims to have found the connected XDMA-enabled FPGA.
Xilinx also provides some test programs/scripts with the driver.
On this system, they run, but terminate unsuccessfully, outputting "Unknown error 512" a few times.
My own test program also gets this error when attempting to read() from an open device file that's DMA enabled (/dev/xdma0_c2h0).
(output via perror() right after it failed).
What I found about this are some referenes in some forums claiming that 512 is not a valid error number, it's a kernel internal error and should not "leak" to userspace - indicating a kernel bug.
What could I do about that / how to find out the cause?
Some additional info:
My own program did not have this error on an ARM Cortex A15 based system, where I was able to read from the FPGA this way. (just that there were other problems, and since the xdma driver is spec'd for x86 systems only, I wanted to see if there's a difference in behavior on a x86 system - so there is, just not the way I imagined...)
Edit: Upgraded to Ubuntu 16 (4.4.0.-139-generic), same behavior. (I initially used Ubuntu 14.04 as it's closer to what I (need to) use on the mentioned ARM system I started out with).
Reading from / writing to the FPGA design's exposed registers via another device file provided by the xdma driver for single accesses without DMA, does work, and does set things in motion inside the FPGA as I expect.
So only the DMA-enabled device file has this mysterious error 512, so far - from my program, and still as well for the Xilinx provided test program.
linux-kernel linux-device-driver fpga xilinx pci-e
I have a x86 64bit (AMD A8-3870) based PC, running Ubuntu 14.04.
Connected to the PCI-e slot, there is a Xilinx FPGA eval board (AC701). The reference driver provided by Xilinx, XDMA, with its counterpart IP core being in the FPGA, was compiled against this kernel. It loads and claims to have found the connected XDMA-enabled FPGA.
Xilinx also provides some test programs/scripts with the driver.
On this system, they run, but terminate unsuccessfully, outputting "Unknown error 512" a few times.
My own test program also gets this error when attempting to read() from an open device file that's DMA enabled (/dev/xdma0_c2h0).
(output via perror() right after it failed).
What I found about this are some referenes in some forums claiming that 512 is not a valid error number, it's a kernel internal error and should not "leak" to userspace - indicating a kernel bug.
What could I do about that / how to find out the cause?
Some additional info:
My own program did not have this error on an ARM Cortex A15 based system, where I was able to read from the FPGA this way. (just that there were other problems, and since the xdma driver is spec'd for x86 systems only, I wanted to see if there's a difference in behavior on a x86 system - so there is, just not the way I imagined...)
Edit: Upgraded to Ubuntu 16 (4.4.0.-139-generic), same behavior. (I initially used Ubuntu 14.04 as it's closer to what I (need to) use on the mentioned ARM system I started out with).
Reading from / writing to the FPGA design's exposed registers via another device file provided by the xdma driver for single accesses without DMA, does work, and does set things in motion inside the FPGA as I expect.
So only the DMA-enabled device file has this mysterious error 512, so far - from my program, and still as well for the Xilinx provided test program.
linux-kernel linux-device-driver fpga xilinx pci-e
linux-kernel linux-device-driver fpga xilinx pci-e
edited yesterday
asked yesterday
sktpin
24
24
You'll need to look at the driver source code. There's nothing magic abouterrno
values, they're just integers. Ordinarily, a driver returns one of the pre-defined ones (that are#define
d in<errno.h>
and have a text translation in libc) but there's no requirement for that. The driver is free to return whatever error value it likes and AFAIK, the kernel does not restrict the range. Since 512 isn't one of the usual ones, there's no way to predict what that error value might mean. (And whether it constitutes a bug is a matter of opinion.)
– Gil Hamilton
yesterday
Try running the application withstrace
and see what error code is returned by the kernel. If it's "wrong", look in the driver source. Otherwise in the userspace side.
– Luca Ceresoli
23 hours ago
Ah, thanks for those hints, clear some things up. The driver code, alas, does not do anything with a 512 as an error number. Maybe I'll see with strace where it comes from. I wonder what the downvote was for. It's always great when people do that without explaining what's supposedly wrong with a question, a real help...
– sktpin
21 hours ago
Stack Overflow is a Question/Answer site. But... what would be an answer to your question? Fixes in the driver's code? - But you even don't show that code. Note, that Stack Overflow is not a forum, and it doesn't suited for long discussions. What you see in the comments, it is just an attempt to make the question clear, so it can be answered.
– Tsyvarev
10 hours ago
add a comment |
You'll need to look at the driver source code. There's nothing magic abouterrno
values, they're just integers. Ordinarily, a driver returns one of the pre-defined ones (that are#define
d in<errno.h>
and have a text translation in libc) but there's no requirement for that. The driver is free to return whatever error value it likes and AFAIK, the kernel does not restrict the range. Since 512 isn't one of the usual ones, there's no way to predict what that error value might mean. (And whether it constitutes a bug is a matter of opinion.)
– Gil Hamilton
yesterday
Try running the application withstrace
and see what error code is returned by the kernel. If it's "wrong", look in the driver source. Otherwise in the userspace side.
– Luca Ceresoli
23 hours ago
Ah, thanks for those hints, clear some things up. The driver code, alas, does not do anything with a 512 as an error number. Maybe I'll see with strace where it comes from. I wonder what the downvote was for. It's always great when people do that without explaining what's supposedly wrong with a question, a real help...
– sktpin
21 hours ago
Stack Overflow is a Question/Answer site. But... what would be an answer to your question? Fixes in the driver's code? - But you even don't show that code. Note, that Stack Overflow is not a forum, and it doesn't suited for long discussions. What you see in the comments, it is just an attempt to make the question clear, so it can be answered.
– Tsyvarev
10 hours ago
You'll need to look at the driver source code. There's nothing magic about
errno
values, they're just integers. Ordinarily, a driver returns one of the pre-defined ones (that are #define
d in <errno.h>
and have a text translation in libc) but there's no requirement for that. The driver is free to return whatever error value it likes and AFAIK, the kernel does not restrict the range. Since 512 isn't one of the usual ones, there's no way to predict what that error value might mean. (And whether it constitutes a bug is a matter of opinion.)– Gil Hamilton
yesterday
You'll need to look at the driver source code. There's nothing magic about
errno
values, they're just integers. Ordinarily, a driver returns one of the pre-defined ones (that are #define
d in <errno.h>
and have a text translation in libc) but there's no requirement for that. The driver is free to return whatever error value it likes and AFAIK, the kernel does not restrict the range. Since 512 isn't one of the usual ones, there's no way to predict what that error value might mean. (And whether it constitutes a bug is a matter of opinion.)– Gil Hamilton
yesterday
Try running the application with
strace
and see what error code is returned by the kernel. If it's "wrong", look in the driver source. Otherwise in the userspace side.– Luca Ceresoli
23 hours ago
Try running the application with
strace
and see what error code is returned by the kernel. If it's "wrong", look in the driver source. Otherwise in the userspace side.– Luca Ceresoli
23 hours ago
Ah, thanks for those hints, clear some things up. The driver code, alas, does not do anything with a 512 as an error number. Maybe I'll see with strace where it comes from. I wonder what the downvote was for. It's always great when people do that without explaining what's supposedly wrong with a question, a real help...
– sktpin
21 hours ago
Ah, thanks for those hints, clear some things up. The driver code, alas, does not do anything with a 512 as an error number. Maybe I'll see with strace where it comes from. I wonder what the downvote was for. It's always great when people do that without explaining what's supposedly wrong with a question, a real help...
– sktpin
21 hours ago
Stack Overflow is a Question/Answer site. But... what would be an answer to your question? Fixes in the driver's code? - But you even don't show that code. Note, that Stack Overflow is not a forum, and it doesn't suited for long discussions. What you see in the comments, it is just an attempt to make the question clear, so it can be answered.
– Tsyvarev
10 hours ago
Stack Overflow is a Question/Answer site. But... what would be an answer to your question? Fixes in the driver's code? - But you even don't show that code. Note, that Stack Overflow is not a forum, and it doesn't suited for long discussions. What you see in the comments, it is just an attempt to make the question clear, so it can be answered.
– Tsyvarev
10 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417093%2fread-on-device-file-results-in-errno-512-unknown-error-what-does-it-mean%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You'll need to look at the driver source code. There's nothing magic about
errno
values, they're just integers. Ordinarily, a driver returns one of the pre-defined ones (that are#define
d in<errno.h>
and have a text translation in libc) but there's no requirement for that. The driver is free to return whatever error value it likes and AFAIK, the kernel does not restrict the range. Since 512 isn't one of the usual ones, there's no way to predict what that error value might mean. (And whether it constitutes a bug is a matter of opinion.)– Gil Hamilton
yesterday
Try running the application with
strace
and see what error code is returned by the kernel. If it's "wrong", look in the driver source. Otherwise in the userspace side.– Luca Ceresoli
23 hours ago
Ah, thanks for those hints, clear some things up. The driver code, alas, does not do anything with a 512 as an error number. Maybe I'll see with strace where it comes from. I wonder what the downvote was for. It's always great when people do that without explaining what's supposedly wrong with a question, a real help...
– sktpin
21 hours ago
Stack Overflow is a Question/Answer site. But... what would be an answer to your question? Fixes in the driver's code? - But you even don't show that code. Note, that Stack Overflow is not a forum, and it doesn't suited for long discussions. What you see in the comments, it is just an attempt to make the question clear, so it can be answered.
– Tsyvarev
10 hours ago