* [PATCH] scsi/3w-9xxx: Avoid disabling device if failing to enable it
@ 2022-08-29 11:01 Letu Ren
2022-09-07 2:22 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Letu Ren @ 2022-08-29 11:01 UTC (permalink / raw)
To: aradford, jejb, martin.petersen
Cc: linux-scsi, linux-kernel, Letu Ren, Zheyu Ma
The original code will goto out_disable_device and `pci_disable_device`
if `pci_enable_device` fails. Kernel will generate a warning message
"3w-9xxx 0000:00:05.0: disabling already-disabled device". We shouldn't
disable a failed to enable device. A simple return is fine.
Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Letu Ren <fantasquex@gmail.com>
---
drivers/scsi/3w-9xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index cd823ff5deab..6cb9cca9565b 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2006,7 +2006,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
retval = pci_enable_device(pdev);
if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device");
- goto out_disable_device;
+ return -ENODEV;
}
pci_set_master(pdev);
--
2.37.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi/3w-9xxx: Avoid disabling device if failing to enable it
2022-08-29 11:01 [PATCH] scsi/3w-9xxx: Avoid disabling device if failing to enable it Letu Ren
@ 2022-09-07 2:22 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2022-09-07 2:22 UTC (permalink / raw)
To: Letu Ren
Cc: aradford, jejb, martin.petersen, linux-scsi, linux-kernel, Zheyu Ma
Letu,
> The original code will goto out_disable_device and
> `pci_disable_device` if `pci_enable_device` fails. Kernel will
> generate a warning message "3w-9xxx 0000:00:05.0: disabling
> already-disabled device". We shouldn't disable a failed to enable
> device. A simple return is fine.
Applied to 6.1/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-07 2:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 11:01 [PATCH] scsi/3w-9xxx: Avoid disabling device if failing to enable it Letu Ren
2022-09-07 2:22 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).