All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinpu Wang <jinpu.wang@cloud.ionos.com>
To: Viswas G <Viswas.G@microchip.com.com>
Cc: Linux SCSI Mailinglist <linux-scsi@vger.kernel.org>,
	Vasanthalakshmi.Tharmarajan@microchip.com,
	Viswas G <Viswas.G@microchip.com>,
	Ruksar.devadi@microchip.com, yuuzheng@google.com,
	vishakhavc@google.com, Radha Ramachandran <radha@google.com>,
	akshatzen@google.com, bjashnani@google.com
Subject: Re: [PATCH 6/8] pm80xx: Simultaneous poll for all FW readiness.
Date: Tue, 5 Jan 2021 14:31:49 +0100	[thread overview]
Message-ID: <CAMGffE=06PW7Fc9EC_KxUW5aFk30oicFVZ8MbUC6p=k73KBF7A@mail.gmail.com> (raw)
In-Reply-To: <20201230045743.14694-7-Viswas.G@microchip.com.com>

On Wed, Dec 30, 2020 at 5:47 AM Viswas G <Viswas.G@microchip.com.com> wrote:
>
> From: Bhavesh Jashnani <bjashnani@google.com>
>
> In check_fw_ready() we first wait for ILA to come up and then we
> wait for RAAE to come up and IOPs and so on. This is a sequential check.
> Because of this ILA image seems to be not ready in the allocated time
> and so the driver marks it as "not ready" and then move on to other FW
> images. But ILA does become ready eventually, but is not checked again.
> In this way driver concludes that FW is not ready, when it actually is.
>
> Fix: Instead of sequentially polling each image, we keep polling for all
> images to be ready. The timeout for the polling has been set to the sum
> of what was used for each individual image.
>
> Signed-off-by: Bhavesh Jashnani <bjashnani@google.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
> Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
> Signed-off-by: Radha Ramachandran <radha@google.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Thx
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 80 ++++++++++++----------------------------
>  1 file changed, 23 insertions(+), 57 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 407c0cf6ab5f..df679e36954a 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -1043,6 +1043,7 @@ static int check_fw_ready(struct pm8001_hba_info *pm8001_ha)
>         u32 value;
>         u32 max_wait_count;
>         u32 max_wait_time;
> +       u32 expected_mask;
>         int ret = 0;
>
>         /* reset / PCIe ready */
> @@ -1052,70 +1053,35 @@ static int check_fw_ready(struct pm8001_hba_info *pm8001_ha)
>                 value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
>         } while ((value == 0xFFFFFFFF) && (--max_wait_count));
>
> -       /* check ila status */
> -       max_wait_time = max_wait_count = 50;    /* 1000 milli sec */
> -       do {
> -               msleep(FW_READY_INTERVAL);
> -               value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
> -       } while (((value & SCRATCH_PAD_ILA_READY) !=
> -                       SCRATCH_PAD_ILA_READY) && (--max_wait_count));
> -       if (!max_wait_count)
> -               ret = -1;
> -       else {
> -               pm8001_dbg(pm8001_ha, MSG,
> -                          " ila ready status in %d millisec\n",
> -                          (max_wait_time - max_wait_count));
> -       }
> -
> -       /* check RAAE status */
> -       max_wait_time = max_wait_count = 90;    /* 1800 milli sec */
> -       do {
> -               msleep(FW_READY_INTERVAL);
> -               value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
> -       } while (((value & SCRATCH_PAD_RAAE_READY) !=
> -                               SCRATCH_PAD_RAAE_READY) && (--max_wait_count));
> -       if (!max_wait_count)
> -               ret = -1;
> -       else {
> -               pm8001_dbg(pm8001_ha, MSG,
> -                          " raae ready status in %d millisec\n",
> -                          (max_wait_time - max_wait_count));
> +       /* check ila, RAAE and iops status */
> +       if ((pm8001_ha->chip_id != chip_8008) &&
> +                       (pm8001_ha->chip_id != chip_8009)) {
> +               max_wait_time = max_wait_count = 180;   /* 3600 milli sec */
> +               expected_mask = SCRATCH_PAD_ILA_READY |
> +                       SCRATCH_PAD_RAAE_READY |
> +                       SCRATCH_PAD_IOP0_READY |
> +                       SCRATCH_PAD_IOP1_READY;
> +       } else {
> +               max_wait_time = max_wait_count = 170;   /* 3400 milli sec */
> +               expected_mask = SCRATCH_PAD_ILA_READY |
> +                       SCRATCH_PAD_RAAE_READY |
> +                       SCRATCH_PAD_IOP0_READY;
>         }
> -
> -       /* check iop0 status */
> -       max_wait_time = max_wait_count = 30;    /* 600 milli sec */
>         do {
>                 msleep(FW_READY_INTERVAL);
>                 value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
> -       } while (((value & SCRATCH_PAD_IOP0_READY) != SCRATCH_PAD_IOP0_READY) &&
> -                       (--max_wait_count));
> -       if (!max_wait_count)
> +       } while (((value & expected_mask) !=
> +                                expected_mask) && (--max_wait_count));
> +       if (!max_wait_count) {
> +               pm8001_dbg(pm8001_ha, INIT,
> +               "At least one FW component failed to load within %d millisec: Scratchpad1: 0x%x\n",
> +                       max_wait_time * FW_READY_INTERVAL, value);
>                 ret = -1;
> -       else {
> +       } else {
>                 pm8001_dbg(pm8001_ha, MSG,
> -                          " iop0 ready status in %d millisec\n",
> -                          (max_wait_time - max_wait_count));
> +                       "All FW components ready by %d ms\n",
> +                       (max_wait_time - max_wait_count) * FW_READY_INTERVAL);
>         }
> -
> -       /* check iop1 status only for 16 port controllers */
> -       if ((pm8001_ha->chip_id != chip_8008) &&
> -                       (pm8001_ha->chip_id != chip_8009)) {
> -               /* 200 milli sec */
> -               max_wait_time = max_wait_count = 10;
> -               do {
> -                       msleep(FW_READY_INTERVAL);
> -                       value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
> -               } while (((value & SCRATCH_PAD_IOP1_READY) !=
> -                               SCRATCH_PAD_IOP1_READY) && (--max_wait_count));
> -               if (!max_wait_count)
> -                       ret = -1;
> -               else {
> -                       pm8001_dbg(pm8001_ha, MSG,
> -                                  "iop1 ready status in %d millisec\n",
> -                                  (max_wait_time - max_wait_count));
> -               }
> -       }
> -
>         return ret;
>  }
>
> --
> 2.16.3
>

  reply	other threads:[~2021-01-05 13:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  4:57 [PATCH 0/8] pm80xx updates Viswas G
2020-12-30  4:57 ` [PATCH 1/8] pm80xx: No busywait in MPI init check Viswas G
2021-01-04  6:45   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 2/8] pm80xx: check fatal error Viswas G
2021-01-05 13:19   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 3/8] pm80xx: check main config table address Viswas G
2021-01-05 13:23   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 4/8] pm80xx: fix missing tag_free in NVMD DATA req Viswas G
2021-01-05 13:24   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 5/8] pm80xx: fix driver fatal dump failure Viswas G
2021-01-05 13:25   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 6/8] pm80xx: Simultaneous poll for all FW readiness Viswas G
2021-01-05 13:31   ` Jinpu Wang [this message]
2020-12-30  4:57 ` [PATCH 7/8] pm80xx: Log SATA IOMB completion status on failure Viswas G
2021-01-05 13:33   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 8/8] pm80xx: Add sysfs attribute for ioc health Viswas G
2021-01-05 13:35   ` Jinpu Wang
2021-01-08  3:21 ` [PATCH 0/8] pm80xx updates Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMGffE=06PW7Fc9EC_KxUW5aFk30oicFVZ8MbUC6p=k73KBF7A@mail.gmail.com' \
    --to=jinpu.wang@cloud.ionos.com \
    --cc=Ruksar.devadi@microchip.com \
    --cc=Vasanthalakshmi.Tharmarajan@microchip.com \
    --cc=Viswas.G@microchip.com \
    --cc=Viswas.G@microchip.com.com \
    --cc=akshatzen@google.com \
    --cc=bjashnani@google.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=radha@google.com \
    --cc=vishakhavc@google.com \
    --cc=yuuzheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.