From patchwork Wed Mar 27 01:50:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Hilliard X-Patchwork-Id: 10872389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92A23139A for ; Wed, 27 Mar 2019 01:51:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D14128C7A for ; Wed, 27 Mar 2019 01:51:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EE3828D5D; Wed, 27 Mar 2019 01:51:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2650428C7A for ; Wed, 27 Mar 2019 01:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732369AbfC0BvN (ORCPT ); Tue, 26 Mar 2019 21:51:13 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:56117 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732114AbfC0BvF (ORCPT ); Tue, 26 Mar 2019 21:51:05 -0400 Received: by mail-it1-f195.google.com with SMTP id z126so22930259itd.5; Tue, 26 Mar 2019 18:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5QSaziYjkmv23ZIocqo6YaM3iWHVUdwZxhQSM3dO/v4=; b=dDLDNyQyBUVfcdVQ/KkVim18X7Bi3NJNtTmtH1VWvtumD4tk6CCvpqAw16k5DaFRID 1QZKEE/pGz7JDfNgXG3vKUwQWGjfDPGh57yUbIrR7g/Tf5JtFXL6zO7FW+69Qj7GyTa5 LIvcxrrgRa9v/DAjrQP/OeXiwcgYnbceWocpdcOLURJBmS1V1fbfQpJasY5fN5w7XNdl Jk69+7doqQebaqk/HbEna6BpADnK9lCjodUo64WcbVEhKT/HrNLYVn8or4oJNC8emLZc qJkFxCCZKHm4Zsp01u3KB0V00s3eqSt/AmE/i2be9Lar+on92nmzj4VqObE4Ulp0HD8O bEFw== 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=5QSaziYjkmv23ZIocqo6YaM3iWHVUdwZxhQSM3dO/v4=; b=YS9GiohToSAoW6b/zzYSG/YbVUVqS0r4RkeZ3ttPTPQ4iCVtHaF3NpRzXtdHGX5PrD eFtrDbuKzhLineoKCpDDgP5CJ3l/TXQCs5J1QvbKvcwBl2Bw3sd0hDh9v2dGgx7aSNpL HDKz1ITk/JR7gxKJ4KGxN8ZExbmF6+YHtMjNmgdAQMudqV8sB6wLytf57qWW+x4ks6ag bICJ92cZNaeclFhVcGifv2aIg5HcJboutR1sUc0dzfmkKKCv7bvaSEC9CJkk3Ff58AIo ZdNCtmtFD3El3rOkehxe+2TfAIK94OrEjIfrqtTaYnPcRHqMsi60bIsUyr+Yyt5KgMYm TJ2w== X-Gm-Message-State: APjAAAXYIRoAHKTTwGlbXP6o5i/uEYv0Uz5Gq8Boxpwc89toqUUpIgbQ 2LLrSxE2/ApQRaI911Hoodo= X-Google-Smtp-Source: APXvYqxtISPv53sdT40H/+S5yVKZjgiPogMq/sltWCMrLw6uBCVGRUDqecXzuoWDmxh6fdvYhgJOig== X-Received: by 2002:a02:a50a:: with SMTP id e10mr26166581jam.104.1553651465007; Tue, 26 Mar 2019 18:51:05 -0700 (PDT) Received: from localhost.localdomain (c-73-242-244-99.hsd1.nm.comcast.net. [73.242.244.99]) by smtp.gmail.com with ESMTPSA id e27sm4550040ioc.14.2019.03.26.18.51.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 18:51:04 -0700 (PDT) From: George Hilliard To: Greg Kroah-Hartman Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, George Hilliard Subject: [PATCH v5 1/2] staging: mt7621-mmc: Remove obsolete Kconfig flags Date: Tue, 26 Mar 2019 19:50:56 -0600 Message-Id: <20190327015057.9568-2-thirtythreeforty@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190327015057.9568-1-thirtythreeforty@gmail.com> References: <20190327015057.9568-1-thirtythreeforty@gmail.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These values are not referred to anywhere else in the kernel. Card detect is controlled by the device tree property "mediatek,cd-poll", and there is no driver support for eMMC whatsoever. Signed-off-by: George Hilliard --- v2: Rewrite of v1 v3: [Not present] v4: Resubmit of v2 v5: No change from v4 drivers/staging/mt7621-mmc/Kconfig | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/staging/mt7621-mmc/Kconfig b/drivers/staging/mt7621-mmc/Kconfig index 1eb79cd6e22f..01f231dd8511 100644 --- a/drivers/staging/mt7621-mmc/Kconfig +++ b/drivers/staging/mt7621-mmc/Kconfig @@ -6,11 +6,3 @@ config MTK_AEE_KDUMP bool "MTK AEE KDUMP" depends on MTK_MMC -config MTK_MMC_CD_POLL - bool "Card Detect with Polling" - depends on MTK_MMC - -config MTK_MMC_EMMC_8BIT - bool "eMMC 8-bit support" - depends on MTK_MMC && RALINK_MT7628 - From patchwork Wed Mar 27 01:50:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Hilliard X-Patchwork-Id: 10872387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A83C9139A for ; Wed, 27 Mar 2019 01:51:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87F7D28C7A for ; Wed, 27 Mar 2019 01:51:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C23028D5D; Wed, 27 Mar 2019 01:51:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1588528C7A for ; Wed, 27 Mar 2019 01:51:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732371AbfC0BvH (ORCPT ); Tue, 26 Mar 2019 21:51:07 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:40151 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726922AbfC0BvG (ORCPT ); Tue, 26 Mar 2019 21:51:06 -0400 Received: by mail-it1-f196.google.com with SMTP id y63so11894488itb.5; Tue, 26 Mar 2019 18:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gmSbYUaITpcXSdME+U0+kal7ZNf0Gfb6hH7q8/011WE=; b=Nqu6cu7os2lFdqNtWLjjfqRWrdkEveSAjBmYSF4f6lE1STeKnk6bHJPWqMH6ZVIcKC hHsaCu+zSpg8Z49Pu7GD0dr09Pdr+2j3MQugkisGAUgHqhh+M6NXzbK0tT+M/2yjan7j NImC5b8MFxMUD65h2cStTmk0Q9/Fr/l4YExe4YfhfFyKgs4vD/AkFwrw0s7kQeCrQlDC 44+oobfIx5Frp/dNZnLF4VeYC2SiTwsC+zaJnsAbCydQ8LcqG+tl5uhEu2y9+PzeuTuh pvhfQ7uLuclKj8eGaS0oy0r0Crt7lw1ROP7MtYSGJJrREzlXNxMdvFA4rp4lHc26W4Ae OsOw== 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=gmSbYUaITpcXSdME+U0+kal7ZNf0Gfb6hH7q8/011WE=; b=ASgIyl4bX5SyuSWaZn8j+KbW0oLn7gv3rosp7ijxRiIyij/85EzoO+Imb5MJJqTL5X z75I8J+XuWzEZkrjYZVKzztdr+KlEktNcWx2NPFvgrRT4YHLrg9neKZSQn2+28Lr3/cH rP7dn6tJYgrF5oxjv3f6r8ijsOsekjvcpTWqDra5RRyvfQpERZE75iIKXFTDUKgd2epf WZhMZyZpJ7+J7QqX1tiX3+GVyrusP0wrydNQ9pRzN4QTPpPrFJ2ll5A7YFGfUj5d2uAa PqZkq0wcpmldOvnBNO7gt+ubUBTjzm8UYio9qNSju5Np2KPX63SuAgtUWYvwhjTEoLaR +fkQ== X-Gm-Message-State: APjAAAXuSgcEGmfZ4AtfNzU7YVGONRpiTiEDJVXg18R3UgPuWI+yatud mQqZN2pULkmHqXp1E7abvVU= X-Google-Smtp-Source: APXvYqz3ZLa9NKsVhDoO3VoijH5bWgB/9RicRK1zHrwsVDNlVHJN8f8nsX+pF+RRNldhCLh8970Qhg== X-Received: by 2002:a24:f68a:: with SMTP id u132mr1691036ith.45.1553651465975; Tue, 26 Mar 2019 18:51:05 -0700 (PDT) Received: from localhost.localdomain (c-73-242-244-99.hsd1.nm.comcast.net. [73.242.244.99]) by smtp.gmail.com with ESMTPSA id e27sm4550040ioc.14.2019.03.26.18.51.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 18:51:05 -0700 (PDT) From: George Hilliard To: Greg Kroah-Hartman Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, George Hilliard Subject: [PATCH v5 2/2] staging: mt7621-mmc: Initialize completions a single time during probe Date: Tue, 26 Mar 2019 19:50:57 -0600 Message-Id: <20190327015057.9568-3-thirtythreeforty@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190327015057.9568-1-thirtythreeforty@gmail.com> References: <20190327015057.9568-1-thirtythreeforty@gmail.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 v5: *Correct* whitespace 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..9a4b27562cd0 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)) + dev_err(mmc_dev(host->mmc), + "previous command was not handled\n"); sdr_set_bits(host->base + MSDC_INTEN, wints); sdc_send_cmd(rawcmd, cmd->arg); @@ -488,7 +492,6 @@ static unsigned int msdc_command_resp(struct msdc_host *host, MSDC_INT_ACMD19_DONE; BUG_ON(in_interrupt()); - //init_completion(&host->cmd_done); //sdr_set_bits(host->base + MSDC_INTEN, wints); spin_unlock(&host->lock); @@ -670,7 +673,13 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) //msdc_clr_fifo(host); /* no need */ msdc_dma_on(); /* enable DMA mode first!! */ - init_completion(&host->xfer_done); + + // The completion should have been consumed by the previous + // xfer response handler, because the mmc requests should be + // serialized + if (completion_done(&host->cmd_done)) + dev_err(mmc_dev(host->mmc), + "previous transfer was not handled\n"); /* start the command first*/ if (msdc_command_start(host, cmd, CMD_TIMEOUT) != 0) @@ -696,7 +705,6 @@ static int msdc_do_request(struct mmc_host *mmc, struct mmc_request *mrq) /* for read, the data coming too fast, then CRC error * start DMA no business with CRC. */ - //init_completion(&host->xfer_done); msdc_dma_start(host); spin_unlock(&host->lock); @@ -1687,6 +1695,8 @@ static int msdc_drv_probe(struct platform_device *pdev) } msdc_init_gpd_bd(host, &host->dma); + init_completion(&host->cmd_done); + init_completion(&host->xfer_done); INIT_DELAYED_WORK(&host->card_delaywork, msdc_tasklet_card); spin_lock_init(&host->lock); msdc_init_hw(host);