Received: by 10.192.165.156 with SMTP id m28csp845023imm; Wed, 11 Apr 2018 08:07:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/3kG0DVkDTEv88R3IEez4sfei4tKakz0ETjPCSMXLLAWxaT5okNyqAMBDYwzxi51eROcIF X-Received: by 10.99.107.8 with SMTP id g8mr3763619pgc.271.1523459271069; Wed, 11 Apr 2018 08:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523459271; cv=none; d=google.com; s=arc-20160816; b=AxJKZtGbf4Gyfp1PxJumDizQfKMNdqFHHZ1RiaM+dXQsUrP0XGbjqFAjFtYJbnW9Gt adrooLQC9InolHUbqvJzYUF48RVP6foWoaocYlEsAoUqMbViQ8t/c8mF8SF3bAj7SBY1 PrWrA4v1uq099NMzHqmFX4m9HNVwJzJr2xMImRqCfpiY724mysjch2nnxZDWYkeg/Up+ YnBo1DXhnFPwvZZKb2EhUkaXlE9GBKvi9oGVAcZUbdSig/f2H1E6UdsmPLz08JhFXClJ XaNSQrn/G3gNqV2zisBicMnBpFlx6VVkdmmIa9lIAEZr9RWEpn0u2Z1dlqkUt9ugyYYp +dhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=HDubg+7aqYCEYdqOOLO3nW1bomSFo22iZvZ7sGA2eaI=; b=qrPvjvcE/OFwLSUlVJe+ykKvNfaQjCtwdgbw9bi8NKSNo9QfJbA0gxll4ZMRAlfXi4 KnYIf//YHWq2kqT4+QUhOc2BWdZM6qGuoTFM9zdyDWrTsn+d0voSngaYVxWuk0A3fb5W 1CGtg+EYV8n9OPfY3VheVPSf0+XnYO1+aCFhaUaUIvUVNb6U6hXcHGz4bEYLs4hyMDs+ mmV1kkKRu4jMH3hwDrQNbgS8Zni6iPipe71gUlod4eFqYHyAGkq8KvQqtozmyu4ADLYl WlUudu41L49wmqKZa2PtJTrfDbvNaUy+1zEYDsvf66rodmIzXBI7Ft/Qs977Ft+yR1Qi JW+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itWVQOCa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m68si1007806pfm.0.2018.04.11.08.07.14; Wed, 11 Apr 2018 08:07:51 -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=@linaro.org header.s=google header.b=itWVQOCa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbeDKPER (ORCPT + 99 others); Wed, 11 Apr 2018 11:04:17 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:33066 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752211AbeDKPEP (ORCPT ); Wed, 11 Apr 2018 11:04:15 -0400 Received: by mail-it0-f68.google.com with SMTP id x144-v6so18106117itc.0 for ; Wed, 11 Apr 2018 08:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HDubg+7aqYCEYdqOOLO3nW1bomSFo22iZvZ7sGA2eaI=; b=itWVQOCaeMeYZr+1aXgBcIMDZG++uzYGtRDpg+VCsKT3EsO3Q+DjvYpX5c7yuSnE7N JjNU3meULhC4GT63i+g0hozFRu0y1mP2aani+xK9gJtPPOG4l0dVNhQTcFqpHQOHogxX i9Q7/MbVX7KGX3FfABz4yw4xiu24hpRZfQGuM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HDubg+7aqYCEYdqOOLO3nW1bomSFo22iZvZ7sGA2eaI=; b=YjEz124utnTG+8kVLcAVAocQJgJFsHejXZzq3F9NLWOOgVCm0UVg/kmS9X9fIXNog2 ORZMGiwf0cYevPtjKfGmwW6nGoT2fG6RQO/EYXa6KEvUfZmUYXQfRlNb9BDzteNXzhaW icbpwACkt9XV7CDGJUOjiLAsFQS9Tz3CV+5pcBn0fN1J0IdZ7CaALF5Hgw8cEwdBfjKy fx9MQmc0qTT359vohccUbdHrOsN6ybqvBGHFk9wmDo8eocBrj6JWc++o/4MA3b9cnWRO IeXuaemtI0fzp9I861DuCFV4MHuehZvMIuL8CJUdQh7R7YmZjX1a9UPFDW8II+JSx29T Jh9g== X-Gm-Message-State: ALQs6tBUeEtXiE5IQbEjralWlULcmPBx+K6JP0JCQPcAy9skxfd5Y4Lf 3/Uiz0siFu0IMs41XQ0oz57l2BqzToL4fYbeZzdY4w== X-Received: by 2002:a24:248:: with SMTP id 69-v6mr4146700itu.55.1523459054887; Wed, 11 Apr 2018 08:04:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.101.23 with HTTP; Wed, 11 Apr 2018 08:04:14 -0700 (PDT) In-Reply-To: <1523414803-2626-1-git-send-email-baijiaju1990@gmail.com> References: <1523414803-2626-1-git-send-email-baijiaju1990@gmail.com> From: Ulf Hansson Date: Wed, 11 Apr 2018 17:04:14 +0200 Message-ID: Subject: Re: [PATCH 1/3] mmc: wbsd: Replace mdelay with usleep_range in wbsd_init To: Jia-Ju Bai Cc: Pierre Ossman , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11 April 2018 at 04:46, Jia-Ju Bai wrote: > wbsd_init() is never called in atomic context. > > The call chains ending up at wbsd_init() are: > [1] wbsd_init() <- wbsd_probe() > [2] wbsd_init() <- wbsd_pnp_probe() > > wbsd_probe() is set as ".probe" in struct platform_driver. > wbsd_pnp_probe() is set as ".probe" in struct pnp_driver. > These functions are not called in atomic context. > > Despite never getting called from atomic context, wbsd_init() > calls mdelay() to busily wait. > This is not necessary and can be replaced with usleep_range() to > avoid busy waiting. > > This is found by a static analysis tool named DCNS written by myself. > And I also manually check it. > > Signed-off-by: Jia-Ju Bai The patch is good, however I think you should squash all three in this series into one. For obvious reasons. Kind regards Uffe > --- > drivers/mmc/host/wbsd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c > index 546aaf8..6224d12 100644 > --- a/drivers/mmc/host/wbsd.c > +++ b/drivers/mmc/host/wbsd.c > @@ -1709,7 +1709,7 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma, > /* > * Allow device to initialise itself properly. > */ > - mdelay(5); > + usleep_range(5000, 6000); > > /* > * Reset the chip into a known state. > -- > 1.9.1 >