Received: by 10.192.165.148 with SMTP id m20csp569631imm; Fri, 20 Apr 2018 11:22:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49L1pBesfbwm6C9vQ8qPxdrSnCckz/5MaYMWbkJQT+wJsTr8v7xqQTwxnWJAzoYffbkJ00E X-Received: by 10.101.90.194 with SMTP id d2mr9460113pgt.352.1524248553740; Fri, 20 Apr 2018 11:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524248553; cv=none; d=google.com; s=arc-20160816; b=lujbdo3y/WeCBLa3vWwQl1GoBVWuKIlsvC6Bzh47UO16A3oCZQo1Hp88HxJTYBaT0J xPID0H/c9kC6mP7LoKGqu8ViFhiGU3/oBl/EpR5efP9OxCEgftIQknwph+yvtzrQghYW sRkdyQKri6Z/5lOn+BAq8Bz+MiH5VR+F5IlIAlAZhCfN7WfV5dLbwek6d1vmRBB21GhC sTtvlFCFmygwBQaJ0DZ0XMQWqeMBOyQP2+gVrHRTMwSbOxmIum7odc8ZqNpbt7LMJ2yh ERhEtN5JBw1KEKqYZ0MFGXocqaq0/saMT72i15hbTbnTaloqHcHsdF3eizAvAU67IpMQ /DzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=neGm39E+LVV1kF8+Z+5evcg+Ray9NLnxK1DR+X9mUtE=; b=M3kMmNJQ/Ymvzd24dlcQ90U5ONQ+v7/WDuSRR2x3t0ZIXjX5BtT9JL1EptCDDYxQxz SSlePb3yorrHY90tdT1WPdjK9qiLHN/CRG9almjKFZPCA5mVCr5yLXrBQNvtuUyNWwia Dm3wnrItMUdcS+Cks6rEDhJIovZcMzNZxRoxCxbuktx5CpagjOm4HOq3xNNBb9K6IQCi xyQALx1Nr0VK8rKlDDfKMKr1Pf9uhotFhoo5x8q4fCyQZN6YhotNE+2DhQ0fcTIGRuF1 lH+YyD9vCKMruKW2S5PBX230nWRsskwSvDOGxocfuMSgUEo/G6mKOQnEGdCPT52whwiR zMDA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si2642270plx.99.2018.04.20.11.21.56; Fri, 20 Apr 2018 11:22:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753865AbeDTSSn (ORCPT + 99 others); Fri, 20 Apr 2018 14:18:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60648 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753782AbeDTSSF (ORCPT ); Fri, 20 Apr 2018 14:18:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53CFE402314E; Fri, 20 Apr 2018 18:18:05 +0000 (UTC) Received: from redhat.com (ovpn-126-37.rdu2.redhat.com [10.10.126.37]) by smtp.corp.redhat.com (Postfix) with SMTP id D7D1B11701C7; Fri, 20 Apr 2018 18:18:03 +0000 (UTC) Date: Fri, 20 Apr 2018 21:18:03 +0300 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , virtualization@lists.linux-foundation.org, stable@vger.kernel.org, Tiwei Bie , Jason Wang Subject: [PATCH 4/6] virtio_console: drop custom control queue cleanup Message-ID: <1524248223-393618-5-git-send-email-mst@redhat.com> References: <1524248223-393618-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524248223-393618-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 20 Apr 2018 18:18:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 20 Apr 2018 18:18:05 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We now cleanup all VQs on device removal - no need to handle the control VQ specially. Signed-off-by: Michael S. Tsirkin --- drivers/char/virtio_console.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 26a66ff..2d87ce5 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1988,21 +1988,6 @@ static void remove_vqs(struct ports_device *portdev) 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 virtio_device *vdev) * 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_device *vdev) */ 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); -- MST