Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp992004ybs; Mon, 25 May 2020 04:37:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwISbEgiaOFwAfAJwREeB9fmNfW8BgQ/d3nwgcwN7WYrTH3PPXDlKXxnIWXJ/hxjk3lI73U X-Received: by 2002:a17:907:10c2:: with SMTP id rv2mr17918063ejb.309.1590406634584; Mon, 25 May 2020 04:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590406634; cv=none; d=google.com; s=arc-20160816; b=U5r1caxhgTbOIVS+npNqw4ALq5Vs5t6VJSl2WFnCRzWGjF1cRiUvLO1NUC5MhK4BXg j/UQwgDhMCvLG3zkb3eoE73mmENsMlF/7pRdDKJFeLdsLW/vmvopYXbxQoRQwfgo/vNA Vq7DUJoMoaKml5QoTQN7KAiEXgKCtj3JxcfI5oIVnW8w9cw3VzNUXYYYALqqQw2icMPf rbDz0Rla5+wAVaIzdDjGs0o44FZ/aifk6yMDDII6Zq53zRS2ZVZfsHWva2vLXmIb5q5q aPpS/aPCWQlC+vwVLCmAlFhgfXrK5wz5XNT011YnQWRkFZMuPWJRcqQRpvvGFW3yjUsK Ejyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=ei+RppXiolPjoRiI/RFWXi5BQoKUeEoa84BdSD+myV4=; b=yXGhmh4vLzdFPHqJb6QWfVzk+or9zFiudd4kJ58TWBC3H6d5qytS9VdDpGn2aHbhKz ijeFVJ6Z0iXOxn+uvMlx0AURcL6RHYyXdIgzb/l5Wnxz6qn53yb/XrB0Qh2FPjZ1U9ky yFOily5GOMU2CzcbrfNC84uaQTDgZvKgfMjiF5wzhkWTuwjQPfNZ7gBiVotK23gXwGwP 7z2oGKVcDmfO02upmutV3/VDrgO+TMeLnrw4pkAboMWdCfASJh2yo8Fhb4mxMmANnM1i bW1JaIaIWACXPTJfYeEEsZ35PNcJIm5uN/kWVo+J695tZ/XIUnsx66DBTy7UoHANoxul TMtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bjbxUQ+9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si9138018ejm.315.2020.05.25.04.36.51; Mon, 25 May 2020 04:37:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bjbxUQ+9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390192AbgEYLc2 (ORCPT + 99 others); Mon, 25 May 2020 07:32:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:54050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388733AbgEYLc1 (ORCPT ); Mon, 25 May 2020 07:32:27 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D195F20787; Mon, 25 May 2020 11:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590406346; bh=wiKO9ZZ2xlGA++fntc5tHue7H7VM7k0ZGV0z0X7E/BE=; h=From:To:Cc:Subject:Date:From; b=bjbxUQ+9O7AIW3rZSJ2V/MYQ7lfowjf+b01Pg8o9Y7sbrMjFunOJQ+kqyed9Ow3yB 0SW7Ws7esp2tIDjPUJpY7byOGS64erfIYdee/cphuPChMCnSUZLSFY/BUicdS6b6cW kfWopQodjT0h1otwWiKfY5hReiFK21iA4NaUhk1w= From: Krzysztof Kozlowski To: =?UTF-8?q?Pali=20Roh=C3=A1r?= , "Andrew F. Davis" , Sebastian Reichel , Anton Vorontsov , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [RFC] power: supply: bq27xxx_battery: Fix polling interval after re-bind Date: Mon, 25 May 2020 13:32:19 +0200 Message-Id: <20200525113220.369-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 8cfaaa811894a3ae2d7360a15a6cfccff3ebc7db. If device was unbound and bound, the polling interval would be set to 0. This is both unexpected and messes up with other bq27xxx devices (if more than one battery device is used). This reset of polling interval was added in commit 8cfaaa811894 ("bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver") stating that power_supply_unregister() calls get_property(). However in Linux kernel v3.1 and newer, such call trace does not exist. Unregistering power supply does not call get_property() on unregistered power supply. Fixes: 8cfaaa811894 ("bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver") Cc: Signed-off-by: Krzysztof Kozlowski --- I really could not identify the issue being fixed in offending commit 8cfaaa811894 ("bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver"), therefore maybe I missed here something important. Please share your thoughts on this. --- drivers/power/supply/bq27xxx_battery.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index 942c92127b6d..4c94ee72de95 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -1905,14 +1905,6 @@ EXPORT_SYMBOL_GPL(bq27xxx_battery_setup); void bq27xxx_battery_teardown(struct bq27xxx_device_info *di) { - /* - * power_supply_unregister call bq27xxx_battery_get_property which - * call bq27xxx_battery_poll. - * Make sure that bq27xxx_battery_poll will not call - * schedule_delayed_work again after unregister (which cause OOPS). - */ - poll_interval = 0; - cancel_delayed_work_sync(&di->work); power_supply_unregister(di->bat); -- 2.17.1