Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1470202ybh; Thu, 23 Jul 2020 09:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXlf/GFGbz4dIiUt/6ydyr6q9oCRjxQS3y3Yuu6XZVB/qraTyRHoqNrEka9PoupVsLygmb X-Received: by 2002:a17:906:d78f:: with SMTP id pj15mr5403857ejb.283.1595522245426; Thu, 23 Jul 2020 09:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595522245; cv=none; d=google.com; s=arc-20160816; b=nW9nrg2zG+BqSBoxF7Au6XyoWS/6SdwrZLC5gjQgiock+7Ufn9lv8ROTKbmXoXx0+Q ot+Zsw/y0cKhUWtsc7Zl8/+CWMz2EuV++us3xaS7XvR98/6mAI0aHUKxmwJLLqOl0Ho+ Tooe9VfC6vIkKno8jLugii245tpPi+eUD/VFLUdp7jhy6u/CSeEQQOKbnZKJwPTDdukq R5OCDZCKFOAXT15HOqdmMD9wqNmgqJRhG6VPyJhjfQc+m9uBJguskxuVxjXEv7ttT6ot eWJ206Txi6CY43u1wnxHJa/em816KyOyzgUO3IwUa2cpxOZJB6VDcAMUvDqVHIVPFJYS chxg== 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=BeqM54H7BgTV3iOZCXjk1VdLz151b7xQZIyLCC9536o=; b=UA/KwoQKKJVwWdo/7D/yuJjXUKsCNvYk0dANDUgCeCWldBsH1uUDG8Y+b7b7yG0QR1 3iT8mVgVDUjdoWWvlo3c1xRXrVcX+Zi12uNvs9CjQ8Q+F18GuiTQLI9J3939tBApq2ve ik0ddUtwL5bxSm9JSN71A7Hl6z9ayZu+3GDp4HJgzkAfLqVYItoy4AugOx4ixTxspeO6 3+nMvWKGvuPwTO2SxaIwWAPlU93OdoO2KjTxZJjMxB3EvFDGODY1sxH6uSMpTBwBWoKT CZp5wzGUzXa8G7YAf51fuyCqQHzpa8rq1O/C2xPgWXCH6+Nnsrj6a8mdQcHZkylj6rT0 arYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg12si2182994edb.81.2020.07.23.09.37.01; Thu, 23 Jul 2020 09:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729795AbgGWQgs (ORCPT + 99 others); Thu, 23 Jul 2020 12:36:48 -0400 Received: from foss.arm.com ([217.140.110.172]:48546 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbgGWQgs (ORCPT ); Thu, 23 Jul 2020 12:36:48 -0400 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 5B7791FB; Thu, 23 Jul 2020 09:36:47 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CA2C63F66F; Thu, 23 Jul 2020 09:36:45 -0700 (PDT) Date: Thu, 23 Jul 2020 17:36:43 +0100 From: Lorenzo Pieralisi To: Wei Hu Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "wei.liu@kernel.org" , "robh@kernel.org" , "bhelgaas@google.com" , "linux-hyperv@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Dexuan Cui , Michael Kelley Subject: Re: [PATCH v3] PCI: hv: Fix a timing issue which causes kdump to fail occasionally Message-ID: <20200723163643.GB11749@e121166-lin.cambridge.arm.com> References: <20200718034752.4843-1-weh@microsoft.com> <20200723111402.GA8120@e121166-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 23, 2020 at 03:52:39PM +0000, Wei Hu wrote: > > -----Original Message----- > > From: Lorenzo Pieralisi > > > Kdump could fail sometime on Hyper-V guest over Accelerated Network > > > interface. This is because the retry in hv_pci_enter_d0() relies on an > > > asynchronous host event arriving before the guest calls > > > hv_send_resources_allocated(). Fix the problem by moving retry to > > > hv_pci_probe(), removing this dependency and making the calling > > > sequence synchronous. > > > > You have to explain why this code move fixes the problem > > How about following commit message: > > Kdump could fail sometime on Hyper-V guest over Accelerated Network > nterface. "Interface" and this is irrelevant if you don't explain why the failure is caused by it and not any other piece of software, ie why the failure happens explicitly on the Accelerated Network Interface only. > This is because the retry in hv_pci_enter_d0() relies on an > asynchronous host event arriving before the guest calls > hv_send_resources_allocated(). Fix the problem by moving retry to > hv_pci_probe() and start the retry from hv_pci_query_relations() call. > This causes the host to generate an synchronous event, hence removing > this unreliable dependency. It is a bit better but I am pretty sure it can be improved, for instance by describing the failure path in relation to the asynchronous notification, in other words what happens when things go wrong. > > and you also have to > > add a comment to the code so that anyone who has to fix it in the future can > > understand why the code is where you are moving it to and why that's a > > solution. > > It already has the comment in the code as: > + * The retry should start from hv_pci_query_relations() call. Explain *why* it should restart from there, it is not that complicated. > It would be a bug if the retry does not start from this according to the host > Behaviour. So I think no further explanation would be needed. It is needed, add it please. > > > Fixes: c81992e7f4aa ("PCI: hv: Retry PCI bus D0 entry on invalid > > > device state") > > > Signed-off-by: Wei Hu > > > > Please carry tags and send patches -in-reply-to the previous version to allow > > threading. > > > > Do you mean to add review-by tags? If not would you please elaborate > what 'carry tags' means? Sorry I am not familiar to this term. It should not be me who applies Reviewed-by tags added on previous patch versions, it should be you who add it to newer versions. AKA Michael already reviewed it and I need to see his reviewed-by tag to apply it. Thanks, Lorenzo