From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbbFDIrk (ORCPT ); Thu, 4 Jun 2015 04:47:40 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:32887 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbbFDIr3 (ORCPT ); Thu, 4 Jun 2015 04:47:29 -0400 MIME-Version: 1.0 In-Reply-To: <20150604075425.BC0E7C406CA@trevor.secretlab.ca> References: <1432625486-15442-1-git-send-email-ricardo.ribalda@gmail.com> <1432625486-15442-3-git-send-email-ricardo.ribalda@gmail.com> <20150604075425.BC0E7C406CA@trevor.secretlab.ca> From: Ricardo Ribalda Delgado Date: Thu, 4 Jun 2015 10:47:07 +0200 Message-ID: Subject: Re: [PATCH v5 2/4] base/platform: Continue on insert_resource() error To: Grant Likely Cc: Greg Kroah-Hartman , Rob Herring , Andrew Morton , Jakub Sitnicki , Vivek Goyal , Bjorn Helgaas , Jiang Liu , Mike Travis , Thierry Reding , LKML , "devicetree@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Grant On Thu, Jun 4, 2015 at 9:54 AM, Grant Likely wrote: > > I'm pretty sure this is going to break some platforms. I described it in > my earlier email today, but I'll summarize here too since this is the > latest patch set. The version that is in stable is also broken. Unloading the device tree crashes the device completely. > > Making this change allows the registration of devices to continue, but > it will still break device drivers that do a request_resource() on a > region that another device managed to claim with insert_resource(). The > only way around this is to not do insert_resource() at all, or to remove > the request_resource() from all drivers (not feasible). If we do not do insert_resource(), we will have the crash on release_resource() and a lot! of code duplication. > > I think we have to deal with it by making resource insertion optional. > I'd like to make the default be to do the insertion, and be able to > blacklist platforms that have issues. What about, making the request_resource a little bit more clever. Something like: If the resouce is not taken return ok if the resource is taken: If the requester or the current owner of the resource are device tree devices show a warning and continue. else return error Wouldn't this fix the issue and guide the developers towards a proper fix for their platform, instead of just encourage them to blacklist their platform? Thanks! > > g. > -- Ricardo Ribalda