Re: [PATCH 2/3] PCIUtils: fix inconsistent bus centric view between the sysfs and proc methods

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> The vendor and device IDs may be different when using sysfs and proc
> methods with bus centric view enabled. The sysfs method reads the IDs
> from the configuration space instead of using the values from sysfs
> entries. But the proc method always uses values from the proc files.
> This fix makes the proc method use the values from configuration space,

ACK.

> and also clean up some unused code that handles 64-bit BAR (it's already
> taken care of by generic/proc/sysfs methods code).

Please do not mix the two things in a single patch.

> diff --git a/lspci.c b/lspci.c
> index d872c75..cb6740f 100644
> --- a/lspci.c
> +++ b/lspci.c
> @@ -17,7 +17,6 @@
>  /* Options */
>  
>  int verbose;				/* Show detailed information */
> -static int opt_buscentric;		/* Show bus addresses/IRQ's instead of CPU-visible ones */
>  static int opt_hex;			/* Show contents of config space as hexadecimal numbers */
>  struct pci_filter filter;		/* Device filter */
>  static int opt_tree;			/* Show bus tree */
> @@ -391,28 +390,6 @@ show_bases(struct device *d, int cnt)
>  	  u32 z = 0;
>  
>  	  printf("Memory at ");
> -	  if (t == PCI_BASE_ADDRESS_MEM_TYPE_64)
> -	    {
> -	      if (i >= cnt - 1)
> -		{
> -		  printf("<invalid-64bit-slot>");
> -		  done = 1;
> -		}
> -	      else
> -		{
> -		  i++;
> -		  z = get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i);
> -		  if (opt_buscentric)
> -		    {
> -		      u32 y = a & 0xffffffff;
> -		      if (a || z)
> -			printf("%08x%08x", z, y);
> -		      else
> -			printf("<unassigned>");
> -		      done = 1;
> -		    }
> -		}
> -	    }

While the decoding of 64-bit BARs is redundant and should be removed,
the <invalid-64bit-slot> warning is useful and it should be kept.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj@xxxxxx>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"#define QUESTION ((bb) || !(bb))"  -- Shakespeare
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux