Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp905153imm; Wed, 8 Aug 2018 07:40:30 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzdiURHThJgFP6fw5ue1z+ucNMBgWcola4Z+Wtskj6J/TL5csV45oQV3tDYSzNjS5FXgaYO X-Received: by 2002:a63:8548:: with SMTP id u69-v6mr2868273pgd.346.1533739230608; Wed, 08 Aug 2018 07:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533739230; cv=none; d=google.com; s=arc-20160816; b=b22LX9tfbJEBAdl/j1lVuruomUgkBrZPWy5q6dP4Fkc3fS4d2IfmozoKO9zAg/XA2F H9JMSw1+QFnRikVd5IkXTr2EfTSnlZMr7tqu0ypiZOxa0ulpi5A8Rh3ex2pwnOUBCmYL Anm++TxPpqgFolUEjPUFl0PlMjrtxLDkMuCw0luOIMzKuhsAdYSv7TtPFiNQcGGGgqmw uKrNfEKDVcth6UPqka4kAqSfB41pTtUGEFRHaMrldH3448GyJPUJZ5k+sYYGjC4ighmY wUyHihxttPx+ruEnULOKDic4na85Hclr4MUggbDejUWIu7/2JqDwvm8fOYT4dS5yYbbN TWjg== 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=wFvJoD2zt0ssWKLR+WZ6A5JcLvcgfN2ruGKJXyUC4rI=; b=uM/tRMBIJyh8z9N+OhNzagf+AEK4Y9q9YETCgNGm/XZ+D94P4GezMGAIrjQiABhDOa +oh8TBzUTubXSANP6rw8u0bZHEUdPa1vtbdBHTpJFKYQhkNNEBT3L7mztPcCu8DXUMUr PnjZAL7BhmFwcaiPhEZnx7SLrbt7KlowyTCTQzFKymrhtujuScSWqjAAw9neszLuGryQ Y11+8EsNBMMGLAIH6T2yO6dWoHsOb57/cGQPIuNX+eHJdyh1356Fl4JGWy8XLfv6kZsF mKzWyqvkMj0iYyg6+1FRel2MqSwRenkvXLvIhB3Hxws14khBUVN7lN7IOmXRgw5JL5fq EZ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p3rxpHsq; 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=QUARANTINE 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 h25-v6si4081974pgh.119.2018.08.08.07.40.16; Wed, 08 Aug 2018 07:40:30 -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=@gmail.com header.s=20161025 header.b=p3rxpHsq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbeHHQ7Q (ORCPT + 99 others); Wed, 8 Aug 2018 12:59:16 -0400 Received: from mail-ed1-f50.google.com ([209.85.208.50]:46736 "EHLO mail-ed1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbeHHQ7Q (ORCPT ); Wed, 8 Aug 2018 12:59:16 -0400 Received: by mail-ed1-f50.google.com with SMTP id o8-v6so1355718edt.13; Wed, 08 Aug 2018 07:39:17 -0700 (PDT) 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=wFvJoD2zt0ssWKLR+WZ6A5JcLvcgfN2ruGKJXyUC4rI=; b=p3rxpHsqtu0Q0QZ1zZgxgzEOOrl0NCpy5yDl3q4n5zAYKOY7UmDXnAJMXquA7lXgrU UPDPTOtHkUa8Gorqu+1cdmYNXV6kugwDDLFGZ5/h26pdyALgtz0CpvfZB3JRFUWn06wC bLxwWOkxVqnZMU4NdJ2S52YE6ZPFxTsU962se1ftAb3PBHPiL7p9/wTJ1TLDHIk+VR9L 2FbrRngTn9mjV1xMc16rcazr4WIOFaD7YPKjrFYHAghyszIVBNxtEjyYJ0K4vxC/4n4O zykHd1ajpKZel42fq5veGwqH+d11RGUuqCu42HavPXg+dl/KHmrGfWLjK51qzRB9wD3j CrVw== 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=wFvJoD2zt0ssWKLR+WZ6A5JcLvcgfN2ruGKJXyUC4rI=; b=AdJ+a2ZMHlqOld8+YUWnVWQ57yfzi+pZVY4q+54KsxIGiP2p9kErbNiR+KZcAIaQzf /6L6JoqF2tQK0DYHwHidyqGxB8uYRTBkdCjUok0qats+qkfojBN0K6l5XctfTWdkEzY2 9LEKYC1/+GfxNK5icVvuNvUhbTBESrg1V5hCofH5l4JKxPWU0gafZz+ZDmNE9XGsDDuI XVYP9lTM4kvBf0y8RoWTwJEtCeBWdHWPIIyNDvIv7KaSoGb6K+aKU1lnhWLfi8fdD7wG WARyUOAmQnVlD5jqVRxFCsJLD8O77V+I6LT5lnMhbXfHBKM4KhNb7LoJSBSeOKQXgUgA tTtA== X-Gm-Message-State: AOUpUlF+HhjelYlHrrzEwwl66cD+qEHaurnFk+8bSPuNeZ7wRtJSZ9f3 dK54xCFDJ7qwEPko0S5tXyB1TID2bm6vLSppof0= X-Received: by 2002:a50:af03:: with SMTP id g3-v6mr3526054edd.220.1533739156985; Wed, 08 Aug 2018 07:39:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:f68b:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 07:39:16 -0700 (PDT) In-Reply-To: References: <20180702114033.15654-1-mperttunen@nvidia.com> <20180702114033.15654-4-mperttunen@nvidia.com> <907bac36-0c54-8f38-0f5e-f59196d414c6@kapsi.fi> From: Jassi Brar Date: Wed, 8 Aug 2018 20:09:16 +0530 Message-ID: Subject: Re: [PATCH v3 3/8] mailbox: Add transmit done by blocking option To: Mikko Perttunen Cc: Mikko Perttunen , Greg KH , Thierry Reding , Jon Hunter , Devicetree List , linux-serial@vger.kernel.org, linux-tegra@vger.kernel.org, <", linux-arm-kernel"@lists.infradead.org>, srv_heupstream , srv_heupstream , Linux Kernel Mailing List 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 Wed, Aug 8, 2018 at 8:04 PM, Mikko Perttunen wrote: > > > On 08/08/2018 05:10 PM, Jassi Brar wrote: >> >> On Wed, Aug 8, 2018 at 5:08 PM, Mikko Perttunen wrote: >>> >>> >>> >>> On 04.08.2018 13:45, Mikko Perttunen wrote: >>>> >>>> >>>> On 08/03/2018 03:54 PM, Jassi Brar wrote: >>>>> >>>>> >>>>> On Mon, Jul 2, 2018 at 5:10 PM, Mikko Perttunen >>>>> wrote: >>>>>> >>>>>> >>>>>> Add a new TXDONE option, TXDONE_BY_BLOCK. With this option, the >>>>>> send_data function of the mailbox driver is expected to block until >>>>>> the message has been sent. The new option is used with the Tegra >>>>>> Combined UART driver to minimize unnecessary overhead when >>>>>> transmitting >>>>>> data. >>>>>> >>>>> 1) TXDONE_BY_BLOCK flag :- >>>>> Have you tried setting the flag >>>>> mbox_chan->mbox_client->tx_block >>>>> ? >>>> >>>> >>>> >>>> No - I suppose I should have done that. I'm a bit concerned about >>>> overhead >>>> as send_data may be called thousands of times per second, so I tried to >>>> make >>>> it as close as possible to the downstream driver that just pokes the >>>> mailbox >>>> register directly. >>> >>> >>> >>> I tried using polling in the mailbox framework. Some printing is done >>> from >>> atomic context so it seems tx_block cannot be used - >>> wait_for_completion_timeout understandably does not work in atomic >>> context. >>> I also tried without tx_block, in which case I got some horribly garbled >>> output, but "Try increasing MBOX_TX_QUEUE_LEN" was readable there. >>> >>> Any opinions? >>> >> The problems arise because your hardware (SM) supports TXDONE_BY_POLL, >> but your client drives it by TXDONE_BY_ACK because the older DB >> channels are so. >> >> Please populate SM channels as a separate controller than DB. >> The DB controller, as is, run by ACK method. >> The SM controller should be run by polling, i.e, set txdone_poll = >> true and the poll period small enough. The virtual tty client driver >> should be able to safely set tx_block from appropriate context. >> > > Sorry, I should have clarified that I already split up the controllers. The > SM controller has txdone_poll = true. I didn't adjust txpoll_period so I > guess it's zero. > Can you please share your code (controller and client) ? Maybe offline if you wish.