Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4805529img; Tue, 26 Mar 2019 17:47:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/UT1RI3ZeSAeWzESk+sX0wmSi2Pf0Ju/x15Do1BHcH4YQymuST+RUx1yCSSzQa7ejrMwf X-Received: by 2002:a63:ef0d:: with SMTP id u13mr8979177pgh.450.1553647619968; Tue, 26 Mar 2019 17:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553647619; cv=none; d=google.com; s=arc-20160816; b=EYO27czp4wqT47Zw06adzgbspYhhPtQaZOdsOEnMng/PZ8WbQov2wSUJHiiPfFUR6l 48DUr9setjhExxIsk6KFkCkiuBwEmWSD6q3zAtUGir1wQAvizgaTBi3OQil++LloZUgQ b2SmTuXHqKpryE8o8GsOTiPe/fWNjMo15kAhnwXryjwRt9NvjzsJDH+BwrcdBeSmH7jp IJVdUwcG/xd+slQeiGZkGra1kqGExpLCGGjVRhxtwvzsaJ1BLXEUsGdvbAA8PsffbZJ3 5JOiihoyiZNwr8zh0MLc/kkHJIXg5GNSd3ixZeqOoIi8TOEjjg27Ex9PNI46OHctf5/Q OK4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XD8Mmv6u2MA8HntUqXc5CskO4QSBKgyETZAbR7Cg2Zo=; b=eBQ0treoA1QLYO69KQ33refZUCMlXeZ8im1iHg1mtVFROSO0vNdwIU0pv1RhHaSuFh /kzmBCJMe2eLabTSJc6wDDq6yLSImLeQHYo+UshAgFOZ83irF2qg/BFAEx7ChITn8cQb UPpAeZgE3Ob1GZwHcW6DNIyy9SbXUCUw1UD8gfFXQQ92WsXCTiRr6pJimYl+azQN0xLY G9CewH0TycYnblHbuRkxJ8kxY0AX551/3eRswl9SgPp8TKjK5GgJRoktglLb0jnFj9WY uQhDL7PjI2niHfAP0SuhEW/gwbZgpuQC0DZc3vPSynFGA61YFLCxqpmu18pAbgVQSBGE gUeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nMgJMuai; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si19165650plb.140.2019.03.26.17.46.43; Tue, 26 Mar 2019 17:46:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nMgJMuai; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731847AbfC0AqJ (ORCPT + 99 others); Tue, 26 Mar 2019 20:46:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:46660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730333AbfC0AqJ (ORCPT ); Tue, 26 Mar 2019 20:46:09 -0400 Received: from localhost (mobile-166-137-177-030.mycingular.net [166.137.177.30]) (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 F41342082F; Wed, 27 Mar 2019 00:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553647568; bh=VnGM0s5kqmuXW+KOcnWFx1TyYj0DnTnhE/my1+oM1cA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nMgJMuai1zofqgzM+DacllOwm5Uo9cbD+nLxlWK5LiS/c6OWWO7N8WpWwas4Noue+ ROO8+QIFuYfXUxwstauDm9aPj7sPwJrjOPL+MAHOnlj6X12UXRocgkG+pWbDcg0aWN 5kuoFNrxrKvdKrJfY4BvfKB6+gVZ5QFwklr2exwI= Date: Wed, 27 Mar 2019 09:46:03 +0900 From: Greg Kroah-Hartman To: George Hilliard Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] staging: mt7621-mmc: Initialize completions a single time during probe Message-ID: <20190327004603.GA28785@kroah.com> References: <20190326152139.18609-1-thirtythreeforty@gmail.com> <20190326152139.18609-3-thirtythreeforty@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190326152139.18609-3-thirtythreeforty@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 26, 2019 at 09:21:39AM -0600, George Hilliard wrote: > The module was initializing completions whenever it was going to wait on > them, and not when the completion was allocated. This is incorrect > according to the completion docs: > > Calling init_completion() on the same completion object twice is > most likely a bug [...] > > Re-initialization is also unnecessary because the module never uses > complete_all(). Fix this by only ever initializing the completion a > single time, and log if the completions are not consumed as intended > (this is not a fatal problem, but should not go unnoticed). > > Signed-off-by: George Hilliard > --- > v2: rewrite of v1 > v3: Remove BUG_ON() calls > v4: Indent style fixup > > drivers/staging/mt7621-mmc/sd.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c > index e346167754bd..ed63bd3ba6cc 100644 > --- a/drivers/staging/mt7621-mmc/sd.c > +++ b/drivers/staging/mt7621-mmc/sd.c > @@ -466,7 +466,11 @@ static unsigned int msdc_command_start(struct msdc_host *host, > host->cmd = cmd; > host->cmd_rsp = resp; > > - init_completion(&host->cmd_done); > + // The completion should have been consumed by the previous command > + // response handler, because the mmc requests should be serialized > + if(completion_done(&host->cmd_done)) Did you run your patch through checkpatch.pl? It should have reported an error here :(