Re: [PATCH v10 0/5] PCI: VF resizable BAR

2025-07-14 Thread Michał Winiarski
On Wed, Jul 02, 2025 at 11:35:17AM +0200, Michał Winiarski wrote: > Hi, > > The series is now reviewed, and it looks like there's no further > feedback. > To limit it to PCI subsystem, I removed the last patch in the series, as > it contained changes in drm/xe driver (it c

[PATCH v10 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-07-02 Thread Michał Winiarski
controlled by a separate VF MSE field in SR-IOV cap). Extend the pci_resize_resource() function to accept IOV resources. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 21 + drivers/pci/pci.c | 8

[PATCH v10 5/5] PCI: Allow drivers to control VF BAR size

2025-07-02 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 73 + include/linux/pci.h | 6 2

[PATCH v10 4/5] PCI/IOV: Check that VF BAR fits within the reservation

2025-07-02 Thread Michał Winiarski
lying reservation resource. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 852424cf2ae15..f34173c70b32a 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -668,9 +6

[PATCH v10 0/5] PCI: VF resizable BAR

2025-07-02 Thread Michał Winiarski
) and usage in Xe driver - Reduce the number of ifdefs (Christian) - Drop patch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (5): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to convert between VF BAR num

[PATCH v10 2/5] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-07-02 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and corresponding VF BAR numbers are done. Extract the logic to pci_resource_num_from_vf_bar() and pci_resource_num_to_vf_bar() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski Acked-by: Christian König

[PATCH v10 1/5] PCI/IOV: Restore VF resizable BAR state after reset

2025-07-02 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. The capability layout is the same as PCI_EXT_CAP_ID_REBAR. Add the capability ID and restore it as a part of IOV state. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał

