billfarrow / pcimem

Simple program to read & write to a pci device from userspace
GNU General Public License v2.0
309 stars 115 forks source link

System goes inaccessible after using ./pcimem #8

Open vineeshvs opened 5 years ago

vineeshvs commented 5 years ago

Hi, I tried writing to a location using the following command. sudo ./pcimem /sys/bus/pci/devices/0000\:0a\:00.0/resource0 0x100 w 0x1234abcd The machine got stuck and I am not able to ping it now.

What could be the reason?

billfarrow commented 5 years ago

The PCI device that was written to might not be completing the PCI transaction and holding the PCI bus indefinitely, or perhaps the PCI device is doing something bad when that address is written. Lockups like this should be expected when probing around during the initial stages of driver development. I like to have a system watchdog setup and running, as well as a remote power switch for this situation during driver development.

Infanswer commented 5 years ago

Hi, I tried writing to a location using the following command. ./pcimem /sys/bus/pci/devices/0000\:03\:00.0/resource 0x110 w An error occurs: Error at line 111,fine pcimem.c(19) [No such device]

What could be the reason?

billfarrow commented 5 years ago

The mmap() system call failed when trying to map your PCI device memory. The pcimem tool doesn't think there is a valid resource at that sysfs path. Make sure the PCI device shown correctly in sysfs and the resource path is correct.

On Tue, Apr 2, 2019 at 8:11 AM Infanswer notifications@github.com wrote:

Hi, I tried writing to a location using the following command. ./pcimem /sys/bus/pci/devices/0000:03:00.0/resource 0x110 w An error occurs: Error at line 111,fine pcimem.c(19) [No such device]

What could be the reason?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/billfarrow/pcimem/issues/8#issuecomment-478967994, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXxj65U8-NGR8gVu8oNj-q9eb9wBX3Xks5vc0kFgaJpZM4ZUnCC .