aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/pvpanic/pvpanic-pci.c
AgeCommit message (Collapse)AuthorFilesLines
2024-04-29misc/pvpanic-pci: register attributes via pci_driverThomas Weißschuh1-3/+1
In __pci_register_driver(), the pci core overwrites the dev_groups field of the embedded struct device_driver with the dev_groups from the outer struct pci_driver unconditionally. Set dev_groups in the pci_driver to make sure it is used. This was broken since the introduction of pvpanic-pci. Fixes: db3a4f0abefd ("misc/pvpanic: add PCI driver") Cc: [email protected] Signed-off-by: Thomas Weißschuh <[email protected]> Fixes: ded13b9cfd59 ("PCI: Add support for dev_groups to struct pci_driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-01-04pvpanic: Kill duplicate PCI_VENDOR_ID_REDHAT definitionAndy Shevchenko1-1/+0
PCI_VENDOR_ID_REDHAT is already defined in pci_ids.h. Kill the dup. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-12-23pvpanic: Don't use "proxy" headersAndy Shevchenko1-4/+1
Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-10-18misc/pvpanic: deduplicate common codeThomas Weißschuh1-56/+2
pvpanic-mmio.c and pvpanic-pci.c share a lot of code. Refactor it into pvpanic.c where it doesn't have to be kept in sync manually and where the core logic can be understood more easily. No functional change. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-09-14pvpanic: Indentation fixes here and thereAndy Shevchenko1-7/+5
1) replace double spaces with single; 2) relax line width limitation a bit. Reviewed-by: Mihai Carabas <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-09-14pvpanic: Keep single style across modulesAndy Shevchenko1-8/+6
We have different style on where we place module_*() and MODULE_*() macros. Inherit the style from the original module (now pvpanic-mmio.c). Reviewed-by: Mihai Carabas <[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-07-21misc/pvpanic-pci: Allow automatic loadingEric Auger1-0/+2
The virtual machine monitor (QEMU) exposes the pvpanic-pci device to the guest. On guest side the module exists but currently isn't loaded automatically. So the driver fails to be probed and does not its job of handling guest panic events. Instead of requiring manual modprobe, let's include a device database using the MODULE_DEVICE_TABLE macro and let the module auto-load when the guest gets exposed with such a pvpanic-pci device. Signed-off-by: Eric Auger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-27misc/pvpanic: Make 'pvpanic_probe()' resource managedChristophe JAILLET1-12/+1
Simplify code and turn 'pvpanic_probe()' into a managed resource version. This simplify callers that don't need to do some clean-up on error in the probe and on remove. Update pvpanic-mmio.c and pvpanic-pci.c accordingly. 'pvpanic_remove()' don't need to be exported anymore. Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/9212cdc8c1e5c187a2f1129a6190085c2a10d28a.1621665058.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-27misc/pvpanic-pci: Use GFP_KERNEL instead of GFP_ATOMICChristophe JAILLET1-1/+1
There is no need to use GFP_ATOMIC in a probe function. Use GFP_KERNEL instead. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/5ea4fb9802f7b780cc3e5ae768561a0372a39ebb.1621665058.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-05-27misc/pvpanic-pci: Fix error handling in 'pvpanic_pci_probe()'Christophe JAILLET1-6/+3
There is no error handling path in the probe function. Switch to managed resource so that errors in the probe are handled easily and simplify the remove function accordingly. Fixes: db3a4f0abefd ("misc/pvpanic: add PCI driver") Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/ab071b1f4ed6e1174f9199095fb16a58bb406090.1621665058.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-04-02misc/pvpanic: fix return value check in pvpanic_pci_probe()Qiheng Lin1-2/+2
In case of error, the function pci_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Qiheng Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-03-28misc/pvpanic: add PCI driverMihai Carabas1-0/+125
Add support for pvpanic PCI device added in qemu [1]. At probe time, obtain the address where to read/write pvpanic events and pass it to the generic handling code. Will follow the same logic as pvpanic MMIO device driver. At remove time, unmap base address and disable PCI device. [1] https://github.com/qemu/qemu/commit/9df52f58e76e904fb141b10318362d718f470db2 Signed-off-by: Mihai Carabas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>