[PATCH v9 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-05-27 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. The capability layout is the same as PCI_EXT_CAP_ID_REBAR. Add the capability ID and restore it as a part of IOV state. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał

[PATCH v9 5/6] PCI: Allow drivers to control VF BAR size

2025-05-27 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 73 + include/linux/pci.h | 6 2 files changed, 79

[PATCH v9 2/6] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-05-27 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and corresponding VF BAR numbers are done. Extract the logic to pci_resource_num_from_vf_bar() and pci_resource_num_to_vf_bar() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski Acked-by: Christian König

[PATCH v9 6/6] drm/xe/pf: Set VF LMEM BAR size

2025-05-27 Thread Michał Winiarski
size that allows to fit the number of enabled VFs and inform the user in case the resize attempt is not successful. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed

[PATCH v9 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-05-27 Thread Michał Winiarski
lying reservation resource. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 852424cf2ae15..f34173c70b32a 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -668,9 +6

[PATCH v9 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-05-27 Thread Michał Winiarski
controlled by a separate VF MSE field in SR-IOV cap). Extend the pci_resize_resource() function to accept IOV resources. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 21 + drivers/pci/pci.c | 8

[PATCH v9 0/6] PCI: VF resizable BAR

2025-05-27 Thread Michał Winiarski
esource_extend() and usage in Xe driver - Reduce the number of ifdefs (Christian) - Drop patch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (6): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to convert

Re: [PATCH v7 5/6] PCI: Allow drivers to control VF BAR size

2025-05-26 Thread Michał Winiarski
On Thu, Apr 03, 2025 at 01:20:58PM +0300, Ilpo Järvinen wrote: > On Wed, 2 Apr 2025, Michał Winiarski wrote: > > > Drivers could leverage the fact that the VF BAR MMIO reservation is > > created for total number of VFs supported by the device by resizing the > > BAR to

[PATCH v8 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-05-26 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. The capability layout is the same as PCI_EXT_CAP_ID_REBAR. Add the capability ID and restore it as a part of IOV state. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał

[PATCH v8 0/6] PCI: VF resizable BAR

2025-05-26 Thread Michał Winiarski
tch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (6): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to convert between VF BAR number and IOV resource PCI: Allow IOV resources to be resized in pci_resize_r

[PATCH v8 6/6] drm/xe/pf: Set VF LMEM BAR size

2025-05-26 Thread Michał Winiarski
size that allows to fit the number of enabled VFs and inform the user in case the resize attempt is not successful. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed

[PATCH v8 5/6] PCI: Allow drivers to control VF BAR size

2025-05-26 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 73 + include/linux/pci.h | 6 2 files changed, 79

[PATCH v8 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-05-26 Thread Michał Winiarski
lying reservation resource. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index fee99e15a943f..2fafbd6a998f0 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -668,9 +6

[PATCH v8 2/6] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-05-26 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and corresponding VF BAR numbers are done. Extract the logic to pci_resource_num_from_vf_bar() and pci_resource_num_to_vf_bar() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski Acked-by: Christian König

[PATCH v8 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-05-26 Thread Michał Winiarski
controlled by a separate VF MSE field in SR-IOV cap). Extend the pci_resize_resource() function to accept IOV resources. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c | 21 + drivers/pci/pci.c | 10

[PATCH v7 0/6] PCI: VF resizable BAR

2025-04-05 Thread Michał Winiarski
v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (6): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to convert between VF BAR number and IOV resource PCI: Allow IOV resources to be resized in pci_resize_resource() PCI

[PATCH v7 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-04-05 Thread Michał Winiarski
lying reservation resource. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index fee99e15a943f..2fafbd6a998f0 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -668,9 +668,12 @@ static int sriov_e

[PATCH v7 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-04-05 Thread Michał Winiarski
controlled by a separate VF MSE field in SR-IOV cap). Extend the pci_resize_resource() function to accept IOV resources. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 21 + drivers/pci/pci.c | 10 +- drivers/pci/pci.h

[PATCH v6 0/6] PCI: VF resizable BAR

2025-04-05 Thread Michał Winiarski
in Xe driver - Reduce the number of ifdefs (Christian) - Drop patch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (6): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to convert between VF BAR number and IOV

[PATCH v7 6/6] drm/xe/pf: Set VF LMEM BAR size

2025-04-04 Thread Michał Winiarski
size that allows to fit the number of enabled VFs and inform the user in case the resize attempt is not successful. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed

Re: [PATCH v6 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-04-04 Thread Michał Winiarski
On Wed, Mar 26, 2025 at 04:58:14PM +0200, Ilpo Järvinen wrote: > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > Similar to regular resizable BAR, VF BAR can also be resized. > > > > The structures are very similar, which means we can reuse most of the > >

[PATCH v7 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-04-02 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. The capability layout is the same as PCI_EXT_CAP_ID_REBAR. Add the capability ID and restore it as a part of IOV state. See PCIe r6.2, sec 7.8.7. Signed-off-by: Michał

[PATCH v7 5/6] PCI: Allow drivers to control VF BAR size

2025-04-02 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 69 + include/linux/pci.h | 6 2 files changed, 75

[PATCH v7 2/6] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-04-02 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and corresponding VF BAR numbers are done. Extract the logic to pci_resource_num_from_vf_bar() and pci_resource_num_to_vf_bar() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski Acked-by: Christian König

Re: [PATCH v6 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-04-02 Thread Michał Winiarski
On Wed, Mar 26, 2025 at 05:11:04PM +0200, Ilpo Järvinen wrote: > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > When the resource representing VF MMIO BAR reservation is created, its > > size is always large enough to accommodate the BAR of all SR-IOV Virtual >

Re: [PATCH v6 6/6] drm/xe/pf: Set VF LMEM BAR size

2025-04-02 Thread Michał Winiarski
On Wed, Mar 26, 2025 at 05:29:31PM +0200, Ilpo Järvinen wrote: > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > LMEM is partitioned between multiple VFs and we expect that the more > > VFs we have, the less LMEM is assigned to each VF. > > This means that we can achi

Re: [PATCH v6 5/6] PCI: Allow drivers to control VF BAR size

2025-04-02 Thread Michał Winiarski
On Wed, Mar 26, 2025 at 05:22:50PM +0200, Ilpo Järvinen wrote: > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > Drivers could leverage the fact that the VF BAR MMIO reservation is > > created for total number of VFs supported by the device by resizing the > > BAR to

Re: [PATCH v6 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-04-02 Thread Michał Winiarski
On Fri, Mar 28, 2025 at 06:39:29PM +0200, Ilpo Järvinen wrote: > On Wed, 26 Mar 2025, Ilpo Järvinen wrote: > > > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > > > When the resource representing VF MMIO BAR reservation is created, its > > > size is always

Re: [PATCH v6 2/6] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-04-02 Thread Michał Winiarski
On Wed, Mar 26, 2025 at 04:46:19PM +0200, Ilpo Järvinen wrote: > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > There are multiple places where conversions between IOV resources and > > corresponding VF BAR numbers are done. > > > > Extract the logic to pci_

Re: [PATCH v6 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-04-02 Thread Michał Winiarski
On Wed, Mar 26, 2025 at 04:52:22PM +0200, Ilpo Järvinen wrote: > On Wed, 26 Mar 2025, Ilpo Järvinen wrote: > > > On Thu, 20 Mar 2025, Michał Winiarski wrote: > > > > > Similar to regular resizable BAR, VF BAR can also be resized, e.g. by > > > the system

[PATCH v6 5/6] PCI: Allow drivers to control VF BAR size

2025-03-20 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 78 + include/linux/pci.h | 6 2 files changed, 84

[PATCH v6 6/6] drm/xe/pf: Set VF LMEM BAR size

2025-03-20 Thread Michał Winiarski
allows to fit the number of enabled VFs. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs

[PATCH v6 2/6] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-03-20 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and corresponding VF BAR numbers are done. Extract the logic to pci_resource_num_from_vf_bar() and pci_resource_num_to_vf_bar() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski Acked-by: Christian König

[PATCH v6 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-03-20 Thread Michał Winiarski
lying reservation resource. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index cbf335725d4fb..861273ad9a580 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -646,8 +646,13 @@ stati

[PATCH v6 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-03-20 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. Add the capability ID and restore it as a part of IOV state. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen Reviewed-by: Christian

[PATCH v6 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-03-20 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. Extend the pci_resize_resource() function to accept IOV resources. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci

Re: [PATCH v5 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-03-17 Thread Michał Winiarski
On Thu, Mar 13, 2025 at 11:56:07AM +0200, Ilpo Järvinen wrote: > On Wed, 12 Mar 2025, Michał Winiarski wrote: > > > Similar to regular resizable BAR, VF BAR can also be resized. > > > > The structures are very similar, which means we can reuse most of the > > imple

Re: [PATCH v5 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-03-17 Thread Michał Winiarski
On Thu, Mar 13, 2025 at 11:50:37AM +0200, Ilpo Järvinen wrote: > On Thu, 13 Mar 2025, Ilpo Järvinen wrote: > > > On Wed, 12 Mar 2025, Michał Winiarski wrote: > > > > > Similar to regular resizable BAR, VF BAR can also be resized, e.g. by > > > the system

[PATCH v5 3/6] PCI: Allow IOV resources to be resized in pci_resize_resource()

2025-03-12 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. Extend the pci_resize_resource() function to accept IOV resources. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci

[PATCH v5 0/6] PCI: VF resizable BAR

2025-03-12 Thread Michał Winiarski
o) - Fix build without CONFIG_PCI_IOV (CI) v1 -> v2: - Add pci_iov_resource_extend() and usage in Xe driver - Reduce the number of ifdefs (Christian) - Drop patch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (6): PCI/IOV: Restore

[PATCH v5 6/6] drm/xe/pf: Set VF LMEM BAR size

2025-03-12 Thread Michał Winiarski
allows to fit the number of enabled VFs. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs

[PATCH v5 5/6] PCI: Allow drivers to control VF BAR size

2025-03-12 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 78 + include/linux/pci.h | 6 2 files changed, 84

[PATCH v5 4/6] PCI/IOV: Check that VF BAR fits within the reservation

2025-03-12 Thread Michał Winiarski
ource. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 7cc17e898cea7..d6d63083884e6 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -646,8 +646,13 @@ static int sriov_enable(struct pc

[PATCH v5 2/6] PCI: Add a helper to convert between VF BAR number and IOV resource

2025-03-12 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and corresponding VF BAR numbers are done. Extract the logic to pci_resource_num_from_vf_bar() and pci_resource_num_to_vf_bar() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski --- drivers/pci/iov.c

[PATCH v5 1/6] PCI/IOV: Restore VF resizable BAR state after reset

2025-03-12 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. Add the capability ID and restore it as a part of IOV state. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen Reviewed-by: Christian

Re: [PATCH v4 6/7] PCI: Allow drivers to control VF BAR size

2024-11-12 Thread Michał Winiarski
On Mon, Oct 28, 2024 at 11:50:31AM -0500, Bjorn Helgaas wrote: > On Fri, Oct 25, 2024 at 11:50:37PM +0200, Michał Winiarski wrote: > > Drivers could leverage the fact that the VF BAR MMIO reservation is > > created for total number of VFs supported by the device by resizing the &g

Re: [PATCH v4 3/7] PCI: Add a helper to convert between standard and IOV resources

2024-11-12 Thread Michał Winiarski
On Wed, Nov 06, 2024 at 04:22:11PM +0200, Ilpo Järvinen wrote: > On Fri, 25 Oct 2024, Michał Winiarski wrote: > > > There are multiple places where conversions between IOV resources and > > standard resources are done. > > > > Extract the logic to pci_resource_to_i

Re: [PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-11-12 Thread Michał Winiarski
On Wed, Oct 30, 2024 at 11:55:01AM -0500, Bjorn Helgaas wrote: > On Wed, Oct 30, 2024 at 12:43:19PM +0100, Michał Winiarski wrote: > > On Mon, Oct 28, 2024 at 11:56:04AM -0500, Bjorn Helgaas wrote: > > > On Fri, Oct 25, 2024 at 11:50:36PM +0200, Michał Winiarski wrote: > &

Re: [PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-10-30 Thread Michał Winiarski
On Mon, Oct 28, 2024 at 11:56:04AM -0500, Bjorn Helgaas wrote: > On Fri, Oct 25, 2024 at 11:50:36PM +0200, Michał Winiarski wrote: > > VF MMIO resource reservation, either created by system firmware and > > inherited by Linux PCI subsystem or created by the subsystem itself, >

Re: [PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-10-28 Thread Michał Winiarski
On Fri, Oct 25, 2024 at 11:50:36PM +0200, Michał Winiarski wrote: > VF MMIO resource reservation, either created by system firmware and > inherited by Linux PCI subsystem or created by the subsystem itself, > should contain enough space to fit the BAR of all SR-IOV Virtual > Functi

[PATCH v4 0/7] PCI: VF resizable BAR

2024-10-25 Thread Michał Winiarski
ending the BAR (Christian) - Tidy the commit messages, use 80 line limit where necessary (Bjorn) - Add kerneldocs to exported functions (Bjorn) - Add pci_resource_to_iov() / pci_resource_from_iov() helpers (Ilpo) - Use FIELD_GET(), tidy whitespace (Ilpo) Michał Winiarski (7): PCI/IOV: Restore VF

[PATCH v4 2/7] PCI: Add a helper to identify IOV resources

2024-10-25 Thread Michał Winiarski
There are multiple places where special handling is required for IOV resources. Extract it to pci_resource_is_iov() helper and drop a few ifdefs. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/pci.h | 19 +++ drivers/pci/setup-bus.c | 7

[PATCH v4 3/7] PCI: Add a helper to convert between standard and IOV resources

2024-10-25 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and standard resources are done. Extract the logic to pci_resource_to_iov() and pci_resource_from_iov() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 20

[PATCH v4 7/7] drm/xe/pf: Set VF LMEM BAR size

2024-10-25 Thread Michał Winiarski
allows to fit the number of enabled VFs. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs

[PATCH v4 4/7] PCI: Allow IOV resources to be resized in pci_resize_resource()

2024-10-25 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. Extend the pci_resize_resource() function to accept IOV resources. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci

[PATCH v4 6/7] PCI: Allow drivers to control VF BAR size

2024-10-25 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 80 + include/linux/pci.h | 6 2 files changed, 86

[PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-10-25 Thread Michał Winiarski
assumption only holds in an environment where VF BAR size can't be modified. Add an additional check that verifies that VF BAR for all enabled VFs fits within the underlying reservation resource. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 8 ++-- 1 file changed, 6 insertions(

[PATCH v4 1/7] PCI/IOV: Restore VF resizable BAR state after reset

2024-10-25 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. Add the capability ID and restore it as a part of IOV state. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c

Re: [PATCH v3 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource

2024-10-10 Thread Michał Winiarski
On Thu, Oct 10, 2024 at 02:17:11PM +0300, Ilpo Järvinen wrote: > On Thu, 10 Oct 2024, Michał Winiarski wrote: > > > Similar to regular resizable BAR, VF BAR can also be resized. > > The structures are very similar, which means we can reuse most of the > > implementa

[PATCH v3 5/5] drm/xe/pf: Extend the VF LMEM BAR

2024-10-10 Thread Michał Winiarski
: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_sriov_pf.c | 8 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs/xe_bars.h index ce05b6ae832f1..880140d6ccdca 100644 --- a/drivers/gpu/drm/xe

[PATCH v3 4/5] PCI/IOV: Allow extending VF BAR within original resource boundary

2024-10-10 Thread Michał Winiarski
. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 92 - drivers/pci/pci.h | 1 + include/linux/pci.h | 3 ++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 591a3eae1618a

[PATCH v3 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource

2024-10-10 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 20 drivers/pci/pci.c | 9

[PATCH v3 2/5] PCI: Add a helper to identify IOV resources

2024-10-10 Thread Michał Winiarski
There are multiple places where special handling is required for IOV resources. Extract it to a helper and drop a few ifdefs. Signed-off-by: Michał Winiarski --- drivers/pci/pci.h | 18 ++ drivers/pci/setup-bus.c | 5 + drivers/pci/setup-res.c | 4 +--- 3 files

[PATCH v3 1/5] PCI/IOV: Restore VF resizable BAR state after reset

2024-10-10 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware, or the PCI subsystem itself. Add the capability ID and restore it as a part of IOV state. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 29

[PATCH v3 0/5] PCI: VF resizable BAR

2024-10-10 Thread Michał Winiarski
ing VF rebar state to separate commit (Christian) - Reorganize memory decoding check (Christian) - Don't use dev_WARN (Ilpo) - Fix build without CONFIG_PCI_IOV (CI) Michał Winiarski (5): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to identify IOV resources PCI

Re: [PATCH v2 2/3] PCI: Allow extending VF BAR within original resource boundary

2024-10-10 Thread Michał Winiarski
On Fri, Sep 20, 2024 at 12:07:34PM +0200, Christian König wrote: > Am 20.09.24 um 00:35 schrieb Michał Winiarski: > > VF MMIO resource reservation, either created by system firmware and > > inherited by Linux PCI subsystem or created by the subsystem itself, > > contains en

Re: [PATCH v2 1/3] PCI: Add support for VF Resizable Bar extended cap

2024-10-10 Thread Michał Winiarski
On Fri, Sep 20, 2024 at 11:57:34AM +0200, Christian König wrote: > Am 20.09.24 um 00:35 schrieb Michał Winiarski: > > Similar to regular resizable BAR, VF BAR can also be resized. > > The structures are very similar, which means we can reuse most of the > > implementatio

Re: [PATCH v2 2/3] PCI: Allow extending VF BAR within original resource boundary

2024-10-10 Thread Michał Winiarski
On Fri, Sep 20, 2024 at 02:30:00PM +0300, Ilpo Järvinen wrote: > On Fri, 20 Sep 2024, Michał Winiarski wrote: > > > VF MMIO resource reservation, either created by system firmware and > > inherited by Linux PCI subsystem or created by the subsystem itself, > > contains eno

[PATCH v2 3/3] drm/xe/pf: Extend the VF LMEM BAR

2024-09-19 Thread Michał Winiarski
: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_sriov_pf.c | 8 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs/xe_bars.h index ce05b6ae832f1..880140d6ccdca 100644 --- a/drivers/gpu/drm/xe

[PATCH v2 2/3] PCI: Allow extending VF BAR within original resource boundary

2024-09-19 Thread Michał Winiarski
. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 92 - drivers/pci/pci.h | 1 + include/linux/pci.h | 3 ++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index e8ccd2ae0f024

[PATCH v2 1/3] PCI: Add support for VF Resizable Bar extended cap

2024-09-19 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 28 ++ drivers/pci/pci.c

[PATCH v2 0/3] PCI: VF resizable BAR

2024-09-19 Thread Michał Winiarski
Xe driver - Reduce the number of ifdefs (Christian) - Drop patch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (3): PCI: Add support for VF Resizable Bar extended cap PCI: Allow extending VF BAR within original resource boundary

[PATCH v7 3/3] drm: Expand max DRM device number to full MINORBITS

2024-08-23 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Acked-by: James Zhu Signed-off-by: Michał Winiarski --- drivers/gpu/

[PATCH v7 2/3] accel: Use XArray instead of IDR for minors

2024-08-23 Thread Michał Winiarski
. Acked-by: James Zhu Signed-off-by: Michał Winiarski --- drivers/accel/drm_accel.c | 110 +++-- drivers/gpu/drm/drm_drv.c | 66 ++-- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/drm_internal.h | 4 -- include/drm/drm_accel.h

[PATCH v7 1/3] drm: Use XArray instead of IDR for minors

2024-08-23 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Suggested-by: Matthew Wilcox Acked-by: James Zhu Signed-off-by: M

[PATCH v7 0/3] drm: Use full allocated minor range for DRM

2024-08-23 Thread Michał Winiarski
) v4 -> v5: Fixup IDR to XArray conversion (Matthew Wilcox) v5 -> v6: Also convert Accel to XArray Rename skip_legacy_minors to force_extended_minors v6 -> v7: Drop the force_extended_minors patch intended for debug Rebase on latest drm-tip Update the cover letter, pointing out libd

Re: [PATCH v6 0/4] drm: Use full allocated minor range for DRM

2024-08-13 Thread Michał Winiarski
/ Acks. If you're interested to have a go at it - I can resend it. It should still apply on latest drm-tip. -Michał > > Alex > > On Mon, Jul 24, 2023 at 5:15 PM Michał Winiarski > wrote: > > > > 64 DRM device nodes is not enough for everyone. > > Upgrade

Re: [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR

2024-04-25 Thread Michał Winiarski
On Thu, Apr 25, 2024 at 11:47:46AM +0530, Aravind Iddamsetty wrote: > > On 25/04/24 04:59, Michał Winiarski wrote: > > On Wed, Apr 24, 2024 at 10:42:59AM +0530, Aravind Iddamsetty wrote: > >> On 24/04/24 05:19, Michał Winiarski wrote: > >>> On Mon, Apr 22,

Re: [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR

2024-04-24 Thread Michał Winiarski
On Wed, Apr 24, 2024 at 10:42:59AM +0530, Aravind Iddamsetty wrote: > > On 24/04/24 05:19, Michał Winiarski wrote: > > On Mon, Apr 22, 2024 at 12:27:56PM +0530, Aravind Iddamsetty wrote: > >> PCI subsystem provides callbacks to inform the driver about a request to > >&

Re: [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR

2024-04-23 Thread Michał Winiarski
On Mon, Apr 22, 2024 at 12:27:56PM +0530, Aravind Iddamsetty wrote: > PCI subsystem provides callbacks to inform the driver about a request to > do function level reset by user, initiated by writing to sysfs entry > /sys/bus/pci/devices/.../reset. This will allow the driver to handle FLR > without

[PATCH] drm/tests: mm: Convert to drm_dbg_printer

2024-02-09 Thread Michał Winiarski
Fix one of the tests in drm_mm that was not converted prior to drm_debug_printer removal, causing tests build failure. Fixes: e154c4fc7bf2d ("drm: remove drm_debug_printer in favor of drm_dbg_printer") Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_mm_test.c | 2

[PATCH] drm/tests: mm: Call drm_mm_print in drm_test_mm_debug

2024-01-16 Thread Michał Winiarski
The original intent behind the test was to sanity check whether calling the debug iterator (drm_mm_print) doesn't cause any problems. Unfortunately - this call got accidentally removed during KUnit transition. Restore it. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_mm_t

[PATCH v5 4/5] drm/tests: managed: Extract device initialization into test init

2024-01-15 Thread Michał Winiarski
It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski Acked-by: Maxime Ripard --- drivers/gpu/drm/tests/drm_managed_test.c | 41 +++- 1 file changed, 26 insertions(+), 15 deletions

[PATCH v5 5/5] drm/tests: managed: Add a simple test for drmm_managed_release

2024-01-15 Thread Michał Winiarski
Add a simple test that checks whether the action is called when drmm_managed_release is called. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 25 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b

[PATCH v5 2/5] drm/tests: managed: Rename the suite name to match other DRM tests

2024-01-15 Thread Michał Winiarski
DRM tests use "_" rather than "-" as word separator. Rename the test suite to match other tests. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_manag

[PATCH v5 3/5] drm/tests: managed: Add comments about test intent

2024-01-15 Thread Michał Winiarski
Add comments explaining the intention behind the test and certain implementation details related to device lifetime. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c

[PATCH v5 1/5] drm/managed: Add drmm_release_action

2024-01-15 Thread Michał Winiarski
Similar to devres equivalent, it allows to call the "release" action directly and remove the resource from the managed resources list. Signed-off-by: Michał Winiarski Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_managed.c | 39 +++ i

[PATCH v5 0/5] drm/managed: Add drmm_release_action

2024-01-15 Thread Michał Winiarski
ease test (Maxime) - Rename suite to "drm_managed" (Maxime) - Drop redundant messages from asserts (Maxime) Michał Winiarski (5): drm/managed: Add drmm_release_action drm/tests: managed: Rename the suite name to match other DRM tests drm/tests: managed: Add comments about test intent

Re: Re: [PATCH v4 6/6] drm/tests: managed: Add a simple test for drmm_managed_release

2024-01-15 Thread Michał Winiarski
On Wed, Jan 10, 2024 at 04:56:27PM +0100, Maxime Ripard wrote: > On Fri, Jan 05, 2024 at 11:13:24AM +0100, Michał Winiarski wrote: > > Add a simple test that checks whether the action is indeed called right > > away and that it is not called on the final drm_dev_put(). > &g

[PATCH v4 6/6] drm/tests: managed: Add a simple test for drmm_managed_release

2024-01-05 Thread Michał Winiarski
Add a simple test that checks whether the action is indeed called right away and that it is not called on the final drm_dev_put(). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers

[PATCH v4 5/6] drm/tests: managed: Extract device initialization into test init

2024-01-05 Thread Michał Winiarski
It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 37 +++- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v4 4/6] drm/tests: managed: Add comments and expect fail messages

2024-01-05 Thread Michał Winiarski
Add comments explaining the intention behind the test and certain implementation details related to device lifetime. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests

[PATCH v4 3/6] drm/tests: managed: Remove the waitqueue usage

2024-01-05 Thread Michał Winiarski
t the "action_done" state directly. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index 659af5abb8014

  1   2   3   >