From patchwork Thu Mar 14 18:31:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1056655 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Ky3k1w89z9s3q; Fri, 15 Mar 2019 05:32:02 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1h4V91-0007nl-HM; Thu, 14 Mar 2019 18:31:55 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1h4V8x-0007km-Vt for kernel-team@lists.ubuntu.com; Thu, 14 Mar 2019 18:31:51 +0000 Received: from mail-qt1-f200.google.com ([209.85.160.200]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1h4V8x-0004Y0-F3 for kernel-team@lists.ubuntu.com; Thu, 14 Mar 2019 18:31:51 +0000 Received: by mail-qt1-f200.google.com with SMTP id b1so6221277qtk.11 for ; Thu, 14 Mar 2019 11:31:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=RMmdt5qyCMrCj6RxdHV1mybQvXcsZy5vDk6WCwsZoCQ=; b=RXdJcDuPQO9XKBT4NSpUBcDusg+jHORZwXjy5kE9PSdUKEFILnpE0y8ZO4PfWtKG2i bdwEom16+HvOTDAqL0stWDgEeUMNSLsG/4LzFB896AhwiPTUp/T9bnoCEZmdc9NCyFvP yL1W1tWHrbbmPba1H8d0lFqmM+AEblmWUaZAM30y90NgIiUKCd8G2WyBZt9IWfHHI1Cg FjC6pT6XeuA0y0+rXne2yq7TRHnZr655B4/ZxWQzuYzjk4+I1t9UKrtHmad+ryMZyy+8 HKRR6yKCRZUDAMQJOPWhXTy5Bss+H2anjDoM3D1eCArsShRU5NwxK6l0EYL/3cz8efJh RE7A== X-Gm-Message-State: APjAAAWmGPK1t1zIIHV+Tola9OkqvhkLDUSfbEA7H5vUvQxw+kO0eehQ Z4If5AMtJymmSIslpQzteJWH3PCy319firr0VKTJ1n9JIlG7wAYGgKDXg5PewRHQYfDSCTOOios RgZhCPRP7vGssPPi6lUCjbHxaHRh4T4aFQoWYunsk X-Received: by 2002:ac8:2297:: with SMTP id f23mr28477479qta.348.1552588310049; Thu, 14 Mar 2019 11:31:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZnWUPVRVzaHesk4R2QIIfMXdWUtXNFvg7+DnF77i1jcE2KdEJN7BxZgIaHU7E9FPRy1jw3w== X-Received: by 2002:ac8:2297:: with SMTP id f23mr28477464qta.348.1552588309789; Thu, 14 Mar 2019 11:31:49 -0700 (PDT) Received: from gallifrey.lan ([2804:14c:4e3:4a76:8145:c566:46dd:a2ba]) by smtp.gmail.com with ESMTPSA id j64sm1575576qkf.13.2019.03.14.11.31.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 11:31:49 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [c/azure][PATCH 5/8] uio_hv_generic: set callbacks on open Date: Thu, 14 Mar 2019 15:31:32 -0300 Message-Id: <20190314183135.20235-6-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190314183135.20235-1-marcelo.cerri@canonical.com> References: <20190314183135.20235-1-marcelo.cerri@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stephen Hemminger BugLink: http://bugs.launchpad.net/bugs/1812123 This fixes the problem where uio application was unable to use multple queues on restart. The root cause is that the callbacks are cleared on disconnect. Change to setting up callbacks everytime in open. Fixes: cdfa835c6e5e ("uio_hv_generic: defer opening vmbus until first use") Reported-by: Mohammed Gamal Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 5e3c420dcca53766dec57d5bf4df8eecdb953c03) Signed-off-by: Marcelo Henrique Cerri --- drivers/uio/uio_hv_generic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c index 418e3cbbb869..84f3d418694c 100644 --- a/drivers/uio/uio_hv_generic.c +++ b/drivers/uio/uio_hv_generic.c @@ -207,9 +207,11 @@ hv_uio_open(struct uio_info *info, struct inode *inode) if (atomic_inc_return(&pdata->refcnt) != 1) return 0; + vmbus_set_chn_rescind_callback(dev->channel, hv_uio_rescind); + vmbus_set_sc_create_callback(dev->channel, hv_uio_new_channel); + ret = vmbus_connect_ring(dev->channel, hv_uio_channel_cb, dev->channel); - if (ret == 0) dev->channel->inbound.ring_buffer->interrupt_mask = 1; else @@ -337,9 +339,6 @@ hv_uio_probe(struct hv_device *dev, goto fail_close; } - vmbus_set_chn_rescind_callback(channel, hv_uio_rescind); - vmbus_set_sc_create_callback(channel, hv_uio_new_channel); - ret = sysfs_create_bin_file(&channel->kobj, &ring_buffer_bin_attr); if (ret) dev_notice(&dev->device,