From patchwork Fri Aug 17 16:54:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10569223 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 E47CD14BD for ; Fri, 17 Aug 2018 16:54:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB46F2ACDF for ; Fri, 17 Aug 2018 16:54:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8A312BDF1; Fri, 17 Aug 2018 16:54:14 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 7B4C22ACE1 for ; Fri, 17 Aug 2018 16:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727218AbeHQT6T (ORCPT ); Fri, 17 Aug 2018 15:58:19 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:39047 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727948AbeHQT6T (ORCPT ); Fri, 17 Aug 2018 15:58:19 -0400 Received: by mail-lj1-f194.google.com with SMTP id l15-v6so6869867lji.6 for ; Fri, 17 Aug 2018 09:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:organization:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=kjsLnFot33ZLLHF24tVs2DVgjUBexKQ1isRwCmszJFA=; b=QFaYs+xRHBq1eK6scd+b9d/c1V3TDi+6Uitr3/pHAnc3XSK1PdHVzWwS+dEWcDIF1v Jsa2Az2J7V9io6YfbUzVhQH6XcI5ZSOmUE0RTeOXLjG7l4cfVGRjVpN9Y5dQSGp1WX8O 4oASdlPErX6qbTV7pgKhkT5v7sc9blOWPzJ/FWF6+EvXE5o7rtyTR4S/y4OMYQPRyP+x J5O8cOSMIa3Y8CHl9JvsdyJQi4nptRtjLBuA4nGgmaq9/ffo3ohrH40fYH7QamTIy/KK LW38iHGPgToEU59WU7kzDBmMRcz52eexG1FMS3ugR05ugrARf9L5eGy389ufalyHqaus kI5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:organization:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=kjsLnFot33ZLLHF24tVs2DVgjUBexKQ1isRwCmszJFA=; b=ZMWi0W9UJvZvG5zk+HvX+QcroqvZ+lKu2pyyas2TWhTNRQXbVpf0rSoIu03hQ2egO3 Xy0xzTMsY23sRnxxp5gCFVjyTFI0YG2Em0UB4/MCrvL8/ktXwDWNeQgfDY+5R+PGJ6am JMmvzLl3Gsx0tSr5kcjbA6FG0iBIGRVBXtcPP01On/i7s5uLuhGdOs046FCKD/UwZrGt 9o/0guVybsm41aJ7v9xrQXZhpJNamfo6H/Hv1Embo95gcCYCotdtqN9aXlRYFSZIeqFP jiQilBWiI+ddYFPpLGy558NzO+aYR44efG0vsZj5ckKpKTFybv1br1YMwT3mjAY3Re2x hVHg== X-Gm-Message-State: AOUpUlETKx5EYQKXiZuDPKr2ktHtTu8RHehHXATvT16aWPe+T9raP/hJ 8xyzmKwK5v2/YfwVj2cg0QMV2VdfNeM= X-Google-Smtp-Source: AA+uWPycPTNEwacoBBuvQ1/YlmSLOqekWK203xWsbxf/owZq8L4Fc0QTjtPaNlSl9St5VF+7tP8Xqg== X-Received: by 2002:a2e:5519:: with SMTP id j25-v6mr26170327ljb.124.1534524851623; Fri, 17 Aug 2018 09:54:11 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.84.250]) by smtp.gmail.com with ESMTPSA id q85-v6sm469731lfg.20.2018.08.17.09.54.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:54:10 -0700 (PDT) From: Sergei Shtylyov Subject: [PATCH] mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts To: Wolfram Sang , Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Organization: Cogent Embedded Message-ID: <711ef434-1208-4a9b-1c0d-519395251531@cogentembedded.com> Date: Fri, 17 Aug 2018 19:54:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-MW Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I have encountered an interrupt storm during the eMMC chip probing (and the chip finally didn't get detected). It turned out that U-Boot left the SDHI DMA interrupts enabled while the Linux driver didn't use those. Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets rid of both issues... Signed-off-by: Sergei Shtylyov --- The patch is against Ulf Hansson's 'mmc.git' repo's 'fixes' branch. drivers/mmc/host/renesas_sdhi_internal_dmac.c | 11 +++++++++++ 1 file changed, 11 insertions(+) Index: mmc/drivers/mmc/host/renesas_sdhi_internal_dmac.c =================================================================== --- mmc.orig/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ mmc/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -51,10 +51,12 @@ #define INFO1_CLEAR 0 #define INFO1_DTRANEND1 BIT(17) #define INFO1_DTRANEND0 BIT(16) +#define INFO1_RESERVED_BITS GENMASK_ULL(32, 0) /* DM_CM_INFO2 and DM_CM_INFO2_MASK */ #define INFO2_DTRANERR1 BIT(17) #define INFO2_DTRANERR0 BIT(16) +#define INFO2_RESERVED_BITS GENMASK_ULL(32, 0) /* * Specification of this driver: @@ -236,6 +238,15 @@ renesas_sdhi_internal_dmac_request_dma(s { struct renesas_sdhi *priv = host_to_priv(host); + /* + * We don't use the DMA interrupts, but they might have been enabled + * by a bootloader, so mask them to avoid an interrupt storm... + */ + renesas_sdhi_internal_dmac_dm_write(host, DM_CM_INFO1_MASK, + INFO1_RESERVED_BITS); + renesas_sdhi_internal_dmac_dm_write(host, DM_CM_INFO2_MASK, + INFO2_RESERVED_BITS); + /* Each value is set to non-zero to assume "enabling" each DMA */ host->chan_rx = host->chan_tx = (void *)0xdeadbeaf;