From patchwork Mon Oct 19 20:05:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 7439501 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D66D9F52D for ; Mon, 19 Oct 2015 20:05:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B8EB206E2 for ; Mon, 19 Oct 2015 20:05:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E86AE206D0 for ; Mon, 19 Oct 2015 20:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753584AbbJSUFa (ORCPT ); Mon, 19 Oct 2015 16:05:30 -0400 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:48669 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbbJSUF3 (ORCPT ); Mon, 19 Oct 2015 16:05:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=m8ZUwZ8D0/5p0mBTqHD+8eElErp3Qu4bf73pHfegeoc=; b=XADzs79ILZlfgGsTVCfBWYt3k35SBAidM6qnlMa6BFRy5lBJ1BIxAHbBI80LGPBpLgxfyPzK8YZzuBG5C16ClyZh2qMe7FwYB9HNqVHOlMUN1lWgPcLbXBotnziu9gmEedFGTri6DaWwRHOxKEDqn3x7BoXZfeKiZ9Gk1cKaVRw=; Received: from n2100.arm.linux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:44021) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZoGgQ-00052x-Jl; Mon, 19 Oct 2015 21:05:26 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1ZoGgM-0000wt-O6; Mon, 19 Oct 2015 21:05:22 +0100 Date: Mon, 19 Oct 2015 21:05:22 +0100 From: Russell King - ARM Linux To: Aaro Koskinen Cc: Tony Lindgren , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [BISECTED] Nokia 770 framebuffer breakage Message-ID: <20151019200522.GJ32536@n2100.arm.linux.org.uk> References: <20151019193759.GE31069@blackmetal.musicnaut.iki.fi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151019193759.GE31069@blackmetal.musicnaut.iki.fi> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Oct 19, 2015 at 10:37:59PM +0300, Aaro Koskinen wrote: > Hi, > > Somewhere between 4.1 .. 4.3-rc6 framebuffer on Nokia 770 stopped working. > > Bisection points to: > > commit 2568999835d7797afce3dcc3a3f368051ffcaf1f > Author: Russell King > Date: Mon Mar 2 15:40:29 2015 +0000 > > clkdev: add clkdev_create() helper > > The commit cannot be reverted cleanly from current trees, but I re-tested > that commit 2568999835d7797afce3dcc3a3f368051ffcaf1f does not work and > commit 2568999835d7797afce3dcc3a3f368051ffcaf1f^1 indeed works. Really need more information than that, like a kernel log or something. clk_register_clkdev() should not have changed in any way, since the change there effectively changes the sequence from: va_start(ap, dev_fmt); - cl = vclkdev_alloc(__clk_get_hw(clk), con_id, dev_fmt, ap); va_end(ap); - if (!cl) - return -ENOMEM; - clkdev_add(cl); - return 0; to: va_start(ap, dev_fmt); + cl = vclkdev_alloc(__clk_get_hw(clk), con_id, dev_fmt, ap); + if (cl) + __clkdev_add(cl); va_end(ap); + return cl ? 0 : -ENOMEM; So I'm guessing this isn't the problem. However, clk_add_alias() changes slightly, from: fmt = alias_dev_name; va_start(ap, fmt); l = vclkdev_alloc(__clk_get_hw(clk), con_id, fmt, ap) va_end(ap); - if (!l) - return -ENODEV; - clkdev_add(l); - return 0; to (effectively): fmt = "%s" va_start(ap, fmt); cl = vclkdev_alloc(__clk_get_hw(clk), con_id, fmt, ap); if (cl) clkdev_add(cl); va_end(ap); + return l ? 0 : -ENODEV; In other words, there's the addition of a "%s" in the format string which wasn't there before - which is reasonable as clk_add_alias() doesn't take a format string. This should improve the safety of the function. I guess things might go wrong if you pass a NULL alias device name? Can you try this patch please? diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index c0eaf0973bd2..779b6ff0c7ad 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -333,7 +333,8 @@ int clk_add_alias(const char *alias, const char *alias_dev_name, if (IS_ERR(r)) return PTR_ERR(r); - l = clkdev_create(r, alias, "%s", alias_dev_name); + l = clkdev_create(r, alias, alias_dev_name ? "%s" : NULL, + alias_dev_name); clk_put(r); return l ? 0 : -ENODEV;