[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190327004603.GA28785@kroah.com>
Date: Wed, 27 Mar 2019 09:46:03 +0900
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: George Hilliard <thirtythreeforty@...il.com>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] staging: mt7621-mmc: Initialize completions a
single time during probe
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 <thirtythreeforty@...il.com>
> ---
> 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 :(
Powered by blists - more mailing lists