From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [PATCH 2/2] xen: drain submit queue in xen-usb before removing device Date: Tue, 02 Aug 2016 13:37:36 +0200 Message-ID: <1470137856.30562.92.camel@redhat.com> References: <1469791051-680-1-git-send-email-jgross@suse.com> <1469791051-680-3-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1469791051-680-3-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: "Qemu-devel" To: Juergen Gross Cc: anthony.perard@citrix.com, xen-devel@lists.xensource.com, sstabellini@kernel.org, qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org On Fr, 2016-07-29 at 13:17 +0200, Juergen Gross wrote: > When unplugging a device in the Xen pvusb backend drain the submit > queue before deallocation of the control structures. Otherwise there > will be bogus memory accesses when I/O contracts are finished. >=20 > Correlated to this issue is the handling of cancel requests: a packet > cancelled will still lead to the call of complete, so add a flag > A =3D=3D=3D checkpatch complains =3D=3D=3D WARNING: braces {} are necessary for all arms of this statement #105: FILE: hw/usb/xen-usb.c:696: + if (sched) [...] WARNING: braces {} are necessary for all arms of this statement #111: FILE: hw/usb/xen-usb.c:702: + if (!usbif->ports[port - 1].attached) [...] WARNING: braces {} are necessary for all arms of this statement #152: FILE: hw/usb/xen-usb.c:847: + if (usbif->ports[i].dev) [...] cheers, Gerd