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 5/8] pm80xx: fix driver fatal dump failure.
Date: Tue, 5 Jan 2021 14:25:52 +0100	[thread overview]
Message-ID: <CAMGffEkrL3KxK9M6kU5JC7GEtYn349t+jgbb_5X5se+Mx9gppA@mail.gmail.com> (raw)
In-Reply-To: <20201230045743.14694-6-Viswas.G@microchip.com.com>

On Wed, Dec 30, 2020 at 5:47 AM Viswas G <Viswas.G@microchip.com.com> wrote:
>
> From: Viswas G <Viswas.G@microchip.com>
>
> The fatal dump function pm80xx_get_fatal_dump() has two issues that
> result in the fatal dump not being completed successfully.
>
> 1. When trying collect fatal_logs from the application it is getting
> failed, because we are not shifting MEMBASE-II register properly.
> Once we read 64K region of data we have to shift the MEMBASE-II register
> and read the next chunk of data, then only we would be able to get
> complete data.
>
> 2. If timeout occurs our application will get stuck because we are not
> handling this case. In this patch it resolves all these issues.
>
> 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>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Thx
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 7d0eada11d3c..407c0cf6ab5f 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -349,10 +349,15 @@ ssize_t pm80xx_get_fatal_dump(struct device *cdev,
>                                 sprintf(
>                                 pm8001_ha->forensic_info.data_buf.direct_data,
>                                 "%08x ", 0xFFFFFFFF);
> -                               pm8001_cw32(pm8001_ha, 0,
> +                               return((char *)pm8001_ha->forensic_info.data_buf.direct_data -
> +                                               (char *)buf);
> +                       }
> +       /* reset fatal_forensic_shift_offset back to zero and reset MEMBASE 2 register to zero */
> +                       pm8001_ha->fatal_forensic_shift_offset = 0; /* location in 64k region */
> +                       pm8001_cw32(pm8001_ha, 0,
>                                         MEMBASE_II_SHIFT_REGISTER,
>                                         pm8001_ha->fatal_forensic_shift_offset);
> -                       }
> +               }
>                         /* Read the next block of the debug data.*/
>                         length_to_read = pm8001_mr32(fatal_table_address,
>                         MPI_FATAL_EDUMP_TABLE_ACCUM_LEN) -
> @@ -373,13 +378,12 @@ ssize_t pm80xx_get_fatal_dump(struct device *cdev,
>                                                                 = 0;
>                                 pm8001_ha->forensic_info.data_buf.read_len = 0;
>                         }
> -               }
>         }
>         offset = (int)((char *)pm8001_ha->forensic_info.data_buf.direct_data
>                         - (char *)buf);
>         pm8001_dbg(pm8001_ha, IO, "get_fatal_spcv: return4 0x%x\n", offset);
> -       return (char *)pm8001_ha->forensic_info.data_buf.direct_data -
> -               (char *)buf;
> +       return ((char *)pm8001_ha->forensic_info.data_buf.direct_data -
> +               (char *)buf);
>  }
>
>  /* pm80xx_get_non_fatal_dump - dump the nonfatal data from the dma
> --
> 2.16.3
>

  reply	other threads:[~2021-01-05 13:26 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 [this message]
2020-12-30  4:57 ` [PATCH 6/8] pm80xx: Simultaneous poll for all FW readiness Viswas G
2021-01-05 13:31   ` Jinpu Wang
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=CAMGffEkrL3KxK9M6kU5JC7GEtYn349t+jgbb_5X5se+Mx9gppA@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.