Ubuntu not recognizing charger unless already plugged in when booting.
So, I have a Dell XPS 15 9500 with a Windows 11 and Ubuntu 24.04 dual-boot setup. For some reason, Ubuntu is unable to recognize when I plug in the charger and it won't charge my laptop. The only way I can make it work is to plug in the charger while it's off, then boot it. It doesn't work if I reboot while plugged in an unrecognized state; it must be plugged during while the laptop is off (the exception is if I reboot from Windows to Ubuntu while plugged in, in which case it recognizes the charger).
This didn't happen when I was using Ubuntu 20.04 (skipped 22.04). This also doesn't happen when I boot into Windows unplugged. In case it's relevant, Ubuntu has a habit of automatically restarting around 3 times when I first boot it (doesn't happen with Windows). I was planning on raising this as a separate issue. The battery is also has a reduced capacity, which I've been meaning to replace it or its cells. It's really annoying and I would appreciate any pointers.