Received: by 10.192.165.148 with SMTP id m20csp4158214imm; Mon, 30 Apr 2018 12:53:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo61IhgK1qtFexXjK/aLrjnj5Q8GbYWFSuRic6XR/cf/fG5tpCWZR5PXY9n1+gaREvcQ169 X-Received: by 10.98.80.80 with SMTP id e77mr13290420pfb.16.1525118005098; Mon, 30 Apr 2018 12:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525118005; cv=none; d=google.com; s=arc-20160816; b=Ufi/QUmyOE+N1Ld5LeDlyRSs7nG6MTBGUAjtlNJ+0Uizf7FYohF6i6jPtpl6UH+7C0 QoVWCyKFnbKvYne0ty5+oOCZOb9WiMc2qVlSwv9Ia9kjEqwdUAr8GJqXUwdOCY48D/Ye A+DeYURnfgQD3eXQ1jgp5hwFlZ7opahbRI22Er7DRUZh8gLspXHr1gXc33o+YwacofIM OCssoDHUUxruMU0CRI3JP2Ofpf4+IYOanF47vUy3cFtNgA3Fk1IyVpMWs2Obw6ReRXbr igh9TOdKFAtsZAG8Fa1BsJyr7KhcLcJGMdKhkPR3KMt0UmbtFaWWJUoZ0vwcPnV9t/dJ 1xWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=zCY0YK8wwbE3oEGbhquhcEoOQ2cIRCtia4TJyOZJBeE=; b=eKk/Lfq6qaHShwUjfmkOKbumtUipiJpgyVPe5+zfwMmuZnLPj33sWsYivC0NReOh3X 6jkQGgBX8j6/Z48a4ElWP1EaPvId4PlZ2JXvD27q7JTr3etSeWnIcGKEKexIBJ7L+fpn /cFBFSoo6mL4XYHsawt1M96QS9As4CAH5YeiOejAUFVQn5LqhMTXogJbGt5/PKMAFm2W stP5bN6ChExrGEn+3+3imktHUgvPu/lvSjWF4qMS3ZvLbQJkgwIvTZg5dyCNXQ5S1GYP GLF8zZ4TRecYtGV/WVwJborZnWbY0eVVbP7T/LtVj63BrRlGJFpBhDdJcxx3g1PV8GUd HCGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13-v6si6507362pgq.670.2018.04.30.12.52.40; Mon, 30 Apr 2018 12:53:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756193AbeD3TwM (ORCPT + 99 others); Mon, 30 Apr 2018 15:52:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:35332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755144AbeD3T2E (ORCPT ); Mon, 30 Apr 2018 15:28:04 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09E2A22DAC; Mon, 30 Apr 2018 19:28:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09E2A22DAC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Michael S. Tsirkin" Subject: [PATCH 4.16 027/113] virtio_console: drop custom control queue cleanup Date: Mon, 30 Apr 2018 12:23:58 -0700 Message-Id: <20180430184016.216294156@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael S. Tsirkin commit 61a8950c5c5708cf2068b29ffde94e454e528208 upstream. We now cleanup all VQs on device removal - no need to handle the control VQ specially. Cc: stable@vger.kernel.org Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman --- drivers/char/virtio_console.c | 17 ----------------- 1 file changed, 17 deletions(-) --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1988,21 +1988,6 @@ static void remove_vqs(struct ports_devi kfree(portdev->out_vqs); } -static void remove_controlq_data(struct ports_device *portdev) -{ - struct port_buffer *buf; - unsigned int len; - - if (!use_multiport(portdev)) - return; - - while ((buf = virtqueue_get_buf(portdev->c_ivq, &len))) - free_buf(buf, true); - - while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq))) - free_buf(buf, true); -} - /* * Once we're further in boot, we get probed like any other virtio * device. @@ -2163,7 +2148,6 @@ static void virtcons_remove(struct virti * have to just stop using the port, as the vqs are going * away. */ - remove_controlq_data(portdev); remove_vqs(portdev); kfree(portdev); } @@ -2208,7 +2192,6 @@ static int virtcons_freeze(struct virtio */ if (use_multiport(portdev)) virtqueue_disable_cb(portdev->c_ivq); - remove_controlq_data(portdev); list_for_each_entry(port, &portdev->ports, list) { virtqueue_disable_cb(port->in_vq);