diff mbox series

[1/1] drm/i915: Fixing error code for WOPCM initialization

Message ID 20190305005556.25073-1-sujaritha.sundaresan@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/1] drm/i915: Fixing error code for WOPCM initialization | expand

Commit Message

Sundaresan, Sujaritha March 5, 2019, 12:55 a.m. UTC
Replacing the -E2BIG error code return for WOPCM
initialization with -ENODEV. This will prevent the pci from
picking this up as a warning during fault injection testing.

Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
---
 drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniele Ceraolo Spurio March 5, 2019, 10:05 p.m. UTC | #1
On 3/4/19 4:55 PM, Sujaritha Sundaresan wrote:
> Replacing the -E2BIG error code return for WOPCM
> initialization with -ENODEV. This will prevent the pci from
> picking this up as a warning during fault injection testing.

To clarify, we want to silence this:



> 
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
> index f82a415ea2ba..a651557e6e4e 100644
> --- a/drivers/gpu/drm/i915/intel_wopcm.c
> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
> @@ -169,7 +169,7 @@ int intel_wopcm_init(struct intel_wopcm *wopcm)
>   	GEM_BUG_ON(!wopcm->size);
>   
>   	if (i915_inject_load_failure())
> -		return -E2BIG;
> +		return -ENODEV;

Would it be better to just change the final return code in 
i915_pci_probe() to ENODEV?

i.e.
	err = i915_driver_load(pdev, ent);
	if (err)
		return i915_error_injected() ? -ENODEV : err;

This way we can test that the possible error codes (E2BIG in this case) 
don't hit issues in dedicated cases during onion unwinding.

Daniele

>   
>   	if (guc_fw_size >= wopcm->size) {
>   		DRM_ERROR("GuC FW (%uKiB) is too big to fit in WOPCM.",
>
Daniele Ceraolo Spurio March 5, 2019, 10:06 p.m. UTC | #2
On 3/5/19 2:05 PM, Daniele Ceraolo Spurio wrote:
> 
> 
> On 3/4/19 4:55 PM, Sujaritha Sundaresan wrote:
>> Replacing the -E2BIG error code return for WOPCM
>> initialization with -ENODEV. This will prevent the pci from
>> picking this up as a warning during fault injection testing.
> 
> To clarify, we want to silence this:
> 

forgot to paste the log...

<4> [381.569479] i915: probe of 0000:00:02.0 failed with error -7

Daniele

> 
> 
>>
>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_wopcm.c 
>> b/drivers/gpu/drm/i915/intel_wopcm.c
>> index f82a415ea2ba..a651557e6e4e 100644
>> --- a/drivers/gpu/drm/i915/intel_wopcm.c
>> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
>> @@ -169,7 +169,7 @@ int intel_wopcm_init(struct intel_wopcm *wopcm)
>>       GEM_BUG_ON(!wopcm->size);
>>       if (i915_inject_load_failure())
>> -        return -E2BIG;
>> +        return -ENODEV;
> 
> Would it be better to just change the final return code in 
> i915_pci_probe() to ENODEV?
> 
> i.e.
>      err = i915_driver_load(pdev, ent);
>      if (err)
>          return i915_error_injected() ? -ENODEV : err;
> 
> This way we can test that the possible error codes (E2BIG in this case) 
> don't hit issues in dedicated cases during onion unwinding.
> 
> Daniele
> 
>>       if (guc_fw_size >= wopcm->size) {
>>           DRM_ERROR("GuC FW (%uKiB) is too big to fit in WOPCM.",
>>
Sundaresan, Sujaritha March 6, 2019, 12:11 a.m. UTC | #3
On 3/5/19 2:06 PM, Daniele Ceraolo Spurio wrote:
>
>
> On 3/5/19 2:05 PM, Daniele Ceraolo Spurio wrote:
>>
>>
>> On 3/4/19 4:55 PM, Sujaritha Sundaresan wrote:
>>> Replacing the -E2BIG error code return for WOPCM
>>> initialization with -ENODEV. This will prevent the pci from
>>> picking this up as a warning during fault injection testing.
>>
>> To clarify, we want to silence this:
>>
>
> forgot to paste the log...
>
> <4> [381.569479] i915: probe of 0000:00:02.0 failed with error -7
>
> Daniele
>
>>
>>
>>>
>>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>>> Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_wopcm.c 
>>> b/drivers/gpu/drm/i915/intel_wopcm.c
>>> index f82a415ea2ba..a651557e6e4e 100644
>>> --- a/drivers/gpu/drm/i915/intel_wopcm.c
>>> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
>>> @@ -169,7 +169,7 @@ int intel_wopcm_init(struct intel_wopcm *wopcm)
>>>       GEM_BUG_ON(!wopcm->size);
>>>       if (i915_inject_load_failure())
>>> -        return -E2BIG;
>>> +        return -ENODEV;
>>
>> Would it be better to just change the final return code in 
>> i915_pci_probe() to ENODEV?
>>
>> i.e.
>>      err = i915_driver_load(pdev, ent);
>>      if (err)
>>          return i915_error_injected() ? -ENODEV : err;
>>
>> This way we can test that the possible error codes (E2BIG in this 
>> case) don't hit issues in dedicated cases during onion unwinding.
>>
>> Daniele
>>
>>>       if (guc_fw_size >= wopcm->size) {
>>>           DRM_ERROR("GuC FW (%uKiB) is too big to fit in WOPCM.",
>>>

Okay this approach seems to provide a wider fix. Will make this change. 
Thanks for the review.

Sujaritha
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
index f82a415ea2ba..a651557e6e4e 100644
--- a/drivers/gpu/drm/i915/intel_wopcm.c
+++ b/drivers/gpu/drm/i915/intel_wopcm.c
@@ -169,7 +169,7 @@  int intel_wopcm_init(struct intel_wopcm *wopcm)
 	GEM_BUG_ON(!wopcm->size);
 
 	if (i915_inject_load_failure())
-		return -E2BIG;
+		return -ENODEV;
 
 	if (guc_fw_size >= wopcm->size) {
 		DRM_ERROR("GuC FW (%uKiB) is too big to fit in WOPCM.",