From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E930C433E1 for ; Fri, 10 Jul 2020 16:08:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0CB8207F9 for ; Fri, 10 Jul 2020 16:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594397313; bh=vC1vGxiGyID9V8iW+BxRHqjSMbf0Sz/SFWTTjr0xW9U=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=XNEGJR3wZ7UKQ/8uh7TB9RLBKEVIjldBgCrSsidExQJy6CUvwLvTMSesAmQ709q+E 3w7TjBiDIUVg0EmYHrV/k6UOba5wOWxlGaHGgu0pEEg0ku+eebIFaJPTS6fKNsYQFA bJrkgRmMZddLbrMh09ygZEUS/Vs9PR7qjXq9vS2g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbgGJQIc (ORCPT ); Fri, 10 Jul 2020 12:08:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:38500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbgGJQIb (ORCPT ); Fri, 10 Jul 2020 12:08:31 -0400 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E2482078D; Fri, 10 Jul 2020 16:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594397310; bh=vC1vGxiGyID9V8iW+BxRHqjSMbf0Sz/SFWTTjr0xW9U=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=O7T5JxThg2lij9AUFeH0M/ZWnvO3yBMFs5WxD4DWKoI9kx0z5XJcjj6Qfmd9G8txW XtNnbdLbjp/tNA5CnlRAPyoRB+eaD92YxtkJRTt50rajYNfoI6SI/vJrAVBXA2ICmH FKk5HwYebDBnR9I8ixaOPxym7PrdG3mIGJZtcgU8= Date: Fri, 10 Jul 2020 11:08:28 -0500 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Lorenzo Pieralisi , Thomas Petazzoni , Andrew Murray , Bjorn Helgaas , Marek =?iso-8859-1?Q?Beh=FAn?= , Remi Pommarel , Tomasz Maciej Nowak , Xogium , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected Message-ID: <20200710160828.GA63389@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200710154458.bntk7cgewvxmubf4@pali> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 10, 2020 at 05:44:58PM +0200, Pali Rohár wrote: > I can reproduce following issue: Connect Compex WLE900VX card, configure > aardvark to gen2 mode. And then card is detected only after the first > link training. If kernel tries to retrain link again (e.g. via ASPM > code) then card is not detected anymore. Somebody should go over the ASPM retrain link code and the PCIe spec with a fine-toothed comb. Maybe we're doing something wrong there. Or maybe aardvark has some hardware issue and we need some sort of quirk to work around it. > Another issue which happens for WLE900VX, WLE600VX and WLE1216VS-20 (but > not for WLE200VX): Linux kernel can detect these cards only if it issues > card reset via PERST# signal and start link training (via standard pcie > endpoint register PCI_EXP_LNKCTL/PCI_EXP_LNKCTL_RL) I think you mean "downstream port" (not "endpoint") register? PCI_EXP_LNKCTL_RL is only applicable to *downstream ports* (root ports or switch downstream ports) and is reserved for endpoints. > immediately after > enable link training in aardvark (via aardvark specific LINK_TRAINING_EN > bit). If there is e.g. 100ms delay between enabling link training and > setting PCI_EXP_LNKCTL_RL bit then these cards are not detected. This sounds problematic. Hardware should not be dependent on the software being "fast enough". In general we should be able to insert arbitrary delays at any point without breaking anything. But I have the impression that aardvark requires more software hand-holding that most hardware does. If it imposes timing requirements on the software, that *should* be documented in the aardvark spec. > I read in kernel bugzilla that WLE600VX and WLE900VX cards are buggy and > more people have problems with them. But issues described in kernel > bugzilla (like card is reporting incorrect PCI device id) I'm not > observing. Pointer? Is the incorrect device ID 0xffff? That could be a symptom of a PCIe error. If we read a device ID that's something other than 0, 0xffff, or the correct ID, that would be really weird. Even 0 would be really strange. I suspect these wifi cards are a little special because they probably play unusual games with power for airplane mode and the like. Bjorn From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82626C433E1 for ; Fri, 10 Jul 2020 16:09:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F19A206C3 for ; Fri, 10 Jul 2020 16:09:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oLo8a6Zo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="O7T5JxTh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F19A206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID:Subject:To:From: Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=WG2o4+QQHg/2DLffWhHw4vCb4LuyoHndY2uhnVOryQE=; b=oLo8a6Zo8TElESNuOLK+32/IX kPI+C6iz4NW2TC3rIBZ2zetzlUzBihOPBDTrUcHpP7qdsP0ATUy3Un21JeJ5qM8X3Bei9eJWrYY2I DC6zJR9nqPcYrwMN7i/2x/0sCgtep9pJUgx4WAs9dDWWM6Dup/bMTKjPPNE3/CAbC0wajmWiUtA8O 2k2Vm/qogwEI1yRMiCn5dvs/cilizVx+tj0JSALVxS0iJUi5ZJeB1Xqp73FTkspGTY6n+9Ew4i0iF mn2Dz/D59EbyJSwisQ9/1mw3llZ3ZhN4SfUrpmiyZW3mb2J/lyX9guoHBbFW89BFgA+A49BHjvWbs dCMirNu9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtvZi-0006oy-Gn; Fri, 10 Jul 2020 16:08:34 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtvZf-0006oM-9D for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 16:08:31 +0000 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E2482078D; Fri, 10 Jul 2020 16:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594397310; bh=vC1vGxiGyID9V8iW+BxRHqjSMbf0Sz/SFWTTjr0xW9U=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=O7T5JxThg2lij9AUFeH0M/ZWnvO3yBMFs5WxD4DWKoI9kx0z5XJcjj6Qfmd9G8txW XtNnbdLbjp/tNA5CnlRAPyoRB+eaD92YxtkJRTt50rajYNfoI6SI/vJrAVBXA2ICmH FKk5HwYebDBnR9I8ixaOPxym7PrdG3mIGJZtcgU8= Date: Fri, 10 Jul 2020 11:08:28 -0500 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected Message-ID: <20200710160828.GA63389@bjorn-Precision-5520> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200710154458.bntk7cgewvxmubf4@pali> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_120831_415575_B277F827 X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomasz Maciej Nowak , Lorenzo Pieralisi , linux-pci@vger.kernel.org, Xogium , linux-kernel@vger.kernel.org, Marek =?iso-8859-1?Q?Beh=FAn?= , Remi Pommarel , Thomas Petazzoni , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Andrew Murray Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 10, 2020 at 05:44:58PM +0200, Pali Roh=E1r wrote: > I can reproduce following issue: Connect Compex WLE900VX card, configure > aardvark to gen2 mode. And then card is detected only after the first > link training. If kernel tries to retrain link again (e.g. via ASPM > code) then card is not detected anymore. = Somebody should go over the ASPM retrain link code and the PCIe spec with a fine-toothed comb. Maybe we're doing something wrong there. Or maybe aardvark has some hardware issue and we need some sort of quirk to work around it. > Another issue which happens for WLE900VX, WLE600VX and WLE1216VS-20 (but > not for WLE200VX): Linux kernel can detect these cards only if it issues > card reset via PERST# signal and start link training (via standard pcie > endpoint register PCI_EXP_LNKCTL/PCI_EXP_LNKCTL_RL) I think you mean "downstream port" (not "endpoint") register? PCI_EXP_LNKCTL_RL is only applicable to *downstream ports* (root ports or switch downstream ports) and is reserved for endpoints. > immediately after > enable link training in aardvark (via aardvark specific LINK_TRAINING_EN > bit). If there is e.g. 100ms delay between enabling link training and > setting PCI_EXP_LNKCTL_RL bit then these cards are not detected. This sounds problematic. Hardware should not be dependent on the software being "fast enough". In general we should be able to insert arbitrary delays at any point without breaking anything. But I have the impression that aardvark requires more software hand-holding that most hardware does. If it imposes timing requirements on the software, that *should* be documented in the aardvark spec. > I read in kernel bugzilla that WLE600VX and WLE900VX cards are buggy and > more people have problems with them. But issues described in kernel > bugzilla (like card is reporting incorrect PCI device id) I'm not > observing. Pointer? Is the incorrect device ID 0xffff? That could be a symptom of a PCIe error. If we read a device ID that's something other than 0, 0xffff, or the correct ID, that would be really weird. Even 0 would be really strange. I suspect these wifi cards are a little special because they probably play unusual games with power for airplane mode and the like. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel