Linux PCI subsystem development
 help / color / mirror / Atom feed
* help with setpci "no devices at"
@ 2014-06-13 16:25 Patrick
  2014-06-13 17:44 ` Patrick
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick @ 2014-06-13 16:25 UTC (permalink / raw)
  To: linux-pci@vger.kernel.org

Hi Everyone

Thanks again to Bjorn for helping me in the thread "updating firmware 
with setpci"

I have started a new thread as it's more specific than the previous one 
and might be more valuable this way in the archives.

I replaced a PCI chip on one card I am trying to copy the good PCI 
configuration space settings from another card, as-is they are very 
different and the repaired card is failing.

I found a perfect little awk script here to generate setpci commands 
from lspci -xxx  :

https://gist.github.com/jlopez-git/4594728

I ended up with setpci complaining about missing a width. I found this 
thread:
https://access.redhat.com/site/solutions/45240

It looks like older versions of the tool did not require widths to be 
specified. The awk script may be a bit dated.

I changed XX= to XX.b=
setpci -sD 04:01.0 00.b=813010e8

based on:
http://www.tutorialspoint.com/unix_commands/setpci.htm
which gave this example:
setpci -s 13:8.4 40.b=50:d0,04:0c,ff


but now I have another error:
setpci: Warning: No devices selected for "04:01.0".
setpci: Invalid width "0".


lspci shows the device at:
04:01.0 Unassigned class [ff00]: Device a101:81ff

The example showed the b near the register address but the "invalid 
width 0" error has me wondering if it's supposed to go somewhere else or 
I should be using a different width flag.

Could someone point me in the right direction ?

Thanks for reading-Patrick















^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help with setpci "no devices at"
  2014-06-13 16:25 help with setpci "no devices at" Patrick
@ 2014-06-13 17:44 ` Patrick
  2014-06-13 18:02   ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick @ 2014-06-13 17:44 UTC (permalink / raw)
  To: linux-pci@vger.kernel.org

On 13/06/14 12:25 PM, Patrick wrote:
> Hi Everyone
>
> Thanks again to Bjorn for helping me in the thread "updating firmware 
> with setpci"
>
> I have started a new thread as it's more specific than the previous 
> one and might be more valuable this way in the archives.
>
> I replaced a PCI chip on one card I am trying to copy the good PCI 
> configuration space settings from another card, as-is they are very 
> different and the repaired card is failing.
>
> I found a perfect little awk script here to generate setpci commands 
> from lspci -xxx  :
>
> https://gist.github.com/jlopez-git/4594728
>
> I ended up with setpci complaining about missing a width. I found this 
> thread:
> https://access.redhat.com/site/solutions/45240
>
> It looks like older versions of the tool did not require widths to be 
> specified. The awk script may be a bit dated.
>
> I changed XX= to XX.b=
> setpci -sD 04:01.0 00.b=813010e8
>
> based on:
> http://www.tutorialspoint.com/unix_commands/setpci.htm
> which gave this example:
> setpci -s 13:8.4 40.b=50:d0,04:0c,ff
>
>
> but now I have another error:
> setpci: Warning: No devices selected for "04:01.0".
> setpci: Invalid width "0".
>
>
> lspci shows the device at:
> 04:01.0 Unassigned class [ff00]: Device a101:81ff
>
> The example showed the b near the register address but the "invalid 
> width 0" error has me wondering if it's supposed to go somewhere else 
> or I should be using a different width flag.
>
> Could someone point me in the right direction ?
>
> Thanks for reading-Patrick
>
>

I am not sure if it is good etiquette to answer your own post but I 
wanted to mention that I found two of my mistakes.

I specified B but I was writing 4 bytes. I thought I better use the -D 
flag to test-run things but that doesn't look right in this situation.

setpci -s  04:01.0 0x00.L=813010e8

Ran without errors but the changes were not reflected in the card's 
configuration space. lspci -xxx gave the same results before and after. 
I have run all commands as root.

If anyone can point out another mistake I have made that would be so great.













^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: help with setpci "no devices at"
  2014-06-13 17:44 ` Patrick
@ 2014-06-13 18:02   ` Alex Williamson
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2014-06-13 18:02 UTC (permalink / raw)
  To: Patrick; +Cc: linux-pci@vger.kernel.org

On Fri, 2014-06-13 at 13:44 -0400, Patrick wrote:
> On 13/06/14 12:25 PM, Patrick wrote:
> > Hi Everyone
> >
> > Thanks again to Bjorn for helping me in the thread "updating firmware 
> > with setpci"
> >
> > I have started a new thread as it's more specific than the previous 
> > one and might be more valuable this way in the archives.
> >
> > I replaced a PCI chip on one card I am trying to copy the good PCI 
> > configuration space settings from another card, as-is they are very 
> > different and the repaired card is failing.
> >
> > I found a perfect little awk script here to generate setpci commands 
> > from lspci -xxx  :
> >
> > https://gist.github.com/jlopez-git/4594728
> >
> > I ended up with setpci complaining about missing a width. I found this 
> > thread:
> > https://access.redhat.com/site/solutions/45240
> >
> > It looks like older versions of the tool did not require widths to be 
> > specified. The awk script may be a bit dated.
> >
> > I changed XX= to XX.b=
> > setpci -sD 04:01.0 00.b=813010e8
> >
> > based on:
> > http://www.tutorialspoint.com/unix_commands/setpci.htm
> > which gave this example:
> > setpci -s 13:8.4 40.b=50:d0,04:0c,ff
> >
> >
> > but now I have another error:
> > setpci: Warning: No devices selected for "04:01.0".
> > setpci: Invalid width "0".
> >
> >
> > lspci shows the device at:
> > 04:01.0 Unassigned class [ff00]: Device a101:81ff
> >
> > The example showed the b near the register address but the "invalid 
> > width 0" error has me wondering if it's supposed to go somewhere else 
> > or I should be using a different width flag.
> >
> > Could someone point me in the right direction ?
> >
> > Thanks for reading-Patrick
> >
> >
> 
> I am not sure if it is good etiquette to answer your own post but I 
> wanted to mention that I found two of my mistakes.
> 
> I specified B but I was writing 4 bytes. I thought I better use the -D 
> flag to test-run things but that doesn't look right in this situation.
> 
> setpci -s  04:01.0 0x00.L=813010e8
> 
> Ran without errors but the changes were not reflected in the card's 
> configuration space. lspci -xxx gave the same results before and after. 
> I have run all commands as root.
> 
> If anyone can point out another mistake I have made that would be so great.

I think the premise of being able to "update" a device via PCI config
space is flawed.  Much of config space is read-only, such as the vendor
and device IDs that you're trying to change.  The bits that can be
changed are not persistent across boots.  Some devices may have
sequences where vendor capability fields can be used to access some sort
of programming mode of the card, but they would be very device specific.
You cannot simply write a new value to any given register and expect it
to change and be persistent.  Thanks,

Alex


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-13 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 16:25 help with setpci "no devices at" Patrick
2014-06-13 17:44 ` Patrick
2014-06-13 18:02   ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox