linux_dsm_epyc7002/drivers
Anssi Hannula 8ebd83bdb0 can: xilinx_can: fix power management handling
There are several issues with the suspend/resume handling code of the
driver:

- The device is attached and detached in the runtime_suspend() and
  runtime_resume() callbacks if the interface is running. However,
  during xcan_chip_start() the interface is considered running,
  causing the resume handler to incorrectly call netif_start_queue()
  at the beginning of xcan_chip_start(), and on xcan_chip_start() error
  return the suspend handler detaches the device leaving the user
  unable to bring-up the device anymore.

- The device is not brought properly up on system resume. A reset is
  done and the code tries to determine the bus state after that.
  However, after reset the device is always in Configuration mode
  (down), so the state checking code does not make sense and
  communication will also not work.

- The suspend callback tries to set the device to sleep mode (low-power
  mode which monitors the bus and brings the device back to normal mode
  on activity), but then immediately disables the clocks (possibly
  before the device reaches the sleep mode), which does not make sense
  to me. If a clean shutdown is wanted before disabling clocks, we can
  just bring it down completely instead of only sleep mode.

Reorganize the PM code so that only the clock logic remains in the
runtime PM callbacks and the system PM callbacks contain the device
bring-up/down logic. This makes calling the runtime PM callbacks during
e.g. xcan_chip_start() safe.

The system PM callbacks now simply call common code to start/stop the
HW if the interface was running, replacing the broken code from before.

xcan_chip_stop() is updated to use the common reset code so that it will
wait for the reset to complete. Reset also disables all interrupts so do
not do that separately.

Also, the device_may_wakeup() checks are removed as the driver does not
have wakeup support.

Tested on Zynq-7000 integrated CAN.

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-07-23 14:34:46 +02:00
..
accessibility
acpi * fix one ensures that a variable passed in by reference to 2018-07-13 10:54:01 -07:00
amba
android
ata ata: Remove depends on HAS_DMA in case of platform dependency 2018-07-02 13:18:22 -07:00
atm atm: zatm: Fix potential Spectre v1 2018-06-30 21:24:18 +09:00
auxdisplay
base PM / Domains: Don't power on at attach for the multi PM domain case 2018-07-03 16:42:51 +02:00
bcma
block for-linus-20180706 2018-07-06 19:13:42 -07:00
bluetooth
bus bus: ti-sysc: Use 2-factor allocator arguments 2018-07-02 04:24:44 -07:00
cdrom
char char: amd64-agp: Use 64-bit arithmetic instead of 32-bit 2018-07-10 13:50:31 +10:00
clk
clocksource clocksource: arm_arch_timer: Set arch_mem_timer cpumask to cpu_possible_mask 2018-07-10 22:12:47 +02:00
connector
cpufreq
cpuidle
crypto
dax * fix one ensures that a variable passed in by reference to 2018-07-13 10:54:01 -07:00
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fmc
fpga fpga: altera-cvp: Fix an error handling path in 'altera_cvp_probe()' 2018-07-07 16:55:22 +02:00
fsi
gpio
gpu - GVT fix for KBL vGPU hang to update virtual register from LRI. 2018-07-16 10:32:28 +10:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2018-07-09 17:16:11 -07:00
hsi
hv
hwmon
hwspinlock
hwtracing
i2c Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-07-13 15:34:29 -07:00
ide
idle
iio
infiniband Regression, user visible bugs, and crashing fixes: 2018-07-13 12:42:14 -07:00
input
iommu Revert "iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()" 2018-07-05 13:32:06 -06:00
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md 2018-07-02 12:40:59 -07:00
media
memory
memstick
message
mfd
misc ibmasm: don't write out of bounds in read handler 2018-07-07 09:59:35 +02:00
mmc mmc: sdhci-esdhc-imx: allow 1.8V modes without 100/200MHz pinctrl states 2018-07-09 11:17:47 +02:00
mtd mtd: spi-nor: cadence-quadspi: Fix direct mode write timeouts 2018-07-03 10:01:44 +02:00
mux
net can: xilinx_can: fix power management handling 2018-07-23 14:34:46 +02:00
nfc
ntb
nubus
nvdimm * fix one ensures that a variable passed in by reference to 2018-07-13 10:54:01 -07:00
nvme
nvmem nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us 2018-07-07 17:30:25 +02:00
of of: overlay: update phandle cache on overlay apply and remove 2018-07-16 08:41:32 -06:00
opp
oprofile
parisc
parport
pci pci-v4.18-fixes-2 2018-07-08 10:55:21 -07:00
pcmcia
perf
phy
pinctrl pinctrl: nsp: Fix potential NULL dereference 2018-07-14 12:47:04 +02:00
platform
pnp
power
powercap
pps
ps3
ptp ptp: fix missing break in switch 2018-07-18 15:25:25 -07:00
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc rtc: fix alarm read and set offset 2018-07-13 10:37:54 +02:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2018-07-06 09:14:34 -07:00
sbus
scsi SCSI fixes on 20180706 2018-07-06 19:45:47 -07:00
sfi
sh
siox
slimbus
sn
soc
soundwire
spi
spmi
ssb
staging staging: r8822be: Fix RTL8822be can't find any wireless AP 2018-07-06 17:44:35 +02:00
target
tc
tee
thermal
thunderbolt thunderbolt: Notify userspace when boot_acl is changed 2018-07-07 17:29:17 +02:00
tty
uio uio: fix crash after the device is unregistered 2018-07-07 16:57:35 +02:00
usb USB: yurex: fix out-of-bounds uaccess in read handler 2018-07-06 17:21:34 +02:00
uwb
vfio vfio: Use get_user_pages_longterm correctly 2018-06-30 13:58:09 -06:00
vhost
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile