Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-12 Thread Don Dutile
On 07/11/2013 09:38 PM, Yijing Wang wrote: Hi Don, Thanks for your review and comments very much! +dev->sn = pci_device_serial_number(dev); + Finally, 'the comment below': I know you were following Bjorn's suggestion, which I thought was an improvement, but why not do above assignment

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-12 Thread Don Dutile
On 07/11/2013 09:38 PM, Yijing Wang wrote: Hi Don, Thanks for your review and comments very much! +dev-sn = pci_device_serial_number(dev); + Finally, 'the comment below': I know you were following Bjorn's suggestion, which I thought was an improvement, but why not do above assignment

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Bjorn Helgaas
On Thu, Jul 11, 2013 at 12:18 PM, Don Dutile wrote: > On 07/11/2013 04:09 PM, Bjorn Helgaas wrote: >> >> On Thu, Jul 11, 2013 at 3:51 AM, Don Dutile wrote: >>> >>> On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
On 2013/7/12 2:18, Don Dutile wrote: > On 07/11/2013 04:09 PM, Bjorn Helgaas wrote: >> On Thu, Jul 11, 2013 at 3:51 AM, Don Dutile wrote: >>> On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
>> } >>> >>> + pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DSN); >>> + if (!pos) >>> + return 0; >>> + >>> + pci_read_config_dword(dev, pos + 4,); >>> + pci_read_config_dword(dev, pos + 8,); >>> + sn = ((u64)hi<< 32) | lo; >> >> See comment below:

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
>> > [...] >> diff --git a/include/linux/pci.h b/include/linux/pci.h >> index 0fd1f15..10d190b 100644 >> --- a/include/linux/pci.h >> +++ b/include/linux/pci.h >> @@ -342,6 +342,7 @@ struct pci_dev { >> struct list_head msi_list; >> struct kset *msi_kset; >> #endif >> +u64 sn;

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
Hi Don, Thanks for your review and comments very much! >> +dev->sn = pci_device_serial_number(dev); >> + > Finally, 'the comment below': > I know you were following Bjorn's suggestion, which I thought > was an improvement, but why not do above assignment in > pci_device_serial_number() ?

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Don Dutile
On 07/11/2013 04:09 PM, Bjorn Helgaas wrote: On Thu, Jul 11, 2013 at 3:51 AM, Don Dutile wrote: On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Bjorn Helgaas
On Thu, Jul 11, 2013 at 3:51 AM, Don Dutile wrote: > On 07/11/2013 05:43 AM, Yijing Wang wrote: >> >> Introduce PCIe Ext Capability Device Serial Number support, >> so we can use the unique device serial number to identify >> the physical device. During system suspend, if the PCIe >> device was

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Paul Bolle
On Thu, 2013-07-11 at 17:43 +0800, Yijing Wang wrote: > Introduce PCIe Ext Capability Device Serial Number support, > so we can use the unique device serial number to identify > the physical device. During system suspend, if the PCIe > device was removed and inserted a new same device, after >

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Don Dutile
On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system suspend, if the PCIe device was removed and inserted a new same device, after system resume there is

[PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system suspend, if the PCIe device was removed and inserted a new same device, after system resume there is no good way to identify it, maybe Device

[PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system suspend, if the PCIe device was removed and inserted a new same device, after system resume there is no good way to identify it, maybe Device

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Don Dutile
On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system suspend, if the PCIe device was removed and inserted a new same device, after system resume there is

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Paul Bolle
On Thu, 2013-07-11 at 17:43 +0800, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system suspend, if the PCIe device was removed and inserted a new same device, after system

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Bjorn Helgaas
On Thu, Jul 11, 2013 at 3:51 AM, Don Dutile ddut...@redhat.com wrote: On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical device. During system suspend, if the PCIe

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Don Dutile
On 07/11/2013 04:09 PM, Bjorn Helgaas wrote: On Thu, Jul 11, 2013 at 3:51 AM, Don Dutileddut...@redhat.com wrote: On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device serial number to identify the physical

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
Hi Don, Thanks for your review and comments very much! +dev-sn = pci_device_serial_number(dev); + Finally, 'the comment below': I know you were following Bjorn's suggestion, which I thought was an improvement, but why not do above assignment in pci_device_serial_number() ? I don't

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
[...] diff --git a/include/linux/pci.h b/include/linux/pci.h index 0fd1f15..10d190b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -342,6 +342,7 @@ struct pci_dev { struct list_head msi_list; struct kset *msi_kset; #endif +u64 sn; /* device

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
} + pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DSN); + if (!pos) + return 0; + + pci_read_config_dword(dev, pos + 4,lo); + pci_read_config_dword(dev, pos + 8,hi); + sn = ((u64)hi 32) | lo; See comment below: dev-sn = ((u64)hi

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Yijing Wang
On 2013/7/12 2:18, Don Dutile wrote: On 07/11/2013 04:09 PM, Bjorn Helgaas wrote: On Thu, Jul 11, 2013 at 3:51 AM, Don Dutileddut...@redhat.com wrote: On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support, so we can use the unique device

Re: [PATCH -v2 1/3] PCI: introduce PCIe Device Serial Number Capability support

2013-07-11 Thread Bjorn Helgaas
On Thu, Jul 11, 2013 at 12:18 PM, Don Dutile ddut...@redhat.com wrote: On 07/11/2013 04:09 PM, Bjorn Helgaas wrote: On Thu, Jul 11, 2013 at 3:51 AM, Don Dutileddut...@redhat.com wrote: On 07/11/2013 05:43 AM, Yijing Wang wrote: Introduce PCIe Ext Capability Device Serial Number support,