* [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values
@ 2013-02-06 5:18 Jingoo Han
2013-02-06 14:27 ` Alex Deucher
0 siblings, 1 reply; 4+ messages in thread
From: Jingoo Han @ 2013-02-06 5:18 UTC (permalink / raw)
To: 'David Airlie'; +Cc: dri-devel, linux-pci, 'Jingoo Han'
Use PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB instead
of hardcoded values for readability. These bit definitions were
added by commit 130f1b8 ("PCI: Add PCIe Link Capability link speed
and width names")
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/gpu/drm/drm_pci.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 754bc96..11c8add 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -504,9 +504,9 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask)
if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB)
*mask |= DRM_PCIE_SPEED_80;
} else {
- if (lnkcap & 1)
+ if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB)
*mask |= DRM_PCIE_SPEED_25;
- if (lnkcap & 2)
+ if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB)
*mask |= DRM_PCIE_SPEED_50;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values
2013-02-06 5:18 [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values Jingoo Han
@ 2013-02-06 14:27 ` Alex Deucher
2013-02-06 17:08 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2013-02-06 14:27 UTC (permalink / raw)
To: Jingoo Han; +Cc: David Airlie, linux-pci, dri-devel
On Wed, Feb 6, 2013 at 12:18 AM, Jingoo Han <jg1.han@samsung.com> wrote:
> Use PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB instead
> of hardcoded values for readability. These bit definitions were
> added by commit 130f1b8 ("PCI: Add PCIe Link Capability link speed
> and width names")
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/drm_pci.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index 754bc96..11c8add 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -504,9 +504,9 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask)
> if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB)
> *mask |= DRM_PCIE_SPEED_80;
> } else {
> - if (lnkcap & 1)
> + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB)
> *mask |= DRM_PCIE_SPEED_25;
> - if (lnkcap & 2)
> + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB)
> *mask |= DRM_PCIE_SPEED_50;
> }
>
> --
> 1.7.2.5
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values
2013-02-06 14:27 ` Alex Deucher
@ 2013-02-06 17:08 ` Bjorn Helgaas
2013-02-06 23:59 ` Jingoo Han
0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2013-02-06 17:08 UTC (permalink / raw)
To: Alex Deucher; +Cc: Jingoo Han, David Airlie, linux-pci, dri-devel
On Wed, Feb 6, 2013 at 7:27 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Wed, Feb 6, 2013 at 12:18 AM, Jingoo Han <jg1.han@samsung.com> wrote:
>> Use PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB instead
>> of hardcoded values for readability. These bit definitions were
>> added by commit 130f1b8 ("PCI: Add PCIe Link Capability link speed
>> and width names")
>>
>> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
I posted the same patch last month, along with two other patches that
fix the reporting for pre-r3.0 devices and simplify the code a bit:
http://marc.info/?l=linux-pci&m=135732663513525&w=2
http://marc.info/?l=linux-pci&m=135732713413779&w=2
http://marc.info/?l=linux-pci&m=135732666213542&w=2
I don't know the status of any of these; I'm expecting Dave to do
whatever he thinks is best.
>
>> ---
>> drivers/gpu/drm/drm_pci.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
>> index 754bc96..11c8add 100644
>> --- a/drivers/gpu/drm/drm_pci.c
>> +++ b/drivers/gpu/drm/drm_pci.c
>> @@ -504,9 +504,9 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask)
>> if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB)
>> *mask |= DRM_PCIE_SPEED_80;
>> } else {
>> - if (lnkcap & 1)
>> + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB)
>> *mask |= DRM_PCIE_SPEED_25;
>> - if (lnkcap & 2)
>> + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB)
>> *mask |= DRM_PCIE_SPEED_50;
>> }
>>
>> --
>> 1.7.2.5
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values
2013-02-06 17:08 ` Bjorn Helgaas
@ 2013-02-06 23:59 ` Jingoo Han
0 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2013-02-06 23:59 UTC (permalink / raw)
To: 'Bjorn Helgaas', 'Alex Deucher'
Cc: 'David Airlie', linux-pci, dri-devel, 'Jingoo Han'
On Thursday, February 07, 2013 2:08 AM, Bjorn Helgaas wrote
>
> On Wed, Feb 6, 2013 at 7:27 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> > On Wed, Feb 6, 2013 at 12:18 AM, Jingoo Han <jg1.han@samsung.com> wrote:
> >> Use PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB instead
> >> of hardcoded values for readability. These bit definitions were
> >> added by commit 130f1b8 ("PCI: Add PCIe Link Capability link speed
> >> and width names")
> >>
> >> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> >
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
>
> I posted the same patch last month, along with two other patches that
> fix the reporting for pre-r3.0 devices and simplify the code a bit:
>
> http://marc.info/?l=linux-pci&m=135732663513525&w=2
> http://marc.info/?l=linux-pci&m=135732713413779&w=2
> http://marc.info/?l=linux-pci&m=135732666213542&w=2
Oh, I missed your patch.
I think that my patch will be abandoned.
Best regards,
Jingoo Han
>
> I don't know the status of any of these; I'm expecting Dave to do
> whatever he thinks is best.
>
> >
> >> ---
> >> drivers/gpu/drm/drm_pci.c | 4 ++--
> >> 1 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> >> index 754bc96..11c8add 100644
> >> --- a/drivers/gpu/drm/drm_pci.c
> >> +++ b/drivers/gpu/drm/drm_pci.c
> >> @@ -504,9 +504,9 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask)
> >> if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB)
> >> *mask |= DRM_PCIE_SPEED_80;
> >> } else {
> >> - if (lnkcap & 1)
> >> + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB)
> >> *mask |= DRM_PCIE_SPEED_25;
> >> - if (lnkcap & 2)
> >> + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB)
> >> *mask |= DRM_PCIE_SPEED_50;
> >> }
> >>
> >> --
> >> 1.7.2.5
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-06 23:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 5:18 [PATCH] drm/pci: use PCI_EXP_LNKCAP_SLS_2_5GB/5_0GB instead of hardcoded values Jingoo Han
2013-02-06 14:27 ` Alex Deucher
2013-02-06 17:08 ` Bjorn Helgaas
2013-02-06 23:59 ` Jingoo Han
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.