diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-03-18 09:54:57 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-11 10:24:13 -0400 |
commit | 0cf0f23c286459625eb5cbf9934135ff3156ce95 (patch) | |
tree | 3a1785c7f1cecd6f6ec83a4bcece0545540b7bf7 /drivers | |
parent | f18a8927f6779f5dc9dc4327522c8a12f2cf31b9 (diff) |
[SCSI] mptfusion: Proper error handling is added after mpt_config timeout
Added proper error handling after mpt_config.
Now check of MPI_IOCSTATUS_CONFIG_INVALID_PAGE is added.
If error is MPI_IOCSTATUS_CONFIG_INVALID_PAGE, driver will return -ENODEV.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 77f21e068da0..ac000e83db0e 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -2523,6 +2523,12 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info, | |||
2523 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | 2523 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; |
2524 | 2524 | ||
2525 | error = mpt_config(ioc, &cfg); | 2525 | error = mpt_config(ioc, &cfg); |
2526 | |||
2527 | if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) { | ||
2528 | error = -ENODEV; | ||
2529 | goto out_free_consistent; | ||
2530 | } | ||
2531 | |||
2526 | if (error) | 2532 | if (error) |
2527 | goto out_free_consistent; | 2533 | goto out_free_consistent; |
2528 | 2534 | ||
@@ -2599,14 +2605,14 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info, | |||
2599 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | 2605 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; |
2600 | 2606 | ||
2601 | error = mpt_config(ioc, &cfg); | 2607 | error = mpt_config(ioc, &cfg); |
2602 | if (error) | 2608 | if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) { |
2603 | goto out_free_consistent; | ||
2604 | |||
2605 | if (!buffer->NumPhys) { | ||
2606 | error = -ENODEV; | 2609 | error = -ENODEV; |
2607 | goto out_free_consistent; | 2610 | goto out_free_consistent; |
2608 | } | 2611 | } |
2609 | 2612 | ||
2613 | if (error) | ||
2614 | goto out_free_consistent; | ||
2615 | |||
2610 | /* save config data */ | 2616 | /* save config data */ |
2611 | port_info->num_phys = (buffer->NumPhys) ? buffer->NumPhys : 1; | 2617 | port_info->num_phys = (buffer->NumPhys) ? buffer->NumPhys : 1; |
2612 | port_info->phy_info = kcalloc(port_info->num_phys, | 2618 | port_info->phy_info = kcalloc(port_info->num_phys, |
@@ -2682,7 +2688,7 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, | |||
2682 | 2688 | ||
2683 | if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) { | 2689 | if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) { |
2684 | error = -ENODEV; | 2690 | error = -ENODEV; |
2685 | goto out; | 2691 | goto out_free_consistent; |
2686 | } | 2692 | } |
2687 | 2693 | ||
2688 | if (error) | 2694 | if (error) |