Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2259520ybx; Fri, 8 Nov 2019 02:00:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzXKCqz58lG89xz7p+o3qtu7vkWZFXcWkPlW3vXuSAtpR6lTbBxhxZn28rLjYfkqTcbS9sJ X-Received: by 2002:a17:906:1812:: with SMTP id v18mr7882999eje.86.1573207223720; Fri, 08 Nov 2019 02:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573207223; cv=none; d=google.com; s=arc-20160816; b=VlmZk5HzM0jqd3liG6UE/atUUMkQK7FGbYfKgMO+226CLByjL6kYX6oSAQhkRdFWR8 3CuUPCE2qnmHEHVWMrg1R7GVB4nD6OBn2D4NOB9R5BG+fxYgpelP5HnoxUJa7YLBLdD0 yhuAHe2YoUo2lja0n7XpGJX55zPKeSRus7eKhKNaQXK1bJaoHQ0Zjc8E6GqIklSBF8Kx ORgGVF7K6zcIOsgK+8OCsBclB/Ulxn/QKxUVMk5KkiqMb3N0dFRhNl1UgHGqcW3fyVvQ sFPXUFFbPYFHd9HBcdOVNleUHEieBnNP4OX5f6O4ep2+PxIEdKQvSOa6cbiPES3sfU+5 HD2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=P8JlKnid9Y2kEqivMjFHyTKsPZIt5rTMQAK/1GNDSuo=; b=MRpXodWUv6VH+Fo8HY9+nNf7Z4Xaeap6dy06nDk+5BRwWgnFUWmCfRtUBngTE0MJ+i DyRxgSSWDh2geS2CP9SDL9oL0yfCFWTrTiJBQJ3h8iuZKFdt+9yIh9Y5zCXYZw2foMVb EzHa8fv5CLppWbipOdsGNYdH2CqyeZ7hqgmIa5XNFWE4FfVx7XtqTT2md+c+laPLGDOD EsMh8iEmzAPYcZ270FjzhZJXPG+t8IqPir2i2TcD1jq+7fR4W3qZeZNmVjeiA8kRrRnV wOwE3XnbYNl/BkYjinWJHTDvMmLeJS5xsYySWfvFaKgiTAoyHyHVNWKctAWjLXtWnr+k u/4Q== 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 c23si3507481ejk.143.2019.11.08.02.00.00; Fri, 08 Nov 2019 02:00:23 -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 S1730616AbfKHJ7S (ORCPT + 99 others); Fri, 8 Nov 2019 04:59:18 -0500 Received: from foss.arm.com ([217.140.110.172]:39712 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728513AbfKHJ7R (ORCPT ); Fri, 8 Nov 2019 04:59:17 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C544531B; Fri, 8 Nov 2019 01:59:16 -0800 (PST) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2AC3D3F719; Fri, 8 Nov 2019 01:59:15 -0800 (PST) Date: Fri, 8 Nov 2019 09:59:14 +0000 From: Andrew Murray To: Kunihiko Hayashi Cc: Lorenzo Pieralisi , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Masami Hiramatsu , Jassi Brar , Kishon Vijay Abraham I Subject: Re: [PATCH 2/2] PCI: uniphier: Add checking whether PERST# is deasserted Message-ID: <20191108095913.GD43905@e119886-lin.cambridge.arm.com> References: <20191107205239.65C1.4A936039@socionext.com> <20191107124617.GA43905@e119886-lin.cambridge.arm.com> <20191108163026.0DFB.4A936039@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108163026.0DFB.4A936039@socionext.com> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 08, 2019 at 04:30:27PM +0900, Kunihiko Hayashi wrote: > Hi Andrew, > +CC Kishon > > On Thu, 7 Nov 2019 12:46:17 +0000 wrote: > > > On Thu, Nov 07, 2019 at 08:52:39PM +0900, Kunihiko Hayashi wrote: > > > Hi Andrew, > > > Thank you for your comments. > > > > > > On Thu, 7 Nov 2019 10:02:08 +0000 wrote: > > > > > > > On Thu, Nov 07, 2019 at 01:58:15PM +0900, Kunihiko Hayashi wrote: > > > > > When PERST# is asserted once, EP configuration will be initialized. > > > > > > > > I don't quite understand this - does the EP/RC mode depend on how often > > > > PERST# is toggled? > > > > > > I think of connecting this RC controller and EP based on `Linux PCI > > > endpoint framework' in another machine. > > > > > > While this RC driver is probing, the EP driver might be also probing and > > > configurating itself using configfs. If PERST# is toggled after the EP > > > has done its configuration, this configuration will be lost. > > > > > > I expect that the EP configurates after RC has toggled PERST#, however, > > > there is no way to synchronize both of them. > > > > > > > OK I understand where you are coming from now. Please ensure the commit > > message gives this rationale. > > I'll explain about that in the commit message next. > > > 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#. > > > The only way you can ensure the EP is started after the RC is initialised > > is to start the EP after the RC is initialised. > > Yes, it's the only soution for now. > > > I'm not sure what the solution is here, but it feels like this approach > > only partially solves it. > > Surely relying on outside of the driver doesn't seem to be a complete solution. > > If there is the way that `Linux PCI endpoint framework' assumes, > I'd like to follow it, however, I can't find the other way. Indeed, this must be a common problem - many host controller drivers in the tree toggle perst on start up. Keen for any feedback from Kishon on this. Thanks, Andrew Murray > > Thank you, > > --- > Best Regards, > Kunihiko Hayashi > >