From patchwork Sun Apr 8 18:01:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10328453 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5CADA60385 for ; Sun, 8 Apr 2018 18:01:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D7EA28A89 for ; Sun, 8 Apr 2018 18:01:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 424C028AA8; Sun, 8 Apr 2018 18:01:49 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 E52FA28A8D for ; Sun, 8 Apr 2018 18:01:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbeDHSBs (ORCPT ); Sun, 8 Apr 2018 14:01:48 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:42342 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbeDHSBr (ORCPT ); Sun, 8 Apr 2018 14:01:47 -0400 Received: by mail-wr0-f196.google.com with SMTP id s18so6360577wrg.9 for ; Sun, 08 Apr 2018 11:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:references:organization:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8mRzfpDHwK4VYAXCAjZzlvAqHlI1vx1KVG0CH9FP7as=; b=ZgDuzwVUunpMaYEhTasN3C5kXsQeHC2Zv2HHZ55qt6H09jo1codf5zjPKtCNLf/ZoP YkbQcXn682SwBUMjf2fFfVhW8JsGp8t7QtM4RZcn3wy1cRUv9sRrDDcYIgQb2AhNPQrv af90CaK+aqVQRxJ5K43HyxNTIEB9fzz4T0fbEXuLayhbGwQ+z7w3lbtmuVa1ttJQM2a2 Ngh8A1AVwcZ4jkvidlSgLNNsRiNv2wcA8PFxpXhTPINgW9h7Z6eXt/oArEiSEFXSEBwI KSQhsr8MQXafMuPmnUskZO0HL+W3qM635/SkQnnEfa0EIcWyQPtX8RXSHJlcQkJtq5oI mOWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=8mRzfpDHwK4VYAXCAjZzlvAqHlI1vx1KVG0CH9FP7as=; b=PW3FB0gY14bVC+k2rTXNSJ0m8yAtNtZRUi9SSsawoN9ZnONgdg/M2uQJ192jBy1D1z Ax7fC1RgyL78o9wWjpiPifO09dKkFJkoLVPNnC08Qs994m1JnoXp2vGqezNUTvHIhUwH MV+c86PEQ5f9XjntiQVvMM2GWxboozRCD5WjWGa0o6WcdrTIWfgpr2zD1ahhpogw3mh9 9yTH/aWWEzxuLSVuj9wZMnyoU9+8bhfmoXtQgLKSraPyMlWUsCNbL11S0y3sIzyd9sEb NFrKvc99sancpJseQ6d3STaPj99tu8dDBLQlI+5I9FDiiHhDHArT8WaDweO8h8PKJz9R 9T3g== X-Gm-Message-State: ALQs6tDq/eLTGNHFwbJqEsmjvmosbC/2voo5WMgKMOjsc6T0OuPOxDgC hIlgnaIy3jXsFGt6URuumHOw3Q== X-Google-Smtp-Source: AIpwx48SMpqNqU6jm11GZvyG6KklYCXGFzdMqsilOizpubR8WTJ1ROoBIWsHGYMmpCMWP7KEt3GUnw== X-Received: by 2002:a19:59d1:: with SMTP id n200-v6mr20079535lfb.84.1523210506292; Sun, 08 Apr 2018 11:01:46 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.81.34]) by smtp.gmail.com with ESMTPSA id o2sm2514179lja.86.2018.04.08.11.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Apr 2018 11:01:45 -0700 (PDT) Subject: [PATCH v2 2/5] pcie-rcar: remove PHYRDY polling from rcar_pcie_hw_init_h1() From: Sergei Shtylyov To: horms@verge.net.au, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Lorenzo Pieralisi References: <26e803ca-06b6-28c5-b87c-fc639b322d6f@cogentembedded.com> Organization: Cogent Embedded Message-ID: <3c582c72-cee2-54b3-f82a-186999450f44@cogentembedded.com> Date: Sun, 8 Apr 2018 21:01:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <26e803ca-06b6-28c5-b87c-fc639b322d6f@cogentembedded.com> Content-Language: en-MW 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 Now that we've added PCIEPHYSR.PHYRDY polling to rcar_pcie_hw_init(), there is no need anymore for polling the PHY specific register in rcar_pcie_hw_init_h1() -- remove it. Signed-off-by: Sergei Shtylyov --- drivers/pci/host/pcie-rcar.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) Index: pci/drivers/pci/host/pcie-rcar.c =================================================================== --- pci.orig/drivers/pci/host/pcie-rcar.c +++ pci/drivers/pci/host/pcie-rcar.c @@ -102,7 +102,6 @@ #define LANE_POS 8 #define ADR_POS 0 #define H1_PCIEPHYDOUTR 0x040014 -#define H1_PCIEPHYSR 0x040018 /* R-Car Gen2 PHY */ #define GEN2_PCIEPHYADDR 0x780 @@ -627,8 +626,6 @@ static int rcar_pcie_hw_init(struct rcar static int rcar_pcie_hw_init_h1(struct rcar_pcie *pcie) { - unsigned int timeout = 10; - /* Initialize the phy */ phy_write_reg(pcie, 0, 0x42, 0x1, 0x0EC34191); phy_write_reg(pcie, 1, 0x42, 0x1, 0x0EC34180); @@ -647,14 +644,7 @@ static int rcar_pcie_hw_init_h1(struct r phy_write_reg(pcie, 0, 0x64, 0x1, 0x3F0F1F0F); phy_write_reg(pcie, 0, 0x66, 0x1, 0x00008000); - while (timeout--) { - if (rcar_pci_read_reg(pcie, H1_PCIEPHYSR)) - return rcar_pcie_hw_init(pcie); - - msleep(5); - } - - return -ETIMEDOUT; + return rcar_pcie_hw_init(pcie); } static int rcar_pcie_hw_init_gen2(struct rcar_pcie *pcie)