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

Bug#891674: Patch to fix the problem



On 2018-02-28 02:41 AM, Peter.Chubb@data61.csiro.au wrote:
> The linux kernel treats PCI domains as 32 bit ints.
> 
> diff -ru libpciaccess-0.13.4/include/pciaccess.h libpciaccess-0.13.4-fixed/include/pciaccess.h
> --- libpciaccess-0.13.4/include/pciaccess.h	2015-05-01 14:44:47.000000000 +1000
> +++ libpciaccess-0.13.4-fixed/include/pciaccess.h	2018-02-28 12:21:12.280963252 +1100
> @@ -321,7 +321,7 @@
>       * the domain will always be zero.
>       */
>      /*@{*/
> -    uint16_t    domain;
> +    uint32_t    domain;
>      uint8_t     bus;
>      uint8_t     dev;
>      uint8_t     func;
> diff -ru libpciaccess-0.13.4/src/linux_sysfs.c libpciaccess-0.13.4-fixed/src/linux_sysfs.c
> --- libpciaccess-0.13.4/src/linux_sysfs.c	2015-05-01 14:44:47.000000000 +1000
> +++ libpciaccess-0.13.4-fixed/src/linux_sysfs.c	2018-02-28 12:21:32.676941130 +1100
> @@ -157,7 +157,7 @@
>  			(struct pci_device_private *) &p->devices[i];
>  
>  
> -		sscanf(devices[i]->d_name, "%04x:%02x:%02x.%1u",
> +		sscanf(devices[i]->d_name, "%x:%02x:%02x.%1u",
>  		       & dom, & bus, & dev, & func);
>  
>  		device->base.domain = dom;
> 

Doing it like this breaks ABI. This is fixed in libpciaccess 0.14 by
https://cgit.freedesktop.org/xorg/lib/libpciaccess/commit/?id=a167bd6474522a709ff3cbb00476c0e4309cb66f
, though Xorg needs to be rebuilt against that for it to take effect.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


Reply to: