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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D61AC433F5 for ; Mon, 6 Sep 2021 05:56:10 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE55F6103E for ; Mon, 6 Sep 2021 05:56:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EE55F6103E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BE2C880FC6; Mon, 6 Sep 2021 05:56:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zxniuQ4fcHer; Mon, 6 Sep 2021 05:56:09 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id B7BD980F80; Mon, 6 Sep 2021 05:56:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 837C9C0010; Mon, 6 Sep 2021 05:56:08 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id E87BBC000E for ; Mon, 6 Sep 2021 05:56:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CA961403EF for ; Mon, 6 Sep 2021 05:56:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gkq5AqoIODQF for ; Mon, 6 Sep 2021 05:56:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 20404403EC for ; Mon, 6 Sep 2021 05:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630907764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vovMbtPf5r3ofbG1k9TCSMxb7U8AijKtdOS/02BCPEA=; b=CVESPRfNdTF+vdulmTYD6011okiVK50tVhKpHgiwg6X9DOUUcd8qipPyTBLeQSKRVS8t3n bRQMqGEEZcV7KDQQYhu59wlIvAXaZmCVNSm0K9rugA+OIBD6cYXJtxruo4OAGiCnHR+bXo Wr4tcQFBY11srz8uGWBGH0M2WkWBWDE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-cVpC_1iSMmuXoRT_jlEIzA-1; Mon, 06 Sep 2021 01:56:03 -0400 X-MC-Unique: cVpC_1iSMmuXoRT_jlEIzA-1 Received: by mail-wm1-f71.google.com with SMTP id f19-20020a1c1f13000000b002e6bd83c344so2809377wmf.3 for ; Sun, 05 Sep 2021 22:56:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vovMbtPf5r3ofbG1k9TCSMxb7U8AijKtdOS/02BCPEA=; b=K1ah39EeWIX65kN1FyMNBBh+X/0AVFewszoT87dV58TFOkmbcZ1+UlAmwPxQ8l4GO0 euQMNP6n5+1o+gsA1an44X/Eu6ysc4DCWeKDRSiVoXVa3bojNJQvmFCoBnL6qKYCXjr3 BvdV1q+U6lg29vvDx/Z2k5sBrXeclKKv7LxtRKwXmIPrR07lzCqCYjwQg10d79KzqGV0 4ZTAc5oAyl9EgpX6BfiLxnSL1isSP74eu2tIOPc0dlXeICK3wSSp4aLMfL+uwNysnDyZ Q6pmn8cMM2VZ4IQUU9bqFKqrgsy9Iuvu1as6ubReO/jekHdhI11RaV29KkPptyV5ecIs eQew== X-Gm-Message-State: AOAM530xth8emYfqYDv2++iO+NKdZ/5myL8RvqSPkA2JYjBI9SrwY3Oc Qj9WGJfbNx21kSc40gkYSuVbb+LnJwv0Nq1Uk1xJwI/8vmH42Y07+0vCgmhD4A1q0yn5IXJBKhP 4/O9LiCJTacvobnx5NnD5y2uOyN/pGA== X-Received: by 2002:a1c:a50c:: with SMTP id o12mr9495404wme.4.1630907762444; Sun, 05 Sep 2021 22:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSohV4waNTUQh5Sb39O42c9OGim/c0J+8EbtpG04qEdzlJ16UAGsVC7V6aTmAbRvcBXz/LFQ== X-Received: by 2002:a1c:a50c:: with SMTP id o12mr9495363wme.4.1630907762186; Sun, 05 Sep 2021 22:56:02 -0700 (PDT) Received: from redhat.com ([2.55.131.183]) by smtp.gmail.com with ESMTPSA id a133sm6174326wme.5.2021.09.05.22.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Sep 2021 22:56:01 -0700 (PDT) Date: Mon, 6 Sep 2021 01:55:56 -0400 From: "Michael S. Tsirkin" To: Xie Yongji Subject: Re: [PATCH v13 05/13] vdpa: Add reset callback in vdpa_config_ops Message-ID: <20210906015524-mutt-send-email-mst@kernel.org> References: <20210831103634.33-1-xieyongji@bytedance.com> <20210831103634.33-6-xieyongji@bytedance.com> MIME-Version: 1.0 In-Reply-To: <20210831103634.33-6-xieyongji@bytedance.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: kvm@vger.kernel.org, jasowang@redhat.com, virtualization@lists.linux-foundation.org, christian.brauner@canonical.com, will@kernel.org, corbet@lwn.net, willy@infradead.org, hch@infradead.org, dan.carpenter@oracle.com, sgarzare@redhat.com, xiaodong.liu@intel.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, stefanha@redhat.com, songmuchun@bytedance.com, axboe@kernel.dk, zhe.he@windriver.com, gregkh@linuxfoundation.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, bcrl@kvack.org, netdev@vger.kernel.org, joe@perches.com, robin.murphy@arm.com, mika.penttila@nextfour.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, Aug 31, 2021 at 06:36:26PM +0800, Xie Yongji wrote: > This adds a new callback to support device specific reset > behavior. The vdpa bus driver will call the reset function > instead of setting status to zero during resetting. > > Signed-off-by: Xie Yongji This does gloss over a significant change though: > --- > @@ -348,12 +352,12 @@ static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) > return vdev->dma_dev; > } > > -static inline void vdpa_reset(struct vdpa_device *vdev) > +static inline int vdpa_reset(struct vdpa_device *vdev) > { > const struct vdpa_config_ops *ops = vdev->config; > > vdev->features_valid = false; > - ops->set_status(vdev, 0); > + return ops->reset(vdev); > } > > static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) Unfortunately this breaks virtio_vdpa: static void virtio_vdpa_reset(struct virtio_device *vdev) { struct vdpa_device *vdpa = vd_get_vdpa(vdev); vdpa_reset(vdpa); } and there's no easy way to fix this, kernel can't recover from a reset failure e.g. during driver unbind. Find a way to disable virtio_vdpa for now? > -- > 2.11.0 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB8DAC433F5 for ; Mon, 6 Sep 2021 05:56:16 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FCC96023D for ; Mon, 6 Sep 2021 05:56:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9FCC96023D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6BF1B60632; Mon, 6 Sep 2021 05:56:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2_-LVt_MOV0g; Mon, 6 Sep 2021 05:56:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1478360692; Mon, 6 Sep 2021 05:56:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C0B7DC0010; Mon, 6 Sep 2021 05:56:14 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0BB05C000E for ; Mon, 6 Sep 2021 05:56:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id EEDE180F7F for ; Mon, 6 Sep 2021 05:56:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HnTCEQ3Zmukw for ; Mon, 6 Sep 2021 05:56:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id C1A5080F7E for ; Mon, 6 Sep 2021 05:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630907766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vovMbtPf5r3ofbG1k9TCSMxb7U8AijKtdOS/02BCPEA=; b=QgaNE+IYoOTbtYNzHXfudmLUbr9M1CW50dfNCvQxRjFq6IdPgJuu0I/wVhLz0GXn4kHQcK 8UeBftzQRnWOxc3zSn28/wp4oNL11piJmSXyh2WA5PAw6dNkW/skw/6Nl67NDK5JI+uaDG v8zvj8ox+OVeCDfA3ATACsFf/wrqmN4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-c3faViplPzmRfWitw0tlRA-1; Mon, 06 Sep 2021 01:56:03 -0400 X-MC-Unique: c3faViplPzmRfWitw0tlRA-1 Received: by mail-wm1-f71.google.com with SMTP id o20-20020a05600c379400b002e755735eedso2826951wmr.0 for ; Sun, 05 Sep 2021 22:56:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vovMbtPf5r3ofbG1k9TCSMxb7U8AijKtdOS/02BCPEA=; b=r4UfemxHCFagvKCEMzWGl35nkx0yyfG1TM8rFsEB5q5SnIndtxz0m47sb0Bj4iCFBn Tv5EmdRhRWeQwE+F/Eeb20f+SUXEq9dT/bTGfjn627r/Vi9k3tKeVR39d2BNfXSxjDdU NHRq9LilIMBV43FcwrfLFQoIWbxECshHgFP+hWJaLkDB72BsM5iesPX4WxDwdy7XKLMr 4W0ONwQiZM0Lbz+rsevpSmbswyWUH8JGXnS3JfLz/nBPy5ci3Mu8Qn33g4mC9qm6Uv3o 2z7ey9xStq6AsZxGT0aDgCOP1g9+mrKhq8/oZuumdmFzZLGflE5DwoP3LKTOOjCoq+cI DuVQ== X-Gm-Message-State: AOAM532pArNi8TjlMUisLsnOs5j9zg5O8EZ4usP/jfNy8b0MBrK3HKVF 5afFIghrXkPWXQKuRKi4rz8W1asYJibysIBGuc/MhhaF6mLUrihyVJGOjuOPqdf0uKOSls1qOa/ w3vnfcetiZ1NjqwhPhp99aFVwMJzwogEo+btTvtN/aA== X-Received: by 2002:a1c:a50c:: with SMTP id o12mr9495381wme.4.1630907762367; Sun, 05 Sep 2021 22:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSohV4waNTUQh5Sb39O42c9OGim/c0J+8EbtpG04qEdzlJ16UAGsVC7V6aTmAbRvcBXz/LFQ== X-Received: by 2002:a1c:a50c:: with SMTP id o12mr9495363wme.4.1630907762186; Sun, 05 Sep 2021 22:56:02 -0700 (PDT) Received: from redhat.com ([2.55.131.183]) by smtp.gmail.com with ESMTPSA id a133sm6174326wme.5.2021.09.05.22.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Sep 2021 22:56:01 -0700 (PDT) Date: Mon, 6 Sep 2021 01:55:56 -0400 From: "Michael S. Tsirkin" To: Xie Yongji Subject: Re: [PATCH v13 05/13] vdpa: Add reset callback in vdpa_config_ops Message-ID: <20210906015524-mutt-send-email-mst@kernel.org> References: <20210831103634.33-1-xieyongji@bytedance.com> <20210831103634.33-6-xieyongji@bytedance.com> MIME-Version: 1.0 In-Reply-To: <20210831103634.33-6-xieyongji@bytedance.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, christian.brauner@canonical.com, will@kernel.org, corbet@lwn.net, joro@8bytes.org, willy@infradead.org, hch@infradead.org, dan.carpenter@oracle.com, john.garry@huawei.com, xiaodong.liu@intel.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, stefanha@redhat.com, songmuchun@bytedance.com, axboe@kernel.dk, zhe.he@windriver.com, gregkh@linuxfoundation.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, bcrl@kvack.org, netdev@vger.kernel.org, joe@perches.com, robin.murphy@arm.com, mika.penttila@nextfour.com X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Tue, Aug 31, 2021 at 06:36:26PM +0800, Xie Yongji wrote: > This adds a new callback to support device specific reset > behavior. The vdpa bus driver will call the reset function > instead of setting status to zero during resetting. > > Signed-off-by: Xie Yongji This does gloss over a significant change though: > --- > @@ -348,12 +352,12 @@ static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) > return vdev->dma_dev; > } > > -static inline void vdpa_reset(struct vdpa_device *vdev) > +static inline int vdpa_reset(struct vdpa_device *vdev) > { > const struct vdpa_config_ops *ops = vdev->config; > > vdev->features_valid = false; > - ops->set_status(vdev, 0); > + return ops->reset(vdev); > } > > static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) Unfortunately this breaks virtio_vdpa: static void virtio_vdpa_reset(struct virtio_device *vdev) { struct vdpa_device *vdpa = vd_get_vdpa(vdev); vdpa_reset(vdpa); } and there's no easy way to fix this, kernel can't recover from a reset failure e.g. during driver unbind. Find a way to disable virtio_vdpa for now? > -- > 2.11.0 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3579C433EF for ; Mon, 6 Sep 2021 05:56:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB68B61039 for ; Mon, 6 Sep 2021 05:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239259AbhIFF5L (ORCPT ); Mon, 6 Sep 2021 01:57:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59358 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239048AbhIFF5J (ORCPT ); Mon, 6 Sep 2021 01:57:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630907765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vovMbtPf5r3ofbG1k9TCSMxb7U8AijKtdOS/02BCPEA=; b=c/WB3cGs0VdQSYISTv5WAem0B6nQzF2kI1JZw2qhGii5AmF4PG9P199CHVQyZd24cfDaky vx6g2DLPMZccEg8BaEpULyEiOrl5Utx6XS+wmnHi7YOubtX06nxWKZAHpyETd3YRRzIMXk Gg8uNKUTlgfZq1ptk+mkYktRn3pI6YA= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-E_wGKxHRN4Oe0JTh9P7gfQ-1; Mon, 06 Sep 2021 01:56:03 -0400 X-MC-Unique: E_wGKxHRN4Oe0JTh9P7gfQ-1 Received: by mail-wr1-f71.google.com with SMTP id m16-20020a056000181000b0015964e4ae48so847124wrh.14 for ; Sun, 05 Sep 2021 22:56:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vovMbtPf5r3ofbG1k9TCSMxb7U8AijKtdOS/02BCPEA=; b=Y75bnkmmZQ+nKv4eMzWWg/yPe/qvMSTbVbmObGiMQmCzNajh9Pui+o6ZFaQAnzmdOA fjDV+Z0ldCkMQsVJ+eAuiH258D7F1CnzvoUdhVwQfVdIXqB/9QcTdPa9R2daINq/T7Nt 7WSCM1/UpG4efO8gaQ4QE6x+IcjAeUg6cfqgt0zsiV7GSojrUho8dWNHWS1lujcEospl /l7nsnsWsh+cAjnpKuUQygkSEwo0JkBTlbgPtxCl6D+hFXmTtiPeoqwTxL30jqLSNliW 2bJWoyVLhD24jPcHAtaRQTFR+fvIgT9gzUQxlx9HrO/n6SKVCbgS5xGfC2fAyQJSVXQ0 e79A== X-Gm-Message-State: AOAM531h+3zQDjZGxB4ix9rBLMOU1TTu0Tk4GvXKBxKfiVpv366/UlA3 +yputtZTt4tdsxvr/KKReoMtwVEfHO2rhAZMszTfNKPvT7kck9vQOGgcgkacGFbziiE6T3J6fw8 d/JWb2HqCUMhX X-Received: by 2002:a1c:a50c:: with SMTP id o12mr9495400wme.4.1630907762420; Sun, 05 Sep 2021 22:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSohV4waNTUQh5Sb39O42c9OGim/c0J+8EbtpG04qEdzlJ16UAGsVC7V6aTmAbRvcBXz/LFQ== X-Received: by 2002:a1c:a50c:: with SMTP id o12mr9495363wme.4.1630907762186; Sun, 05 Sep 2021 22:56:02 -0700 (PDT) Received: from redhat.com ([2.55.131.183]) by smtp.gmail.com with ESMTPSA id a133sm6174326wme.5.2021.09.05.22.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Sep 2021 22:56:01 -0700 (PDT) Date: Mon, 6 Sep 2021 01:55:56 -0400 From: "Michael S. Tsirkin" To: Xie Yongji Cc: jasowang@redhat.com, stefanha@redhat.com, sgarzare@redhat.com, parav@nvidia.com, hch@infradead.org, christian.brauner@canonical.com, rdunlap@infradead.org, willy@infradead.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, corbet@lwn.net, mika.penttila@nextfour.com, dan.carpenter@oracle.com, joro@8bytes.org, gregkh@linuxfoundation.org, zhe.he@windriver.com, xiaodong.liu@intel.com, joe@perches.com, robin.murphy@arm.com, will@kernel.org, john.garry@huawei.com, songmuchun@bytedance.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 05/13] vdpa: Add reset callback in vdpa_config_ops Message-ID: <20210906015524-mutt-send-email-mst@kernel.org> References: <20210831103634.33-1-xieyongji@bytedance.com> <20210831103634.33-6-xieyongji@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210831103634.33-6-xieyongji@bytedance.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Aug 31, 2021 at 06:36:26PM +0800, Xie Yongji wrote: > This adds a new callback to support device specific reset > behavior. The vdpa bus driver will call the reset function > instead of setting status to zero during resetting. > > Signed-off-by: Xie Yongji This does gloss over a significant change though: > --- > @@ -348,12 +352,12 @@ static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) > return vdev->dma_dev; > } > > -static inline void vdpa_reset(struct vdpa_device *vdev) > +static inline int vdpa_reset(struct vdpa_device *vdev) > { > const struct vdpa_config_ops *ops = vdev->config; > > vdev->features_valid = false; > - ops->set_status(vdev, 0); > + return ops->reset(vdev); > } > > static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) Unfortunately this breaks virtio_vdpa: static void virtio_vdpa_reset(struct virtio_device *vdev) { struct vdpa_device *vdpa = vd_get_vdpa(vdev); vdpa_reset(vdpa); } and there's no easy way to fix this, kernel can't recover from a reset failure e.g. during driver unbind. Find a way to disable virtio_vdpa for now? > -- > 2.11.0