linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device
@ 2019-09-07  1:07 chenxiang
  2019-09-10  8:29 ` John Garry
  2019-09-24  2:55 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: chenxiang @ 2019-09-07  1:07 UTC (permalink / raw)
  To: martin.petersen
  Cc: linuxarm, linux-scsi, john.garry, kashyap.desai, sumit.saxena,
	shivasharan.srikanteshwara, Xiang Chen

From: Xiang Chen <chenxiang66@hisilicon.com>

For pci device, need to disable device when probe failed after enabled
device.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
 drivers/scsi/megaraid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 45a6604..ff6d4aa 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -4183,11 +4183,11 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		 */
 		if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
 		    pdev->subsystem_device == 0xC000)
-		   	return -ENODEV;
+			goto out_disable_device;
 		/* Now check the magic signature byte */
 		pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
 		if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
-			return -ENODEV;
+			goto out_disable_device;
 		/* Ok it is probably a megaraid */
 	}
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device
  2019-09-07  1:07 [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device chenxiang
@ 2019-09-10  8:29 ` John Garry
  2019-09-24  2:55 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: John Garry @ 2019-09-10  8:29 UTC (permalink / raw)
  To: chenxiang, martin.petersen
  Cc: linuxarm, linux-scsi, kashyap.desai, sumit.saxena,
	shivasharan.srikanteshwara

On 07/09/2019 02:07, chenxiang wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
>
> For pci device, need to disable device when probe failed after enabled
> device.
>
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>

Reviewed-by: John Garry <john.garry@huawei.com>

> ---
>  drivers/scsi/megaraid.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
> index 45a6604..ff6d4aa 100644
> --- a/drivers/scsi/megaraid.c
> +++ b/drivers/scsi/megaraid.c
> @@ -4183,11 +4183,11 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  		 */
>  		if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
>  		    pdev->subsystem_device == 0xC000)
> -		   	return -ENODEV;
> +			goto out_disable_device;
>  		/* Now check the magic signature byte */
>  		pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
>  		if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
> -			return -ENODEV;
> +			goto out_disable_device;

It would be nicer if the driver didn't init the return code to -ENODEV 
and we set it explicitly here, but that's a different change.

>  		/* Ok it is probably a megaraid */
>  	}
>
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device
  2019-09-07  1:07 [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device chenxiang
  2019-09-10  8:29 ` John Garry
@ 2019-09-24  2:55 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-09-24  2:55 UTC (permalink / raw)
  To: chenxiang
  Cc: martin.petersen, linuxarm, linux-scsi, john.garry, kashyap.desai,
	sumit.saxena, shivasharan.srikanteshwara


> For pci device, need to disable device when probe failed after enabled
> device.

Applied to 5.4/scsi-fixes, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-24  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-07  1:07 [RESEND PATCH] scsi: megaraid: disable device when probe failed after enabled device chenxiang
2019-09-10  8:29 ` John Garry
2019-09-24  2:55 ` 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).