Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5444931ybi; Tue, 28 May 2019 13:13:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyElLX5sra8Dr1lNgdkEdAJbOBWIwlHqdPSLJw7ZuMnj+Gez+G7Mtl4Vs58qQGqJEldavws X-Received: by 2002:a17:90a:fa0d:: with SMTP id cm13mr8259041pjb.115.1559074431992; Tue, 28 May 2019 13:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559074431; cv=none; d=google.com; s=arc-20160816; b=HRW1hFwelleJ44UkEK/8iNRXTRNYjh8y705CamjqghZiChDFsTMfOgaKbO2dWhaRSG 6AhLIUgIA8oV9cOZfVO1kUo5nNwcnRhA2nhELsak6YPCPCV3L7dNOzdR1XwpdbvD8+l5 6j1uqtKZtjEn0x/H63yddo/GH0GEYsX1o37ndnyJxRCd1l3NMMC3TeyEPrK6WVjFUJG7 1aJtxNkhCloQAOosFfQap1VV2i1AbDj/q5G8Akug5VuBqN2GNff4kLTTw1rIaRFIqibR NWUCaRoZSpjfKg836Jk/NLVEpWp1JvIpmRIG9cxSoYiqOf4wIveJAocfRjTWULbJBJVL BBAg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=gi/kDB0T8blaZ4N3Go9mHKUpJE7iS399aaXlXpsJB/M=; b=Ic2u97xnmJHiNR/s6d1RJjbvAuA31wAnwNsG+Tep6z1PRv9vm6HLs85xPEvRZza71k EOBOye/eS1XAUAywR9s/MFg+KZ/9eXY1DgSP+7Py/PXs9RkQyrlOpMfa5WTp8kmcgyjx TjrKev6RKKqHaq5dTWtzbjW0sy35WgpWqC7INao8XEgzV5LWEv2DZ4UBtSMdHNyMtarD 1yQ4mNx/UHy0rMcjR5O8oJlbUaN6TSiteuqR8D/+wMSMg40MQ/mKdMKsv9NIKXZ3HqGx 6Pj5ixfVPa9DW5pRFiG/pJTbOWJOLcV9XhfNI4X34+GPC8Vp3uEKwnq8UUP+pTvv+nm2 pPrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JLxYOnmD; 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 cg6si12954952plb.350.2019.05.28.13.13.35; Tue, 28 May 2019 13:13: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=JLxYOnmD; 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 S1727565AbfE1UMd (ORCPT + 99 others); Tue, 28 May 2019 16:12:33 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:43620 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbfE1UMc (ORCPT ); Tue, 28 May 2019 16:12:32 -0400 Received: by mail-vs1-f68.google.com with SMTP id d128so106791vsc.10 for ; Tue, 28 May 2019 13:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gi/kDB0T8blaZ4N3Go9mHKUpJE7iS399aaXlXpsJB/M=; b=JLxYOnmDJcrvrx0TjCujM/n0knfusm2CntjGzV4VPzAD+EFhlo8bMTG9t7aal/sQvQ KPH6TmOjB26vlVux4qFF2O7y0N3OLKr3gAJH/DJGCfmBrsadoIeWKCNpm3fBOPswf3Ba 6by4zMVQHchTKPYZV4Sc0dM7vt5MIxMKhWGK8F+toGpf0xixHkbFMljAUDpVxZ/LNjen fxCbCXU8wIgSXM+/Nytt81ZkmCUgDWHkB1l6JSa87KEV9ETuHHhjodSJ1RBbqtHpA8SJ fE8OC9iG1QauEooEVyrRXOLAFESuw9fIG7TkKzagGOcjZoImxM5Z7R51VbDlxDGe0BcB fH2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gi/kDB0T8blaZ4N3Go9mHKUpJE7iS399aaXlXpsJB/M=; b=l0HH1eumkjUP2kUO8k27iw8S0IREryIIYK3vgdDqlA2/dJGvKDULM5BUKQpeco2pcm RWAXJMg/ZWZe9RNCUiNvIftkODSnGhblhwO4yLh22cUpyWoD4vN40e3kOmgifpeR0OKL 9keSoHnoaXvqu/9wB7bFUKFLdqgeUKVaDC4xwW1Fxk3qgbL6EMj4ZztWBeW0fwTealBV 9EIMEre1jUiHC688dmXmqEaWAGCdaAmJjG30swpB2f/6kpK4aecfX8V/dG87mQb9n0Yd B4CiX2jfRRx3gznVHDslJmDwYGmQ3E6yiqc7bKNieUn7S/meYNpHBo40KxOuUYzu9JSQ eg0Q== X-Gm-Message-State: APjAAAWkYhzwgB5aXO0lkajlEhqbO7HBh0ZY6w3p4xt65IYdUQ/nbqka pf4LB7n264LVn68WXj36FwQh/yMMFC+nrkN/I/jQ9g== X-Received: by 2002:a67:ebc5:: with SMTP id y5mr75082391vso.34.1559074351753; Tue, 28 May 2019 13:12:31 -0700 (PDT) MIME-Version: 1.0 References: <20190524111053.12228-1-masneyb@onstation.org> <70782901-a9ac-5647-1abe-89c86a44a01b@intel.com> <20190524154958.GB16322@basecamp> <20190526122136.GA26456@basecamp> <20190526195819.GA29665@basecamp> <20190527093711.GA853@basecamp> <20190527125026.GA4272@basecamp> In-Reply-To: <20190527125026.GA4272@basecamp> From: Ulf Hansson Date: Tue, 28 May 2019 22:11:55 +0200 Message-ID: Subject: Re: Issue with Broadcom wireless in 5.2rc1 (was Re: [PATCH] mmc: sdhci: queue work after sdhci_defer_done()) To: Brian Masney , Adrian Hunter Cc: Arend Van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Faiz Abbas , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , linux-arm-msm , Kalle Valo , linux-wireless , brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, netdev@vger.kernel.org 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 Mon, 27 May 2019 at 14:50, Brian Masney wrote: > > On Mon, May 27, 2019 at 03:08:07PM +0300, Adrian Hunter wrote: > > On 27/05/19 12:37 PM, Brian Masney wrote: > > > On Sun, May 26, 2019 at 03:58:19PM -0400, Brian Masney wrote: > > >> I attached a patch that shows how I was able to determine what had > > >> already claimed the host. > > > On Mon, May 27, 2019 at 10:48:24AM +0300, Adrian Hunter wrote: > > >> This is because SDHCI is using the IRQ thread to process the SDIO card > > >> interrupt (sdio_run_irqs()). When the card driver tries to use the card, it > > >> causes interrupts which deadlocks since c07a48c26519 ("mmc: sdhci: Remove > > >> finish_tasklet") has moved the tasklet processing to the IRQ thread. > > >> > > >> I would expect to be able to use the IRQ thread to complete requests, and it > > >> is desirable to do so because it is lower latency. > > >> > > >> Probably, SDHCI should use sdio_signal_irq() which queues a work item, and > > >> is what other drivers are doing. > > >> > > >> I will investigate some more and send a patch. > > > > Please try the patch below: > > > > From: Adrian Hunter > > Date: Mon, 27 May 2019 14:45:55 +0300 > > Subject: [PATCH] mmc: sdhci: Fix SDIO IRQ thread deadlock > > > > Since commit c07a48c26519 ("mmc: sdhci: Remove finish_tasklet"), the IRQ > > thread might be used to complete requests, but the IRQ thread is also used > > to process SDIO card interrupts. This can cause a deadlock when the SDIO > > processing tries to access the card since that would also require the IRQ > > thread. Change SDHCI to use sdio_signal_irq() to schedule a work item > > instead. That also requires implementing the ->ack_sdio_irq() mmc host op. > > > > Signed-off-by: Adrian Hunter > > Fixes: c07a48c26519 ("mmc: sdhci: Remove finish_tasklet") > > Yes, this fixes the issue for me. You can add my: > > Reported-by: Brian Masney > Tested-by: Brian Masney > Applied for fixes, thanks! Kind regards Uffe