Date: Tue, 13 Feb 2018 15:14:32 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329211 - stable/11/sys/dev/mlx5/mlx5_core Message-ID: <201802131514.w1DFEW76024659@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Tue Feb 13 15:14:32 2018 New Revision: 329211 URL: https://svnweb.freebsd.org/changeset/base/329211 Log: MFC r325652: Prevent mlx5 core from accessing host memory after shutdown by disabling PCI busmaster. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:13:43 2018 (r329210) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Feb 13 15:14:32 2018 (r329211) @@ -1134,6 +1134,12 @@ static void remove_one(struct pci_dev *pdev) kfree(dev); } +static void shutdown_one(struct pci_dev *pdev) +{ + /* prevent device from accessing host memory after shutdown */ + pci_clear_master(pdev); +} + static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */ { PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */ @@ -1175,6 +1181,7 @@ MODULE_DEVICE_TABLE(pci, mlx5_core_pci_table); static struct pci_driver mlx5_core_driver = { .name = DRIVER_NAME, .id_table = mlx5_core_pci_table, + .shutdown = shutdown_one, .probe = init_one, .remove = remove_one };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802131514.w1DFEW76024659>