From patchwork Thu May 3 19:37: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: 10379031 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 6CC7D60541 for ; Thu, 3 May 2018 19:37:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63FA722ADC for ; Thu, 3 May 2018 19:37:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5866026AE3; Thu, 3 May 2018 19:37:57 +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 0952922ADC for ; Thu, 3 May 2018 19:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbeECThz (ORCPT ); Thu, 3 May 2018 15:37:55 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:35677 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbeECThz (ORCPT ); Thu, 3 May 2018 15:37:55 -0400 Received: by mail-lf0-f65.google.com with SMTP id y72-v6so13925783lfd.2 for ; Thu, 03 May 2018 12:37:54 -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=A4p/88FzfPDrDb2nhfurU8AN94k/38r47eNfa/0l61M=; b=CdobM2F3QvmDHj/4XaB1Xw/TSoIApHcp8vaP99PQdiOoxwQW8oWcCzcqtmfN35AhrQ f8nrl3kamWD0aEHZ1H8LSssBeZx+JhcVy7ZsxwVxcbHfZrluTOftVeCXRZsLJWsdMeAg nRPJc0wxLJ31JhDE2nZGZZpUtU+JgWovlnnVIRLirhhZrlinPUi6Q9i5rSE7MGPHdzhC ux7Q/flGn/HWWPM36/y9EW5Cva86xH4SKk8pMPH/Mbz0obbnujTCBeys73COG5NMa1mG fX5ncZx3Lmo/2AZ4AAU2mjBQFe47+XAUWF1pF/T6cuNe6slqgprP/4YdV8onUvRwDcFk PDuQ== 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=A4p/88FzfPDrDb2nhfurU8AN94k/38r47eNfa/0l61M=; b=LYJk4qX0owZwIXkjD6ByRSjnn0nIZfhMr60Hm9UMfURXlZnZ5ETVP2ANwtL6zYGgsQ ZEbqk3bd6uC+xDy4qdq5Ru1bm/TZC5daW6KWxZdaTj3wze4r58eoE1zx3kRxvtfRy4he Rfh2/eVU7IwRCSr+V0rjSjC1uU/7osNuVhNfTJ4Y2XvLYoV4TkjqAtxqFZBHrWt90qi7 6v3uaqcaQa+kkPUgEpyu+X/ABFsRe0o9hFFqcQ1kvxECD4IoH2g571eHWdUlOo7uJPnw UFXWaYdkYkbYoRV19v5D0PJutBXUhFyblpI4wc4yNhGRt/LbEwWRRc+mAty4mfdNOfSG j+7w== X-Gm-Message-State: ALQs6tDpqMnhR39PHDHLSZ5ji4IQnHXVBysjyk12ZTCK7HcL9SKRsBci 6AJjSDe1bL3Jt1z7TwrabiRyXw== X-Google-Smtp-Source: AB8JxZruczzQBmJXph+GgMl1PqZjLGykQqqY5mPbmqVR+B3WUbmwwRKCyJlp0KnU1C/5fVrpyoaoAw== X-Received: by 2002:a19:4a48:: with SMTP id x69-v6mr16039701lfa.80.1525376273829; Thu, 03 May 2018 12:37:53 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.85.138]) by smtp.gmail.com with ESMTPSA id v1-v6sm1590049ljg.58.2018.05.03.12.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 12:37:52 -0700 (PDT) Subject: [PATCH v3 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: Organization: Cogent Embedded Message-ID: Date: Thu, 3 May 2018 22:37: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: 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 Reviewed-by: Simon Horman --- Changes in version 3: - added Simon's tag; - refreshed atop of Marek's patch. 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 @@ -103,7 +103,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)