Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1418202lqt; Wed, 20 Mar 2024 03:32:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVY+LlgIJGxTeycjHExKsI40G543LgOEqLw9+ZHwxFGiLGizncE0i2XBcq2+eDol6lwq5kvrCF9RBbJ6zVc3dzUUIyKchIHqIfc3CVDkQ== X-Google-Smtp-Source: AGHT+IHH4k1fXJY/1HPGR25vfWZqfIeDoTQ1bVobyLCVUG8/hOje9+oA4k5VvUYDzcG4AmmujXWe X-Received: by 2002:a17:902:c948:b0:1e0:2f6c:c27b with SMTP id i8-20020a170902c94800b001e02f6cc27bmr6740033pla.51.1710930733984; Wed, 20 Mar 2024 03:32:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710930733; cv=pass; d=google.com; s=arc-20160816; b=dJhB0CopEoLZzvFzMp5qqUd2kUSaJ4qlphs56rrx4U/xifpv9wsgm3unc8XeCCqmyT aSxKvW7J8wqWB/9peui2MtN8kSjcpU8TIyFZS8ozs7DN6QIrpxz0eWLOGhLvYFdVbxg0 HHc+hnOZ8vMjTeg7/NX06leXnX35+b/xG6F3TFiB1PKAsJ4uJqIGjkncWLK/WDEGP/2C bCa3ngQ52SFQjfvRuZX+SOZuiZc/IUivY3ir+vG4QG5ZbDrUogHB9j1JGXaBCDgTk2R4 R+rTrkdyz++j68n15CSYAx8SWUFavznnnBVoldPgrKYlb2OICTIryiWuDmBGZXFJ+gcZ sHIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=8sNJLDeO3//ygBsBaKWyExrUSf4lpQZ7TMC4jMog21w=; fh=G7JxRLuAY0NBTYbETpCYR0Pmy65SV5uiYdZRLRjOZ3s=; b=ImOqd/RHgjwQHjJzx7FS1zOkzVGMbXz+FF2HPX/VCA0GcX52FjcRUHOqSc+e843698 dQqvFQUZAi2rdqhUxDo9pkJfvQu5S8vW0F2ueV9lsETujwONXSshE2C8cOlFnwpNU4YM mWpEfrEtbNEOOXrQu+aQAsvgjd4eEJWJPZtfrt4bRtKfUFk9hqoSQbnkMXXcFcMKx9vJ Jaqgtrfz2/fGN9vfQsW9/nw56XK4hxd34s6g9m949oowCvN0xut5cPUFJyJFB2Xr3G8P qyCe+eZFOUfMVZusxRplNPPDJth0vERRw7dGipN6BG1UEbzuu9wVng5lvzrwoa9lgjWn exZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=NlApVX93; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-108780-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108780-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e9-20020a17090301c900b001def3cc3fbdsi10374279plh.263.2024.03.20.03.32.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 03:32:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108780-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=NlApVX93; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-108780-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108780-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A6706283B1E for ; Wed, 20 Mar 2024 10:32:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F264742064; Wed, 20 Mar 2024 10:29:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="NlApVX93" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF24C405D8; Wed, 20 Mar 2024 10:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710930590; cv=none; b=VbS0ZPl6Xqwg3wn4YLlcCYuT9MtrtoFqD3mCPcLx/v4ObY+6VF0mTouD8vm4ZLYaMQb1Js2RRvJeQMZYoPA4sjWNtph0q8w5RxZ6dpEOoTMHs3njV2gHxtNEvh8ct3n6ISIwLk9JRfoUAbfFvQZMoVZyhrelHCRspuKDha5msxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710930590; c=relaxed/simple; bh=OtlHloyPyeniToJMbwKNtvJXxZeJasCcJsQXkoFTzzc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=B1Jkg1GnPnPylRNscZyeDPuO2Ad+rxhz0SO1VlgearPaAxrsykJTiHWdSq2gv8nh1pRelLb8wR+DGdsZVUbzW7xWo/+aZNPttcJEnLjPVShPSm/O/AIV0NCYzOpwtJDP9mZjkgsQay5YzI6nq4CguKS2/x87vzgxktqrywb10fk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=NlApVX93; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 3FA9B20B74C3; Wed, 20 Mar 2024 03:29:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3FA9B20B74C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710930588; bh=8sNJLDeO3//ygBsBaKWyExrUSf4lpQZ7TMC4jMog21w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NlApVX93aTcpT0QDXePHEpswPpxyfGH1ydbN9xLUQpSQksjfD/1liZG1BzLDDZZby JW9Q4gTROWswP0tMjp7Jm4bu5TsOvWBwuIl0tcvERNuY5+3ZMPsgI+QB8+yFUay5Il hz++tuk78KrR/ZSgmXhDJY0IwH3/CVFR5Fpds/6o= From: Saurabh Sengar To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Cc: longli@microsoft.com, ssengar@microsoft.com Subject: [PATCH v2 3/7] uio_hv_generic: Enable interrupt for low speed VMBus devices Date: Wed, 20 Mar 2024 03:29:40 -0700 Message-Id: <1710930584-31180-4-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710930584-31180-1-git-send-email-ssengar@linux.microsoft.com> References: <1710930584-31180-1-git-send-email-ssengar@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Hyper-V is adding some "specialty" synthetic devices. Instead of writing new kernel-level VMBus drivers for these devices, the devices will be presented to user space via this existing Hyper-V generic UIO driver, so that a user space driver can handle the device. Since these new synthetic devices are low speed devices, they don't support monitor bits and we must use vmbus_setevent() to enable interrupts from the host. Signed-off-by: Saurabh Sengar Reviewed-by: Long Li --- [V2] - Added Reviewed-by form Long Li drivers/uio/uio_hv_generic.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c index 4bda6b52e49e..289611c7dfd7 100644 --- a/drivers/uio/uio_hv_generic.c +++ b/drivers/uio/uio_hv_generic.c @@ -84,6 +84,9 @@ hv_uio_irqcontrol(struct uio_info *info, s32 irq_state) dev->channel->inbound.ring_buffer->interrupt_mask = !irq_state; virt_mb(); + if (!dev->channel->offermsg.monitor_allocated && irq_state) + vmbus_setevent(dev->channel); + return 0; } @@ -240,12 +243,6 @@ hv_uio_probe(struct hv_device *dev, int ret; size_t ring_size = hv_dev_ring_size(channel); - /* Communicating with host has to be via shared memory not hypercall */ - if (!channel->offermsg.monitor_allocated) { - dev_err(&dev->device, "vmbus channel requires hypercall\n"); - return -ENOTSUPP; - } - if (!ring_size) ring_size = HV_RING_SIZE * PAGE_SIZE; -- 2.34.1