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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 031D5C433E0 for ; Mon, 1 Mar 2021 08:33:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD67E64DEE for ; Mon, 1 Mar 2021 08:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233165AbhCAIdo (ORCPT ); Mon, 1 Mar 2021 03:33:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:54454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233159AbhCAIdm (ORCPT ); Mon, 1 Mar 2021 03:33:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7773F64DDF; Mon, 1 Mar 2021 08:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614587582; bh=T/R7z14RRAN4+3cmPneyHMVehxixYPltnuGQWGGpzWw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lx6VVIuor4wg2LVTDF8pGTJmzpaqZRZB6yDk6PymLl/3cdEvQnVI9YRQUOVIeBxfm mPLiNxGdxYtpGppmIfeQv73USRxP8uD/rMO9iN8GjoDvGsl/mAxERdBF43sMI35oMY dwTnA+uH2P3r2P36imR01levxM/LeOxeR5Tzdhi8= Date: Mon, 1 Mar 2021 09:32:59 +0100 From: Greg KH To: "Zhang, Qiang" Cc: "zaitcev@redhat.com" , "linux-usb@vger.kernel.org" Subject: Re: =?utf-8?B?5Zue5aSNOiBbUEFUQ0g=?= =?utf-8?Q?=5D?= USB: usblp: Add device status detection in usblp_poll() Message-ID: References: <20210301040300.20834-1-qiang.zhang@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, Mar 01, 2021 at 08:26:22AM +0000, Zhang, Qiang wrote: > > > ________________________________________ > 发件人: Greg KH > 发送时间: 2021年3月1日 16:00 > 收件人: Zhang, Qiang > 抄送: zaitcev@redhat.com; linux-usb@vger.kernel.org > 主题: Re: [PATCH] USB: usblp: Add device status detection in usblp_poll() > > [Please note: This e-mail is from an EXTERNAL e-mail address] > > On Mon, Mar 01, 2021 at 12:03:00PM +0800, qiang.zhang@windriver.com wrote: > > From: Zqiang > > > > If usblp device has been disconnected, direct return > > 'EPOLLHUP | EPOLLERR' in usblp_poll(). > > > >Why? What problem are you solving here? Is this fixing an >older > >commit, if so, what one? > > > > There is not need fix older commit. > After the device is disconnected, if the userspace call poll/select() function, will block and never be awakened . If the device is disconnected, how can the file be opened at all? Shouldn't it have been torn down already? And now you are holding a lock across some poll_wait() calls, is that going to cause problems? thanks, greg k-h