Linux PCI subsystem development
 help / color / mirror / Atom feed
* Re: [RFC PATCH] pciehp: Wait for link get trained in pci_check_link_status()
       [not found]     ` <4EB9A50D.1040302@oracle.com>
@ 2011-11-10  7:39       ` Kenji Kaneshige
  2011-11-10  7:40         ` [PATCH 1/2] pciehp: wait 1000 ms before Link Training check Kenji Kaneshige
  2011-11-10  7:42         ` [PATCH 2/2] pciehp: wait 100 ms after " Kenji Kaneshige
  0 siblings, 2 replies; 10+ messages in thread
From: Kenji Kaneshige @ 2011-11-10  7:39 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Jesse Barnes, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

(2011/11/09 6:54), Yinghai Lu wrote:
> On 11/08/2011 07:27 AM, Yinghai Lu wrote:
>
>> On 11/08/2011 01:19 AM, Kenji Kaneshige wrote:
>>>
>>> What about the patch below? I think it's much simpler and has less impact.
>>
>> Should work. will try it today.
>
>
> yes, that works too.
>
> Thanks
>
> Yinghai
>

I updated the patch with description. I split it into two and
a logic is a little changed. Could you check these?

Regards,
Kenji Kaneshige


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

* [PATCH 1/2] pciehp: wait 1000 ms before Link Training check
  2011-11-10  7:39       ` [RFC PATCH] pciehp: Wait for link get trained in pci_check_link_status() Kenji Kaneshige
@ 2011-11-10  7:40         ` Kenji Kaneshige
  2011-11-10 19:10           ` Yinghai Lu
  2011-11-10  7:42         ` [PATCH 2/2] pciehp: wait 100 ms after " Kenji Kaneshige
  1 sibling, 1 reply; 10+ messages in thread
From: Kenji Kaneshige @ 2011-11-10  7:40 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Jesse Barnes, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

We need to wait for 1000 ms after Data Link Layer Link Active (DLLLA)
bit reads 1b before sending configuration request. Currently pciehp
does this wait after checking Link Training (LT) bit. But we need it
before checking LT bit because LT is still set even after DLLLA bit is
set on some platforms.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
 drivers/pci/hotplug/pciehp_ctrl.c |    3 ---
 drivers/pci/hotplug/pciehp_hpc.c  |    8 ++++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

Index: linux-3.1/drivers/pci/hotplug/pciehp_ctrl.c
===================================================================
--- linux-3.1.orig/drivers/pci/hotplug/pciehp_ctrl.c
+++ linux-3.1/drivers/pci/hotplug/pciehp_ctrl.c
@@ -213,9 +213,6 @@ static int board_added(struct slot *p_sl
 		goto err_exit;
 	}
 
-	/* Wait for 1 second after checking link training status */
-	msleep(1000);
-
 	/* Check for a power fault */
 	if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) {
 		ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(p_slot));
