diff mbox series

drm/i915: disable pci resize on 32-bit machine

Message ID 20220726083212.24071-1-nirmoy.das@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: disable pci resize on 32-bit machine | expand

Commit Message

Nirmoy Das July 26, 2022, 8:32 a.m. UTC
PCI bar resize only works with 64 bit BAR so disable
this on 32-bit machine.

Fixes: a91d1a17cd341 ("drm/i915: Add support for LMEM PCIe resizable bar")
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_region_lmem.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Matthew Auld July 27, 2022, 4:58 p.m. UTC | #1
On 26/07/2022 09:32, Nirmoy Das wrote:
> PCI bar resize only works with 64 bit BAR so disable
> this on 32-bit machine.

Maybe also mention somewhere that this is just to fix a compiler warning 
with the 0x100000000ull being out-of-range with resource_size_t on 32bit?

Acked-by: Matthew Auld <matthew.auld@intel.com>

> 
> Fixes: a91d1a17cd341 ("drm/i915: Add support for LMEM PCIe resizable bar")
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_region_lmem.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> index 6e90032e12e9..aa6aed837194 100644
> --- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> +++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> @@ -15,6 +15,7 @@
>   #include "gt/intel_gt_mcr.h"
>   #include "gt/intel_gt_regs.h"
>   
> +#ifdef CONFIG_64BIT
>   static void _release_bars(struct pci_dev *pdev)
>   {
>   	int resno;
> @@ -111,6 +112,9 @@ static void i915_resize_lmem_bar(struct drm_i915_private *i915, resource_size_t
>   	pci_assign_unassigned_bus_resources(pdev->bus);
>   	pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
>   }
> +#else
> +static void i915_resize_lmem_bar(struct drm_i915_private *i915, resource_size_t lmem_size) {}
> +#endif
>   
>   static int
>   region_lmem_release(struct intel_memory_region *mem)
Nirmoy Das July 27, 2022, 5:15 p.m. UTC | #2
On 7/27/2022 6:58 PM, Matthew Auld wrote:
> On 26/07/2022 09:32, Nirmoy Das wrote:
>> PCI bar resize only works with 64 bit BAR so disable
>> this on 32-bit machine.
>
> Maybe also mention somewhere that this is just to fix a compiler 
> warning with the 0x100000000ull being out-of-range with 
> resource_size_t on 32bit?


Yes, sounds good. I will resend with a comment.


Nirmoy

>
> Acked-by: Matthew Auld <matthew.auld@intel.com>
>
>>
>> Fixes: a91d1a17cd341 ("drm/i915: Add support for LMEM PCIe resizable 
>> bar")
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_region_lmem.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c 
>> b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
>> index 6e90032e12e9..aa6aed837194 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
>> @@ -15,6 +15,7 @@
>>   #include "gt/intel_gt_mcr.h"
>>   #include "gt/intel_gt_regs.h"
>>   +#ifdef CONFIG_64BIT
>>   static void _release_bars(struct pci_dev *pdev)
>>   {
>>       int resno;
>> @@ -111,6 +112,9 @@ static void i915_resize_lmem_bar(struct 
>> drm_i915_private *i915, resource_size_t
>>       pci_assign_unassigned_bus_resources(pdev->bus);
>>       pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
>>   }
>> +#else
>> +static void i915_resize_lmem_bar(struct drm_i915_private *i915, 
>> resource_size_t lmem_size) {}
>> +#endif
>>     static int
>>   region_lmem_release(struct intel_memory_region *mem)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
index 6e90032e12e9..aa6aed837194 100644
--- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
@@ -15,6 +15,7 @@ 
 #include "gt/intel_gt_mcr.h"
 #include "gt/intel_gt_regs.h"
 
+#ifdef CONFIG_64BIT
 static void _release_bars(struct pci_dev *pdev)
 {
 	int resno;
@@ -111,6 +112,9 @@  static void i915_resize_lmem_bar(struct drm_i915_private *i915, resource_size_t
 	pci_assign_unassigned_bus_resources(pdev->bus);
 	pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
 }
+#else
+static void i915_resize_lmem_bar(struct drm_i915_private *i915, resource_size_t lmem_size) {}
+#endif
 
 static int
 region_lmem_release(struct intel_memory_region *mem)