From patchwork Wed Jun 8 17:13:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1640858 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=BKR/Ao25; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=k1sfvISH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LJDNl6kwZz9sFr for ; Thu, 9 Jun 2022 03:14:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5KlVLyhA30Y+7ZWch7GGcd2G+yxHctEQtpYUVbUPgfs=; b=BKR/Ao25Y6gfXC bBZi17cioaGRtoQCXlv+5RtYqfNwOgAHqg8g7Pimccb6yFZ+49ew0otJ3GW19IslXkt0jNWz2Gf8f 1LLIS9qq320NWqwGrs+UTt283oi+g/O7Qc9eoUAa+1fJZrLlnDZ3gqTl9Wj0Tvzut+ko++nys2EEP xanyd6lwWvIAuqKxLItIiEkiG5AqI3bYrQWcoxuc8KIFlHq/wV2wu7YkpPoCBWTNEXa0hFVgQz2H5 0LJUlsEy7SnEm46VhdTcEDRTxsv8xFt8sSOgj/UcZdZBdMe/xRrpD7qLEe0yWgZ0ydKicEuyGGkwb ITrpqntdzbg881xhHwNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyzGG-00ETA8-DO; Wed, 08 Jun 2022 17:14:28 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyzGD-00ET8d-Jk for kvm-riscv@lists.infradead.org; Wed, 08 Jun 2022 17:14:26 +0000 Received: by mail-pj1-x102f.google.com with SMTP id q12-20020a17090a304c00b001e2d4fb0eb4so24394367pjl.4 for ; Wed, 08 Jun 2022 10:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=egiLLKGdpV2llxCKr0nnUtNRcHSTkDD/C9StjqhJwTA=; b=k1sfvISH2Sdwc1FIPhi3BB/QRohqYKpauU1UWP0WMUSa2pVAd2t/OWq8UizdfKJ1Gs 0cEF2PM+PZEo4VgS7QP1/IfcIgk37/IS6d/g2aBxi6nz6zcDHOmE4AbzYBxv6TO7+6Gs dVdZDMAuSjNREJGGvzoIeG30ETbSwWUMdn/yr0lE88yCP7ur3M0Y1jO9eqA3rxjE8blQ wuX5g+Z0l3X+Ee3pkCLb1twGLH9iBL4LQSA2zQTimczmbnNVXNkjYorwyapf78W/3yUc 72c154e3w8K1kNFavpAJlAVOw4EyDrma+OX0pYxYDpYhVqPsb/zTYi5BdfdRDHxSTb3N 834A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=egiLLKGdpV2llxCKr0nnUtNRcHSTkDD/C9StjqhJwTA=; b=tPB6pV8mSMAnnlTJZUaAxMIgr/BZdISgeuQXVs9v1EO5PX+cqIYQhVgUxvA/bHeUQg +bmTBzL2dOeQeodMfI37LmwfG3OHHrKvrmairQVvJwtjm9Hs7hXbaTdhPhxtGyOAWEYj N3t5m1me3J0bRoBxWqOccwIrcMKp3beGd9wSl/orxv3KXTQzq228jdriNv0gYombvhTb Jln+o6aHGD+7hQEnp1PglhWE0QyyydH97O24dcOs3ryAVgAeuPjmzqWMSYUR0/O4f3H2 Ku5ilLmky5ensP2aWwir089TIBwbZO/x1h+WOlEmAnAOSkYGoBiTn8c0+us58fEXGNaa qIoQ== X-Gm-Message-State: AOAM531MLetygBbY9Y32VXNHKyhRF31EoIksI1t/HVue3IJ82yeRJHhQ U6ZmdgpCacUEV5RJsqnkq+GC0f1DDjMhvw== X-Google-Smtp-Source: ABdhPJwnSXhqanUExGjOjaslzLH28gNyihKxRKbOKvlSQ5G9Fh+O5F4WK51Ziid1m7cnlKuvugoFEQ== X-Received: by 2002:a17:902:ec84:b0:167:6f74:ba76 with SMTP id x4-20020a170902ec8400b001676f74ba76mr20402231plg.17.1654708461912; Wed, 08 Jun 2022 10:14:21 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.162.103.97]) by smtp.gmail.com with ESMTPSA id t7-20020a17090a4e4700b001df4b919937sm16803986pjl.16.2022.06.08.10.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 10:14:21 -0700 (PDT) From: Anup Patel To: Bjorn Andersson , Mathieu Poirier Cc: Atish Patra , Alistair Francis , Anup Patel , linux-remoteproc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH] rpmsg: virtio: Fix broken rpmsg_probe() Date: Wed, 8 Jun 2022 22:43:34 +0530 Message-Id: <20220608171334.730739-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_101425_669931_B2D3975D X-CRM114-Status: GOOD ( 10.04 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The rpmsg_probe() is broken at the moment because virtqueue_add_inbuf() fails due to both virtqueues (Rx and Tx) marked as broken by the __vring_new_virtqueue() function. To solve this, virtio_device_ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The rpmsg_probe() is broken at the moment because virtqueue_add_inbuf() fails due to both virtqueues (Rx and Tx) marked as broken by the __vring_new_virtqueue() function. To solve this, virtio_device_ready() (which unbreaks queues) should be called before virtqueue_add_inbuf(). Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ") Signed-off-by: Anup Patel --- drivers/rpmsg/virtio_rpmsg_bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 905ac7910c98..71a64d2c7644 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -929,6 +929,9 @@ static int rpmsg_probe(struct virtio_device *vdev) /* and half is dedicated for TX */ vrp->sbufs = bufs_va + total_buf_space / 2; + /* From this point on, we can notify and get callbacks. */ + virtio_device_ready(vdev); + /* set up the receive buffers */ for (i = 0; i < vrp->num_bufs / 2; i++) { struct scatterlist sg; @@ -983,9 +986,6 @@ static int rpmsg_probe(struct virtio_device *vdev) */ notify = virtqueue_kick_prepare(vrp->rvq); - /* From this point on, we can notify and get callbacks. */ - virtio_device_ready(vdev); - /* tell the remote processor it can start sending messages */ /* * this might be concurrent with callbacks, but we are only