From mboxrd@z Thu Jan 1 00:00:00 1970 From: Petr Mladek Subject: Re: [PATCH] of/unittest: fix infinite loop in of_unittest_destroy_tracked_overlays() Date: Wed, 2 Mar 2016 15:44:05 +0100 Message-ID: <20160302144405.GC22171@pathway.suse.cz> References: <1456917889-4416-1-git-send-email-sergey.senozhatsky@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1456917889-4416-1-git-send-email-sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sergey Senozhatsky Cc: Rob Herring , Frank Rowand , Grant Likely , Andrew Morton , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sergey Senozhatsky List-Id: devicetree@vger.kernel.org On Wed 2016-03-02 20:24:49, Sergey Senozhatsky wrote: > of_overlay_destroy() can return `-ENODEV' error code once it > failed to find the requested overlay in `ov_idr'. However, > of_unittest_destroy_tracked_overlays() does not handle this > error code correctly and continues to call of_overlay_destroy() > on the 'missing' overlay over and over again. This results in > a printk flood > > [..] > [ 33.497583] of_overlay_destroy: Could not find overlay #6 > [ 33.497583] of_overlay_destroy: Could not find overlay #6 > [ 33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [ 33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [ 33.497586] of_overlay_destroy: Could not find overlay #6 > [ 33.497586] of_overlay_destroy: Could not find overlay #6 > [ 33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [ 33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [..] > > which is not really good due to printk design, and can lead to soft > lockups, hard lockups, etc. (depending on the context console_unlock() > is being called from). The problem has bee observed in real life > and reported by Ying Huang. > > This patch does not address the root cause of missing overlay in > `ov_idr', it fixes the endless loop only. > > Signed-off-by: Sergey Senozhatsky > Reported-by: kernel test robot > Link: lkml.kernel.org/r/87fuwk1c0o.fsf-5/hDr2MS57EDqwDYnZuMFFaTQe2KTcn/@public.gmane.org I am not sure why the overlay did not exist but this patch avoids a possible infinite loop and makes sense on its own. Reviewed-by: Petr Mladek Best Regards, Petr -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754277AbcCBOoK (ORCPT ); Wed, 2 Mar 2016 09:44:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:57002 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbcCBOoI (ORCPT ); Wed, 2 Mar 2016 09:44:08 -0500 Date: Wed, 2 Mar 2016 15:44:05 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: Rob Herring , Frank Rowand , Grant Likely , Andrew Morton , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH] of/unittest: fix infinite loop in of_unittest_destroy_tracked_overlays() Message-ID: <20160302144405.GC22171@pathway.suse.cz> References: <1456917889-4416-1-git-send-email-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456917889-4416-1-git-send-email-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2016-03-02 20:24:49, Sergey Senozhatsky wrote: > of_overlay_destroy() can return `-ENODEV' error code once it > failed to find the requested overlay in `ov_idr'. However, > of_unittest_destroy_tracked_overlays() does not handle this > error code correctly and continues to call of_overlay_destroy() > on the 'missing' overlay over and over again. This results in > a printk flood > > [..] > [ 33.497583] of_overlay_destroy: Could not find overlay #6 > [ 33.497583] of_overlay_destroy: Could not find overlay #6 > [ 33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [ 33.497584] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [ 33.497586] of_overlay_destroy: Could not find overlay #6 > [ 33.497586] of_overlay_destroy: Could not find overlay #6 > [ 33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [ 33.497587] ### dt-test ### of_unittest_destroy_tracked_overlays: overlay destroy failed for #6 > [..] > > which is not really good due to printk design, and can lead to soft > lockups, hard lockups, etc. (depending on the context console_unlock() > is being called from). The problem has bee observed in real life > and reported by Ying Huang. > > This patch does not address the root cause of missing overlay in > `ov_idr', it fixes the endless loop only. > > Signed-off-by: Sergey Senozhatsky > Reported-by: kernel test robot > Link: lkml.kernel.org/r/87fuwk1c0o.fsf@yhuang-dev.intel.com I am not sure why the overlay did not exist but this patch avoids a possible infinite loop and makes sense on its own. Reviewed-by: Petr Mladek Best Regards, Petr