Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1141275pxk; Fri, 4 Sep 2020 01:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBeRdgGK70gnxh9kLYi2mwGQ8wdqlJAF7qgJB8ANE4i3gJon8bDr2XTbDZKiD/YyScA91U X-Received: by 2002:a05:6402:2c7:: with SMTP id b7mr7603303edx.125.1599207929977; Fri, 04 Sep 2020 01:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599207929; cv=none; d=google.com; s=arc-20160816; b=Yt974BBciyx+PKF7mBUTli/MH40cD8lIP0X325UzJwxi63dXcRVoHIoc9J6eDbo9Es U9dqDiOSTyhh8/AYrfnixWIftGv/Zt/pNN/KsS1EiiPIeUr8coGSuVCKAoqjWINTvYcF kp0CkZC3gq8TP4/YAxCoeBVxpdyNIj8UIwDf3UKrHwJ1gMd58XW5/jKJEvG7vNC1LNef g9zQ8VbZFmT4/dU0o5G7qNraSYJbz9Ejt1TAXNuTb8f5BTlOWfZhrjfKutxV+hWoFgDG PWYeX85H5Hmr8E4tuJHbSMcADisCZsfyHVC47l1ETG70IpQSFkzuW2OrVahKASqU+B0a QqCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PsZK0BVKj7q50z+/THhbC/qaSOk2NIiNCF27Ec/EakA=; b=l1QMZlTFmeJvZV59INtioP6GK64AWrzL0TLz/ySYV55Ch7H/mX1IsLvpLAW945W005 ihv3vxBSPXybwPgnsfjIshneuLuHaliM67+KOR0leD0Ps6j/QsFuBMGw25MpfzZpcmqq PoKO3S3DQ+XyEwBOB0PvUUJj3jzwUN16hGREY/n3tmrfc509Vk9zG+q5dXBVnehPbdi2 ZV53PSl2aHXuAp5O3MulJWji3H+hpD+EgelYtbwW7QN46GMUPu0//MphbKSgQe6G9wFB D0coC3+knlfZcavM8zU/k45MzGzLuJbnfiCL6QjfvetONFAy/0aTgps5P+xCrJ35KdE9 k+Mw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd28si3615947ejb.302.2020.09.04.01.25.07; Fri, 04 Sep 2020 01:25:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729824AbgIDIVm (ORCPT + 99 others); Fri, 4 Sep 2020 04:21:42 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:55645 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729808AbgIDIVl (ORCPT ); Fri, 4 Sep 2020 04:21:41 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-vBvCEjuyPtSr0Qvj5kAg_g-1; Fri, 04 Sep 2020 04:21:36 -0400 X-MC-Unique: vBvCEjuyPtSr0Qvj5kAg_g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E19E81F030; Fri, 4 Sep 2020 08:21:35 +0000 (UTC) Received: from [10.36.112.51] (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE8AE811B1; Fri, 4 Sep 2020 08:21:30 +0000 (UTC) Subject: Re: [PATCH v4 10/10] vfio/fsl-mc: Add support for device reset To: Diana Craciun , alex.williamson@redhat.com, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, bharatb.linux@gmail.com, laurentiu.tudor@nxp.com References: <20200826093315.5279-1-diana.craciun@oss.nxp.com> <20200826093315.5279-11-diana.craciun@oss.nxp.com> From: Auger Eric Message-ID: <629498a6-8329-1045-c1a4-ab334f3c8107@redhat.com> Date: Fri, 4 Sep 2020 10:21:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200826093315.5279-11-diana.craciun@oss.nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Diana, On 8/26/20 11:33 AM, Diana Craciun wrote: > Currently only resetting the DPRC container is supported which > will reset all the objects inside it. Resetting individual > objects is possible from the userspace by issueing commands > towards MC firmware. > > Signed-off-by: Diana Craciun > --- > drivers/vfio/fsl-mc/vfio_fsl_mc.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c > index 27713aa86878..d17c5b3148ad 100644 > --- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c > +++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c > @@ -310,7 +310,20 @@ static long vfio_fsl_mc_ioctl(void *device_data, unsigned int cmd, > } > case VFIO_DEVICE_RESET: > { > - return -ENOTTY; > + int ret = 0; initialization not needed > + spare empty line > + struct fsl_mc_device *mc_dev = vdev->mc_dev; > + > + /* reset is supported only for the DPRC */ > + if (!is_fsl_mc_bus_dprc(mc_dev)) > + return -ENOTTY; it is an error case or do we just don't care? > + > + ret = dprc_reset_container(mc_dev->mc_io, 0, > + mc_dev->mc_handle, > + mc_dev->obj_desc.id, > + DPRC_RESET_OPTION_NON_RECURSIVE); > + return ret; > + > } > default: > return -ENOTTY; > Thanks Eric