Received: by 10.223.148.5 with SMTP id 5csp7058758wrq; Thu, 18 Jan 2018 00:02:37 -0800 (PST) X-Google-Smtp-Source: ACJfBosTdUNSJoZKUjKzPMGje64uKKpjkN2p7sGyADx6nWKAfCChf9NNPmFGhF7CyfqhkV9GzVpc X-Received: by 10.84.231.142 with SMTP id g14mr12706322plk.309.1516262556990; Thu, 18 Jan 2018 00:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516262556; cv=none; d=google.com; s=arc-20160816; b=fgc7vrvoRUZjNf1/pLlDNkpftuo2S0ycxmKvYLZz4tUJ/fPtu6mqe++Ro1G1ijpv3M iFXL/iZ/zqlc5QDC00qbvh3D8A4ERf01ivJ6qoPM+qxibiAyDNvCcP6PGf7nizLF6Pvr +h2AAiMQEScdOAG0zPcFkNEGE7O3TswqFdYuz8/aCrOjG/YnYRLBD2ERz0Wf+Gn71kxK nycEFehTs13h/6YY8Fdp3AN8ZhXC65Gr4LMrvS0cwHRs21iSOWK9hqjF2MtEpr9Qwhj4 1+raQNL8Da4S8x2UdN3o17r3fmuIWg2JAWK+4eorZUQmK8as8xapJwjNI4jwc5NCIAjw TpGQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ZrOnT07r12U7ywgcuDaivCYY5sJTuaD3kY0eqYc+haU=; b=wNxNrh5QJrxrUP9CnsmfV3LId3RKQ3COxnJUjUqob2sPrKojLItk1gadoAyj2NCp33 +zg4/9FBs9XcOtSsQk/wAxF0UNkPBTXUbaZqU/2DnffKCIhE0xi0g3AL0iPgADdeU0H8 2j5QV/HSGzdoCOb3X/ajDACnAqaeaQBtwi1NznAkZP5xuMg+eiMPqOyDS7xvB8409D7z 0Z267uEPXFuOs3LZWhRbo38b+9gRTbg4UyS7IqebtjX19IQYO6KHMg1qoBa6uCFkfcV/ hVoaGcRdLamt4iNUyQUGYQvB/YZd5MMh3mCAomisblPC/K6n2q2BS8A/X7jMfsjGjTUx Sx7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=InVvxamL; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si6226742pfg.94.2018.01.18.00.02.21; Thu, 18 Jan 2018 00:02:36 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=InVvxamL; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754818AbeARIB3 (ORCPT + 99 others); Thu, 18 Jan 2018 03:01:29 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38787 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754087AbeARIB0 (ORCPT ); Thu, 18 Jan 2018 03:01:26 -0500 Received: by mail-wm0-f44.google.com with SMTP id 141so20692888wme.3; Thu, 18 Jan 2018 00:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZrOnT07r12U7ywgcuDaivCYY5sJTuaD3kY0eqYc+haU=; b=InVvxamLkjLch3KEttm0mNllWEoRPUtd2G3THk33sECMKErFKJjFBp4y+XH08Ko5qu JFNNtRQwoBxzqLyGO7N81iRNmwXleSxzZPDhdxq3uoC4byVgWvjTUo/TuyJORyAotr2b Iv6Sjzsz8OsWwLgPXn9r6JaRrwXfWivOSDlNreexTZEZeX0ErsiUuwsNGk+c7MtTI6rZ l7Wjj9x2qeDPhaJmDwc1EHTA7H5sgxQOkGiFz88HUr1Q/Bptp28CCZfS2OF+UGOzk21o jwSD+7lnxZurk4Ml3pweSRfJLXTDRstyY3F+imhyfXVT/HSElEFd0dV6lliYWY0GQXup b1Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZrOnT07r12U7ywgcuDaivCYY5sJTuaD3kY0eqYc+haU=; b=thtqmQKfzHHtZs9208Mm2h6pSIQ2C4xL4ND2i4Q60N6y/e9Z7yK/xa/4SHoh5VHFe8 OMdTaRCTdBdHpDv1hWPt/PHxVSn8SWHHXzC/X8SgivQ5CPhOYnGUrjv0DdHVVv06upus SmILDGTwroh/2EWeoMmZCvuPUYEMxLuPRGB05plJBTxVw1s1vaBNMZzG7EJsEgUtZfjI 6PmNX7gXycXiKE6Y01nhHfUyeY4E5CHhmEXhmdxT5JVGETeZwh6aJgb1LO3tqUCCXvvh rYO208P3rT0Rvo7gD9Z25IAJBzCiMgeJtduSUIfwidsKSrDZnU8ID/A3bwBI7WCf4P1l zkmQ== X-Gm-Message-State: AKwxytdsEX1dcUCHoZ4R8hNJ3io1qfvz12JilZ9xE5OSz0oh9k6APTrq Zz1rAgy+TGGMFLFZS3WH45JMSI51rDpRzqmI5qs= X-Received: by 10.80.186.161 with SMTP id x30mr6711583ede.138.1516262485449; Thu, 18 Jan 2018 00:01:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.162.102 with HTTP; Thu, 18 Jan 2018 00:01:24 -0800 (PST) In-Reply-To: <1515400735.21044.35.camel@mhfsdcap03> 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> From: Jassi Brar Date: Thu, 18 Jan 2018 13:31:24 +0530 Message-ID: Subject: Re: FW: [PATCH v20 2/4] mailbox: mediatek: Add Mediatek CMDQ driver To: houlong wei Cc: Rob Herring , ", Matthias Brugger" , ", Daniel Kurtz" , ", Sascha Hauer" , ", Devicetree List" , ", Linux Kernel Mailing List" , ", linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, srv_heupstream" , ", Sascha Hauer" , ", Philipp Zabel" , ", Nicolas Boichat" , ", CK Hu" , ", Cawa Cheng" , ", Bibby Hsieh" , ", YT Shen" , ", Daoyuan Huang" , ", Damon Chu" , ", Josh-YC Liu" , ", Glory Hung" , ", Jiaguang Zhang" , ", Dennis-YC Hsieh" , ", Monica Wang" , ", Hs Liao" 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, 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.