GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — driver: isl9241: clear BGATE_OFF when bypass entry aborts by 0xdeafbeef · Pull Request #99 · FrameworkComputer/EmbeddedController ConversationProblemMy Framework 16 (AMD Ryzen 7040, BIOS 04.05, EC lotus-4.0.5-2246d58 RO) did not charge on 65 W and 100 W USB-C supplies. I read the charger options with Lotus init writes CONTROL0=0x0000 and CONTROL1=0x0303. In I ran the driver functions verbatim in a host harness against fake registers, starting from the Lotus init values. I do not know why the VSYS wait failed on this laptop or when the attempt happened. Clearing only BGATE_OFF on the laptop (CHARGE_STATE SET_PARAM with 0x03030060, the same values without bit 6) made the battery charge without a reboot. ChangeWhen the VSYS wait in Two new ztests in
TestingTwister on
The test log shows both abort paths: "Aborting bypass mode. Vsys is unknown." and "Aborting bypass mode. Vsys too low (0 < 18304)", each followed by "bypass -> nvdc". To build locally I passed I have not flashed the patched firmware or tested it on hardware. Not coveredOn this rollback path Only Lotus enables bypass mode.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsisl9241_nvdc_to_bypass() sets CONTROL1.BGATE_OFF in step 7 and clears
it in step 15. If the VSYS ADC read fails or VSYS does not reach the
target within ISL9241_BYPASS_VSYS_TIMEOUT_MS, the function returns
early and skips step 15. The caller isl9241_enable_bypass_mode() then
calls isl9241_bypass_to_nvdc(), which does not touch BGATE and returns
success. The battery FET stays off and the battery is isolated.
Nothing else clears the bit. Dropping to 100 W or less does not call
the driver again, because the charger is not in bypass. Only EC
re-init or a later successful bypass entry clears it.
A Framework 16 (Ryzen 7040, EC lotus-4.0.5-2246d58) was in this state
with CONTROL0=0x0060 and CONTROL1=0x0343. It did not charge on 65 W
and 100 W USB-C supplies and sat at 8-9 % with 0-4 mA battery current.
Clearing only BGATE_OFF through CHARGE_STATE SET_PARAM made it charge
at 2.43 A within 25 seconds, without a reboot.
Clear BGATE_OFF before returning when the VSYS wait fails. The rest of
the rollback stays in isl9241_bypass_to_nvdc().
Add two tests, run in a new testcase drivers.isl9241.bypass with
CONFIG_PLATFORM_EC_CHARGER_BYPASS_MODE. Both check that BGATE_OFF is
clear after charger_enable_bypass_mode(true) aborts.
test_bypass_abort_releases_bgate injects a read failure on the VSYS
ADC register. test_bypass_timeout_releases_bgate gives the charge
manager a 20 V supply on port 0 while the emulated VSYS stays at 0,
so the wait times out. Add isl9241_emul_get_i2c_common_data() to the
ISL9241 emulator for the first one, like the ISL923x emulator has.
Include <stdbool.h> in isl9241_public.h. It declares
bool isl9241_is_in_bypass_mode(), and the ISL9241 emulator includes
it first; with GCC 14 the emulator did not compile without it.
BRANCH=fwk-tulip-29169
BUG=lotus battery stops charging after an aborted bypass mode entry
TEST=twister drivers.isl9241.bypass passes; both new tests fail
without the fix
2 of 12 tasks
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |