From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936265AbdKPRYz (ORCPT ); Thu, 16 Nov 2017 12:24:55 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54290 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759930AbdKPRYr (ORCPT ); Thu, 16 Nov 2017 12:24:47 -0500 Cc: Sudeep Holla , Linux Kernel Mailing List , Alexey Klimov Subject: Re: [PATCH] mailbox: txdone_method shouldn't always be reset To: Jassi Brar , Bjorn Andersson References: <20171116053126.28640-1-bjorn.andersson@linaro.org> From: Sudeep Holla Organization: ARM Message-ID: Date: Thu, 16 Nov 2017 17:24:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (- Remove Alexey Klimov's ARM id as he has left the company, adding his personal id instead) On 16/11/17 16:51, Jassi Brar wrote: > On Thu, Nov 16, 2017 at 11:01 AM, Bjorn Andersson > wrote: >> A client that knows how to drive txdone would temporarily "upgrade" the >> method to TXDONE_BY_ACK. But with the introduction of commit 33cd7123ac0ba >> ("mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone") >> there is no longer a distinction between a channel in "upgraded" state >> or a channel for a controller that only supports TXDONE_BY_ACK. So upon >> freeing the channel it will be "downgraded" to TXDONE_BY_POLL. >> >> But a channel that operates with the txdone method of TXDONE_BY_POLL >> requires that the controller implements the last_tx_done callback and >> that the associated hrtimer was initialized when the controller was >> registered. >> >> So the core now relies on the fact that subsequent calls to >> mbox_request_channel() "upgrades" the channel to TXDONE_BY_ACK or it >> will dereference the non-initialized hrtimer. >> > I think we just need avoid the channel not running under POLL > > Does this fix your issue? > Unfortunately only Alexey had fast reproducer of the issue reported with original commit. I will try to run on my setup, but it was hard to reproduce(mainly lack of firmware support for multiple virtual channels). I will try my best to test this. Sorry for not considering temporary "upgrade" use case. -- Regards, Sudeep