From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70135CF34B0 for ; Thu, 3 Oct 2024 16:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=whn+Cx3dK6wsTxoow/LmLdI8x1w4urJzWvrD3UPss5c=; b=Q4UBoi6+7uvd+VxXSgHczZWQHn TJOe/L0nXrfzh2siL5iZu/fy1AKWVcTy3bxYicOppy1UUwvrlb21OPke2BMZt+CIg+X+y43OgO9b0 ulZELbNo3L8ud0OrL1HOnNCqyajBjwqmI5uAVbID3J9eVz4X98bqlOURi0QsTuWSKxwpBij79QEXI c6atn9oYM7aqtzwi9TuHexi9Rr16PO/1ov10+j/dgtiD08OTsMlwDIBQ2E7yEPPDTC/uIgkMx13Ka cfnCMvu/Bu9bm5Xpoeba7KSMqS3NgOCZ8PAqbbXEGNaWfmQd5VZKQ3SiDJEhgYi+fynw5IpBkDGKl d/+SXT/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swONA-00000009kUh-2NEm; Thu, 03 Oct 2024 16:08:12 +0000 Received: from bali.collaboradmins.com ([148.251.105.195]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swON7-00000009kTQ-24lJ for linux-mediatek@lists.infradead.org; Thu, 03 Oct 2024 16:08:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1727971686; bh=PuxGYKkgO89wMpd84+jo7uDfhXlwBQz2azp6oxMgkfA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HXNRVvxhkf69StUkFUdq3YT3bbby40eacs9Rp2afZBkucUBEszAtpkzaUdYXBF5Qh k9715amVaUim9usnO43x3gtaMiU3IzLWqoiRKxvBV5zrmZH+ikvz/Ai4DAWayB+Ic9 D/ppX8EgSu8wf1B0T3LXFj6ZgQT0FmvkdmUGQ5NEqSay4C6Jn7vUTQKsw39Y+stAwu NzG4bbelCFyy1UWvRNdixNn8noWGx+xIRvLH1C+YRVXXNxGDYYechstYO9cUc5a7y7 IWiUcXEUoKYlOXFyowkSkdW5Z7VqXrpU46qB7ixChWmsSoXn7tBIGVUbtuVe99urzB LKdJhaYsdvdmQ== Received: from notapiano (pool-100-2-116-133.nycmny.fios.verizon.net [100.2.116.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3412F17E3611; Thu, 3 Oct 2024 18:08:05 +0200 (CEST) Date: Thu, 3 Oct 2024 12:08:03 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: Alper Nebi Yasak Cc: chrome-platform@lists.linux.dev, linux-pm@vger.kernel.org, AngeloGioacchino Del Regno , Sebastian Reichel , Benson Leung , Guenter Roeck , Tzung-Bi Shih , Pin-yen Lin , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: Erroneous sbs-battery sysfs info a MT8173 Chromebook Message-ID: References: <6e341522-70f6-413c-b9ba-8ac86a19b5f3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6e341522-70f6-413c-b9ba-8ac86a19b5f3@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241003_090809_834672_4436992A X-CRM114-Status: GOOD ( 18.27 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Thu, Oct 03, 2024 at 06:15:49PM +0300, Alper Nebi Yasak wrote: > Hello, > > I have a MT8173 Chromebook ("Lenovo 300e") where I'm getting a lot of > battery-related errors: > > [ 34.678473] sbs-battery 6-000b: sbs_read_string_data_fallback: Returned block_length is longer than 0x20 > [ 34.702079] power_supply_show_property: 5 callbacks suppressed > [ 34.702096] power_supply sbs-6-000b: driver failed to report `technology' property: -22 > [ 34.754401] sbs-battery 6-000b: sbs_read_string_data_fallback: Returned block_length is longer than 0x20 > [ 34.782568] sbs-battery 6-000b: sbs_read_string_data_fallback: Returned block_length is longer than 0x20 > [ 34.806020] power_supply sbs-6-000b: driver failed to report `manufacturer' property: -22 > [ 34.826135] power_supply sbs-6-000b: driver failed to report `technology' property: -22 > [ 34.844078] sbs-battery 6-000b: sbs_read_string_data_fallback: Returned block_length is longer than 0x20 > [ 34.864128] sbs-battery 6-000b: sbs_read_string_data_fallback: Returned block_length is longer than 0x20 > [ 34.889015] power_supply sbs-6-000b: driver failed to report `model_name' property: -22 > [ 34.895486] power_supply sbs-6-000b: driver failed to report `technology' property: -22 > [ 34.945035] sbs-battery 6-000b: sbs_read_string_data_fallback: Returned block_length is longer than 0x20 > > These infinitely repeat because upower keeps trying to read them. I also > see this which might be important: > > [ 18.111500] cros-usbpd-charger cros-usbpd-charger.7.auto: Could not get charger port count > [ 18.197166] sbs-battery 6-000b: sbs-battery: battery gas gauge device registered > [ 18.248105] sbs-battery 6-000b: I2C adapter does not support I2C_FUNC_SMBUS_READ_BLOCK_DATA. > Fallback method does not support PEC. > > Properties seem to be stuck to weird values (0xffff ?): > > $ for f in /sys/class/power_supply/sbs-6-000b/*; do > printf "$(basename "$f"): " > cat "$f" 2>/dev/null || echo > done > capacity: 100 > capacity_error_margin: 0 > capacity_level: Full > charge_full: 65535000 > charge_full_design: 65535000 > charge_now: 65535000 > constant_charge_current_max: 65535000 > constant_charge_voltage_max: 65535000 > current_avg: -1000 > current_now: -1000 > cycle_count: 65535 > device: > energy_full: 655350000 > energy_full_design: 655350000 > energy_now: 655350000 > health: Calibration required > hwmon2: > manufacture_day: 31 > manufacture_month: 15 > manufacturer: > manufacture_year: 2107 > model_name: > of_node: > power: > present: 1 > serial_number: ffff > status: Discharging > subsystem: > technology: Unknown > temp: 62804 > time_to_empty_avg: 3932100 > time_to_empty_now: 3932100 > time_to_full_avg: 3932100 > type: Battery > uevent: > voltage_max_design: 65535000 > voltage_min_design: 65535000 > voltage_now: 65535000 > wakeup10: > > I suspected a hardware issue, but I can get battery info from the EC > just fine with the same kernel: > > $ sudo ectool battery > Battery info: > OEM name: LGC > Model number: L15L3PB > Chemistry : LiP > Serial number: 0E0C > Design capacity: 4050 mAh > Last full charge: 3341 mAh > Design output voltage 11100 mV > Cycle count 115 > Present voltage 11671 mV > Present current 344 mA > Remaining capacity 2734 mAh > Flags 0x06 BATT_PRESENT DISCHARGING > > $ sudo ectool version > RO version: hana_v1.1.4824-d58e50539 > RW version: hana_v1.1.4825-1473136d99 > Firmware copy: RW > Build info: hana_v1.1.4825-1473136d99 2021-09-11 00:11:48 @chromeos-ci-firmware-us-central2-d-x32-0-jx9e > > I have _another_ MT8173 Chromebook ("ASUS C202X") where things work > fine. But I couldn't find a good mainline kernel version for this one. > Anyone have any idea what is going on? FWIW, I have also experienced issues reading properties from the SBS batteries before on chromebooks: https://lore.kernel.org/all/924db470-8163-4454-8f59-f7372a132186@notapiano/ In those cases it was due to the EC firmware not implementing the SBS commands, but that had already been fixed in the latest EC firmware release, so simply updating the firmware fixed it. I don't know how ectool works, but it might be fetching the battery properties through a different mechanism (ie not SBS commands), so this might also be a bug in the EC FW despite ectool working. Thanks, Nícolas