Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp397211imm; Thu, 16 Aug 2018 23:14:40 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxYesqXQMvn9XBpvQuJHA+e4JT5HtX9UEr7czkXktQxUR2WM8vXWrTnNOZSGqbwFLF4MsrJ X-Received: by 2002:aa7:8713:: with SMTP id b19-v6mr12696902pfo.151.1534486480280; Thu, 16 Aug 2018 23:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534486480; cv=none; d=google.com; s=arc-20160816; b=JJ45T8Sf+6q1KNvvHnaJWxF3Iu9If4Bcv5XtoYD+A2pU6NsDe2lxPucEMnxZ5JBmaX YiRH4BXrRz1kt8e+eMKM4RcxHrURnzGo0XG2Hh8Tlle60pp+2GVVmPamLkeKJaCSaTi5 dKr7CZ92qpzWl6Xg0fsQStWac83h/dxKZK7Ddao+Sa35BuSonhxx4KxqgHHPhcoDc1U1 XT8JkV42TZRAI+yd4yKGa2f9AQ9xanMK6il6wILyRCTYsjCQMKkQBFK3zi/VnBfazZyd bJUVg4+6SpCeirKjkqTQkaLHJ1+rKMIQFJ9a2dVzMTeinzhiXEOfKa4mt1KBq5L4jdXX rgDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Ynltls+ZAZsEVbfZRrdGs1Mp0n/VvZ+NyOAoh2DlnAw=; b=T7UIld5AihFGcOvRvOIbxE38e6KpAG4eN8fcqIrN/51Ml8d7eekIh+xlP0ag+0f7Hl Pz7hWpTkccN6ZIeMVhi3Z/AYFDt4IimO6bDet/4fDQeoYp9IuMXcDj6+EH/Zs4N3uJqf VJnEEtnFXJxm1tVIZUbdDM5KPrPu+A/tLCsCpbMXgb39NBI3v+y72aKVH1LaCXJ2bdb6 RW11IZoaHAnH7WlPfrQ36zUpFlb4jyLNlVsayMZEVXjTT0BHIdHHwJK5fK1AfsnKW47y BW9ZS9se/zKgjUAJhyPQIvW0zZ3zFdT5vCa7oJP+4u24zf9FOzmroPRPZIShLTCQooa7 JVJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h65-v6si1281825pfg.197.2018.08.16.23.14.25; Thu, 16 Aug 2018 23:14:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbeHQJOu (ORCPT + 99 others); Fri, 17 Aug 2018 05:14:50 -0400 Received: from mail-sh2.amlogic.com ([58.32.228.45]:40465 "EHLO mail-sh2.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbeHQJOu (ORCPT ); Fri, 17 Aug 2018 05:14:50 -0400 Received: from [10.18.59.72] (10.18.59.72) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 17 Aug 2018 14:12:56 +0800 Subject: Re: [PATCH 2/2] PCI: meson: add the Amlogic Meson PCIe phy driver To: Jerome Brunet , Kishon Vijay Abraham I CC: Yue Wang , , , , , Kevin Hilman , Carlo Caione , Rob Herring , References: <1534227134-151584-1-git-send-email-hanjie.lin@amlogic.com> <1534227134-151584-3-git-send-email-hanjie.lin@amlogic.com> <486e8ab477cc22ff231d2e18d7de22efba2c5abd.camel@baylibre.com> <2b87e834-41e3-e418-95f0-c6d695cd8b3f@amlogic.com> From: Hanjie Lin Message-ID: <91658f21-6934-6085-8deb-b85a1f6b7815@amlogic.com> Date: Fri, 17 Aug 2018 14:12:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.18.59.72] X-ClientProxiedBy: mail-sh2.amlogic.com (10.18.11.6) To mail-sh2.amlogic.com (10.18.11.6) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/8/16 16:33, Jerome Brunet wrote: > On Thu, 2018-08-16 at 11:05 +0800, Hanjie Lin wrote: >> >> On 2018/8/14 18:41, Jerome Brunet wrote: >>> On Tue, 2018-08-14 at 02:12 -0400, Hanjie Lin wrote: >>>> From: Yue Wang >>>> >>>> The Meson-PCIE-PHY controller supports the 5-Gbps data rate >>>> of the PCI Express Gen 2 specification and is backwardcompatible >>>> with the 2.5-Gbps Gen 1.1 specification with only >>>> inferred idle detection supported on AMLOGIC SoCs. >>> >>> It looks like the sole purpose of this driver is to provide the reset lines to >>> pcie driver. >>> >>> I wonder why we need this ? Can't the pcie driver claim the reset lines itself. >>> >>> Also, an init of this phy will always reset both port. What will happen if the >>> first port is in use and the 2nd port comes up ?? >>> >>> Looks the the pcie driver should claim 'apb' and 'phy' reset lines as "shared" >>> reset and the required 'port' as 'exclusive' >>> >> >> Thank you for your response. >> >> Yes, 'apb' and 'phy' reset lines are shared, and ‘port' reset line is exclusive. >> If we handle all reset lines during the first port initial sequence, >> and when the second port comes up, we will do nothing about the rest lines, >> and don't need a extra API to do ‘port' reset; > > With which other driver are your control shared ? > > Looks it is the answer is none since this phy driver will reset both port > already, even if one is used. > > In this case the fact that you are using shared control is just abusing the > framework to reset once. > > As far as I can tell, this driver makes no sense. The appropriate reset lines > should be given directly to your pcie driver. > > > > . > Amlogic AXG SOC includes two pcie controllers and pipes when only one pcie phy: (port_a reset) |PCIE_RC_A---->PCIE_PIPE_A------| (apb_reset) | | (phy reset) APB BUS---> | | PCIE_PHY | | | (port_b_reset) | |PCIE_RC_B---->PCIE_PIPE_B------| The phy_reset affect the PCIE_PHY. The port_a_reset affect the PCIE_PIPE_A, port_b_reset affect the PCIE_PIPE_B. As your suggestion we will move the 'port' reset to controller driver, and keeping the phy driver to process the 'apb' and 'phy' reset or any more changes of the phy in future.