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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A573AC05027 for ; Mon, 20 Feb 2023 18:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232290AbjBTSLq (ORCPT ); Mon, 20 Feb 2023 13:11:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231534AbjBTSLo (ORCPT ); Mon, 20 Feb 2023 13:11:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C1871ABC3 for ; Mon, 20 Feb 2023 10:11:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3B73AB80ACE for ; Mon, 20 Feb 2023 18:11:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90D46C433EF; Mon, 20 Feb 2023 18:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676916700; bh=5UZqyRioULyP4oLw7GNTR/gYtle1o0m+sXwVMukPX9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dg+jZ6pEtv0d7UryNlVA80uJfWvkfg1U3uGt4xUpRetKFfSb+joDNl4KYdi+GahgF /z8sYL5WiHvq33TPEJ5BT/roUle8XhxemIkHjxxpG1baLs9VWD65Vyu6GslRjAwoxZ dbofyzEQBPbTHZ7FjDVwr56Wom/h17iWyshdvzT4= Date: Mon, 20 Feb 2023 19:11:38 +0100 From: Greg KH To: Su Weifeng Cc: mst@redhat.com, linux-kernel@vger.kernel.org, shikemeng@huawei.com, liuzhiqiang26@huawei.com, linfeilong@huawei.com, zhanghongtao22@huawei.com Subject: Re: [PATCH v2] uio:uio_pci_generic:Don't clear master bit when the process does not exit Message-ID: References: <20230220171045.689736-1-suweifeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230220171045.689736-1-suweifeng1@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 21, 2023 at 01:10:44AM +0800, Su Weifeng wrote: > From: Weifeng Su > > The /dev/uioX device has concurrent operations in a few scenarios. > > For example, when a process using the device exits abnormally, > the management program starts the same process to operate the device. > When the process exits and closes the /dev/uioX device, > the master bit of the device is cleared. In this case, if the > new process is issuing commands, I/Os are suspended and cannot be > automatically recovered. > > Therefore, reference counting is added to clear the master bit > only when the last process exits. > > Signed-off-by: Weifeng Su > --- > The difference between the first patch and the first patch is that > the reference counting operation is performed using the atomic semantics, > just like other drivers under UIO: > cdfa835c6e5e87d145f("uio_hv_generic: defer opening vmbus until first use"). And I would claim that that change too is incorrect. Did you test this with dup()? Lots of open/close cycles on the same device node? Passing around the file descriptor? Logically, this is identical to your previous change, so why should it be accepted? Again, why not just use a real PCI driver for your device? thanks, greg k-h