From patchwork Tue Mar 29 12:00:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 8686321 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 DC12C9F36E for ; Tue, 29 Mar 2016 12:01:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83917202FE for ; Tue, 29 Mar 2016 12:00:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97A6C202C8 for ; Tue, 29 Mar 2016 12:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753019AbcC2MAz (ORCPT ); Tue, 29 Mar 2016 08:00:55 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:33014 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975AbcC2MAy (ORCPT ); Tue, 29 Mar 2016 08:00:54 -0400 Received: by mail-io0-f196.google.com with SMTP id g185so2308066ioa.0; Tue, 29 Mar 2016 05:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=4hupFqsAd6BQr9T/15ZO5FHIMKjh4V3IxcDJJIPwJ2w=; b=H8C7jACyeJh0j8PTwwyHKisijjTAxcz6MOuO/XW0L5UvHKShVFShhnjQL4RerpVYVt CD6Ddu9t88AuDGomx4oEDsFSoVmB/O0UeL4Wlo990cSZh6khgW0IhBBrX4eDBxqIV3s2 t3wTJX090SjyvajHMCQr0jD+eby8EuQ0p2e44pq/8RwK/ByPVK1I1ibadbKLwyQJb2fH qVq2ccN+ZrdR7c48rsisJDerXYeIav+F4vSG0mGFDKag75Kg9bTIAvHy1MBnJF2GwzPc x/4wGywGBay6gIpSRr4bcRmLsQcDhAA0uYmFjpt/28cAcYT9GdESM+y/jh+pRjqadtGa LQ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=4hupFqsAd6BQr9T/15ZO5FHIMKjh4V3IxcDJJIPwJ2w=; b=F4x1B+qdmW4+wzyNdl/VQgpZe+Gsk+NQmO3yXJM01UCE3W67q1saRpNUNrnvjc2YdP g6oVmd+1pVj6/YYUeuvKnWEnk0IgYuGpXAaschIwZnstZAd6xxDeoN1BroOdMCxiKKtX DRGToHdDWWTXVVtW7djE81wEe89jniyJ2vd4I/ibD7spciM26PliVGPfVk/Ic6CEzjmA 3hWAfczir5R/PIxcEHjquqf2DJrCYzy+lsL8CSfRCmogV59lreQBpfX2IR3rm4Jdvd4l XAYbae1LSsT4BYXRARnmuwZ6sirLB1Q6JU8COxM+VgRmj9Ogdvkn2y+W2qAOsQNCi5Dr qmig== X-Gm-Message-State: AD7BkJLj9qfOSHbU8A9ZKFhTPhSjCvHlRgsAqtVQ1RpJj1P1PygBT+YrbJDAjEhQwD5cPcSfUKQukBKun/Oz3g== MIME-Version: 1.0 X-Received: by 10.107.26.203 with SMTP id a194mr2626122ioa.115.1459252852864; Tue, 29 Mar 2016 05:00:52 -0700 (PDT) Received: by 10.107.31.77 with HTTP; Tue, 29 Mar 2016 05:00:52 -0700 (PDT) In-Reply-To: <20160327090859.GH5028@sirena.org.uk> References: <1458587912-32665-1-git-send-email-broonie@kernel.org> <1458587912-32665-2-git-send-email-broonie@kernel.org> <56F0624C.8010004@gmail.com> <20160327090859.GH5028@sirena.org.uk> Date: Tue, 29 Mar 2016 14:00:52 +0200 X-Google-Sender-Auth: uU79_yy9B2cQWC1vRHKVIfxV8_M Message-ID: Subject: Re: [PATCH 2/2] regulator: core: Ensure we are at least in bounds for our constraints From: Geert Uytterhoeven To: Mark Brown Cc: Bjorn Andersson , Krzysztof Kozlowski , Ivaylo Dimitrov , Liam Girdwood , "linux-kernel@vger.kernel.org" , Ulf Hansson , linux-mmc , linux-samsung-soc , Javier Martinez Canillas , Marek Szyprowski , linux-renesas-soc@vger.kernel.org Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 Hi Mark, On Sun, Mar 27, 2016 at 11:08 AM, Mark Brown wrote: > On Sat, Mar 26, 2016 at 04:50:41PM -0700, Bjorn Andersson wrote: > >> Reinstating the following snippet in of_get_regulation_constraints() >> sort this out: > >> if (constraints->min_uV && constraints->max_uV) >> constraints->apply_uV = true; > > The existing check in the patch should be an || not an ==, or possibly > we should just not bother looking for min_uV at all. I just pushed out > a version of that, let's see how that goes. Has the fix really been pushed out? With commit fa93fd4ecc9c58475abac6db93a797bff893bc16 Author: Mark Brown Date: Mon Mar 21 18:12:52 2016 +0000 regulator: core: Ensure we are at least in bounds for our constraints I see a few cases of ------------[ cut here ]------------ WARNING: CPU: 1 PID: 31 at drivers/regulator/core.c:2223 _regulator_disable+0x2c/0x128 unbalanced disables for SDHI0 VccQ Modules linked in: CPU: 1 PID: 31 Comm: kworker/1:1 Not tainted 4.6.0-rc1-koelsch-00724-g58d619227282dc16 #2422 Hardware name: Generic R8A7791 (Flattened Device Tree) Workqueue: events_freezable mmc_rescan sh_mobile_sdhi ee140000.sd: could not set regulator OCR (-22) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x7c/0x9c) [] (dump_stack) from [] (__warn+0xcc/0xfc) [] (__warn) from [] (warn_slowpath_fmt+0x34/0x44) [] (warn_slowpath_fmt) from [] (_regulator_disable+0x2c/0x128) [] (_regulator_disable) from [] (regulator_disable+0x30/0x60) [] (regulator_disable) from [] (tmio_mmc_set_ios+0xb8/0x1d4) [] (tmio_mmc_set_ios) from [] (mmc_power_off+0x34/0x54) [] (mmc_power_off) from [] (mmc_rescan+0x214/0x30c) [] (mmc_rescan) from [] (process_one_work+0x1bc/0x2f4) [] (process_one_work) from [] (worker_thread+0x2a8/0x3d0) [] (worker_thread) from [] (kthread+0xd8/0xec) [] (kthread) from [] (ret_from_fork+0x14/0x2c) ---[ end trace 1c61a7f6221c11ea ]--- when booting on r8a7791/koelsch. I'm a bit confused by the discussion of "&&" vs. "||" vs. "==", but the warnings do go away when using "!=", cfr. the whitespace-damaged patch below. Gr{oetje,eeting}s, Geert --- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -43,7 +43,7 @@ static void of_get_regulation_constraints(struct device_node * constraints->max_uV = pval; /* Voltage change possible? */ - if (constraints->min_uV && constraints->max_uV) { + if (constraints->min_uV != constraints->max_uV) { constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE; constraints->apply_uV = true; }