mirror of
https://github.com/gnif/vendor-reset.git
synced 2025-12-29 23:19:28 +01:00
Compare commits
3 Commits
4b466e92a2
...
084881c6e9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
084881c6e9 | ||
|
|
f72619e468 | ||
|
|
1374629d08 |
@ -60,6 +60,7 @@ updating your initrd.
|
||||
|AMD|Polaris 12| RX 540, 550
|
||||
|AMD|Vega 10| Vega 56/64/FE |
|
||||
|AMD|Vega 20| Radeon VII |
|
||||
|AMD|Vega 20| Instinct MI100 |
|
||||
|AMD|Navi 10| 5600XT, 5700, 5700XT
|
||||
|AMD|Navi 12| Pro 5600M |
|
||||
|AMD|Navi 14| Pro 5300, RX 5300, 5500XT
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/version.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
//#include <drm/drm_util.h>
|
||||
@ -39,6 +40,10 @@
|
||||
#include "atom-names.h"
|
||||
#include "atom-bits.h"
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
|
||||
#define strscpy strlcpy
|
||||
#endif
|
||||
|
||||
#define ATOM_COND_ABOVE 0
|
||||
#define ATOM_COND_ABOVEOREQUAL 1
|
||||
#define ATOM_COND_ALWAYS 2
|
||||
@ -1424,7 +1429,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
|
||||
if (*str != '\0')
|
||||
{
|
||||
pr_info("ATOM BIOS: %s\n", str);
|
||||
strlcpy(ctx->vbios_version, str, sizeof(ctx->vbios_version));
|
||||
strscpy(ctx->vbios_version, str, sizeof(ctx->vbios_version));
|
||||
}
|
||||
|
||||
return ctx;
|
||||
|
||||
@ -102,6 +102,9 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
{PCI_VENDOR_ID_ATI, 0x7360, op, DEVICE_INFO(AMD_NAVI12)}, \
|
||||
{PCI_VENDOR_ID_ATI, 0x7362, op, DEVICE_INFO(AMD_NAVI12)}
|
||||
|
||||
#define _AMD_ARCTURUS(op) \
|
||||
{PCI_VENDOR_ID_ATI, 0x738c, op, DEVICE_INFO(AMD_VEGA20)} //Instinct MI100
|
||||
|
||||
static const struct vendor_reset_cfg vendor_reset_devices[] = {
|
||||
_AMD_POLARIS10(&amd_polaris10_ops),
|
||||
_AMD_POLARIS11(&amd_polaris10_ops),
|
||||
@ -111,6 +114,7 @@ static const struct vendor_reset_cfg vendor_reset_devices[] = {
|
||||
_AMD_NAVI10(&amd_navi10_ops),
|
||||
_AMD_NAVI14(&amd_navi10_ops),
|
||||
_AMD_NAVI12(&amd_navi10_ops),
|
||||
_AMD_ARCTURUS(&amd_vega20_ops),
|
||||
|
||||
/* end of array guard */
|
||||
{.vendor = 0}
|
||||
|
||||
@ -30,7 +30,11 @@ static bool hook_installed = false;
|
||||
static int (*orig_pci_dev_specific_reset)(struct pci_dev *dev, int probe);
|
||||
|
||||
/* TCO breaks the hook, we must disable it for this function */
|
||||
#if defined(__GNUC__) && !defined(__llvm__)
|
||||
__attribute__((optimize("-fno-optimize-sibling-calls")))
|
||||
#elif defined(__clang__)
|
||||
__attribute__((disable_tail_calls))
|
||||
#endif
|
||||
static int hooked_pci_dev_specific_reset(struct pci_dev *dev, int probe)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -131,3 +131,5 @@ ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x734F",
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x7360", RUN+="/bin/sh -c '/sbin/modprobe vendor-reset; echo device_specific > /sys$env{DEVPATH}/reset_method'"
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x7362", RUN+="/bin/sh -c '/sbin/modprobe vendor-reset; echo device_specific > /sys$env{DEVPATH}/reset_method'"
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x738c", RUN+="/bin/sh -c '/sbin/modprobe vendor-reset; echo device_specific > /sys$env{DEVPATH}/reset_method'"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user