From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85D19C433EF for ; Thu, 6 Jan 2022 14:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239704AbiAFOLZ (ORCPT ); Thu, 6 Jan 2022 09:11:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239599AbiAFOLY (ORCPT ); Thu, 6 Jan 2022 09:11:24 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABCDC061245 for ; Thu, 6 Jan 2022 06:11:24 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id b13so9848562edd.8 for ; Thu, 06 Jan 2022 06:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8g4XRT7rWmM80EWeJhLTDWCOopUiX4fpxmTW0mMu6h4=; b=SwM+3x1KxwqhQAJ5JP80gv0sEubSJYSl17+bbtEoWWprc9lJEyrTe6n190lRZqo6GY /9I1jKTOa/p5rYp2CxIjM5YpQfvW55doJW2dmurrVKhMMFr2cPcGqWYEt1kkV9xiH+m0 qbmGuJJi4wFR8/SieyzIRfYk0ja+uwbDHrKy7OuRhwsYTQESNq/7rPv4LFhNvzvd6PRJ mWbqiS/WPt49J7J1zetqtIaQuyHvYT4v7Pu7v/FIrY6t2ybd+rb/EjbqYbG+rm6IapL1 LacypXHGvf6Wt24yWGfVXTQqVz53zljTYnfmeRoDPjKLbGYv5uhCPP+vlzvqtQxiYC3C svQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8g4XRT7rWmM80EWeJhLTDWCOopUiX4fpxmTW0mMu6h4=; b=dcTXV9/TeTHWPX9rcQvnxVqEp/GUxIPFI3KUGXCtmEScZk2JBGF/8MaG0DX3aIgr/u HfkmnWF8bgwKJ/bex4dnjcIsLH7ufL3YdjhHb6kfR7XrCpyRv/sONBg7UDzMkV3+9B8O S5Xn3zV//Ou51n6kbw7v3frzCu18fFv5mnn9ajgqw1xHMJwa5OB37egQZWn1BHTGhcol J9oMuEHaE5K95yChjr5C/a9fSlPtzdysUBpa0ESGUtqWl2i8e8YLF+F6zA5b4jfJww9J xoVNsDIkuWLLmnOMssIjnIA9hefP7OS3lP8QdYkHC1EFgYMEwjD+l2bCV28AU/jxPQqA LwTQ== X-Gm-Message-State: AOAM533PL2SiM/522pFVEUv0AhQXJ30QhDwv3EFehJU4+zAYntFRGwjJ T7P+Y3fINdvC4w/9Vearaw7knzaBlKqjgjXH/egrTJTpje0= X-Google-Smtp-Source: ABdhPJxv0YtJmRgNQV/3UY1K1ro/9vMStm2nvfVDxBK0UxnZ3nB6u74hGMA7/IZDSO/LFq3hnpVnulk8zNYnvGng6ng= X-Received: by 2002:a17:907:7295:: with SMTP id dt21mr45922826ejc.441.1641478282847; Thu, 06 Jan 2022 06:11:22 -0800 (PST) MIME-Version: 1.0 References: <20211228111753.10802-1-Ajish.Koshy@microchip.com> In-Reply-To: From: Jinpu Wang Date: Thu, 6 Jan 2022 15:11:12 +0100 Message-ID: Subject: Re: [PATCH] scsi: pm80xx: port reset timeout error handling correction. To: Ajish.Koshy@microchip.com Cc: linux-scsi@vger.kernel.org, Vasanthalakshmi.Tharmarajan@microchip.com, Viswas.G@microchip.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On Thu, Jan 6, 2022 at 2:12 PM wrote: > > Hi Jinpu, > > > Hi Ajish, > > > > > > On Tue, Dec 28, 2021 at 12:15 PM Ajish Koshy > > wrote: > > > > > > Error handling steps were not in sequence as per the programmers > > > manual. Expected sequence: > > > -PHY_DOWN (PORT_IN_RESET) > > > -PORT_RESET_TIMER_TMO > > > -Host aborts pending I/Os > > > -Host deregister the device > > > -Host sends HW_EVENT_PHY_DOWN ack > > > > Just to make sure, does the same sequence work for old pm8001 chip? > > Currently this code is modified and executed based on 8006 controller. > I need to check with team members about the this sequence on old > controller pm8001 chip. Thanks & Regards > > > > > > > Earlier, we were sending HW_EVENT_PHY_DOWN ack first and then > > > deregister the device. > > > > > > Signed-off-by: Ajish Koshy > > > Signed-off-by: Viswas G > > > --- > > > drivers/scsi/pm8001/pm8001_sas.c | 7 ++++++- > > > drivers/scsi/pm8001/pm8001_sas.h | 3 +++ > > > drivers/scsi/pm8001/pm80xx_hwi.c | 7 +++++-- > > > 3 files changed, 14 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/scsi/pm8001/pm8001_sas.c > > > b/drivers/scsi/pm8001/pm8001_sas.c > > > index c9a16eef38c1..160ee8b228c9 100644 > > > --- a/drivers/scsi/pm8001/pm8001_sas.c > > > +++ b/drivers/scsi/pm8001/pm8001_sas.c > > > @@ -1199,7 +1199,7 @@ int pm8001_abort_task(struct sas_task *task) > > > struct pm8001_device *pm8001_dev; > > > struct pm8001_tmf_task tmf_task; > > > int rc = TMF_RESP_FUNC_FAILED, ret; > > > - u32 phy_id; > > > + u32 phy_id, port_id; > > > struct sas_task_slow slow_task; > > > > > > if (unlikely(!task || !task->lldd_task || !task->dev)) @@ > > > -1246,6 +1246,7 @@ int pm8001_abort_task(struct sas_task *task) > > > DECLARE_COMPLETION_ONSTACK(completion_reset); > > > DECLARE_COMPLETION_ONSTACK(completion); > > > struct pm8001_phy *phy = pm8001_ha->phy + > > > phy_id; > > > + port_id = phy->port->port_id; > > > > > > /* 1. Set Device state as Recovery */ > > > pm8001_dev->setds_completion = &completion; @@ > > > -1297,6 +1298,10 @@ int pm8001_abort_task(struct sas_task *task) > > > PORT_RESET_TMO); > > > if (phy->port_reset_status == PORT_RESET_TMO) { > > > pm8001_dev_gone_notify(dev); > > > + PM8001_CHIP_DISP->hw_event_ack_req( > > > + pm8001_ha, 0, > > > + 0x07, /*HW_EVENT_PHY_DOWN ack*/ > > > + port_id, phy_id, 0, > > > + 0); > > > goto out; > > > } > > > } > > > diff --git a/drivers/scsi/pm8001/pm8001_sas.h > > > b/drivers/scsi/pm8001/pm8001_sas.h > > > index 83eec16d021d..a17da1cebce1 100644 > > > --- a/drivers/scsi/pm8001/pm8001_sas.h > > > +++ b/drivers/scsi/pm8001/pm8001_sas.h > > > @@ -216,6 +216,9 @@ struct pm8001_dispatch { > > > u32 state); > > > int (*sas_re_init_req)(struct pm8001_hba_info *pm8001_ha); > > > int (*fatal_errors)(struct pm8001_hba_info *pm8001_ha); > > > + void (*hw_event_ack_req)(struct pm8001_hba_info *pm8001_ha, > > > + u32 Qnum, u32 SEA, u32 port_id, u32 phyId, u32 param0, > > > + u32 param1); > > > }; > > > > > > struct pm8001_chip_info { > > > diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c > > > b/drivers/scsi/pm8001/pm80xx_hwi.c > > > index 0849ecc913c7..97750d0ebee9 100644 > > > --- a/drivers/scsi/pm8001/pm80xx_hwi.c > > > +++ b/drivers/scsi/pm8001/pm80xx_hwi.c > > > @@ -3709,8 +3709,10 @@ static int mpi_hw_event(struct > > pm8001_hba_info *pm8001_ha, void *piomb) > > > break; > > > case HW_EVENT_PORT_RESET_TIMER_TMO: > > > pm8001_dbg(pm8001_ha, MSG, > > "HW_EVENT_PORT_RESET_TIMER_TMO\n"); > > > - pm80xx_hw_event_ack_req(pm8001_ha, 0, > > HW_EVENT_PHY_DOWN, > > > - port_id, phy_id, 0, 0); > > > + if (!pm8001_ha->phy[phy_id].reset_completion) { > > > + pm80xx_hw_event_ack_req(pm8001_ha, 0, > > HW_EVENT_PHY_DOWN, > > > + port_id, phy_id, 0, 0); > > > + } > > > sas_phy_disconnected(sas_phy); > > > phy->phy_attached = 0; > > > sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR, > > > @@ -5051,4 +5053,5 @@ const struct pm8001_dispatch > > pm8001_80xx_dispatch = { > > > .fw_flash_update_req = pm8001_chip_fw_flash_update_req, > > > .set_dev_state_req = pm8001_chip_set_dev_state_req, > > > .fatal_errors = pm80xx_fatal_errors, > > > + .hw_event_ack_req = pm80xx_hw_event_ack_req, > > > }; > > > -- > > > 2.27.0 > > > > > Thanks, > Ajish