From patchwork Fri Jun 7 19:38:45 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: 1112226 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 45LCXK5bqnz9sBp; Sat, 8 Jun 2019 05:39:29 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hZKhw-0007J5-5u; Fri, 07 Jun 2019 19:39:24 +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 1hZKhr-0007ED-6Q for kernel-team@lists.ubuntu.com; Fri, 07 Jun 2019 19:39:19 +0000 Received: from mail-qk1-f199.google.com ([209.85.222.199]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hZKhp-00071t-TU for kernel-team@lists.ubuntu.com; Fri, 07 Jun 2019 19:39:18 +0000 Received: by mail-qk1-f199.google.com with SMTP id i4so2454231qkk.22 for ; Fri, 07 Jun 2019 12:39:17 -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:mime-version:content-transfer-encoding; bh=MhGAc+5rtXdAm6vUc9lI+NmcFjCfUfxs2kTDC/PEjpE=; b=RHcWyzqxqHKud/QE9w1Jk9mfZueB2C8Vf3wrv/mW9Xq0xauycJK8ifffhpGcPOcWGw 8C2IE5sXE1eWelnhw6ah1rJrosqf218/vDD4AsFGiGglYSb2g7BM3p0nKLRsPDfxPERs hfsLSo6MgJgwd1Ha8KKsaowRMULnGngaiQZfL/Cm/YsZRx2mUUpSk/9lSGSjpho4Wl0r V+TDQphGMgvE4g6q+E1e0IdJM6L01NwQlPjdmyDTmTCa2IT7ScVQsdj/Bsb+fXNs98MF n8h0Fw4TNePU40gV1lBTBw2WKRBckGeloPrdGOC+xgMiZVOlkwQgPQfUMEr/X52/6hC/ dxGw== X-Gm-Message-State: APjAAAV9G6Wh/EtPsgmPbh7OHDFyFEICCCKHhRbAhk2kw2H/++AfXUE0 2TBa+F3hbqw2e1qVIyU3vbZG9KaWpzpros/XBshBCbfQA9Dr5n/glzZkA7RH7AW58TK/2mVd/VV 9Jb1e1e8g3K42PQp+ewIhchxK0WtLKMvRuxTM+llY X-Received: by 2002:a05:620a:16c1:: with SMTP id a1mr2666494qkn.269.1559936356691; Fri, 07 Jun 2019 12:39:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzGqQ16yNgqCeqQ4KRDAZmuqQdoJ4vdfUn0MSaPV+2ddWrjvM08IE7rBXiZqLoejgCmAfkag== X-Received: by 2002:a05:620a:16c1:: with SMTP id a1mr2666480qkn.269.1559936356406; Fri, 07 Jun 2019 12:39:16 -0700 (PDT) Received: from gallifrey.lan ([2804:14c:4e3:4a76:b1ae:211f:e30b:4e05]) by smtp.gmail.com with ESMTPSA id r2sm1318875qtp.8.2019.06.07.12.39.14 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 12:39:15 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [x/azure][PATCH 11/17] uio_hv_generic: use correct channel in isr Date: Fri, 7 Jun 2019 16:38:45 -0300 Message-Id: <20190607193851.21914-12-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190607193851.21914-1-marcelo.cerri@canonical.com> References: <20190607193851.21914-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stephen Hemminger BugLink: http://bugs.launchpad.net/bugs/1812123 Need to mask the correct sub-channel in the callback from VMBUS isr. Otherwise, can get in to infinite interrupt storm. Fixes: 37b96a4931db ("uio_hv_generic: support sub-channels") Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 135db384a2efde3718fd551e3968e97fcb400c84) Signed-off-by: Marcelo Henrique Cerri --- drivers/uio/uio_hv_generic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c index 50656530528d..ab7a60fc02e7 100644 --- a/drivers/uio/uio_hv_generic.c +++ b/drivers/uio/uio_hv_generic.c @@ -92,10 +92,11 @@ hv_uio_irqcontrol(struct uio_info *info, s32 irq_state) */ static void hv_uio_channel_cb(void *context) { - struct hv_uio_private_data *pdata = context; - struct hv_device *dev = pdata->device; + struct vmbus_channel *chan = context; + struct hv_device *hv_dev = chan->device_obj; + struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev); - dev->channel->inbound.ring_buffer->interrupt_mask = 1; + chan->inbound.ring_buffer->interrupt_mask = 1; virt_mb(); uio_event_notify(&pdata->info); @@ -148,19 +149,18 @@ static struct bin_attribute ring_buffer_bin_attr __ro_after_init = { .mmap = hv_uio_ring_mmap, }; -/* Callback from VMBUS subystem when new channel created. */ +/* Callback from VMBUS subsystem when new channel created. */ static void hv_uio_new_channel(struct vmbus_channel *new_sc) { struct hv_device *hv_dev = new_sc->primary_channel->device_obj; struct device *device = &hv_dev->device; - struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev); const size_t ring_bytes = HV_RING_SIZE * PAGE_SIZE; int ret; /* Create host communication ring */ ret = vmbus_open(new_sc, ring_bytes, ring_bytes, NULL, 0, - hv_uio_channel_cb, pdata); + hv_uio_channel_cb, new_sc); if (ret) { dev_err(device, "vmbus_open subchannel failed: %d\n", ret); return; @@ -202,7 +202,7 @@ hv_uio_probe(struct hv_device *dev, ret = vmbus_open(dev->channel, HV_RING_SIZE * PAGE_SIZE, HV_RING_SIZE * PAGE_SIZE, NULL, 0, - hv_uio_channel_cb, pdata); + hv_uio_channel_cb, dev->channel); if (ret) goto fail;