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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 209BCC4332B for ; Thu, 19 Mar 2020 08:41:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E825C2072C for ; Thu, 19 Mar 2020 08:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584607260; bh=dHtJENXjO0z7ELO16+oHxTUd6KSiGYOo+FAU1g3r1L8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=pusLVzBs5TeSCHdBFWG+gE4H65E2nQ5SZ825KpwoyJOn8ikLq28Ld+Jh3AV0GOIpX PXOYYy/nq39U5GwdX1LAfJEkZqiubS7lsHbeEAb9o+Pi09oSZi6ASU0RNt+h9/CuyZ uFuoU+CMCMC/hSPaByDjlKImjuBbiHIw1GBUCbN0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbgCSIk5 (ORCPT ); Thu, 19 Mar 2020 04:40:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgCSIk5 (ORCPT ); Thu, 19 Mar 2020 04:40:57 -0400 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 3A53D20724; Thu, 19 Mar 2020 08:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584607255; bh=dHtJENXjO0z7ELO16+oHxTUd6KSiGYOo+FAU1g3r1L8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XAF/A62c4v2KZMa+b7MNCvt5Okc6ArSh27nZ6WmkbKaRhYOcWXD+8cWrAPcz+Oxd5 GcEJnnmipmcEEfVQKgD3elLE172vOeV5zt61gPiItbhWXmp1y4AT19XvauDwP8kAkL YnG/UNS29vEd98MwDnk+VTNPMtTHoyQsUCF7HqAk= Date: Thu, 19 Mar 2020 09:40:53 +0100 From: Greg Kroah-Hartman To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Linus Torvalds , Ingo Molnar , Will Deacon , "Paul E . McKenney" , Joel Fernandes , Steven Rostedt , Randy Dunlap , Sebastian Andrzej Siewior , Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Logan Gunthorpe , Kurt Schwemmer , Bjorn Helgaas , linux-pci@vger.kernel.org, Felipe Balbi , linux-usb@vger.kernel.org, Oleg Nesterov , Davidlohr Bueso , Michael Ellerman , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org Subject: Re: [patch V2 04/15] orinoco_usb: Use the regular completion interfaces Message-ID: <20200319084053.GA3492783@kroah.com> References: <20200318204302.693307984@linutronix.de> <20200318204407.793899611@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200318204407.793899611@linutronix.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 18, 2020 at 09:43:06PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > The completion usage in this driver is interesting: > > - it uses a magic complete function which according to the comment was > implemented by invoking complete() four times in a row because > complete_all() was not exported at that time. > > - it uses an open coded wait/poll which checks completion:done. Only one wait > side (device removal) uses the regular wait_for_completion() interface. > > The rationale behind this is to prevent that wait_for_completion() consumes > completion::done which would prevent that all waiters are woken. This is not > necessary with complete_all() as that sets completion::done to UINT_MAX which > is left unmodified by the woken waiters. > > Replace the magic complete function with complete_all() and convert the > open coded wait/poll to regular completion interfaces. > > This changes the wait to exclusive wait mode. But that does not make any > difference because the wakers use complete_all() which ignores the > exclusive mode. > > Reported-by: Sebastian Andrzej Siewior > Signed-off-by: Thomas Gleixner > Cc: Kalle Valo > Cc: "David S. Miller" > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org > --- > V2: New patch to avoid conversion to swait functions later. > --- > drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 21 ++++---------------- > 1 file changed, 5 insertions(+), 16 deletions(-) > > --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c > +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c > @@ -365,17 +365,6 @@ static struct request_context *ezusb_all > return ctx; > } > > - > -/* Hopefully the real complete_all will soon be exported, in the mean > - * while this should work. */ > -static inline void ezusb_complete_all(struct completion *comp) > -{ > - complete(comp); > - complete(comp); > - complete(comp); > - complete(comp); > -} That's so funny... :( Reviewed-by: Greg Kroah-Hartman