From patchwork Mon Apr 15 00:46:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10900027 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 0C9D8922 for ; Mon, 15 Apr 2019 00:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E82722012F for ; Mon, 15 Apr 2019 00:47:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC4C92861C; Mon, 15 Apr 2019 00:47:28 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B4252012F for ; Mon, 15 Apr 2019 00:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbfDOAr1 (ORCPT ); Sun, 14 Apr 2019 20:47:27 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39906 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726178AbfDOAr1 (ORCPT ); Sun, 14 Apr 2019 20:47:27 -0400 Received: by mail-pg1-f196.google.com with SMTP id k3so7719582pga.6; Sun, 14 Apr 2019 17:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6ZPyWSQHPinUgWmwQRPfs9W8YBEIvp9FgszeG1juFHE=; b=V+2169/1jR/HaXhDuVoQLVhzYg7l+7RaU+E/nUKpESLYBrs6bs/qTKw7pr5xIwlmMt qODOrHcNsS5IdWajLNpMenrq+ZIh1gVeDDPgDdPIYw7MwhWt3ph8ZopDrTPjHjv3vEPv u15PsvDaCQon4kwkB6IPtsc2JYxAaNLm4wR8w+Tt5ZSWJFF+eOOrTpPqHON8/MrtgmsQ BE/BfH4FyqJnXb3FNSwAfB6KigpVXIctj6RKQvt4kpKPYkuUeeNQim6/7sDrlHKIB1cc xjjHiPrmKbx+3msrl2D+iSvDICZmepgkUg1Afej+VkEI8lb9hwekqu80pCp3wY73gh34 /NQA== 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:mime-version :content-transfer-encoding; bh=6ZPyWSQHPinUgWmwQRPfs9W8YBEIvp9FgszeG1juFHE=; b=ffrfFptp17RwXESS3caYNS/eseIwKUJt2Du1S/VanygL6Ymzm0dn7x5PvQZutxhLPi wYh/8DLGI1wlcK+gEWdYkL5/LiRLmQ5Wln4/WSqprvPRKfRHsQcK7jI+vi5n1LIopvY6 mqr9xwDx+tYlDRkLwyLH1ffK2gJDHbBGatdADXUDkuPZK30hZwfGaX6dg6wSuuXcpzrS yJjeHjWvobzIjK+WJg274DCvxXIyFNOO2AqNDDEnAHweHNqZvcYngPmS10y4jLZZa/1u RKB1AtYHmyB/MrQcwO8x5v4STCB+Bvb4XI6e95cvIxNueMgYLinnx3/0gXVhHxbxG4l8 nroA== X-Gm-Message-State: APjAAAU3jdMPHAT49f+CjNouPm8lM6J10ndY7wJrBekx/j3s1umuGG2f 2/BOaGAHPAk1M7crtvsWPaxrYnKf X-Google-Smtp-Source: APXvYqw7hf3lFVNbVikfY9YkZ2TVMYXTAKQgR6zFOYzPBkUrROfk638Y34ZH5sanq3hrGkeTVnnZvQ== X-Received: by 2002:a65:6150:: with SMTP id o16mr6819893pgv.285.1555289246368; Sun, 14 Apr 2019 17:47:26 -0700 (PDT) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id u17sm66111981pfn.19.2019.04.14.17.47.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Apr 2019 17:47:25 -0700 (PDT) From: Andrey Smirnov To: linux-pci@vger.kernel.org Cc: Andrey Smirnov , Lorenzo Pieralisi , Bjorn Helgaas , Fabio Estevam , Chris Healy , Lucas Stach , Leonard Crestez , "A.s. Dong" , Richard Zhu , linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 00/11] i.MX6, DesignWare PCI improvements Date: Sun, 14 Apr 2019 17:46:21 -0700 Message-Id: <20190415004632.5907-1-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Everyone: This is the series containing various small improvements that I made while reading the code and researching commit history of pci-imx6.c and pcie-designware*.c files. All changes are optional, so commits that don't seem like an improvement can be easily dropped. Hopefully each patch is self-explanatory. I tested this series on i.MX6Q, i.MX7D and i.MX8MQ. Feedback is welcome! Thanks, Andrey Smirnov Chagnes since [v3]: - Collected Reviewed-by from Lucas for most of the patches - Converted "PCI: imx6: Replace calls to udelay() with usleep_range()" to "PCI: imx6: Use usleep_range() in imx6_pcie_enable_ref_clk()" - Converted "PCI: imx6: Remove redundant debug tracing" to "PCI: imx6: Drop imx6_pcie_wait_for_link()" - Converted all of the callers of pcie_phy_poll_ack() to use true/false in "PCI: imx6: Simplify pcie_phy_poll_ack()" Changes since [v2]: - All non i.MX6 patches dropped, since they were accepted as a seprarte series - Series rebased on latest 'dwc-pci' branch of PCI tree - Patches "PCI: imx6: Use flags to indicate support for suspend" and "PCI: imx6: Replace calls to udelay() with usleep_range()" added to the series Changes since [v1]: - Dropped "PCI: imx6: Drop imx6_pcie_link_up()" due to the matter already having been addressed by "PCI: imx6: Fix link training status detection in link up check" from Trent Piepho - Changed "designware" -> "dwc" for all subject lines - Collected Acked-by's from Gustavo Pimentel [v3] lkml.kernel.org/r/20190401042547.14067-1-andrew.smirnov@gmail.com [v2] lkml.kernel.org/r/20190104174925.17153-1-andrew.smirnov@gmail.com [v1] lkml.kernel.org/r/20181221072716.29017-1-andrew.smirnov@gmail.com Andrey Smirnov (11): PCI: imx6: Simplify imx7d_pcie_wait_for_phy_pll_lock() PCI: imx6: Drop imx6_pcie_wait_for_link() PCI: imx6: Return -ETIMEOUT from imx6_pcie_wait_for_speed_change() PCI: imx6: Remove PCIE_PL_PFLR_* constants PCI: dwc: imx6: Share PHY debug register definitions PCI: imx6: Make use of BIT() in constant definitions PCI: imx6: Simplify bit operations in PHY functions PCI: imx6: Simplify pcie_phy_poll_ack() PCI: imx6: Restrict PHY register data to 16-bit PCI: imx6: Use flags to indicate support for suspend PCI: imx6: Use usleep_range() in imx6_pcie_enable_ref_clk() drivers/pci/controller/dwc/pci-imx6.c | 143 ++++++++----------- drivers/pci/controller/dwc/pcie-designware.c | 12 +- drivers/pci/controller/dwc/pcie-designware.h | 3 + 3 files changed, 62 insertions(+), 96 deletions(-)