Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4626304rwb; Tue, 6 Sep 2022 10:04:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6dBlFeBMKKouba2XIub3SSLMzcFczqKCAo2gX1X74phPAtdlN9lIYwDIbURIu8UCxgul0N X-Received: by 2002:a17:902:f0d4:b0:176:988a:77fd with SMTP id v20-20020a170902f0d400b00176988a77fdmr14709673pla.25.1662483853952; Tue, 06 Sep 2022 10:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662483853; cv=none; d=google.com; s=arc-20160816; b=h/7VczBZUJKfF0iNk5KgAjzrUAs8MKn7F8n3vyR4l1FhXzOhIaqGPdIRDuZfvgX73j uoeAMB+Xd9wexGheBDXTKOA8uqaDu0hycPRDvLaRetyxcBJCQnsCa9Fyz6cg0NrRA8iV hGMewlCfb0CuLves1+597du4PpBWNILEAiGII7euRXKL6gjYlp7MDxn+Wqi1np62iKF3 QpsiJz7CfAqqjHkdsNUbDIH9vj/yTVV4b6gYlxpI+zq1J1S1eVq7JCRuz7ISuKPK1pSy 9vOxmh6wJvUIT9l/26xEOvAyYkqVBccNZkO2uT9XJOSP4xF5+TWPvVcss4TwUJ8+NbPu nZig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ma2iDt0aE81Ahc9ZUJZycp2jvO5tJvy1n9qVt6gCQwI=; b=yjFZ333/q3BznCjMYJe38z4mm4U6dODNg16Spy+eGh7qvLwzsNYplJp0VlWOECBf7Q vSFQs9YJs0KSseb+ehGM4/lTeJhQ1ahqcUMV6NyxUn/efyRKq8nKbZ1xC2PW/m7viTI6 bB4uWIXryUXVwk0z6qA0EOn9GAS4k473xzbobDPdVgGlhKjSVLQ8TOz27ptIqKyeE762 9+Q4cV+ixaBce5WmJ+fPtLseHkDskwZvniQS8Ed2AAJdR0WD7srnPNq2ffvr4BHDzvKO Ovgnf8U0jUUt9v35my2AbcOGPxKEtfw1oRU7mjWp2Fvtqp+O9djHgKdSLmC8XzPtG2VP 9wuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mZ+FcifZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv6-20020a17090b1b4600b001fd8ade18aasi7681777pjb.137.2022.09.06.10.04.01; Tue, 06 Sep 2022 10:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mZ+FcifZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237347AbiIFQAg (ORCPT + 99 others); Tue, 6 Sep 2022 12:00:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236513AbiIFQAJ (ORCPT ); Tue, 6 Sep 2022 12:00:09 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C632C83F3D; Tue, 6 Sep 2022 08:19:11 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id fg1so1952572ejc.2; Tue, 06 Sep 2022 08:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Ma2iDt0aE81Ahc9ZUJZycp2jvO5tJvy1n9qVt6gCQwI=; b=mZ+FcifZ+4aqabfna498JJgJVm7ZJdYQe8WPPtTpmukN0ltsFgbqVaNbL1sFWPnx0F +kFG3VCNFENVAovNsysmwpOZ9RuJ0ufsyH/pTm2Y0z5gRcOpO/R+heCj40VC0B/407ah gIy12X9ei8z3+szxvE4NyRdxrjANyShKAEl2/x/Zm5O/QSiE8OYXer9bdBZdxhHaAE7q f4tiV5HYLbiMy7AqJzsjwqwX5vSbICO2tfPlRmT+E50cm2MApRR8eNqmx5TuhyMcbdUY 7WrJdlicqbcwsKebKLfXD1Wod6uRLkMhZP+32t59uXM5n6TIYOGjSb2jPimnfwACXEvM IUDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Ma2iDt0aE81Ahc9ZUJZycp2jvO5tJvy1n9qVt6gCQwI=; b=QH4OiwHDUmSV5zbjGts8jFsfEsjPJy8my6Y58o3F0l05IgPR3o9NrNwBtGFY6aQ48W IXTH+NPQ/Mo0c9mymKo0BcfB20okmT3c0ZQTj52Eu8TTxs5exf0dj/8wLdvnKSzxXtEj bZzUz/WD6ZS0eLKIJrN9OKxENRQy/zGiSU8HTikjywdchJ0U+rCnHmizDuSJFKiIPYtn D3vr/2aGJ26S4ruj0ZemXKpjiP/d6x5mSZ5TCcO1DEDhUOpEzmZ+UrveL3hpJCxDod5d 2x4lZb91CQo5hwNI00Va9x1VCf2E6LFgFTmKWjzp/4quKqhoXbhR3Rvki0aoC7Wq0qW0 gEPg== X-Gm-Message-State: ACgBeo1CXck8HreLTMMATX3x1WXuulmWxjPTlvGkevh5pTOuuyAocotS NqYOQj3Q0qDah5YLcctkhX9NAbDI0br2mVOBf7A= X-Received: by 2002:a17:907:2ce7:b0:741:6e62:4558 with SMTP id hz7-20020a1709072ce700b007416e624558mr31784827ejc.273.1662477550254; Tue, 06 Sep 2022 08:19:10 -0700 (PDT) MIME-Version: 1.0 References: <20220829151536.8578-1-jandryuk@gmail.com> <20220902165921.GA354189@bhelgaas> In-Reply-To: <20220902165921.GA354189@bhelgaas> From: Jason Andryuk Date: Tue, 6 Sep 2022 11:18:58 -0400 Message-ID: Subject: Re: [PATCH] xen-pcifront: Handle missed Connected state To: Bjorn Helgaas Cc: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Bjorn Helgaas , xen-devel , linux-pci@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 2, 2022 at 12:59 PM Bjorn Helgaas wrote: > > The conventional style for subject (from "git log --oneline") is: > > xen/pcifront: Handle ... > > On Mon, Aug 29, 2022 at 11:15:36AM -0400, Jason Andryuk wrote: > > An HVM guest with linux stubdom and 2 PCI devices failed to start as > > "stubdom" might be handy shorthand in the Xen world, but I think > it would be nice to consistently spell out "stubdomain" since you use > both forms randomly in this commit log and newbies like me have to > wonder whether they're the same or different. > > > libxl timed out waiting for the PCI devices to be added. It happens > > intermittently but with some regularity. libxl wrote the two xenstore > > entries for the devices, but then timed out waiting for backend state 4 > > (Connected) - the state stayed at 7 (Reconfiguring). (PCI passthrough > > to an HVM with stubdomain is PV passthrough to the stubdomain and then > > HVM passthrough with the QEMU inside the stubdomain.) > > > > The stubdom kernel never printed "pcifront pci-0: Installing PCI > > frontend", so it seems to have missed state 4 which would have > > called pcifront_try_connect -> pcifront_connect_and_init_dma > > Add "()" after function names for clarity. > > > Have pcifront_detach_devices special-case state Initialised and call > > pcifront_connect_and_init_dma. Don't use pcifront_try_connect because > > that sets the xenbus state which may throw off the backend. After > > connecting, skip the remainder of detach_devices since none have been > > initialized yet. When the backend switches to Reconfigured, > > pcifront_attach_devices will pick them up again. Thanks for taking a look, Bjorn. That all sounds good. I'll wait a little longer to see if there is any more feedback before sending a v2. Regards, Jason