All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinpu Wang <jinpu.wang@ionos.com>
To: Ajish Koshy <Ajish.Koshy@microchip.com>
Cc: linux-scsi@vger.kernel.org,
	Vasanthalakshmi.Tharmarajan@microchip.com,
	Viswas.G@microchip.com, damien.lemoal@opensource.wdc.com,
	john.garry@huawei.com, Jinpu Wang <jinpu.wang@ionos.com>
Subject: Re: [PATCH 1/2] scsi: pm80xx: mask and unmask upper interrupt vectors 32-63
Date: Mon, 28 Mar 2022 11:39:50 +0200	[thread overview]
Message-ID: <CAMGffEnQr0cQSwJ2ionZrFwLPb7Uvr8zby+y76+BDAX5E9jzbg@mail.gmail.com> (raw)
In-Reply-To: <20220328084243.301493-2-Ajish.Koshy@microchip.com>

On Mon, Mar 28, 2022 at 10:42 AM Ajish Koshy <Ajish.Koshy@microchip.com> wrote:
>
> When upper inbound and outbound queues 32-63 are enabled, we see upper
> vectors 32-63 in interrupt service routine. We need corresponding
> registers to handle masking and unmasking of these upper interrupts.
>
> To achieve this, we use registers MSGU_ODMR_U(0x34) to mask and
> MSGU_ODMR_CLR_U(0x3C) to unmask the interrupts. In these registers bit
> 0-31 represents interrupt vectors 32-63.
>
> Signed-off-by: Ajish Koshy <Ajish.Koshy@microchip.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
same as patch2, the fixes commit should be add here.
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 35 +++++++++++++++++++++++++++-----
>  1 file changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 9bb31f66db85..b92e82a576e3 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -1728,9 +1728,20 @@ pm80xx_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
>  {
>  #ifdef PM8001_USE_MSIX
>         u32 mask;
> -       mask = (u32)(1 << vec);
> +       u32 vec_u;
>
> -       pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_CLR, (u32)(mask & 0xFFFFFFFF));
> +       if (vec < 32) {
> +               mask = (u32)(1 << vec);
> +               /*vectors 0 - 31*/
> +               pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_CLR,
> +                           (u32)(mask & 0xFFFFFFFF));
> +       } else {
> +               vec_u = vec - 32;
> +               mask = (u32)(1 << vec_u);
> +               /*vectors 32 - 63*/
> +               pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_CLR_U,
> +                           (u32)(mask & 0xFFFFFFFF));
> +       }
>         return;
>  #endif
>         pm80xx_chip_intx_interrupt_enable(pm8001_ha);
> @@ -1747,11 +1758,25 @@ pm80xx_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
>  {
>  #ifdef PM8001_USE_MSIX
>         u32 mask;
> -       if (vec == 0xFF)
> +       u32 vec_u;
> +
> +       if (vec == 0xFF) {
>                 mask = 0xFFFFFFFF;
> -       else
> +               /* disable all vectors 0-31, 32-63*/
> +               pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, mask);
> +               pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_U, mask);
> +       } else if (vec < 32) {
>                 mask = (u32)(1 << vec);
> -       pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, (u32)(mask & 0xFFFFFFFF));
> +               /*vectors 0 - 31*/
> +               pm8001_cw32(pm8001_ha, 0, MSGU_ODMR,
> +                           (u32)(mask & 0xFFFFFFFF));
> +       } else {
> +               vec_u = vec - 32;
> +               mask = (u32)(1 << vec_u);
> +               /*vectors 32 - 63*/
> +               pm8001_cw32(pm8001_ha, 0, MSGU_ODMR_U,
> +                           (u32)(mask & 0xFFFFFFFF));
> +       }
>         return;
>  #endif
>         pm80xx_chip_intx_interrupt_disable(pm8001_ha);
> --
> 2.31.1
>

  parent reply	other threads:[~2022-03-28  9:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  8:42 [PATCH 0/2] pm80xx updates Ajish Koshy
2022-03-28  8:42 ` [PATCH 1/2] scsi: pm80xx: mask and unmask upper interrupt vectors 32-63 Ajish Koshy
2022-03-28  9:20   ` Damien Le Moal
2022-03-28 10:12     ` Ajish.Koshy
2022-03-28  9:39   ` Jinpu Wang [this message]
2022-03-28 10:53     ` Ajish.Koshy
2022-03-28  8:42 ` [PATCH 2/2] scsi: pm80xx: enable upper inbound, outbound queues Ajish Koshy
2022-03-28  9:23   ` Damien Le Moal
2022-03-28 10:48     ` Ajish.Koshy
2022-03-28  9:37   ` Jinpu Wang
2022-03-28 10:51     ` Ajish.Koshy
2022-03-28 14:13   ` John Garry
2022-04-01  9:58     ` Ajish.Koshy

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=CAMGffEnQr0cQSwJ2ionZrFwLPb7Uvr8zby+y76+BDAX5E9jzbg@mail.gmail.com \
    --to=jinpu.wang@ionos.com \
    --cc=Ajish.Koshy@microchip.com \
    --cc=Vasanthalakshmi.Tharmarajan@microchip.com \
    --cc=Viswas.G@microchip.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=john.garry@huawei.com \
    --cc=linux-scsi@vger.kernel.org \
    /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.