From patchwork Tue Jan 24 07:06:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 9534111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B96F6046A for ; Tue, 24 Jan 2017 07:07:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BF5323F88 for ; Tue, 24 Jan 2017 07:07:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 503F7252D5; Tue, 24 Jan 2017 07:07:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCAE223F88 for ; Tue, 24 Jan 2017 07:07:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cVvCB-0002pk-Fo; Tue, 24 Jan 2017 07:07:11 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVvC7-0002ng-6l for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2017 07:07:09 +0000 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 23 Jan 2017 23:06:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,277,1477983600"; d="scan'208";a="216888307" Received: from peijia-mobl1.ccr.corp.intel.com (HELO rzhang1-surface) ([10.255.26.179]) by fmsmga004.fm.intel.com with ESMTP; 23 Jan 2017 23:06:40 -0800 Date: Tue, 24 Jan 2017 15:06:39 +0800 From: Zhang Rui To: Guenter Roeck Subject: Re: v4.10-rc4 to v4.10-rc5: battery regression on Nokia N900 Message-ID: <20170124070639.GA5068@rzhang1-surface> References: <20170123124058.GA17134@amd> <20170123141331.GA11402@amd> <20170123144031.GA7870@amd> <20170123232654.GA19342@amd> <20170123234912.GA2460@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170123234912.GA2460@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_230707_378641_1F954834 X-CRM114-Status: GOOD ( 26.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ivo.g.dimitrov.75@gmail.com, khilman@kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, kernel list , sre@kernel.org, abcloriens@gmail.com, Pavel Machek , pali.rohar@gmail.com, fabio.estevam@nxp.com, linux-omap@vger.kernel.org, patrikbachan@gmail.com, linux-arm-kernel , serge@hallyn.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jan 23, 2017 at 03:49:12PM -0800, Guenter Roeck wrote: > On Tue, Jan 24, 2017 at 12:26:54AM +0100, Pavel Machek wrote: > > Hi! > > > > > > >I'll try to revert it on the top of v4.10-rc5 now... and yes, it fixes > > > > >the issue. > > > > > > > > > >Any idea what went wrong and how to fix that? > > > > > > > > > >Anyway as we are at -rc5 and this is warning fix that caused a > > > > >regression on different hardware... it should be reverted. > > > > > > > > > Agreed. > > > > > > > > What exactly does "stopped working" mean ? That might help understanding > > > > what went wrong. > > > > > > /sys files related to battery no longer appear. I beieve this has > > > something to do with it: > > > > > > [ 2.374877] of_get_named_gpiod_flags: parsed 'reset-gpios' property > > > of node '/ocp@68000000/spi@48098000/tsc2005@0[0]' - status (0) > > > [ 2.375946] input: TSC2005 touchscreen as > > > /devices/platform/68000000.ocp/48098000.spi/spi_master/spi1/spi1.0/input/input5 > > > [ 2.392120] rx51-battery: probe of n900-battery failed with error > > > -22 > > > > Mystery solved: > > > > diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c > > index 3932f92..fe5ec82 100644 > > --- a/drivers/hwmon/hwmon.c > > +++ b/drivers/hwmon/hwmon.c > > @@ -545,8 +545,10 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, > > int i, j, err, id; > > > > /* Do not accept invalid characters in hwmon name attribute */ > > - if (name && (!strlen(name) || strpbrk(name, "-* \t\n"))) > > + if (name && (!strlen(name) || strpbrk(name, "-* \t\n"))) { > > + printk("hwmon: Invalid character detected: %s\n", name); > > return ERR_PTR(-EINVAL); > > + } > > > > id = ida_simple_get(&hwmon_ida, 0, 0, GFP_KERNEL); > > if (id < 0) > > > > > > pavel@n900:~$ dmesg | grep -5 Invalid > > [ 0.829650] of_get_named_gpiod_flags: parsed 'gpio-reset' property > > of node '/ocp@68000000/i2c@48072000/tlv320aic3x@19[0]' - status (0) > > [ 0.833831] tsl2563 2-0029: model 7, rev. 0 > > [ 0.837768] of_get_named_gpiod_flags: parsed 'enable-gpio' property > > of node '/ocp@68000000/i2c@48072000/lp5523@32[0]' - status (0) > > [ 1.921417] omap_i2c 48072000.i2c: controller timed out > > [ 2.056823] lp5523x 2-0032: lp5523 Programmable led chip found > > [ 2.064147] hwmon: Invalid character detected: bq27200-0 > > So the problem is really that the thermal driver needs to create a valid name. > Right. Before reverting, can you please try if this patch works or not? thanks, rui From 79320ea3721314ec29ed6cdd6987ff922b11d6f9 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Tue, 24 Jan 2017 14:11:03 +0800 Subject: [PATCH] thermal: fix parameter when registering hwmon commit 7611fb68062f ("thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()") converts thermal core to use hwmon_device_register_with_info() to register to hwmon instead of deprecated hwmon_device_register(). But at the same time, the name of the hwmon device created is changed to the thermal zone device name in this commit, which may contain incompatible characters for hwmon. Fixes it by using exactly the same parameters as before this commit. Fixes: 7611fb68062f ("thermal: thermal_hwmon: Convert to hwmon_devce_register_with_info()") Reported-by: Pavel Machek Signed-off-by: Zhang Rui --- drivers/thermal/thermal_hwmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index c4a508a..0c6789f 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -157,8 +157,8 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) INIT_LIST_HEAD(&hwmon->tz_list); strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); - hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type, - hwmon, NULL, NULL); + hwmon->device = hwmon_device_register_with_info(NULL, NULL, NULL, + NULL, NULL); if (IS_ERR(hwmon->device)) { result = PTR_ERR(hwmon->device); goto free_mem;