From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05F80C43331 for ; Mon, 11 Nov 2019 09:49:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB23C214DB for ; Mon, 11 Nov 2019 09:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573465763; bh=gNabya5j1CFBN/o4JOXgls+YOBZqNstKbkaeVu6qUX8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=ez5+0u/PIdSRloA6/LSSUYkC7gOU5HbzO1uwMce4wCRBvIRVQNoLGpO1bsxM9MGTe cYClaumNYSAYjoc87XJDIu64XRmhCxwkYdSkO4lx+Vmhp9d8YDdU1jKKoWU/KAJDJs vhTj0EYeu59NpcPMGXJt33l8G1uiQvXR+bsVKKbc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbfKKJtX (ORCPT ); Mon, 11 Nov 2019 04:49:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:57696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbfKKJtX (ORCPT ); Mon, 11 Nov 2019 04:49:23 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 E1664206C3; Mon, 11 Nov 2019 09:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573465762; bh=gNabya5j1CFBN/o4JOXgls+YOBZqNstKbkaeVu6qUX8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ncu7rCdzObqzGfjCEAga+VHdoCibWkdlqmjuO5oZ7KShXtlPgRL2AEuSAchbunpiH IfGtD69s49azMb7EWqdqVlrWokvz20/UnaDTlIWD0uVQHpNMitTAz9eD5gNqjvgpBB Q2GErzAIhCx+SfoYqtkixRw/QLnGHsZ9Xzp7giC8= Date: Mon, 11 Nov 2019 10:49:20 +0100 From: Greg KH To: lantianyu1986@gmail.com Cc: alex.williamson@redhat.com, cohuck@redhat.com, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, mchehab+samsung@kernel.org, davem@davemloft.net, robh@kernel.org, Jonathan.Cameron@huawei.com, paulmck@linux.ibm.com, michael.h.kelley@microsoft.com, Tianyu Lan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, vkuznets@redhat.com Subject: Re: [PATCH] VFIO/VMBUS: Add VFIO VMBUS driver support Message-ID: <20191111094920.GA135867@kroah.com> References: <20191111084507.9286-1-Tianyu.Lan@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191111084507.9286-1-Tianyu.Lan@microsoft.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-hyperv-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On Mon, Nov 11, 2019 at 04:45:07PM +0800, lantianyu1986@gmail.com wrote: > +#define DRIVER_VERSION "0.0.1" Never a need for DRIVER_VERSION as your driver just becomes part of the main kernel tree, so please drop this. We keep trying to delete these types of numbers and they keep coming back... > +static void > +vfio_vmbus_new_channel(struct vmbus_channel *new_sc) > +{ > + struct hv_device *hv_dev = new_sc->primary_channel->device_obj; > + struct device *device = &hv_dev->device; > + int ret; > + > + /* Create host communication ring */ > + ret = vmbus_open(new_sc, HV_RING_SIZE, HV_RING_SIZE, NULL, 0, > + vfio_vmbus_channel_cb, new_sc); > + if (ret) { > + dev_err(device, "vmbus_open subchannel failed: %d\n", ret); > + return; > + } > + > + /* Disable interrupts on sub channel */ > + new_sc->inbound.ring_buffer->interrupt_mask = 1; > + set_channel_read_mode(new_sc, HV_CALL_ISR); > + > + ret = sysfs_create_bin_file(&new_sc->kobj, &ring_buffer_bin_attr); No documentation on this new sysfs file? And by creating it here, userspace is not notified of it, so tools will not see it :( > + if (ret) > + dev_notice(&hv_dev->device, > + "sysfs create ring bin file failed; %d\n", ret); Doesn't the call spit out an error if something happens? > + ret = sysfs_create_bin_file(&channel->kobj, &ring_buffer_bin_attr); > + if (ret) > + dev_notice(&dev->device, > + "sysfs create ring bin file failed; %d\n", ret); > + Again, don't create sysfs files on your own, the bus code should be doing this for you automatically and in a way that is race-free. thanks, greg k-h