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: 7439541 Return-Path: X-Original-To: patchwork-linux-arm@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 353B09F52D for ; Mon, 19 Oct 2015 20:07:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3680F206DD for ; Mon, 19 Oct 2015 20:07:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36297206D2 for ; Mon, 19 Oct 2015 20:07:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoGgx-0005Bu-11; Mon, 19 Oct 2015 20:05:59 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoGgt-00058V-82 for linux-arm-kernel@lists.infradead.org; Mon, 19 Oct 2015 20:05:56 +0000 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151019_130555_807314_F6FCA9D4 X-CRM114-Status: GOOD ( 16.29 ) X-Spam-Score: -4.3 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Lindgren , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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;