From patchwork Thu Apr 11 22:00:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 1084318 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tiIUM8I6"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="NzNFKjHb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44gFQ25ksrz9s4V for ; Fri, 12 Apr 2019 08:02:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yY9OzKo0kkqIGMXXQI5rksx0zPIUrxnY/H3PNumnq8M=; b=tiIUM8I6lsjjed PtdLtEogsp4F0IQHIncBHLDZKx1CLEZjh1A4kaOUu26hbRoI4yE/Zsv6Q7zruBjvLhKiHeOQL5WYr pg724iXrtHAITCGRtLp7RFOofEZ7jGXCSqOPewDw24h49b2Kyihg28JPLuqAFj9XemTJTsHc3ODaN uTFqOP/SosSRcJ6k8M029covMBYFk8pKIns4W/Qy/VkI0u7wSJfRnn0j8j3TnNchuZ0SYe7VWw4sk yik1i+Ek3IMjtUIP4RlrSeIFFX5H6ixm7bY0obfOU6Bfu9k6NJsuT3oNUrkhXvDIk2vA7FlC/ORLb jfluGr3lhq8b6EWRKQiw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEhmO-0005PP-Ma; Thu, 11 Apr 2019 22:02:44 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEhl8-0003ag-LW; Thu, 11 Apr 2019 22:01:30 +0000 Received: by mail-wm1-x343.google.com with SMTP id v14so8479256wmf.2; Thu, 11 Apr 2019 15:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4m105n5JXJH4GNf9WN+soWtXGry/vpyc5a/iSxRDFzw=; b=NzNFKjHb09kbOIHFC41lGJd95srXDx+k6jOgARNJ6GIQ36ROXxomwgG1t5ZZmtnDcq 9x0D4BW/E1st5N+fdpO4q/KshtnUPtQJjHjutgQdFrpX/HAI1lc5Ni4VWJC9Jhnak+9a WLTkCFzeaPFj4djeAlX7H65RWyYR3vJnvlRvlCcEvZ6vxC6XH5Mo7QYJ4PKFAQdOrrZl BH44N+OpoVxPWmBdIAwy0qsgN2oarmGgx7+jb8cJfmn2RlvtqijKBA420rFOYuQ2us0E shLtv0GWTTcOa/xcgDqYvMJ0mH2xgXcuRLkpajKWtvCRPnSPjSLKY+s4lAdDjEeGD7+3 +R2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4m105n5JXJH4GNf9WN+soWtXGry/vpyc5a/iSxRDFzw=; b=rN086315qtYUGIEjh9yNP8rcCf/CinyGPNxVyTbCRcbs32tczxu/XFfe9XGv/11qmR NhjSfKdbYEttExh8F3pKydEqYQD2giiCF4rZ9g5gbIxQU3Bh40zyTgK4bBZNB08NUpjB ZrQeykR99ylchPrfriUxarCwNnU/Z3ghwyfXtSh5V+QcVk58NxR6WsqTUImiUlYml3hi /A/+powfjIFidvVETratIP0zce3XDfd0gYZSW2bMX+HYDoYHmtY8AimyQ/6E7Bkhe2t/ NenqJ5NnDN9pjOwm6XxbEWpvDltMUPoWq+X0p21Rr4HYf7M26woboXKwfIcwpuvXAkw5 jDRw== X-Gm-Message-State: APjAAAUyVM1y7uLnepsoLv1UoG9DAonKWMEufx4RvmCMkuJSLwj/Xwva YU0XGydRS5oWOixwh0A4ISs= X-Google-Smtp-Source: APXvYqwvz5r4sd151G017FJh/Vn+1GDk5EwoOrb7sRHdQs5rc/n1+l76wMQOKuKsn5oRdB6Q4mftzg== X-Received: by 2002:a1c:6783:: with SMTP id b125mr8256171wmc.41.1555020085029; Thu, 11 Apr 2019 15:01:25 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133C8AD0009F15067C8D22C31.dip0.t-ipconnect.de. [2003:f1:33c8:ad00:9f1:5067:c8d2:2c31]) by smtp.googlemail.com with ESMTPSA id s189sm13266186wmf.45.2019.04.11.15.01.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 15:01:24 -0700 (PDT) From: Martin Blumenstingl To: liang.yang@amlogic.com, linux-amlogic@lists.infradead.org, linux-mtd@lists.infradead.org, richard@nod.at, miquel.raynal@bootlin.com Subject: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once Date: Fri, 12 Apr 2019 00:00:56 +0200 Message-Id: <20190411220056.19109-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190411220056.19109-1-martin.blumenstingl@googlemail.com> References: <20190411220056.19109-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_150127_040761_09A97E74 X-CRM114-Status: GOOD ( 12.30 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (martin.blumenstingl[at]googlemail.com) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jianxin.pan@amlogic.com, bbrezillon@kernel.org, Martin Blumenstingl , linux-kernel@vger.kernel.org, marek.vasut@gmail.com, computersforpeace@gmail.com, dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Documentation/scheduler/completion.txt states: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue and enqueued tasks could get "lost" - use reinit_completion() in that case, but be aware of other races. Initialize nfc->completion in meson_nfc_probe using init_completion and change the call in meson_nfc_queue_rb to reinit_completion so the logic matches what the documentation suggests. Signed-off-by: Martin Blumenstingl Tested-by:Liang Yang Acked-by: Liang Yang Tested-by:Liang Yang Acked-by: Liang Yang --- drivers/mtd/nand/raw/meson_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 57cc4bd3f665..ea57ddcec41e 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) cfg |= NFC_RB_IRQ_EN; writel(cfg, nfc->reg_base + NFC_REG_CFG); - init_completion(&nfc->completion); + reinit_completion(&nfc->completion); /* use the max erase time as the maximum clock for waiting R/B */ cmd = NFC_CMD_RB | NFC_CMD_RB_INT @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) nand_controller_init(&nfc->controller); INIT_LIST_HEAD(&nfc->chips); + init_completion(&nfc->completion); nfc->dev = dev;