Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp252030ybl; Wed, 4 Dec 2019 02:06:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwzHWly6hwF9hrgvKbuepcuma6keByWATT3chuFdfalS5PVA/taFqrV573eqp0G0u44Pzjf X-Received: by 2002:a05:6830:1e2d:: with SMTP id t13mr1903536otr.128.1575453997309; Wed, 04 Dec 2019 02:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575453997; cv=none; d=google.com; s=arc-20160816; b=FwwG8dhhOYNk8/tDUkBFbZzq7z8aHCQl1TaxGdbSZQO+W2DCjn6zgZTcyhdRakn38d 2FkwANQjKN6WegRsENspNE1NbzrNqlCGFHtZpSBCUPHjRiXqbPtTMSorAkBEKGIPrEeN lHxJdZj+9nolJXEK2US5Okyau8A0a+4VnE22N//gRoRSel/AT1Dad/SuC5d1vXNoj8rs 9gQNP0yW/CCeod7GgHcMODKNSqGo+3anTQ3sYN0V3lXtc9PmmRXHTUbwD6vK6tJT+rnt E24fwTduMRpIKH9oFfQA8nYBIBkHz02ap0w4qPRA/McF3glU+WhWn23XFJpqH5JmCajI dqfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:references:in-reply-to:cc:subject:to:from:date; bh=bZMkbnangQeTgjLTTQ7KmlcFf6GemPBwoizExbDBzic=; b=mfkt07xcgZm3VI4QzgAgxwUUnf0W9CQFlKuls1KLQUtIDv/ZsSnli/0uHDvS1nlSFl Yo8i9/GPB1D+s4cOsVP43Vxe265qCIjqeETrUSbuwXO3QPyOIsmRnpfQTKq7g1vEicHN lYhgSJy4pfOIzzCXanzo483Pem33qXSHG4ilEnin5VTg0YUOjOdl0BYqacZPhMTpazxc 4No9AwJUF+81QCuwjVtuxMYjOpzQkWeYMezdS7SYlMHpuMPGvG8TJ5QcIokbJRfwlpw9 ktvwG9SsjBahzD8XD7cKoYAAEV0tkgHUaAcHULbt+Af8zmLVUJIPMQvA//zNgoq/HlHP YxfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si2928235oif.122.2019.12.04.02.06.24; Wed, 04 Dec 2019 02:06:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727482AbfLDKFv (ORCPT + 99 others); Wed, 4 Dec 2019 05:05:51 -0500 Received: from mx.socionext.com ([202.248.49.38]:25693 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727420AbfLDKFu (ORCPT ); Wed, 4 Dec 2019 05:05:50 -0500 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 04 Dec 2019 19:05:48 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 7D8B2603AB; Wed, 4 Dec 2019 19:05:48 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 4 Dec 2019 19:06:21 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan.css.socionext.com (Postfix) with ESMTP id E71B11A01CF; Wed, 4 Dec 2019 19:05:47 +0900 (JST) Received: from [10.213.132.48] (unknown [10.213.132.48]) by yuzu.css.socionext.com (Postfix) with ESMTP id B6A79120456; Wed, 4 Dec 2019 19:05:47 +0900 (JST) Date: Wed, 04 Dec 2019 19:05:47 +0900 From: Kunihiko Hayashi To: Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas Subject: Re: [PATCH 2/2] PCI: uniphier: Add checking whether PERST# is deasserted Cc: , , , Masami Hiramatsu , Jassi Brar , Kishon Vijay Abraham I In-Reply-To: <20191122205316.297B.4A936039@socionext.com> References: <20191121164705.GA14229@e121166-lin.cambridge.arm.com> <20191122205316.297B.4A936039@socionext.com> Message-Id: <20191204190547.333C.4A936039@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.70 [ja] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Nov 2019 20:53:16 +0900 wrote: > Hello Lorenzo, > > On Thu, 21 Nov 2019 16:47:05 +0000 wrote: > > > On Fri, Nov 08, 2019 at 04:30:27PM +0900, Kunihiko Hayashi wrote: > > > > However, If I understand correctly, doesn't your solution only work some > > > > of the time? What happens if you boot both machines at the same time, > > > > and PERST# isn't asserted prior to the kernel booting? > > > > > > I think it contains an annoying problem. > > > > > > If PERST# isn't toggled prior to the kernel booting, PERST# remains asserted > > > and the RC driver can't access PCI bus. > > > > > > As a result, this patch works and deasserts PERST# (and EP configuration will > > > be lost). So boot sequence needs to include deasserting PERST#. > > > > I am sorry but I have lost you. Can you explain to us why checking > > that PERST# is deasserted guarantees you that: > > > > - The EP has bootstrapped > > - It is safe not to toggle it again (and also skip > > uniphier_pcie_ltssm_enable()) > > > > Please provide details of the HW configuration so that we understand > > what's actually supposed to happen and why this patch fixes the > > issue you are facing. > > I tried to connect between the following boards, and do pci-epf-test: > - "RC board": UniPhier ld20 board that has DWC RC controller > - "EP board": UniPhier legacy board that has DWC EP controller > > This EP has power-on-state configuration, but it's necessary to set > class ID, BAR sizes, etc. after starting up. > > In case of that starting up RC board before EP board, the RC driver > can't establish link. So we need to boot EP board first. At that point, I've considered why RC can't establish link, and found that the waitng time was too short. - EP/RC: power on both boards - RC: start up the kernel on RC board - RC: wait for link up (long time enough) - EP: start up the kernel on EP board - EP: configurate pci-epf-test When the endpoint configuration is done and the EP driver enables LTSSM, the RC driver will quit from waiting for link up. Currently DWC RC driver calls dwc_pcie_wait_for_link(), however, the function tries to link up 10 times only, that is defined as LINK_WAIT_MAX_RETRIES in pcie-designware.h, it's too short to configurate the endpoint. Now the patch to bypass PERST# is not necessary. Instead for DWC RC drivers, I think that the number of retries should be changed according to the usage. And the same issue remains with other RC drivers. Thank you, --- Best Regards, Kunihiko Hayashi