Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932959AbcLTD46 (ORCPT ); Mon, 19 Dec 2016 22:56:58 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33454 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754605AbcLTD44 (ORCPT ); Mon, 19 Dec 2016 22:56:56 -0500 Date: Mon, 19 Dec 2016 19:56:53 -0800 From: Eduardo Valentin To: Heiko Stuebner Cc: Matthew Wilcox , Andrew Morton , Matthew Wilcox , Zhang Rui , "linux-kernel@vger.kernel.org" Subject: Re: thermal zones break with patch "Reimplement IDR and IDA using the radix tree" (mainline+next) Message-ID: <20161220035652.GA13923@localhost.localdomain> References: <1758112.VgMJOyEgSu@phil> <3643399.LsrOz08NF9@phil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3643399.LsrOz08NF9@phil> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2171 Lines: 60 Hey, On Sat, Dec 17, 2016 at 01:48:33AM +0100, Heiko Stuebner wrote: > Hi Matthew, > > Am Freitag, 16. Dezember 2016, 21:19:37 CET schrieb Matthew Wilcox: > > From: Heiko Stuebner [mailto:heiko@sntech.de] > > > > > commit b05bbe3ea2db ("Reimplement IDR and IDA using the radix tree") > > > seems to > > > break thermal zone allocation. This happens both on todays mainline and > > > linux-next-20161216 and produces errors like: > > > > > > > > > While I haven't looked to deeply into what idr exactly does, some > > > findings: > - thermal_zone0 and thermal_zone1 are allocated correctly > > > - every further thermal_zone always gets allocated the number "1" > > > - thermal core calls idr_alloc with 0 for both start and end > > > - the rewrite-patch seems to change the semantics of idr_alloc > > > > > > where it orignally said "@end: the maximum id (exclusive, <= 0 for > > > max)" > > > the "<= 0" part is gone now, but I checked, simply setting INT_MAX > > > as end in the thermal_core does not help > > > > > > Hi Heiko, > > > > Thanks for the report! The problem is because the thermal subsystem calls > > idr_alloc() passing a NULL pointer for the data. I have fixed this problem > > in my git tree but haven't sent the patch to Andrew yet. This patch should > > fix the problem for you: > > > http://git.infradead.org/users/willy/linux-dax.git/commitdiff/c52eeed7b759c3 > > fefe9b7f1b0a17a438df6950f3 > > yay, this fixes the issue. This should definitly go as fix into 4.10-rc and when > you send it to Andrew you can add my > > Tested-by: Heiko Stuebner > > > > Now ... thermal is actually using an IDR when it could save memory by using > > an IDA. Are you interested in doing that conversion? > > That would more be a question for Eduardo and Rui :-) . I'm just in the > process of tracking down the smallish issues on my Rockchip board that are > poping up during the merge-window. I would prefer to get the right implementation, and fixing thermal core by using IDA. But given that this touches thermal core, we need an agreement with Rui too. > > > Anyway, thanks for pointing to the fix > Heiko