From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web10.8918.1585752495611828379 for ; Wed, 01 Apr 2020 07:48:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WbcQNNrC; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585752494; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d6dMWe+ebFeQgAQYsS0EvJCJKVxCVrERlxEIxCGyKLI=; b=WbcQNNrCxIgKVO+Y+jkFROOu/uHtdVyKdj4UQwqf6htY7PSf9Ue2iav4DIkCF04Fm7s5Db KXM6ZMeYnNjFv72emyoQrmZE5xdTVMxtalZ9KKT41UZPK+5oBdKAbyW7SUQR5Miy4bUY0X ucURbfs5y+HYGG2z0mHY/+rj/ep43Pc= 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-129-BEwwzSbsMEaWDuh39QnCcw-1; Wed, 01 Apr 2020 10:48:12 -0400 X-MC-Unique: BEwwzSbsMEaWDuh39QnCcw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A0271083E8A; Wed, 1 Apr 2020 14:48:11 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-94.ams2.redhat.com [10.36.114.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BE4C5D9CD; Wed, 1 Apr 2020 14:48:09 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2] OvmfPkg/PvScsiDxe: Refactor setup of rings to separate function To: devel@edk2.groups.io, liran.alon@oracle.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org References: <20200331225637.123318-1-liran.alon@oracle.com> From: "Laszlo Ersek" Message-ID: <9c2e2178-cf77-70f8-ad46-4330e38bce37@redhat.com> Date: Wed, 1 Apr 2020 16:48:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200331225637.123318-1-liran.alon@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/01/20 00:56, Liran Alon wrote: > Previous to this change, PvScsiFreeRings() was not undoing all > operations that was done by PvScsiInitRings(). > This is because PvScsiInitRings() was both preparing rings (Allocate > memory and map it for device DMA) and setup the rings against device by > issueing a device command. While PvScsiFreeRings() only unmaps the rings > and free their memory. > > Driver do not have a functional error as it makes sure to reset device > before every call site to PvScsiFreeRings(). However, this is not > intuitive. > > Therefore, prefer to refactor the setup of the ring against device to a > separate function than PvScsiInitRings(). > > Signed-off-by: Liran Alon > --- > OvmfPkg/PvScsiDxe/PvScsi.c | 163 +++++++++++++++++++------------------ > 1 file changed, 85 insertions(+), 78 deletions(-) Pushed as commit e210fc130e5c9738909dca432bbf8bf277ba6e37, via . Thanks! Laszlo