Index: linux-3.1/drivers/pci/hotplug/pciehp_hpc.c
===================================================================
--- linux-3.1.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ linux-3.1/drivers/pci/hotplug/pciehp_hpc.c
@@ -280,6 +280,14 @@ int pciehp_check_link_status(struct cont
         else
                 msleep(1000);
 
+	/*
+	 * Need to wait for 1000 ms after Data Link Layer Link Active
+	 * (DLLLA) bit reads 1b before sending configuration request.
+	 * We need it before checking Link Training (LT) bit becuase
+	 * LT is still set even after DLLLA bit is set on some platform.
+	 */
+	msleep(1000);
+
 	retval = pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status);
 	if (retval) {
 		ctrl_err(ctrl, "Cannot read LNKSTATUS register\n");

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

* [PATCH 2/2] pciehp: wait 100 ms after Link Training check
  2011-11-10  7:39       ` [RFC PATCH] pciehp: Wait for link get trained in pci_check_link_status() Kenji Kaneshige
  2011-11-10  7:40         ` [PATCH 1/2] pciehp: wait 1000 ms before Link Training check Kenji Kaneshige
@ 2011-11-10  7:42         ` Kenji Kaneshige
  2011-11-10 19:10           ` Yinghai Lu
  1 sibling, 1 reply; 10+ messages in thread
From: Kenji Kaneshige @ 2011-11-10  7:42 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Jesse Barnes, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

If the port supports Link speeds greater than 5.0 GT/s, we must wait
for 100 ms after Link training completes before sending configuration
request.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
 drivers/pci/hotplug/pciehp_hpc.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-3.1/drivers/pci/hotplug/pciehp_hpc.c
===================================================================
--- linux-3.1.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ linux-3.1/drivers/pci/hotplug/pciehp_hpc.c
@@ -302,6 +302,14 @@ int pciehp_check_link_status(struct cont
 		return retval;
 	}
 
+	/*
+	 * If the port supports Link speeds greater than 5.0 GT/s, we
+	 * must wait for 100 ms after Link training completes before
+	 * sending configuration request.
+	 */
+	if (ctrl->pcie->port->subordinate->max_bus_speed > PCIE_SPEED_5_0GT)
+		msleep(100);
+
 	pcie_update_link_speed(ctrl->pcie->port->subordinate, lnk_status);
 
 	return retval;

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

* Re: [PATCH 1/2] pciehp: wait 1000 ms before Link Training check
  2011-11-10  7:40         ` [PATCH 1/2] pciehp: wait 1000 ms before Link Training check Kenji Kaneshige
@ 2011-11-10 19:10           ` Yinghai Lu
  0 siblings, 0 replies; 10+ messages in thread
From: Yinghai Lu @ 2011-11-10 19:10 UTC (permalink / raw)
  To: Kenji Kaneshige
  Cc: Jesse Barnes, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

On 11/09/2011 11:40 PM, Kenji Kaneshige wrote:

> We need to wait for 1000 ms after Data Link Layer Link Active (DLLLA)
> bit reads 1b before sending configuration request. Currently pciehp
> does this wait after checking Link Training (LT) bit. But we need it
> before checking LT bit because LT is still set even after DLLLA bit is
> set on some platforms.
> 
> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>


Acked-by: Yinghai Lu <yinghai@kernel.org>
Tested-by: Yinghai Lu <yinghai@kernel.org>

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

* Re: [PATCH 2/2] pciehp: wait 100 ms after Link Training check
  2011-11-10  7:42         ` [PATCH 2/2] pciehp: wait 100 ms after " Kenji Kaneshige
@ 2011-11-10 19:10           ` Yinghai Lu
  2011-11-11 17:32             ` Jesse Barnes
  0 siblings, 1 reply; 10+ messages in thread
From: Yinghai Lu @ 2011-11-10 19:10 UTC (permalink / raw)
  To: Kenji Kaneshige
  Cc: Jesse Barnes, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

On 11/09/2011 11:42 PM, Kenji Kaneshige wrote:

> If the port supports Link speeds greater than 5.0 GT/s, we must wait
> for 100 ms after Link training completes before sending configuration
> request.
> 
> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>



Acked-by: Yinghai Lu <yinghai@kernel.org>
Tested-by: Yinghai Lu <yinghai@kernel.org>

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

* Re: [PATCH 2/2] pciehp: wait 100 ms after Link Training check
  2011-11-10 19:10           ` Yinghai Lu
@ 2011-11-11 17:32             ` Jesse Barnes
  2011-11-11 17:33               ` Yinghai Lu
  0 siblings, 1 reply; 10+ messages in thread
From: Jesse Barnes @ 2011-11-11 17:32 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Kenji Kaneshige, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

On Thu, 10 Nov 2011 11:10:56 -0800
Yinghai Lu <yinghai.lu@oracle.com> wrote:

> On 11/09/2011 11:42 PM, Kenji Kaneshige wrote:
> 
> > If the port supports Link speeds greater than 5.0 GT/s, we must wait
> > for 100 ms after Link training completes before sending configuration
> > request.
> > 
> > Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> 
> 
> 
> Acked-by: Yinghai Lu <yinghai@kernel.org>
> Tested-by: Yinghai Lu <yinghai@kernel.org>

Applied these two to my for-linus branch, thanks guys.

-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/2] pciehp: wait 100 ms after Link Training check
  2011-11-11 17:32             ` Jesse Barnes
@ 2011-11-11 17:33               ` Yinghai Lu
  2011-11-11 17:40                 ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Yinghai Lu @ 2011-11-11 17:33 UTC (permalink / raw)
  To: Jesse Barnes, Greg KH
  Cc: Kenji Kaneshige, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

On 11/11/2011 09:32 AM, Jesse Barnes wrote:

> On Thu, 10 Nov 2011 11:10:56 -0800
> Yinghai Lu <yinghai.lu@oracle.com> wrote:
> 
>> On 11/09/2011 11:42 PM, Kenji Kaneshige wrote:
>>
>>> If the port supports Link speeds greater than 5.0 GT/s, we must wait
>>> for 100 ms after Link training completes before sending configuration
>>> request.
>>>
>>> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
>>
>>
>>
>> Acked-by: Yinghai Lu <yinghai@kernel.org>
>> Tested-by: Yinghai Lu <yinghai@kernel.org>
> 
> Applied these two to my for-linus branch, thanks guys.
> 


Thanks, We may need to put them into stable too.

Yinghai

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

