Re: [PATCH v2 2/2] s390/pci: Extend device lock to cover zpci_report_status()

Farhan Ali <[email protected]>
Newsgroups org.kernel.vger.linux-s390,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 8/19/2026 2:58 AM, Niklas Schnelle wrote:
> As zpci_report_status() accesses the device's driver the device lock
> needs to be held. Extend the critical section to cover the
> zpci_report_status() call.
>
> Cc: [email protected]
> Fixes: 4ec6054e7321 ("s390/pci: Report PCI error recovery results via SCLP")
> Signed-off-by: Niklas Schnelle <[email protected]>
> ---
>   arch/s390/pci/pci_event.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
> index 839bd91c056e..48c150d6ba81 100644
> --- a/arch/s390/pci/pci_event.c
> +++ b/arch/s390/pci/pci_event.c
> @@ -256,8 +256,8 @@ static pci_ers_result_t zpci_event_attempt_error_recovery(struct pci_dev *pdev)
>   		driver->err_handler->resume(pdev);
>   	pci_uevent_ers(pdev, PCI_ERS_RESULT_RECOVERED);
>   out_unlock:
> -	device_unlock(&pdev->dev);
>   	zpci_report_status(zdev, "recovery", status_str);
> +	device_unlock(&pdev->dev);
>   
>   	return ers_res;
>   }

AFAICT this change is correct, but should we also add a lockdep_assert 
in zpci_report_status()? Since this is the only placed its called, it 
maybe fine as is. I just fear that we could miss on getting the lock if 
we were to re-use zpci_report_status().

Either way
Reviewed-by: Farhan Ali<[email protected]>

Thanks

Farhan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.