From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71F83C433EF for ; Sun, 20 Mar 2022 11:43:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF0F283AF7; Sun, 20 Mar 2022 12:43:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="K0NgAZPR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B315083ADC; Sun, 20 Mar 2022 12:41:52 +0100 (CET) Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2CA4683AA6 for ; Sun, 20 Mar 2022 12:41:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3_RI3YgYKBhgyG0I994CC492.0CAI-zCCH96GHG.12BL.12@flex--ascull.bounces.google.com Received: by mail-wm1-x349.google.com with SMTP id c62-20020a1c3541000000b003815245c642so8684229wma.6 for ; Sun, 20 Mar 2022 04:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=NSzNIFBrKpVAxe/hzXffhGGbo55Pi+SnP5hHVxcvNBo=; b=K0NgAZPROOGEp7cHudbX3bQx5VC+LufX4zvbBfPUcQUbq/OPnfV9GuH6S9zd4wJ2YH yrBC5iYzU5NmPtaVIelsjZlpVypnFC7dV2eA9kjLP8iLswUleyGRUqX5AxAmTFpjzQZt QWRpA4ZAS8MuT0OLn14Mwjc7BK6dhnTutqOcX7g0rfMmM6dOo3qUCW57X6uZIo2FsFZm G6teF8qMwYU9sjeZICtdkp7AW6WjZjFFpkz7o/Jri7PXhLB1NJH1Iwj2Sd1SLFZi4738 f7n+vGaCHiNZE7hQ5oqY000LQqe1Zk068miVG4ByWerDTyzYFSJoVJ88Np8cxlZIcbyE H1hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=NSzNIFBrKpVAxe/hzXffhGGbo55Pi+SnP5hHVxcvNBo=; b=VsDQUZ+PN09+CN3NJVhUpl25A0JVFFtKBzwgR2tXgpnyWvJ3/A5aOa8QSiDaS8vYgq coD5vrf+ZhdKoQy2eYt/aFJ2FUmeVbzOYG6C2vDYbf/w/LP9n+OAjH2mJJlFtWCHtDEc Si1MN01OzdWMQEgvNLOUHH1B1Lohhm55hMEdH+iBOQ2J71goconiRZzuLUmBxffLi3w1 9Vi5Fzq2UZB0UxxqqV9SNGevbKTXCf9WXUDzDY+Ne9RAAKHYFcEfrOD1UAjaWak4sRs8 ZDWxzsYRUb6BSL5NvPKUHBq3UTrOOtL4bJPUyOhO+/u/18Q60MU85hKQWCq/zpUmZ+OS jYBg== X-Gm-Message-State: AOAM533yci86YuBwU4ZnlVQScLFC4hAeN1exK0SXrFe20cPuHn7ksALl s1on9HHSYsJ1xvG7zA2QuaQ2mhFZjeVFL4My+f0zRpOsOsJQ+Wj/lfuYk/LbxZn+ywofmNzoNHH 0I0bFTTV2FUmWkHjzB5K3ZIwRUXbcB54uQaGZn6fDWKgB9e0Cr8HGI+L3t3g= X-Google-Smtp-Source: ABdhPJxoW1OVLTXJ1AgyTC/wZW2qAT4pDcxhihojTHxRcW2wXtU9PLmkrUnTVv2vn5TbVillqf4SElcdlRI= X-Received: from ascull.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1510]) (user=ascull job=sendgmr) by 2002:adf:e44b:0:b0:1f0:250a:d3ef with SMTP id t11-20020adfe44b000000b001f0250ad3efmr14655591wrm.402.1647776509511; Sun, 20 Mar 2022 04:41:49 -0700 (PDT) Date: Sun, 20 Mar 2022 11:41:08 +0000 In-Reply-To: <20220320114118.2237795-1-ascull@google.com> Message-Id: <20220320114118.2237795-2-ascull@google.com> Mime-Version: 1.0 References: <20220320114118.2237795-1-ascull@google.com> X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog Subject: [PATCH 01/11] virtio: pci: Fix discovery of device config length From: Andrew Scull To: u-boot@lists.denx.de Cc: sjg@chromium.org, bmeng.cn@gmail.com, adelva@google.com, keirf@google.com, ptosi@google.com, Andrew Scull Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Sun, 20 Mar 2022 12:43:23 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean The length of the device config was erroneously being taken from the notify capability. Correct this by finding the length in the device capability. Signed-off-by: Andrew Scull --- drivers/virtio/virtio_pci_modern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index fd8a1f3fec..55d25cb81b 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -497,7 +497,7 @@ static int virtio_pci_probe(struct udevice *udev) */ device = virtio_pci_find_capability(udev, VIRTIO_PCI_CAP_DEVICE_CFG); if (device) { - offset = notify + offsetof(struct virtio_pci_cap, length); + offset = device + offsetof(struct virtio_pci_cap, length); dm_pci_read_config32(udev, offset, &priv->device_len); } -- 2.35.1.894.gb6a874cedc-goog