From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbeAXDCD (ORCPT ); Tue, 23 Jan 2018 22:02:03 -0500 Received: from vern.gendns.com ([206.190.152.46]:53181 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbeAXDCB (ORCPT ); Tue, 23 Jan 2018 22:02:01 -0500 Subject: Re: [PATCH] i2c: davinci: fix the cpufreq transition To: Bartosz Golaszewski , Sekhar Nori , Kevin Hilman , Wolfram Sang Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski References: <20180122144258.13627-1-brgl@bgdev.pl> From: David Lechner Message-ID: Date: Tue, 23 Jan 2018 21:01:54 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180122144258.13627-1-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/22/2018 08:42 AM, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > i2c_davinci_cpufreq_transition() is implemented in a way that will > block if it ever gets called while no transfer is in progress. > > Not only that, but reinit_completion() is never called for xfr_complete. > > Use the fact that cpufreq uses an srcu_notifier (running in process > context) for transitions and that the bus_lock is taken during the call > to master_xfer() and simplify the code by removing the transfer > completion entirely and protecting i2c_davinci_cpufreq_transition() > with i2c_lock/unlock_adapter(). > > Reported-by: David Lechner > Signed-off-by: Bartosz Golaszewski > --- Tested that it fixes the lockup when there is no active transfer. Tested-by: David Lechner