From patchwork Fri Jun 16 06:06:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9790599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35AF860326 for ; Fri, 16 Jun 2017 06:06:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 259C9205AD for ; Fri, 16 Jun 2017 06:06:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19C942861F; Fri, 16 Jun 2017 06:06:33 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 EB12B2858E for ; Fri, 16 Jun 2017 06:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751906AbdFPGGa (ORCPT ); Fri, 16 Jun 2017 02:06:30 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:42525 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751879AbdFPGGa (ORCPT ); Fri, 16 Jun 2017 02:06:30 -0400 Received: from penelope.horms.nl (52D9BC73.cm-11-1c.dynamic.ziggo.nl [82.217.188.115]) by kirsty.vergenet.net (Postfix) with ESMTPA id 8F2C425B7AB; Fri, 16 Jun 2017 16:06:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1497593188; bh=WhEBKZAJvffk5KN1eG4NPFMwEnWim10c7S+/gTjLOw0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lErdtPgLn4xj7anUFyZ+xUqb1XbGKvB7faRjbTzvJNbylEga3reRv6rExNRk8C7Xv Vy700qgvWixwsKq47JKc5BH2ZJ8NvA08+SNe++WR+pBAEcAQ6auNrlrYLSDWuqNT+l JL9J2Ncld4xHpFP2CS78P7ZpLhaKS/tiWIRpSDXA= Received: by penelope.horms.nl (Postfix, from userid 7100) id 9D132E230CD; Fri, 16 Jun 2017 08:06:08 +0200 (CEST) Date: Fri, 16 Jun 2017 08:06:08 +0200 From: Simon Horman To: Geert Uytterhoeven Cc: Wolfram Sang , Ulf Hansson , Magnus Damm , Linux MMC List , Linux-Renesas Subject: Re: [PATCH/RFC 2/5] mmc: tmio: add complete to DMA ops Message-ID: <20170616060602.GA16534@verge.net.au> References: <1496927368-18897-1-git-send-email-horms+renesas@verge.net.au> <1496927368-18897-4-git-send-email-horms+renesas@verge.net.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions BV User-Agent: Mutt/1.5.23 (2014-03-12) 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 On Fri, Jun 09, 2017 at 09:35:20AM +0200, Geert Uytterhoeven wrote: > Hi Simon, > > On Thu, Jun 8, 2017 at 3:09 PM, Simon Horman wrote: > > Add complete to DMA ops to allow DMAC implementation dependent > > handling of DMA completion. > > > > Signed-off-by: Simon Horman > > --- > > drivers/mmc/host/tmio_mmc.h | 1 + > > drivers/mmc/host/tmio_mmc_core.c | 10 ++++++++-- > > 2 files changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h > > index 9c94b6eb9b49..82725f9de359 100644 > > --- a/drivers/mmc/host/tmio_mmc.h > > +++ b/drivers/mmc/host/tmio_mmc.h > > @@ -121,6 +121,7 @@ struct tmio_mmc_dma_ops { > > struct tmio_mmc_data *pdata); > > void (*release)(struct tmio_mmc_host *host); > > void (*abort)(struct tmio_mmc_host *host); > > + void (*complete)(struct tmio_mmc_host *host); > > }; > > > > struct tmio_mmc_host { > > diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c > > index 0e76e099dc7f..26fe9bb64849 100644 > > --- a/drivers/mmc/host/tmio_mmc_core.c > > +++ b/drivers/mmc/host/tmio_mmc_core.c > > @@ -86,6 +86,12 @@ static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host) > > host->dma_ops->abort(host); > > } > > > > +static inline void tmio_mmc_complete_dma(struct tmio_mmc_host *host) > > +{ > > + if (host->dma_ops) > > + host->dma_ops->complete(host); > > I believe this will cause a crash and thus break bisection, as no driver > fills in the complete pointer yet. Indeed. And it seems to cause a panic on non-Gen3 users of the driver. I think the fix should be: > > > +} > > + > > void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i) > > { > > host->sdcard_irq_mask &= ~(i & TMIO_MASK_IRQ); > > @@ -604,11 +610,11 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat) > > > > if (done) { > > tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND); > > - complete(&host->dma_dataend); > > + tmio_mmc_complete_dma(host); > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds > --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 26fe9bb64849..9ec2e933b6f0 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -88,7 +88,7 @@ static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host) static inline void tmio_mmc_complete_dma(struct tmio_mmc_host *host) { - if (host->dma_ops) + if (host->dma_ops && host->dma_ops->complete) host->dma_ops->complete(host); }