From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbeAWMkQ (ORCPT ); Tue, 23 Jan 2018 07:40:16 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:23206 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751056AbeAWMkO (ORCPT ); Tue, 23 Jan 2018 07:40:14 -0500 Subject: Re: [PATCH] i2c: davinci: fix the cpufreq transition To: Bartosz Golaszewski , Kevin Hilman , Wolfram Sang , David Lechner CC: , , , Bartosz Golaszewski References: <20180122144258.13627-1-brgl@bgdev.pl> From: Sekhar Nori Message-ID: <8323a87f-93fb-c1fd-4098-e47f0fcf5859@ti.com> Date: Tue, 23 Jan 2018 18:08:57 +0530 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" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 22 January 2018 08:12 PM, 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. true! > > Not only that, but reinit_completion() is never called for xfr_complete. reinit_completion() use is must only with complete_all(). At least that bug is not obvious so needs more detail to be added here. > 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 I assume you tested this on a board where I2C-controlled PMIC changes voltage during CPUfreq (DA850 LogicPD EVM should have this hardware support). Perhaps also add: Fixes: 82c0de11b734 ("i2c: davinci: Add cpufreq support") Apart from that: Reviewed-by: Sekhar Nori Thanks, Sekhar