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: 895665 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cogentembedded.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="BUtjfRTs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40HcKt46gBz9s0y for ; Fri, 6 Apr 2018 21:05:06 +1000 (AEST) 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 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)