Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1679941

Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Jassi Brar <jaswinder.singh@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone
Date Mon, 03 Jul 2017 14:00:03 +0200
Message-ID <tZ8bh-R2-35@gated-at.bofh.it> (permalink)
References <tY5S9-77y-9@gated-at.bofh.it> <tYoL8-2ta-3@gated-at.bofh.it> <tZ5n4-78c-39@gated-at.bofh.it> <tZ5ZM-7Eb-21@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7tLQqTN5IgMC7e+ynJw5FFCftmtUlGznUy3gSpfD4eg=; b=ak+OmdYuW8xWk8jXwSPgBra4v0udCAbUriUutY34c8dZqgbTssRIUTyZS9dJGFVgNU f+lzCooPFBQ0jIBuhT07gz/ji1ErkCGWo2HPO5pMs/LyigH9DMOF4rK/zbi5+IDVBVVF VQ/WWMMQEJ9V002Pd0/T9XcnEhG2a1v1o09/c=
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=7tLQqTN5IgMC7e+ynJw5FFCftmtUlGznUy3gSpfD4eg=; b=ldUFctxH1e5z1xEWy4pt66b99+mi10ANtB6tEBTSkkGBxiyNM8V6kMBNbrIe0YYR/r zkItZbNdiVVRMj7fr/RKWvjE6TFwuTBqY74bWjP2x3EthbeDEUd5RdGUDdV/DwerP/hQ jDJ3M8tTHWIZzWFpKhqu8QYc7rbnW3FCyrEkgD1rir3YUpxOPKUuySpw8Z+7hvEhdujp qY5SybyBPpbSCRRLZeMN+llDSTU83HFBCUqoULsoKLMxV+fg3yCOy+2B4BADuLsCq433 5Pxqex65W1DdI/pjWKkYiaK6Gqe2fkUXsaTjwC0SCih1h6oJAR0mqHjNCn1lWn53ZjIR waCA==
X-Gm-Message-State AKS2vOygnqD/e8X3j/ZMtvyCg5KxzKbZ0tzVRiw5Y602A3kq5jB0jktj Cw2bQZ/OSmu0OipGlwtLFtTedWqruCne
X-Received by 10.31.234.3 with SMTP id i3mr18938051vkh.115.1499082617256; Mon, 03 Jul 2017 04:50:17 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 70
Organization linux.* mail to news gateway
X-Original-Cc Jassi Brar <jassisinghbrar@gmail.com>, LKML <linux-kernel@vger.kernel.org>, Alexey Klimov <alexey.klimov@arm.com>
X-Original-Date Mon, 3 Jul 2017 17:20:16 +0530
X-Original-Message-ID <CAJe_Zhef4ngvGXaC0NBFQ08WKbgdT8OdGO+77OkgZ=XwvPnTWw@mail.gmail.com>
X-Original-References <1498835681-23975-1-git-send-email-sudeep.holla@arm.com> <CABb+yY304w2TC8GBAKfuVoRMzQoyf1qikDsd_13NFw+R-X+cpg@mail.gmail.com> <3c542b86-4de1-3c97-5e2d-1335115ac9a3@arm.com> <e9879734-e082-2e50-0ab6-6d3a765199c7@arm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1679941

Show key headers only | View raw


On 3 July 2017 at 15:05, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 03/07/17 09:57, Sudeep Holla wrote:
>>
>>
>> On 01/07/17 12:25, Jassi Brar wrote:
>>> On Fri, Jun 30, 2017 at 8:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>> Currently the mailbox framework sets txdone_method to TXDONE_BY_POLL if
>>>> the controller sets txdone_by_poll. However some clients can have a
>>>> mechanism to do TXDONE_BY_ACK which they can specify by knows_txdone.
>>>> However, we endup setting both TXDONE_BY_POLL and TXDONE_BY_ACK in that
>>>> case. In such scenario, we may end up with below warnings as the tx
>>>> ticker is run both by mailbox framework and the client.
>>>>
>>>> WARNING: CPU: 1 PID: 0 at kernel/time/hrtimer.c:805 hrtimer_forward+0x88/0xd8
>>>> CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.12.0-rc5 #242
>>>> Hardware name: ARM LTD ARM Juno Development Platform
>>>> task: ffff8009768ca700 task.stack: ffff8009768f8000
>>>> PC is at hrtimer_forward+0x88/0xd8
>>>> LR is at txdone_hrtimer+0xd4/0xf8
>>>> Call trace:
>>>>  hrtimer_forward+0x88/0xd8
>>>>  __hrtimer_run_queues+0xe4/0x158
>>>>  hrtimer_interrupt+0xa4/0x220
>>>>  arch_timer_handler_phys+0x30/0x40
>>>>  handle_percpu_devid_irq+0x78/0x130
>>>>  generic_handle_irq+0x24/0x38
>>>>  __handle_domain_irq+0x5c/0xb8
>>>>  gic_handle_irq+0x54/0xa8
>>>>
>>>> This patch fixes the issue by resetting TXDONE_BY_POLL if client has set
>>>> knows_txdone.
>>>>
>>>> Cc: Alexey Klimov <alexey.klimov@arm.com>
>>>> Cc: Jassi Brar <jaswinder.singh@linaro.org>
>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>>> ---
>>>>  drivers/mailbox/mailbox.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
>>>> index 537f4f6d009b..8da30f833262 100644
>>>> --- a/drivers/mailbox/mailbox.c
>>>> +++ b/drivers/mailbox/mailbox.c
>>>> @@ -351,7 +351,7 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
>>>>         init_completion(&chan->tx_complete);
>>>>
>>>>         if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
>>>> -               chan->txdone_method |= TXDONE_BY_ACK;
>>>> +               chan->txdone_method = TXDONE_BY_ACK;
>>>>
>>> It has to be restored back in mbox_free_channel()
>>
>> Ah right, will fix and repost.
>>
>
> I was too fast to response, I see we already take care of that in free
> channel. So I think it should be fine as is.
>
>         if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK))
>                 chan->txdone_method = TXDONE_BY_POLL;
>
You were too fast this time :)

chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK)

  is not same as

(chan->txdone_method == TXDONE_BY_POLL || chan->txdone_method == TXDONE_BY_ACK)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone Sudeep Holla <sudeep.holla@arm.com> - 2017-06-30 17:20 +0200
  Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone Jassi Brar <jassisinghbrar@gmail.com> - 2017-07-01 13:30 +0200
    Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client  knows_txdone Sudeep Holla <sudeep.holla@arm.com> - 2017-07-03 11:00 +0200
      Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client  knows_txdone Sudeep Holla <sudeep.holla@arm.com> - 2017-07-03 11:40 +0200
        Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone Jassi Brar <jaswinder.singh@linaro.org> - 2017-07-03 14:00 +0200
          Re: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client  knows_txdone Sudeep Holla <sudeep.holla@arm.com> - 2017-07-03 15:00 +0200
  [UPDATE][PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone Sudeep Holla <sudeep.holla@arm.com> - 2017-07-03 18:50 +0200

csiph-web