* Re: [PATCH 2/2] pciehp: wait 100 ms after Link Training check
  2011-11-11 17:33               ` Yinghai Lu
@ 2011-11-11 17:40                 ` Greg KH
       [not found]                   ` <4ECDA602.9060103@oracle.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2011-11-11 17:40 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Jesse Barnes, Kenji Kaneshige, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org

On Fri, Nov 11, 2011 at 09:33:32AM -0800, Yinghai Lu wrote:
> On 11/11/2011 09:32 AM, Jesse Barnes wrote:
> 
> > On Thu, 10 Nov 2011 11:10:56 -0800
> > Yinghai Lu <yinghai.lu@oracle.com> wrote:
> > 
> >> On 11/09/2011 11:42 PM, Kenji Kaneshige wrote:
> >>
> >>> If the port supports Link speeds greater than 5.0 GT/s, we must wait
> >>> for 100 ms after Link training completes before sending configuration
> >>> request.
> >>>
> >>> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> >>
> >>
> >>
> >> Acked-by: Yinghai Lu <yinghai@kernel.org>
> >> Tested-by: Yinghai Lu <yinghai@kernel.org>
> > 
> > Applied these two to my for-linus branch, thanks guys.
> > 
> 
> 
> Thanks, We may need to put them into stable too.

Then send stable@vger.kernel.org the git commit ids once they show up in
Linus's tree.

thanks,

greg k-h

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

* Re: pciehp for stable
       [not found]                   ` <4ECDA602.9060103@oracle.com>
@ 2011-11-27  3:25                     ` Greg KH
  2011-12-02 23:21                       ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2011-11-27  3:25 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Greg KH, stable, linux-pci

On Wed, Nov 23, 2011 at 06:03:46PM -0800, Yinghai Lu wrote:
> On 11/11/2011 09:40 AM, Greg KH wrote:
> 
> >> Thanks, We may need to put them into stable too.
> > 
> > Then send stable@vger.kernel.org the git commit ids once they show up in
> > Linus's tree.
> > 
> 
> 
> >From 0027cb3e1947d0f453fece40ed16764fb362bac6 Mon Sep 17 00:00:00 2001
> From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> Date: Thu, 10 Nov 2011 16:40:37 +0900
> Subject: [PATCH] PCI: pciehp: wait 1000 ms before Link Training check
> 
> 
> >From b3c004542229099e18198061c737e13eafc8d4d6 Mon Sep 17 00:00:00 2001
> From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> Date: Thu, 10 Nov 2011 16:42:16 +0900
> Subject: [PATCH] PCI: pciehp: wait 100 ms after Link Training check

Are you sure these patches are correct?  Linus complained about them,
and I will to :)

Please get Jesse to ack them and I'll apply them.

thanks,

greg k-h

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

* Re: pciehp for stable
  2011-11-27  3:25                     ` pciehp for stable Greg KH
@ 2011-12-02 23:21                       ` Greg KH
  0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2011-12-02 23:21 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Greg KH, stable, linux-pci

On Sat, Nov 26, 2011 at 07:25:44PM -0800, Greg KH wrote:
> On Wed, Nov 23, 2011 at 06:03:46PM -0800, Yinghai Lu wrote:
> > On 11/11/2011 09:40 AM, Greg KH wrote:
> > 
> > >> Thanks, We may need to put them into stable too.
> > > 
> > > Then send stable@vger.kernel.org the git commit ids once they show up in
> > > Linus's tree.
> > > 
> > 
> > 
> > >From 0027cb3e1947d0f453fece40ed16764fb362bac6 Mon Sep 17 00:00:00 2001
> > From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> > Date: Thu, 10 Nov 2011 16:40:37 +0900
> > Subject: [PATCH] PCI: pciehp: wait 1000 ms before Link Training check
> > 
> > 
> > >From b3c004542229099e18198061c737e13eafc8d4d6 Mon Sep 17 00:00:00 2001
> > From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> > Date: Thu, 10 Nov 2011 16:42:16 +0900
> > Subject: [PATCH] PCI: pciehp: wait 100 ms after Link Training check
> 
> Are you sure these patches are correct?  Linus complained about them,
> and I will to :)
> 
> Please get Jesse to ack them and I'll apply them.

As I have gotten no reply in the week since I sent this, I'm dropping
this request from my queue, sorry.

greg k-h

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

end of thread, other threads:[~2011-12-02 23:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4EB88238.4050409@oracle.com>
     [not found] ` <4EB8F434.6090003@jp.fujitsu.com>
     [not found]   ` <4EB94A51.6070809@oracle.com>
     [not found]     ` <4EB9A50D.1040302@oracle.com>
2011-11-10  7:39       ` [RFC PATCH] pciehp: Wait for link get trained in pci_check_link_status() Kenji Kaneshige
2011-11-10  7:40         ` [PATCH 1/2] pciehp: wait 1000 ms before Link Training check Kenji Kaneshige
2011-11-10 19:10           ` Yinghai Lu
2011-11-10  7:42         ` [PATCH 2/2] pciehp: wait 100 ms after " Kenji Kaneshige
2011-11-10 19:10           ` Yinghai Lu
2011-11-11 17:32             ` Jesse Barnes
2011-11-11 17:33               ` Yinghai Lu
2011-11-11 17:40                 ` Greg KH
     [not found]                   ` <4ECDA602.9060103@oracle.com>
2011-11-27  3:25                     ` pciehp for stable Greg KH
2011-12-02 23:21                       ` Greg KH

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