From patchwork Fri Apr 6 11:04:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10325847 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 83FE560545 for ; Fri, 6 Apr 2018 11:05:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75F1929293 for ; Fri, 6 Apr 2018 11:05:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AC2C294E7; Fri, 6 Apr 2018 11:05:06 +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 1985029293 for ; Fri, 6 Apr 2018 11:05:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbeDFLFE (ORCPT ); Fri, 6 Apr 2018 07:05:04 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33171 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbeDFLFE (ORCPT ); Fri, 6 Apr 2018 07:05:04 -0400 Received: by mail-wr0-f195.google.com with SMTP id z73so1384685wrb.0 for ; Fri, 06 Apr 2018 04:05:03 -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=BUtjfRTsS65en1ROB6Vj2WPOniLcEkVke0P+lOPExUEC9ZURTIxU+d5YkxkHtpV5JX 5z3atkpzTkp66OKFXlH2v+Wf01GU6fP7WxlUvRQvP76/EQuPsKW0TBlJXUaugSlEwBLs PLaZO7afsomQcKiz0D4japsF2UAbglGbbeW9pMS6TKcD73wEZq0rTWYDKCVxpR7p0fTe 01EjiNtMcdYyLofC1ziGlk9t7YPY7zUrx7z7GXz7z9j+2uembNwwDoxL6wsqZZ9EaqQH Wlbnq+dWQ+6mRIe/KbHO9GtPRA7WSulXujytNCPId8hgIB/T04BaxPaGZV4/1rsWj9IK 02iQ== 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=RCmuPPAkreFWc4TONl3QMykbV9qXCP4l2BbPrwJP/EioX2JqFCgnk9xLSHf8VRD828 CtKTWt9LCyaDjrTHc4FYvPQaT7XGJ9XoWUUtmFmQjW5CXqstG+JhS9KoGp5LVBkAuJ3G pzQK3pab9c/em4VyVyJ4ObC95vhP/URjo8NPSlGZRgsjRP0oX9j8ShF6akTryMKNtGTr 4Yb7guqkGv1CfglR+PrnXS3OLHVGIXa+kszqfjU6rBoUnUBmbJAGDXO3CZbFuJTBteAr 0AqxZLDEYIVAvgADCjHtV2gLF+eDaXk3jYXFEXqWsGLWjEJZDnLxFvgqFqDlmn5kmiDr YZUQ== X-Gm-Message-State: ALQs6tCloWNlDTZhgJniqvYWyE4qwThEW3m5sjgN9rrRpmduhaTyH16Q TV1fGsBvxsJmhVlsDdofNftzTA== X-Google-Smtp-Source: AIpwx49J1bGssGH0giqDzFBO33aZ9wx0SV0RS/fT1+/a05wkXxX4CloeMA0yiTOxSkTRTyke4cqBtw== X-Received: by 2002:a19:f203:: with SMTP id q3-v6mr15588122lfh.54.1523012697908; Fri, 06 Apr 2018 04:04:57 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.80.60]) by smtp.gmail.com with ESMTPSA id t8-v6sm2056492lfk.9.2018.04.06.04.04.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 04:04:57 -0700 (PDT) Subject: [PATCH 2/4] 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: <23335d95-63ca-b107-e43d-f4c2621adc2c@cogentembedded.com> Organization: Cogent Embedded Message-ID: <5322b1c2-109d-bd0c-7785-697ca6a5324a@cogentembedded.com> Date: Fri, 6 Apr 2018 14:04:52 +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: <23335d95-63ca-b107-e43d-f4c2621adc2c@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)