1. 07 Apr, 2023 3 commits
    • Chris Morgan's avatar
      power: supply: rk817: Fix low SOC bugs · baba1315
      Chris Morgan authored
      When the SOC approaches zero, an integer overflows in the columb
      counter causing the driver to react poorly. This makes the driver
      think it's at (above) the fully charged capacity when in fact it's
      zero. It would then write this full capacity to NVRAM which would be
      used on boot if the device remained off for less than 5 hours and
      not plugged in.
      
      This can be fixed and guarded against by doing the following:
       - Changing the type of tmp in rk817_read_or_set_full_charge_on_boot()
         to be an int instead of a u32. That way we can account for negative
         numbers.
       - Guard against negative values for the full charge on boot by setting
         the charge to 0 if the system charge reports less than 0.
       - Catch scenarios where the battery voltage is below the design
         minimum voltage and set the system SOC to 0 at that time and update
         the columb counter with a charge level of 0.
       - Change the off time value from 5 hours to 30 minutes before we
         recalculate the current capacity based on the OCV tables.
      
      These changes allow the driver to operate better at low voltage/low
      capacity conditions.
      
      Fixes: 3268a4d9 ("power: supply: rk817: Fix unsigned comparison with less than zero")
      Fixes: 11cb8da0 ("power: supply: Add charger driver for Rockchip RK817")
      Signed-off-by: default avatarChris Morgan <macromorgan@hotmail.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      baba1315
    • Chris Morgan's avatar
      power: supply: rk817: Drop unneeded debugging code · 528bd426
      Chris Morgan authored
      Some code was left over from debugging the driver while it was in
      development. Remove this code as it's not needed.
      Signed-off-by: default avatarChris Morgan <macromorgan@hotmail.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      528bd426
    • Sebastian Reichel's avatar
      Merge tag 'for-v6.3-rc' · 12752b5d
      Sebastian Reichel authored
      Merge the 6.3 power-supply fixes branch, which is required
      for further cleanups in the rk817 driver.
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      12752b5d
  2. 01 Apr, 2023 2 commits
    • Hans de Goede's avatar
      power: supply: axp288_charger: Use alt usb-id extcon on some x86 android tablets · ce38f3fc
      Hans de Goede authored
      x86 ACPI boards which ship with only Android as their factory image may
      have pretty broken ACPI tables. This includes broken _AEI ACPI GPIO event
      handlers, which are normally used to listen to the micro-USB ID pin and:
      
      1. Switch the USB-mux to the host / device USB controllers
      2. Disable Vbus path before enabling the 5V boost (AXP reg 0x30 bit 7)
      3. Turn 5V Vboost on / off
      
      On non broken systems where this is not done through an ACPI GPIO event
      handler, there is an ACPI INT3496 device describing the involved GPIOs
      which are handled by the extcon-intel-int3496 driver; and axp288-charger.ko
      listens to this extcon-device and disables the Vbus path when necessary.
      
      On x86 Android boards, with broken ACPI GPIO event handlers, these are
      disabled by acpi_quirk_skip_gpio_event_handlers() and an intel-int3496
      extcon device is manually instantiated by x86-android-tablets.ko .
      
      Add support to the axp288-charger code for this setup, so that it
      properly disables the Vbus path when necessary. Note this uses
      acpi_quirk_skip_gpio_event_handlers() to identify these systems,
      to avoid the need to add a separate DMI match table for this.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      ce38f3fc
    • Sebastian Reichel's avatar
      Merge tag 'v6.3-rc3' · 9d6ff170
      Sebastian Reichel authored
      Merge v6.3-rc3, so that 'acpi_quirk_skip_gpio_event_handlers'
      is available, which is needed for adding x86 android tablet
      support in axp288_charger.
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      9d6ff170
  3. 29 Mar, 2023 13 commits
  4. 20 Mar, 2023 1 commit
  5. 19 Mar, 2023 16 commits
  6. 18 Mar, 2023 5 commits
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · a3671bd8
      Linus Torvalds authored
      Pull fbdev fixes from Helge Deller:
       "The majority of lines changed is due to a code style cleanup in the
        pnmtologo helper program.
      
        Arnd removed the omap1 osk driver and the SIS fb driver is now
        orphaned.
      
        Other than that it's the usual bunch of small fixes and cleanups, e.g.
        prevent possible divide-by-zero in various fb drivers if the pixclock
        is zero and various conversions to devm_platform*() and of_property*()
        functions:
      
         - Drop omap1 osk driver
      
         - Various potential divide by zero pixclock fixes
      
         - Add pixelclock and fb_check_var() to stifb
      
         - Code style cleanups and indenting fixes"
      
      * tag 'fbdev-for-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
        fbdev: Use of_property_present() for testing DT property presence
        fbdev: au1200fb: Fix potential divide by zero
        fbdev: lxfb: Fix potential divide by zero
        fbdev: intelfb: Fix potential divide by zero
        fbdev: nvidia: Fix potential divide by zero
        fbdev: stifb: Provide valid pixelclock and add fb_check_var() checks
        fbdev: omapfb: remove omap1 osk driver
        fbdev: xilinxfb: Use devm_platform_get_and_ioremap_resource()
        fbdev: wm8505fb: Use devm_platform_ioremap_resource()
        fbdev: pxa3xx-gcu: Use devm_platform_get_and_ioremap_resource()
        fbdev: Use of_property_read_bool() for boolean properties
        fbdev: clps711x-fb: Use devm_platform_get_and_ioremap_resource()
        fbdev: tgafb: Fix potential divide by zero
        MAINTAINERS: orphan SIS FRAMEBUFFER DRIVER
        fbdev: omapfb: cleanup inconsistent indentation
        drivers: video: logo: add SPDX comment, remove GPL notice in pnmtologo.c
        drivers: video: logo: fix code style issues in pnmtologo.c
      a3671bd8
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.3' of... · 53429336
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Exclude kallsyms_seqs_of_names from kallsyms to fix build error
      
       - Fix 'make kernelrelease' for external module builds
      
       - Get the Debian source package compilable again
      
       - Fix the wrong uname when Debian packages are built with the
         KDEB_PKGVERSION option
      
       - Fix superfluous CROSS_COMPILE when building Debian packages
      
       - Fix RPM package build error when KCONFIG_CONFIG is set
      
       - Use 'git archive' for creating source tarballs
      
       - Remove the scripts/list-gitignored tool
      
      * tag 'kbuild-fixes-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: use git-archive for source package creation
        kbuild: rpm-pkg: move source components to rpmbuild/SOURCES
        kbuild: deb-pkg: use dh_listpackages to know enabled packages
        kbuild: deb-pkg: split image and debug objects staging out into functions
        kbuild: deb-pkg: set CROSS_COMPILE only when undefined
        kbuild: deb-pkg: do not take KERNELRELEASE from the source version
        kbuild: deb-pkg: make debian source package working again
        Makefile: Make kernelrelease target work with M=
        kconfig: Update config changed flag before calling callback
        kallsyms: add kallsyms_seqs_of_names to list of special symbols
      53429336
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v6.3-rc3' of... · 2a3e75a7
      Linus Torvalds authored
      Merge tag 'hwmon-for-v6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - ltc2992, adm1266: Set missing can_sleep flag
      
       - tmp512/tmp513: Drop of_match_ptr for ID table to fix build with
         !CONFIG_OF
      
       - ucd90320: Fix back-to-back access problem
      
       - ina3221: Fix bad error return from probe function
      
       - xgene: Fix use-after-free bug in remove function
      
       - adt7475: Fix hysteresis register bit masks, and fix association of
         'smoothing' attributes
      
      * tag 'hwmon-for-v6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (ltc2992) Set `can_sleep` flag for GPIO chip
        hwmon: (adm1266) Set `can_sleep` flag for GPIO chip
        hwmon: tmp512: drop of_match_ptr for ID table
        hwmon: (ucd90320) Add minimum delay between bus accesses
        hwmon: (ina3221) return prober error code
        hwmon: (xgene) Fix use after free bug in xgene_hwmon_remove due to race condition
        hwmon: (adt7475) Fix masking of hysteresis registers
        hwmon: (adt7475) Display smoothing attributes in correct order
      2a3e75a7
    • Linus Torvalds's avatar
      Merge tag 'ata-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · f900bffe
      Linus Torvalds authored
      Pull ata fixes from Damien Le Moal:
      
       - Two fixes from Ondrej for the pata_parport driver to address an issue
         with error handling during drive connection and to fix memory leaks
         in case of errors during initialization and when disconnecting a
         device.
      
      * tag 'ata-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: pata_parport: fix memory leaks
        ata: pata_parport: fix parport release without claim
      f900bffe
    • Linus Torvalds's avatar
      media: m5mols: fix off-by-one loop termination error · efbcbb12
      Linus Torvalds authored
      The __find_restype() function loops over the m5mols_default_ffmt[]
      array, and the termination condition ends up being wrong: instead of
      stopping when the iterator becomes the size of the array it traverses,
      it stops after it has already overshot the array.
      
      Now, in practice this doesn't likely matter, because the code will
      always find the entry it looks for, and will thus return early and never
      hit that last extra iteration.
      
      But it turns out that clang will unroll the loop fully, because it has
      only two iterations (well, three due to the off-by-one bug), and then
      clang will end up just giving up in the middle of the loop unrolling
      when it notices that the code walks past the end of the array.
      
      And that made 'objtool' very unhappy indeed, because the generated code
      just falls off the edge of the universe, and ends up falling through to
      the next function, causing this warning:
      
         drivers/media/i2c/m5mols/m5mols.o: warning: objtool: m5mols_set_fmt() falls through to next function m5mols_get_frame_desc()
      
      Fix the loop ending condition.
      Reported-by: default avatarJens Axboe <axboe@kernel.dk>
      Analyzed-by: default avatarMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
      Analyzed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Link: https://lore.kernel.org/linux-block/CAHk-=wgTSdKYbmB1JYM5vmHMcD9J9UZr0mn7BOYM_LudrP+Xvw@mail.gmail.com/
      Fixes: bc125106 ("[media] Add support for M-5MOLS 8 Mega Pixel camera ISP")
      Cc: HeungJun, Kim <riverful.kim@samsung.com>
      Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
      Cc: Kyungmin Park <kyungmin.park@samsung.com>
      Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      efbcbb12