From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jassi Brar Subject: Re: FW: [PATCH v20 2/4] mailbox: mediatek: Add Mediatek CMDQ driver Date: Thu, 18 Jan 2018 13:31:24 +0530 Message-ID: References: <1483499169-16329-1-git-send-email-hs.liao@mediatek.com> <1483499169-16329-3-git-send-email-hs.liao@mediatek.com> <1485419833.990.1.camel@mtksdaap41> <1486359476.11424.33.camel@mtksdaap41> <1487733150.15869.11.camel@mtksdaap41> <1487854104.17813.1.camel@mtksdaap41> <497f8e4ef7ae4c8a9b7b4ab259801306@mtkmbs01n1.mediatek.inc> <1515400735.21044.35.camel@mhfsdcap03> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <1515400735.21044.35.camel@mhfsdcap03> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: houlong wei Cc: Rob Herring , ", Matthias Brugger" , ", Daniel Kurtz" , ", Sascha Hauer" , ", Devicetree List" , ", Linux Kernel Mailing List" , ", linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, srv_heupstream" , ", Sascha Hauer" , ", Philipp Zabel" , ", Nicolas Boichat" , ", CK Hu" , ", Cawa Cheng" , ", Bibby Hsieh" , ", YT Shen" , ", Daoyuan Huang" , ", Damon Chu" List-Id: devicetree@vger.kernel.org On Mon, Jan 8, 2018 at 2:08 PM, houlong wei wrote: > Hi Jassi, > > Sorry for reply so late. > According to previous discussion, there are two methods to move > dma_map_single() outside of spin_lock. > (1) put in mtk-cmdq-helper.c, as described by HS on 2017-02-09. > > I think a trade-off solution is to put in mtk-cmdq-helper.c. > > Although it is a mailbox client, it is not a CMDQ client. > > We can include mailbox_controller.h in mtk-cmdq-helper.c (instead of > mtk-cmdq.h), and then map dma at cmdq_pkt_flush_async before > mbox_send_message. > > > pkt->pa_base = dma_map_single(client->chan->mbox->dev, pkt->va_base, > > pkt->cmd_buf_size, DMA_TO_DEVICE); > (2) schedule a tasklet in send_data(). > > After internal discussion with HS and other experts, now we prefer > method (1). > How do you think about it? > I don't exactly see how you mean but please remember send_data() callback is supposed to be atomic ... it is protected by spin_lock_irqsave/restore in drivers/mailbox/mailbox.c:msg_submit() BTW, how many requests max can be queued in the GCE h/w buffer? And since it's been over a year now, could you please resubmit after checking for checkpatch with the --strict option? Thanks. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html