Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08FFFC74A44 for ; Tue, 14 Mar 2023 08:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbjCNINM (ORCPT ); Tue, 14 Mar 2023 04:13:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbjCNIMJ (ORCPT ); Tue, 14 Mar 2023 04:12:09 -0400 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E5D887A3E for ; Tue, 14 Mar 2023 01:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1678781438; x=1710317438; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=X0KxmQowXDDwSTHyOkkSqL6l1rbqAQ9YKCBJzCgDIOw=; b=GKw4Qm6yp0WM3BAw4JfKsAFrCGdn5MYDm16Y3myTySfL+Vm1GVc5Gt+J rEMqddq6mi/XW4USTODqUs1LXUsJBBgV2g5is3Sv5tHezdXdysSH+ikMs x+kDlLKOpIdr7kCw2yOsPpjEplfvPOZ7EQP7qGdm71tWnEYZbnKCNGSL9 LJ7El4iBKQ+JyW+PR8SgRHoW2hnDKGobaEGSeWpmDhhJnEYw7tnJG0Ken 6sBDvdLFV67+Apg0aTeZO72M4QM1yVMQ/FjleVjN1jKcYtw1kSxK9b+UN dxJOqi5iXnzw2Wl6ntp9L0T4kXccym70PIgFaQQM/N06BnlDD+RwkW6SJ Q==; X-IronPort-AV: E=Sophos;i="5.98,259,1673884800"; d="scan'208";a="225366746" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Mar 2023 16:10:36 +0800 IronPort-SDR: q7G24q26sk6d3HBZ61OrN+283zS7BJ4VllR5hKSewkHqtwt4irXNaWn342CNKDH5LJvv9FQqCY TJzK/tWMBh/DT5f2LdsJ+qE2UhFrclCE7xIndSl8Rag2IdksXYWNCP+Zx5ypzdpU7VRabdnk4h zEzJbcahcYQiD8w1c/vGt8XiGSlawoEVxxiWm89SXgirt2N74qUtwtUHvJt2Gu6jC5HjUBzWlS zehXDYAqE9nwv1KGXGBUbGGPsuWJgphGa4GKRejj5QW2AvMQtJ5t6PsWqz/dDHK4y9v7XydRB/ /cw= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Mar 2023 00:27:05 -0700 IronPort-SDR: LqlF+VjAr/x9/XumEW6Ho2LI1WnKqahAUXuuWaGvCJqUOJ4y31VRwy30JWGd/N3eoBqQo9DLIV 5QCZ6g+B/EG/DLHlHaNUCqM6/BYo0de0va1v4EnliQa0EpETyvGpOYnIOQX8sUrJKT5IOgIUSA Qp2p2DbNUnmGAvhu7PEyXz5q1Gf18qqvvzCdrTOu+V48MoYmEAQ5/MVmoe9ixsSa217g0pBvkF WEAYxzvpdEfEmay7dFb76yJnP5lpJNQmZTqIznPwcgWaILYDRFzbPTr7Oft25159OQnzl0jnpH oCo= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Mar 2023 01:10:38 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4PbR6N4XJ8z1RtVp for ; Tue, 14 Mar 2023 01:10:36 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1678781435; x=1681373436; bh=X0KxmQowXDDwSTHyOkkSqL6l1rbqAQ9YKCB JzCgDIOw=; b=aQkApqFk9I+MNhGHlB40yywZEUpsCVbJ29Z4NmlcgwGr0HSf9P7 YNC/NpiufUwyDl6VB2D/wPgxPUOK0flCLsoGSsWAx2S55jQBoLX38U951lj8nXvV cKWvvV7n6D8OllDSGMqaVxNTKSiITVzzY/oxdmfr1e6XbWL0zhPro3aRaMEysKo0 zibVPE/XxlYtiRJiqjeoMAgHOruplq+tmQYq1wqn124YlaAoNO2x+cNOBPqlLVO2 2Dndp8naUWPs3/592xJE9aSqLxOCuZ3Mcr0L970x6oefAJmndFE+f5sIZzkq3t6t /pBxs69vHg9Q2L9LnDAvLtCiiLpH2dWc4Iw== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id u2Sei_UNUVO7 for ; Tue, 14 Mar 2023 01:10:35 -0700 (PDT) Received: from [10.149.53.254] (washi.fujisawa.hgst.com [10.149.53.254]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4PbR6H6r4sz1RtVm; Tue, 14 Mar 2023 01:10:31 -0700 (PDT) Message-ID: <3c4ed614-f088-928f-2807-deaa5e4b668a@opensource.wdc.com> Date: Tue, 14 Mar 2023 17:10:30 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 0/9] PCI: rockchip: Fix RK3399 PCIe endpoint controller driver Content-Language: en-US To: Rick Wertenbroek Cc: alberto.dassatti@heig-vd.ch, xxm@rock-chips.com, rick.wertenbroek@heig-vd.ch, Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Shawn Lin , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Bjorn Helgaas , Jani Nikula , Rodrigo Vivi , Mikko Kovanen , Greg Kroah-Hartman , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org References: <20230214140858.1133292-1-rick.wertenbroek@gmail.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/23 16:57, Rick Wertenbroek wrote: > On Tue, Mar 14, 2023 at 1:02=E2=80=AFAM Damien Le Moal > wrote: >> >> On 2/14/23 23:08, Rick Wertenbroek wrote: >>> This is a series of patches that fixes the PCIe endpoint controller d= river >>> for the Rockchip RK3399 SoC. The driver was introduced in >>> cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe control= ler") >>> The original driver had issues and would not allow for the RK3399 to >>> operate in PCIe endpoint mode correctly. This patch series fixes that= so >>> that the PCIe core controller of the RK3399 SoC can now act as a PCIe >>> endpoint. This is v2 of the patch series and addresses the concerns t= hat >>> were raised during the review of the first version. >> >> Rick, >> >> Are you going to send a rebased V3 soon ? I have a couple of additiona= l >> patches to add on top of your series... >> >=20 > I'll try to send a V3 this week. The changes to V2 will be the issues > raised and discussed on the V2 here in the mailing list with the additi= onal > code for removing the unsupported MSI-X capability list (was discussed > in the mailing list as well). Thanks. Additional patch needed to avoid problems with this controller is that we need to set ".align =3D 256" in the features. Otherwise, things do not work well. This is because the ATU drops the low 8-bits of the PCI addresses. It is a one liner patch, so feel free to add it to your series= . I also noticed random issues wich seem to be due to link-up timing... We probably will need to implement a poll thread to detect and notify with the linkup callback when we actually have the link established with the host (see the dw-ep controller which does something similar). From: Damien Le Moal Date: Thu, 9 Mar 2023 16:37:24 +0900 Subject: [PATCH] PCI: rockchip: Set address alignment for endpoint mode The address translation unit of the rockchip EP controller does not use the lower 8 bits of a PCIe-space address to map local memory. Thus we must set the align feature field to 256 to let the user know about this constraint. Signed-off-by: Damien Le Moal --- drivers/pci/controller/pcie-rockchip-ep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c index 12db9a9d92af..c6a23db84967 100644 --- a/drivers/pci/controller/pcie-rockchip-ep.c +++ b/drivers/pci/controller/pcie-rockchip-ep.c @@ -471,6 +471,7 @@ static const struct pci_epc_features rockchip_pcie_epc_features =3D { .linkup_notifier =3D false, .msi_capable =3D true, .msix_capable =3D false, + .align =3D 256, }; static const struct pci_epc_features* --=20 2.39.2 --=20 Damien Le Moal Western Digital Research