From patchwork Fri Dec 21 07:27:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10740051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7530E746 for ; Fri, 21 Dec 2018 07:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A40F28429 for ; Fri, 21 Dec 2018 07:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DA4F284DC; Fri, 21 Dec 2018 07:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E094028429 for ; Fri, 21 Dec 2018 07:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LN2CmLllGcbkvLHCsPbdFbUvIEabr7yZA4MnSgIYnIg=; b=exrIUR7Ra7eAtJ hmugaBdaF+VrZuSo+WKQpL1I0apgHtccuEG6q/5gaUhYkWbzvul+QzqM80RUtBl51jyeWJb34Nk+1 b/qpRmmfKt2kbfRtgurRGJKWMHvDDcdIQsIBN+4aONmJHtHWKKYBrg/C4JAj3m43HnLIgiporAVOq Pwp6R9Gm1/iI22iO09DmoJgo/Zop9XCugxf/y/DXknYSoI/aSh5b6hqJCvHSBAAGEpvP0aUXCN+Tr ZWpaPquo/OO4F9H08IAkwi4i2ead14X0Mpb9c4GNhjHWkPAbh9IuN11KSWUXh2Q2+c2fOcBjTg3PQ iE8Uk5+F2xcu0LiTe5Tg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaFGg-0005kW-Mq; Fri, 21 Dec 2018 07:30:46 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaFE7-0001jf-7d for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2018 07:28:08 +0000 Received: by mail-pg1-x543.google.com with SMTP id y4so2097241pgc.12 for ; Thu, 20 Dec 2018 23:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u1hnIy8vmdV/yZX7E7Jm64Qo+GuGNv09m6Pi4D4/jFs=; b=igx2pbzCncxfVAQhjH9xaI/FCAIaddYLG9x2Ieuc5tdWQzv3z0MRHJ2KIenPF8WV63 27/RiEAvf91QtmM/jEQgI9eyV+NhU/PU18Q+py2Gp/j37fvH+i7GGtwxWIlty+PHFvUH Va3uTUJCjPQxAdkVT3b86nHZOSfjjGh87OT09JNdzIzMwJ6rphof1OdaYiYbySpiUTpY /3tS4m+UEU3uqZpKCzV8LgRTqXfSsJbbfzqS45E8uxSx7JbCCH9NfWFb0bDhoUjtRHPB gEQLQacnRuVmTtuv4k4vSBTCWnooTZxxj4CgWe1mV3aYE2toxh040AN136AF8Qv97XbR JeeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u1hnIy8vmdV/yZX7E7Jm64Qo+GuGNv09m6Pi4D4/jFs=; b=I0F6pBxOyvKuw+Kyu0GdRq+MmoBc+bUEgcR6yB2p6d41m4ZWWCW3IcNUvpn5i27LmH uEyX6kklOJFwVbucTjzeY+3x5MLchYxUHuCtxe5/iaDkMpFsOiPWX+Sjs/1XYZx7Z5rD 64xc1TCxk42BF4y7UDHPGeBHLp0wzmqFkZkyZc9Kmzsi1vbw82J3YpH5t+iEBTkkUgtt n1H0kDg/iJxO1HSXOvD3FKLuxXGDnT7NlbgGEVzi3ShrVNJKGIRT0oWJU4dyUriF0/sD tj+5cKgeIDZBQURPxf+Y/MRfeUAvb/oZmUAMS6ZdLgM39hQwOI80EeeopTSnQE0ORatv 8xQg== X-Gm-Message-State: AJcUukfIKH+3j6kfwOM+VvLDh/VaJ5nQOJmayfoU/ewBJYNOGTEfeTaa 3bBZPlK7b1NVhDOd2s54ev00FgQb X-Google-Smtp-Source: ALg8bN4vox9LZebHZGx5bOBLDLief4pJfhpahT2U2GmwxOnNKMv9alUCzjnwm7VG02285/dOUUeVLQ== X-Received: by 2002:a65:4381:: with SMTP id m1mr1327155pgp.358.1545377276324; Thu, 20 Dec 2018 23:27:56 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id t90sm44971921pfj.23.2018.12.20.23.27.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 23:27:55 -0800 (PST) From: Andrey Smirnov To: linux-pci@vger.kernel.org Subject: [PATCH 09/21] PCI: imx6: Drop imx6_pcie_link_up() Date: Thu, 20 Dec 2018 23:27:04 -0800 Message-Id: <20181221072716.29017-10-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181221072716.29017-1-andrew.smirnov@gmail.com> References: <20181221072716.29017-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181220_232807_452488_45ACA0D9 X-CRM114-Status: GOOD ( 14.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "A.s. Dong" , Lorenzo Pieralisi , Richard Zhu , linux-arm-kernel@lists.infradead.org, Andrey Smirnov , linux-kernel@vger.kernel.org, Fabio Estevam , linux-imx@nxp.com, Bjorn Helgaas , Leonard Crestez , Chris Healy , Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Until commit 4d107d3b5a68 ("PCI: imx6: Move link up check into imx6_pcie_wait_for_link()") the driver relied on both LINK_UP and LINK_IN_TRAINING to determine if PCIE link was up. I can't seem to find out why, but code using LINK_IN_TRAINING seem to disappear after commit 886bc5ceb5cc ("PCI: designware: Add generic dw_pcie_wait_for_link()") and from then on only LINK_UP seems to be tested (dw_pcie_wait_for_link() -> dw_pcie_link_up() -> imx6_pcie_link_up()). At the same time the default behavior of dw_pcie_link_up() went from using just LINK_UP in commit dac29e6c5460 ("PCI: designware: Add default link up check if sub-driver doesn't override") to using both LINK_IN_TRAINING and LINK_UP in commit 01c076732e82 ("PCI: designware: Check LTSSM training bit before deciding link is up"). Given all that it seems that i.MX6 doesn't really need a special .link_up() callback and imx6_pcie_link_up() can be dropped. Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: Andrey Smirnov --- drivers/pci/controller/dwc/pci-imx6.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 937d630f8c9d..74faca11eeae 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -84,8 +84,6 @@ struct imx6_pcie { #define PL_OFFSET 0x700 #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) -#define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) -#define PCIE_PHY_DEBUG_R1_XMLH_LINK_UP (1 << 4) #define PCIE_PHY_CTRL (PL_OFFSET + 0x114) #define PCIE_PHY_CTRL_DATA_LOC 0 @@ -732,12 +730,6 @@ static int imx6_pcie_host_init(struct pcie_port *pp) return 0; } -static int imx6_pcie_link_up(struct dw_pcie *pci) -{ - return dw_pcie_readl_dbi(pci, PCIE_PHY_DEBUG_R1) & - PCIE_PHY_DEBUG_R1_XMLH_LINK_UP; -} - static const struct dw_pcie_host_ops imx6_pcie_host_ops = { .host_init = imx6_pcie_host_init, }; @@ -769,9 +761,7 @@ static int imx6_add_pcie_port(struct imx6_pcie *imx6_pcie, return 0; } -static const struct dw_pcie_ops dw_pcie_ops = { - .link_up = imx6_pcie_link_up, -}; +static const struct dw_pcie_ops dw_pcie_ops; #ifdef CONFIG_PM_SLEEP static void imx6_pcie_ltssm_disable(struct device *dev)