From patchwork Tue Apr 18 19:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranav Prasad X-Patchwork-Id: 85028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3071802vqo; Tue, 18 Apr 2023 12:14:54 -0700 (PDT) X-Google-Smtp-Source: AKy350aUIXg767nPhvm9foEoqaHFpBj8The47v16hhlGIioSSL13NAzJtz8DzRKrx3jehOiu4ygH X-Received: by 2002:a05:6a20:d38c:b0:ef:fad9:580 with SMTP id iq12-20020a056a20d38c00b000effad90580mr563633pzb.38.1681845294415; Tue, 18 Apr 2023 12:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681845294; cv=none; d=google.com; s=arc-20160816; b=wr6VgXCLhJ4wRWcEV2k2Oozy9yGqrpD0wk9EWXj1gu4LN6kkXSEQIoj5fuQ+qFXecB VTJdolaAXyLsNldsiOofosMuysHyELUcSssj3gGTnfafauFYy3EjYQJzi5k5ldtiGs+l an+nCymxdZ63JRd+k87ik81gCm/RPej5Xn/72GXiso5072hHRR+sCsj3+Jg07h/pran3 +fqNh3oE1bYGTDrUsW7O4YAWmvkq9egDmwSziXCqJGw/jwwOd6wbZCpllzY3EN//1qKf 3AW6TiTRHhh3h34BBYJUKgXdpRlQwyjtDNCrBfX+3g7n2DUwLozlvdkDYelteO/9FmzA zSNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=q2+l5nGu/U3DhJVr26RDR7VgHp3VrT06TGinEZDtaPo=; b=VQaEVFx5pTBXG7Jfl0zOQTaJpTtnyV9Rl4MA/vQPsRkZVI6llGtxY7WBk4D37N5Dho gvM6mBZOspxv6OBMJn+rThMWdzOr8VtlGWwRJMNvNK/a5cQCCQPOK+JU138gaSGBEaZI AYnYSTM4f3YgMgdjw70/cT/xHvuJ+D3t6LifwvgisjgE32dk2lY3qWLUIYX1L16/WE7E Dg57oRoK9LTdHYJnChDklXvn/+oG7RwMW6VEiPX1gV97pWRAIytJ/EhJIxj9bomHyzbe FjG2iM9/sOjlaTkWHvr9kLiQjZFbWxe7Qw71nZc6bzAZm616lvBoq7GvHZ3ZutYmLbyP FGZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=K90yjW6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a635d03000000b0051a7d79ffc9si1113492pgb.132.2023.04.18.12.14.39; Tue, 18 Apr 2023 12:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=K90yjW6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232163AbjDRTBy (ORCPT + 99 others); Tue, 18 Apr 2023 15:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbjDRTBu (ORCPT ); Tue, 18 Apr 2023 15:01:50 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F4005FFB for ; Tue, 18 Apr 2023 12:01:49 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-51f10b8b27dso568654a12.1 for ; Tue, 18 Apr 2023 12:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681844509; x=1684436509; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=q2+l5nGu/U3DhJVr26RDR7VgHp3VrT06TGinEZDtaPo=; b=K90yjW6lbljyadjV0UJ8p4j/Mt3hpNY1tOpdfG8MTeiBY75deOi153Pkgyk1DoRI1E KauCunGjIEicg8ES4Pn00k0CDq0IIMCjJRUx5wTLZ5hoXGbZy+WkHUsKpC8+JnQ12kn+ EJ/atimtEQwLVKkeAz+HDJSx+HXx6Tyo/OYciCCxhhlalByTv/9jgXgJ60XAiw3nIhpj ZgKLR5MU532P2ZLixs500JSQr4QBnv0vmaWUnRps22iukd1CbLpk4ym7gXy87jbnDo42 06u++dZrMZVU65bqio2cJBsNXOY3agTi1Huwa+aieVFQ8a4WS+d/VgfWbL/RN5IwR10p K8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844509; x=1684436509; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q2+l5nGu/U3DhJVr26RDR7VgHp3VrT06TGinEZDtaPo=; b=fImZXbtOB9r5uEzEWGnSs+FTX/LbyWRwH8cQMvpLQIc11eijH8vGIvT2cvn3mxYBOc F5RZ64WzUT/jPniSYJ9ytEcIZX/l9HC/GTOnaz1GnYFJda2/x2WQ87H4dFJKax6pkAjZ PjbXYcXwa7jIYp9BaTuoiH17XJ/WwrR9qrwH8VbMSxFzfKmu/oICk18PwJMZ+NcG2Bip Z5Erxfr94HkJ5LC4v0OXXa1UfwF7XytOPlzTvm0cY41YHLaLxtP/44+HMZm7h1yQwO/y oSTL/pkslLciejyZzXpqF6gkUE0D6x5FqroRGqSxLMNSwogtLVL4XmPxi20DCEfBL2Iy lqyw== X-Gm-Message-State: AAQBX9eyRn4b56uQ4NA4IqR/DheRrrQw6TNN2QVIIOTgpF2G3fHBSzsy l6QUwiAwvbhbdxe21oYlyUv35Du8BqmqoA== X-Received: from pranav-first.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:390b]) (user=pranavpp job=sendgmr) by 2002:a63:1f1a:0:b0:50c:bde:50c7 with SMTP id f26-20020a631f1a000000b0050c0bde50c7mr886192pgf.12.1681844508984; Tue, 18 Apr 2023 12:01:48 -0700 (PDT) Date: Tue, 18 Apr 2023 19:00:56 +0000 In-Reply-To: <20230418190101.696345-1-pranavpp@google.com> Mime-Version: 1.0 References: <20230418190101.696345-1-pranavpp@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418190101.696345-2-pranavpp@google.com> Subject: [PATCH 1/6] scsi: pm80xx: Log some HW events by default From: Pranav Prasad To: Jack Wang , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Akshat Jain , Pranav Prasad X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763542611318069198?= X-GMAIL-MSGID: =?utf-8?q?1763542611318069198?= From: Akshat Jain Log the following hw_event logs under EVENT log severity to help debug disk issues: HW_EVENT_LINK_ERR_INVALID_DWORD HW_EVENT_LINK_ERR_DISPARITY_ERROR HW_EVENT_LINK_ERR_CODE_VIOLATION HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH HW_EVENT_LINK_ERR_PHY_RESET_FAILED HW_EVENT_INBOUND_CRC_ERROR HW_EVENT_PHY_ERROR HW_EVENT_SAS_PHY_UP HW_EVENT_SATA_PHY_UP HW_EVENT_SATA_SPINUP_HOLD HW_EVENT_PHY_DOWN HW_EVENT_PORT_INVALID HW_EVENT_MALFUNCTION HW_EVENT_PORT_RESET_TIMER_TMO HW_EVENT_PORT_RECOVERY_TIMER_TMO HW_EVENT_HARD_RESET_RECEIVED HW_EVENT_ID_FRAME_TIMEOUT HW_EVENT_PORT_RECOVER Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Acked-by: Jack Wang --- drivers/scsi/pm8001/pm8001_init.c | 3 +- drivers/scsi/pm8001/pm8001_sas.h | 1 + drivers/scsi/pm8001/pm80xx_hwi.c | 72 ++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 7e589fe3e010..d8dc629c0efb 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -43,7 +43,8 @@ #include "pm8001_chips.h" #include "pm80xx_hwi.h" -static ulong logging_level = PM8001_FAIL_LOGGING | PM8001_IOERR_LOGGING; +static ulong logging_level = PM8001_FAIL_LOGGING | PM8001_IOERR_LOGGING | + PM8001_EVENT_LOGGING; module_param(logging_level, ulong, 0644); MODULE_PARM_DESC(logging_level, " bits for enabling logging info."); diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index dc1f4d958e03..953572fc0d9e 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -71,6 +71,7 @@ #define PM8001_DEV_LOGGING 0x80 /* development message logging */ #define PM8001_DEVIO_LOGGING 0x100 /* development io message logging */ #define PM8001_IOERR_LOGGING 0x200 /* development io err message logging */ +#define PM8001_EVENT_LOGGING 0x400 /* HW event logging */ #define pm8001_info(HBA, fmt, ...) \ pr_info("%s:: %s %d: " fmt, \ diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 9584cadc4201..ce6a442d2418 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3425,26 +3425,31 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) switch (eventType) { case HW_EVENT_SAS_PHY_UP: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PHY_START_STATUS\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_SAS_PHY_UP phyid:%#x\n", phy_id); hw_event_sas_phy_up(pm8001_ha, piomb); break; case HW_EVENT_SATA_PHY_UP: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_SATA_PHY_UP\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_SATA_PHY_UP phyid:%#x\n", phy_id); hw_event_sata_phy_up(pm8001_ha, piomb); break; case HW_EVENT_SATA_SPINUP_HOLD: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_SATA_SPINUP_HOLD\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_SATA_SPINUP_HOLD phyid:%#x\n", phy_id); sas_notify_phy_event(&phy->sas_phy, PHYE_SPINUP_HOLD, GFP_ATOMIC); break; case HW_EVENT_PHY_DOWN: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PHY_DOWN\n"); + pm8001_dbg(pm8001_ha, EVENT, "HW_EVENT_PHY_DOWN phyid:%#x\n", + phy_id); hw_event_phy_down(pm8001_ha, piomb); phy->phy_attached = 0; phy->phy_state = PHY_LINK_DISABLE; break; case HW_EVENT_PORT_INVALID: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PORT_INVALID\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PORT_INVALID phyid:%#x\n", phy_id); sas_phy_disconnected(sas_phy); phy->phy_attached = 0; sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR, @@ -3463,7 +3468,8 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) GFP_ATOMIC); break; case HW_EVENT_PHY_ERROR: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PHY_ERROR\n"); + pm8001_dbg(pm8001_ha, EVENT, "HW_EVENT_PHY_ERROR phyid:%#x\n", + phy_id); sas_phy_disconnected(&phy->sas_phy); phy->phy_attached = 0; sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_ERROR, GFP_ATOMIC); @@ -3477,34 +3483,39 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) GFP_ATOMIC); break; case HW_EVENT_LINK_ERR_INVALID_DWORD: - pm8001_dbg(pm8001_ha, MSG, - "HW_EVENT_LINK_ERR_INVALID_DWORD\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_LINK_ERR_INVALID_DWORD phyid:%#x\n", + phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0); break; case HW_EVENT_LINK_ERR_DISPARITY_ERROR: - pm8001_dbg(pm8001_ha, MSG, - "HW_EVENT_LINK_ERR_DISPARITY_ERROR\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_LINK_ERR_DISPARITY_ERROR phyid:%#x\n", + phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_DISPARITY_ERROR, port_id, phy_id, 0, 0); break; case HW_EVENT_LINK_ERR_CODE_VIOLATION: - pm8001_dbg(pm8001_ha, MSG, - "HW_EVENT_LINK_ERR_CODE_VIOLATION\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_LINK_ERR_CODE_VIOLATION phyid:%#x\n", + phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_CODE_VIOLATION, port_id, phy_id, 0, 0); break; case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH: - pm8001_dbg(pm8001_ha, MSG, - "HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH phyid:%#x\n", + phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH, port_id, phy_id, 0, 0); break; case HW_EVENT_MALFUNCTION: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_MALFUNCTION\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_MALFUNCTION phyid:%#x\n", phy_id); break; case HW_EVENT_BROADCAST_SES: pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_BROADCAST_SES\n"); @@ -3515,25 +3526,29 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) GFP_ATOMIC); break; case HW_EVENT_INBOUND_CRC_ERROR: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_INBOUND_CRC_ERROR\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_INBOUND_CRC_ERROR phyid:%#x\n", phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_INBOUND_CRC_ERROR, port_id, phy_id, 0, 0); break; case HW_EVENT_HARD_RESET_RECEIVED: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_HARD_RESET_RECEIVED\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_HARD_RESET_RECEIVED phyid:%#x\n", phy_id); sas_notify_port_event(sas_phy, PORTE_HARD_RESET, GFP_ATOMIC); break; case HW_EVENT_ID_FRAME_TIMEOUT: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_ID_FRAME_TIMEOUT\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_ID_FRAME_TIMEOUT phyid:%#x\n", phy_id); sas_phy_disconnected(sas_phy); phy->phy_attached = 0; sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR, GFP_ATOMIC); break; case HW_EVENT_LINK_ERR_PHY_RESET_FAILED: - pm8001_dbg(pm8001_ha, MSG, - "HW_EVENT_LINK_ERR_PHY_RESET_FAILED\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_LINK_ERR_PHY_RESET_FAILED phyid:%#x\n", + phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_PHY_RESET_FAILED, port_id, phy_id, 0, 0); @@ -3543,7 +3558,9 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) GFP_ATOMIC); break; case HW_EVENT_PORT_RESET_TIMER_TMO: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PORT_RESET_TIMER_TMO\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PORT_RESET_TIMER_TMO phyid:%#x\n", + phy_id); 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); @@ -3560,8 +3577,9 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) } break; case HW_EVENT_PORT_RECOVERY_TIMER_TMO: - pm8001_dbg(pm8001_ha, MSG, - "HW_EVENT_PORT_RECOVERY_TIMER_TMO\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PORT_RECOVERY_TIMER_TMO phyid:%#x\n", + phy_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_PORT_RECOVERY_TIMER_TMO, port_id, phy_id, 0, 0); @@ -3575,11 +3593,15 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) } break; case HW_EVENT_PORT_RECOVER: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PORT_RECOVER\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PORT_RECOVER phyid:%#x port_id:%#x\n", + phy_id, port_id); hw_event_port_recover(pm8001_ha, piomb); break; case HW_EVENT_PORT_RESET_COMPLETE: - pm8001_dbg(pm8001_ha, MSG, "HW_EVENT_PORT_RESET_COMPLETE\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PORT_RESET_COMPLETE phyid:%#x port_id:%#x\n", + phy_id, port_id); if (pm8001_ha->phy[phy_id].reset_completion) { pm8001_ha->phy[phy_id].port_reset_status = PORT_RESET_SUCCESS; From patchwork Tue Apr 18 19:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranav Prasad X-Patchwork-Id: 85022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3070347vqo; Tue, 18 Apr 2023 12:11:59 -0700 (PDT) X-Google-Smtp-Source: AKy350b1saDsfdRRpPqsNnmNQxmCf14yoea79O6fkfavECGF4FBXPSrR9Y0iEqnBaHLVbZNrF4LD X-Received: by 2002:a05:6a20:94c7:b0:f0:752a:127a with SMTP id ht7-20020a056a2094c700b000f0752a127amr542207pzb.46.1681845119082; Tue, 18 Apr 2023 12:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681845119; cv=none; d=google.com; s=arc-20160816; b=bhC6UVHLTCWr3GRep9tpuvB55kq5jsGWgzAsY3ABwFl6/M+nWIrI8OMtzQhoi1W2he JI5Ohhllmd/W4G1H2RPQGSnyqO0H8tuuDFV5dKWFV1AoL97Apl7IBA5+Pkm7rc/2TWOc 5EYBegZVH/APxtczIVKAtnXDqu05f2BlHt55oMLlSCwNVIqhbiGnDulsOmEgih1LRv7B e6peYr2om09h2E7dgbzXKH4E8nJwhzJVEN1kieU7rywAY06LcjgmZDV+GSiyYux8GyLI m/MmLmtMnc7gSmtRyau+jYkGXVPWVCqe5mySqW9nWI7gdhq8hp3f1Lxzlu5anyIWOS4l NrnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=3M04/PVG/NW2ywLizOW6+L2fN0aG9yYd0DnDu5UetZk=; b=pIqxNfvo96wp+w325G2eIlwVjOFGoFuLtuZYbGi6uglQArxOiKVLMSYnM0AuPYFyqn /eopamEbpfeqIZgL1olOdrzrZ9tYkbdtbGp3G9Ju9vdVvl58oX/Ux6l/dyXFIsYlMYiw EO57Bfwh+AUXIBC7qyLsKHotLKWXFAbCQEuCUdux8qGz4ngi0drVaEG86X9QC/puw0sl y72dNzaDSTjV6A6toKmJOHbiSpzrwDB+R8O/mKUSxR2TUQnEo7v/qn8aBzRzkA0jQKK8 QaoAnachSbtO8H70re417Oud8Rpz5+Xu72TXKRjhh4IUrcqps/DppVls8HMh93W87mq/ NJ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=jg+iCQtw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a11-20020a63d40b000000b00518ebc6f91csi15471434pgh.306.2023.04.18.12.11.43; Tue, 18 Apr 2023 12:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=jg+iCQtw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232694AbjDRTCH (ORCPT + 99 others); Tue, 18 Apr 2023 15:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbjDRTBw (ORCPT ); Tue, 18 Apr 2023 15:01:52 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846548A46 for ; Tue, 18 Apr 2023 12:01:51 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-552f169d85eso44888867b3.13 for ; Tue, 18 Apr 2023 12:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681844510; x=1684436510; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3M04/PVG/NW2ywLizOW6+L2fN0aG9yYd0DnDu5UetZk=; b=jg+iCQtwdF8xsttudTN/6DvOTpNp4mkmnjDOOLQnElAXlkSTlPdIIA2PKtJG7o6J8k Z5ZIc6nHuE629pFZDMqIMndfSHLVvTAjtrI6dcs8cyWnCHLZjkl6U+XX9oC1biQKyEQc s+xMXOR+KpQsABmTJZL595TnCs/MvZRoUR3InKPvoAUe8nf4RY0gY+Ex5HHroIZel8Fe 3mpbtlZhJfAsTMZGCwt3488DtYArf9ovsAhjZ51Mt64qdcBG6h8fzSZMXeseLPSK6aX6 mpBVOfcMHEDD8DmLqgowfyihlH4Kqj0SOvNuCWsJyKIrYuqoZDQELFQNU4Y9eGTUjdrI qMSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844510; x=1684436510; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3M04/PVG/NW2ywLizOW6+L2fN0aG9yYd0DnDu5UetZk=; b=WAYI8YhPNUV0Msk2bQdUxyRuV8tUv3oUg5OPsLAGilTfhw2aTH8AkqwOXWIrq7WGSs J4zfNfAqR1fetvGOb87USfbM6GNqFTkZrJ13RmDxbOrwcIXBnovILgNvVJhJmo5Lu/ld DrpOMSwLgcV9vgeeZ9xlzg9ATcXRqM7Ad92cRWHPRHc7EEL1z8CvzAVo3ADo43Ox7qlg H//9OTkfEv/XC5yGBuWRVgkLK2uuo6d6CU0x57pyEiryDlYGSKbk/BxhYiIJabrNzuzD kyTPJt6P8qIeJMDMqp0LqFWIcmxqj1r7AWPi8V7kYoYr+KdZquVJjhxVJrv5Ix9fFD8P RlDQ== X-Gm-Message-State: AAQBX9cH4BTOOI+lWffQSpCj4i35mb6CL02gMGnzQL9JVoIE1pfe1vah arxrRJZ5Frs00K06b6LBMWPLDV0+IbBcgQ== X-Received: from pranav-first.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:390b]) (user=pranavpp job=sendgmr) by 2002:a81:bd4f:0:b0:54c:bf7:1853 with SMTP id n15-20020a81bd4f000000b0054c0bf71853mr499349ywk.6.1681844510798; Tue, 18 Apr 2023 12:01:50 -0700 (PDT) Date: Tue, 18 Apr 2023 19:00:57 +0000 In-Reply-To: <20230418190101.696345-1-pranavpp@google.com> Mime-Version: 1.0 References: <20230418190101.696345-1-pranavpp@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418190101.696345-3-pranavpp@google.com> Subject: [PATCH 2/6] scsi: pm80xx: Enable init logging From: Pranav Prasad To: Jack Wang , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Akshat Jain , Pranav Prasad X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763542427736666772?= X-GMAIL-MSGID: =?utf-8?q?1763542427736666772?= From: Akshat Jain Enable init logging to debug drive discovery issues. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Acked-by: Jack Wang --- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/pm8001/pm80xx_hwi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index d8dc629c0efb..041cdc41af80 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -44,7 +44,7 @@ #include "pm80xx_hwi.h" static ulong logging_level = PM8001_FAIL_LOGGING | PM8001_IOERR_LOGGING | - PM8001_EVENT_LOGGING; + PM8001_EVENT_LOGGING | PM8001_INIT_LOGGING; module_param(logging_level, ulong, 0644); MODULE_PARM_DESC(logging_level, " bits for enabling logging info."); diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index ce6a442d2418..61c1bf3d98a0 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4837,7 +4837,7 @@ static void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha, payload.tag = cpu_to_le32(tag); payload.ppc_phyid = cpu_to_le32(((operation & 0xF) << 8) | (phyid & 0xFF)); - pm8001_dbg(pm8001_ha, INIT, + pm8001_dbg(pm8001_ha, DISC, " phy profile command for phy %x ,length is %d\n", le32_to_cpu(payload.ppc_phyid), length); for (i = length; i < (length + PHY_DWORD_LENGTH - 1); i++) { From patchwork Tue Apr 18 19:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranav Prasad X-Patchwork-Id: 85021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3066343vqo; Tue, 18 Apr 2023 12:04:51 -0700 (PDT) X-Google-Smtp-Source: AKy350Zu+P81FH+A8wjg/L2z86ACVobpL5TLFw1l8TvnEgVQ1dVADyHm1jdUcnFMM8oe45w/DnLZ X-Received: by 2002:a17:903:22cf:b0:1a5:1438:9bcd with SMTP id y15-20020a17090322cf00b001a514389bcdmr3338622plg.35.1681844691227; Tue, 18 Apr 2023 12:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681844691; cv=none; d=google.com; s=arc-20160816; b=RiCrqdAl5xcLEcTDVJu85HyGtULyuoRE9M+FF+zenm1av9gLygF95F008ag6NGJ9dm DmAdVGAQii9nN3BvltiqHwRMW3N3jxNgrJve8z8pu2uy62FPLMrGrk/H44Asm8I+R73V VFMfeLF3kjp1q0qbBtWNFlMLkcfdMcGbF1q8CvUVyPZxjp83+flHQUsR5n6eO8tUFQqq xzc4lKPM3gzAE5wx11spRtGMBPMzkye+rHkG82un57MO9RjIF/7B1jtjo46lP66MmeRR sjkE5+7e7o3fA+HcfVza9eEZTLY5hDJUP17tXowHoKHAp0/KKll2Y0aJuzIHfQ/5/TGi 2OYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=UH6ww4Tz5A/eOvsrLoChrvszKblTPJdXQlcphIuhfCY=; b=EXeAldw3cB6sQHsZ7YH/tXeBSMTOLAhFDCdNzbnsEqVK23/+fMhSyONabV21eixyX2 yfya0hWKlHwYNJ8X6q00VOmmKLvJRtQVKVhtEso7tyDUOjX3ohEFiqBaW7aN1VFw0YRU FMd2ilmtJy294d+XM40xAipPV6LPIfAmuLMDGLwfX9DJnd3OAdNSdAjGbDnDp+2Mg3Pr FXYL8vorhyVWL7X62eVM/Wsqb5b2sqDnMCvUYtRKG7YIrVHXwQvzwvizZNZFAb47YbR4 84e2oCDNgXt1QpHk7zuOEM0sQ3DuvYFWK8CaalcB5xpgMQtSIWeRNMKizxlVsYuelyen TWfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Xb4iQzwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a170903245200b001a6492cdf2bsi15398460pls.343.2023.04.18.12.04.33; Tue, 18 Apr 2023 12:04:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Xb4iQzwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232735AbjDRTCK (ORCPT + 99 others); Tue, 18 Apr 2023 15:02:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232450AbjDRTBx (ORCPT ); Tue, 18 Apr 2023 15:01:53 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE75293D7 for ; Tue, 18 Apr 2023 12:01:52 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-5141c742deeso1368213a12.3 for ; Tue, 18 Apr 2023 12:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681844512; x=1684436512; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=UH6ww4Tz5A/eOvsrLoChrvszKblTPJdXQlcphIuhfCY=; b=Xb4iQzwLgZfPoUAQ/odJ+uLwMle0vkgg1CXXGcy+pK4IK8a5OITSiML3yjC9GIz+vt LglJZm9VtSDzqZ6zL1EqEt//YrAIc9qzOjQ/2tZ4x7oofiN/UKfvvGMnN2CUSveDqTp6 Y6qUOHeSTK7H8HaHkL7feME9f5tZs7Y8DwZU6DYL0318AK3qh4mgcbWpHQbX5KhiyX+O zYQQab4w/e+OfN5yF2Ok8eJA52iD/AwanOcagy49gu4uAoAf92SvPd5gx2lk/YadQ7fC sd9r05XEGj/lROATNCbm98AqauIDaEJBDeHgduuZza0Maqm4SQX/vyacsb0iuiGK5KI8 Rfpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844512; x=1684436512; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UH6ww4Tz5A/eOvsrLoChrvszKblTPJdXQlcphIuhfCY=; b=SSnRLX4hZpbPxt263YCj5XuV3pKwIBiR3xRBgSJHfZHr5pKBnnwQtDpii4Va4/ar8y 3DgrPwuu4VeuDddS62l7OlPFLa2U3tEnEh6TVoFamSfGujTfT+xrKPtcPl3SNdS9XMAz QGbEweASgxkcVfGufqdjY/+gasODvNFyV2A+XwDJkCBfGfW26z5h9pfgCSmiuOH4WwKa Tw3qVkg4TLshkoyNkylIvMrEK1KjQbG6xHf2l9ovdYTDDcH41ggtK2t9g6ssL44/7BK4 LPr+5YrCu2ArJGp1EycZ65SNMqptBLNqUF3NaGTKhHbiRQiaFdaXRQEm3/W51uU3f172 Rwjg== X-Gm-Message-State: AAQBX9d41vPavmmD/ifFlo0cL2p4Yk23tgIbzDn4bwtzBc+Oek8C/bdx w5FwmsGta+pZcr2gL+PY+8sufNR3zOfgcg== X-Received: from pranav-first.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:390b]) (user=pranavpp job=sendgmr) by 2002:a63:502:0:b0:520:6a0f:da2a with SMTP id 2-20020a630502000000b005206a0fda2amr89585pgf.8.1681844512153; Tue, 18 Apr 2023 12:01:52 -0700 (PDT) Date: Tue, 18 Apr 2023 19:00:58 +0000 In-Reply-To: <20230418190101.696345-1-pranavpp@google.com> Mime-Version: 1.0 References: <20230418190101.696345-1-pranavpp@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418190101.696345-4-pranavpp@google.com> Subject: [PATCH 3/6] scsi: pm80xx: Print port_id in HW events From: Pranav Prasad To: Jack Wang , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Akshat Jain , Pranav Prasad X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763541979017260196?= X-GMAIL-MSGID: =?utf-8?q?1763541979017260196?= From: Akshat Jain Log port_id and phy_id along with the PHY_UP event. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Acked-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.c | 58 ++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 61c1bf3d98a0..c5bf65d0ad14 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3426,30 +3426,35 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) case HW_EVENT_SAS_PHY_UP: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_SAS_PHY_UP phyid:%#x\n", phy_id); + "HW_EVENT_SAS_PHY_UP phyid:%#x port_id:%#x\n", + phy_id, port_id); hw_event_sas_phy_up(pm8001_ha, piomb); break; case HW_EVENT_SATA_PHY_UP: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_SATA_PHY_UP phyid:%#x\n", phy_id); + "HW_EVENT_SATA_PHY_UP phyid:%#x port_id:%#x\n", + phy_id, port_id); hw_event_sata_phy_up(pm8001_ha, piomb); break; case HW_EVENT_SATA_SPINUP_HOLD: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_SATA_SPINUP_HOLD phyid:%#x\n", phy_id); + "HW_EVENT_SATA_SPINUP_HOLD phyid:%#x port_id:%#x\n", + phy_id, port_id); sas_notify_phy_event(&phy->sas_phy, PHYE_SPINUP_HOLD, GFP_ATOMIC); break; case HW_EVENT_PHY_DOWN: - pm8001_dbg(pm8001_ha, EVENT, "HW_EVENT_PHY_DOWN phyid:%#x\n", - phy_id); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x\n", + phy_id, port_id); hw_event_phy_down(pm8001_ha, piomb); phy->phy_attached = 0; phy->phy_state = PHY_LINK_DISABLE; break; case HW_EVENT_PORT_INVALID: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_PORT_INVALID phyid:%#x\n", phy_id); + "HW_EVENT_PORT_INVALID phyid:%#x port_id:%#x\n", + phy_id, port_id); sas_phy_disconnected(sas_phy); phy->phy_attached = 0; sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR, @@ -3468,8 +3473,9 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) GFP_ATOMIC); break; case HW_EVENT_PHY_ERROR: - pm8001_dbg(pm8001_ha, EVENT, "HW_EVENT_PHY_ERROR phyid:%#x\n", - phy_id); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_ERROR phyid:%#x port_id:%#x\n", + phy_id, port_id); sas_phy_disconnected(&phy->sas_phy); phy->phy_attached = 0; sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_ERROR, GFP_ATOMIC); @@ -3484,31 +3490,31 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) break; case HW_EVENT_LINK_ERR_INVALID_DWORD: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_LINK_ERR_INVALID_DWORD phyid:%#x\n", - phy_id); + "HW_EVENT_LINK_ERR_INVALID_DWORD phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0); break; case HW_EVENT_LINK_ERR_DISPARITY_ERROR: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_LINK_ERR_DISPARITY_ERROR phyid:%#x\n", - phy_id); + "HW_EVENT_LINK_ERR_DISPARITY_ERROR phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_DISPARITY_ERROR, port_id, phy_id, 0, 0); break; case HW_EVENT_LINK_ERR_CODE_VIOLATION: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_LINK_ERR_CODE_VIOLATION phyid:%#x\n", - phy_id); + "HW_EVENT_LINK_ERR_CODE_VIOLATION phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_CODE_VIOLATION, port_id, phy_id, 0, 0); break; case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH phyid:%#x\n", - phy_id); + "HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH, port_id, phy_id, 0, 0); @@ -3527,7 +3533,8 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) break; case HW_EVENT_INBOUND_CRC_ERROR: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_INBOUND_CRC_ERROR phyid:%#x\n", phy_id); + "HW_EVENT_INBOUND_CRC_ERROR phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_INBOUND_CRC_ERROR, port_id, phy_id, 0, 0); @@ -3547,8 +3554,8 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) break; case HW_EVENT_LINK_ERR_PHY_RESET_FAILED: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_LINK_ERR_PHY_RESET_FAILED phyid:%#x\n", - phy_id); + "HW_EVENT_LINK_ERR_PHY_RESET_FAILED phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_LINK_ERR_PHY_RESET_FAILED, port_id, phy_id, 0, 0); @@ -3559,8 +3566,8 @@ 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, EVENT, - "HW_EVENT_PORT_RESET_TIMER_TMO phyid:%#x\n", - phy_id); + "HW_EVENT_PORT_RESET_TIMER_TMO phyid:%#x port_id:%#x\n", + phy_id, port_id); 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); @@ -3578,8 +3585,8 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) break; case HW_EVENT_PORT_RECOVERY_TIMER_TMO: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_PORT_RECOVERY_TIMER_TMO phyid:%#x\n", - phy_id); + "HW_EVENT_PORT_RECOVERY_TIMER_TMO phyid:%#x port_id:%#x\n", + phy_id, port_id); pm80xx_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_PORT_RECOVERY_TIMER_TMO, port_id, phy_id, 0, 0); @@ -3613,8 +3620,9 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) pm8001_dbg(pm8001_ha, MSG, "EVENT_BROADCAST_ASYNCH_EVENT\n"); break; default: - pm8001_dbg(pm8001_ha, DEVIO, "Unknown event type 0x%x\n", - eventType); + pm8001_dbg(pm8001_ha, DEVIO, + "Unknown event portid:%d phyid:%d event:0x%x status:0x%x\n", + port_id, phy_id, eventType, status); break; } return 0; From patchwork Tue Apr 18 19:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranav Prasad X-Patchwork-Id: 85025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3071272vqo; Tue, 18 Apr 2023 12:13:51 -0700 (PDT) X-Google-Smtp-Source: AKy350az4ulzuKOFgAfjqIWM8o9NZu3ghDrO+Z0RwzFhGBbrFrZs8vr1/QK3oZud0swmTkgKVj/x X-Received: by 2002:a17:902:cf52:b0:1a6:639e:887e with SMTP id e18-20020a170902cf5200b001a6639e887emr2741718plg.13.1681845231636; Tue, 18 Apr 2023 12:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681845231; cv=none; d=google.com; s=arc-20160816; b=iwrkPUwUrdsZxoStJSC5l7Fi6FQeHSsAQxopW+Px0cJH7UP68WqXb8IT/oDyUV4CrN elZxmxg1Mj8g0WwQsWjK59Wthc6e0ghXcy5dF5jwdZEKl7mxWtW6JVZMGDvJOvDaVhHz gZ7lAI4i7wbXMoY7LirX9fWPwJ4Zd8ofeMZi+WqalTIYhPtiYzxA8vYzZR0ZuZDxEY1t YtPlQUBuIDRkDMl3ro6GHdgy0oJ45LUJ+qfoB9WyXpG/fJntEod/zL9JH82Tm+j30OgJ HLJZHS6dmvjYcIV0uTckixJNEeYN0C+yO7PvjfawdPie59oCszJZbYfnQ4KsmjM4t1kn F0qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=Q705pkA7pRJMTNZuDFlVqTXdHPjT6mc0BG+foW8FYi0=; b=ZpDouYQRwyCg20q1eolR5ZJFFkUMnGr9Wj6gb8R8QQhoa7jpFHjWekWKoxml2YuIR1 B64nXKkG6h26ZzgYI46u1pEcdr2wuEiZQPug67fmGJzA9T2JHCKKlGcOph5p8qryjVor 32wGGpL/HG4YG+ZAYP+bj40KpY/up+mTWnClDXCqqZ6Tf+RAyJqtPC5A+0FHMeGkYTKG gHrXH335xjvgddmzY/i1KD6FBy80p6AqumRODaipPaL+bsfPfX9UjBsDD4tXmFTCiB9v yMomxjrwGGuAq9jesjXrce9OA86ORAZ9P19nEdZlrM1intsx036P1nf83uFeixrJqvOd Kbvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=GqaVpB2z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902c40900b001a1a9a1d336si16013192plk.206.2023.04.18.12.13.11; Tue, 18 Apr 2023 12:13:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=GqaVpB2z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbjDRTCO (ORCPT + 99 others); Tue, 18 Apr 2023 15:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232239AbjDRTBz (ORCPT ); Tue, 18 Apr 2023 15:01:55 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AB4EAF1E for ; Tue, 18 Apr 2023 12:01:54 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-246f13f35f1so1304791a91.3 for ; Tue, 18 Apr 2023 12:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681844513; x=1684436513; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Q705pkA7pRJMTNZuDFlVqTXdHPjT6mc0BG+foW8FYi0=; b=GqaVpB2zVNhyjotwG0yVhTUD2FgvGT2em4z75cUO2Etv9n/147+YOqB1E8CyE4fiv3 JEf8JAbdkea0iZPmSHSc15ndLOJ2IkC4Sj6HeYSJdQpMsdA78+IA0GK/IKQA0r9nncfo bXcfgRJkYIJuIlbUNqa2N8hn3g3CWMlgBLhbNelz093pW51MxIt4CGWlAhGz2OtZX43h TcjF0s+XJQYHIgn75hlKWOQhCzDd3pN5zXhBXhWHoqrc2U9lC+qvgvrQeyD4dAmbJHrE LP1INYSdOeVG/U2wmrnEflyUDg8+aZwcaTznM3pehyzxkLgbWsyrxgPH5e78ZwEaBeSA hAqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844513; x=1684436513; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Q705pkA7pRJMTNZuDFlVqTXdHPjT6mc0BG+foW8FYi0=; b=BYD0WAHFAPesJN8pZuRa22IY8xckS2O7H6E1aM01lAggT8ozQmlDAiQfqSicP+vteY RrZbbSL6WkWbjj5L3bAF3cVBOvwIryp+23C3oRkz+p3Se2oeN/bhjiRo5ZCcbNohFiHK TD3vxRUbMDCPQ2WLGdCdYvOv8xwsjuwpo41VEBJevshnJgKcEECmQNS9YppUNUvjLaIx /hkLyCLGNEPqu7/RmFkT7FPdY4M/W2Wy1mYSgXsLIx7WlX4GOhvo1CFib8dYUsZRCR3c 6ePYovS8aNBKoBOsosGTWSk6GnVmB85UhXweEJk06cDZ96MCyQOhp6hya1rBnDAntISf OG9w== X-Gm-Message-State: AAQBX9fI8fBBQ0cIjwfh+TF9VMlh8m3L1LQ9JszYBu9kmIc9Ynv/ZewU MnLDsExTN02/LYZk6M/nfItU8mtXELHR+g== X-Received: from pranav-first.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:390b]) (user=pranavpp job=sendgmr) by 2002:a17:90a:3182:b0:247:11e6:f6ff with SMTP id j2-20020a17090a318200b0024711e6f6ffmr260224pjb.3.1681844513734; Tue, 18 Apr 2023 12:01:53 -0700 (PDT) Date: Tue, 18 Apr 2023 19:00:59 +0000 In-Reply-To: <20230418190101.696345-1-pranavpp@google.com> Mime-Version: 1.0 References: <20230418190101.696345-1-pranavpp@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418190101.696345-5-pranavpp@google.com> Subject: [PATCH 4/6] scsi: pm80xx: Log phy_id and port_id in the device registration request From: Pranav Prasad To: Jack Wang , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Akshat Jain , Pranav Prasad X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763542545488510436?= X-GMAIL-MSGID: =?utf-8?q?1763542545488510436?= From: Akshat Jain Print phy_id and port_id sent as part of device registration request. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Acked-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index c5bf65d0ad14..8571f6222eb8 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4756,6 +4756,9 @@ static int pm80xx_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha, memcpy(payload.sas_addr, pm8001_dev->sas_device->sas_addr, SAS_ADDR_SIZE); + pm8001_dbg(pm8001_ha, INIT, + "register device req phy_id 0x%x port_id 0x%x\n", phy_id, + (port->port_id & 0xFF)); rc = pm8001_mpi_build_cmd(pm8001_ha, 0, opc, &payload, sizeof(payload), 0); if (rc) From patchwork Tue Apr 18 19:01:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranav Prasad X-Patchwork-Id: 85020 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3066130vqo; Tue, 18 Apr 2023 12:04:32 -0700 (PDT) X-Google-Smtp-Source: AKy350Yyd0Pu6nlfP7M1NLrAw/h2pQvEbSyIMtQVkNiDNxnePXqYAi+PgEesxK7co0c2L333LAl+ X-Received: by 2002:a17:90a:49c2:b0:247:4e73:cbdd with SMTP id l2-20020a17090a49c200b002474e73cbddmr692383pjm.9.1681844672009; Tue, 18 Apr 2023 12:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681844671; cv=none; d=google.com; s=arc-20160816; b=giV1XmXZsjTFXjU/0xQA6DhLuPqT4MTPg0icmV2ZTsU0YbmGtqjjJIfi5od+f2XLKQ DrIcBiuLoEgoLgadSV389KxsrqQFy3asmBPDOa909njAuZDdQPe9vdHd58oox6NUsERc oD8FtNTkAyFzis++bvqHySd8Hfc3NiCmmmMoQWz93ZOuK3Qj/YG7csu6an8bGOLuKSib XQmQihwNvINxzI/1vRfn7D6rrANpW4h5glDO4YXuQmrd1VUgezCWLvD6zJk0ktHgdSby fbI6imQCtkat+JulKCNmpxCGPeRHyZ2MyQUATkqqEojPfyZBb7zn7B/jbS6Bi0icMDt1 zvlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=3f1EZFPL8iHspGFGaVTxk55voCz6/hxKfdvRSWrACZU=; b=UZLbrfexauG+1dq1GZf3bWIBBNQVlwyl8Xn1qyhz7GU+gK0BAKuJ/GFI8qABeHyGch oibbC8O3gXv8nhH857BP7+DS1DWntAbb8j3qM2sTtM8SD4fLwg/p6Z0VWdPhKrtbhU9O Rjzj1sw4n1Wwb35IYCS2XLhMJo8pK6jmm/VEjrmguFz8jOiO58js977AoyZfaJqj17WD LezRBdFJmHs2k9Gox22gaEa1UAzG4/Koh7BDDCqDePdeHch62E+ZYittbQUJ+nxKeInk +er/OHVVPnAi4aj66mPaPbTh5gsLzluCEtRZh+ZZRa8/15OgrMkE8iLHhtOGx2e+GoUs 27/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=c4zkBfft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oc18-20020a17090b1c1200b0024985861bc0si45359pjb.172.2023.04.18.12.04.17; Tue, 18 Apr 2023 12:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=c4zkBfft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232757AbjDRTCY (ORCPT + 99 others); Tue, 18 Apr 2023 15:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbjDRTCG (ORCPT ); Tue, 18 Apr 2023 15:02:06 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF0EAD1E for ; Tue, 18 Apr 2023 12:01:56 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 62-20020a250341000000b00b9505f220d4so2923809ybd.20 for ; Tue, 18 Apr 2023 12:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681844515; x=1684436515; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3f1EZFPL8iHspGFGaVTxk55voCz6/hxKfdvRSWrACZU=; b=c4zkBfftCqOGxIJfB9cQriVe/8h+ZPNmyfJOdK2vWCZJ2FY2PS3slFzP7qUWVUgOCO g3xzNpOdaDKxZJomDgGMM+sMCBb60KlfJqFcJbkbbjEKLCp73oaTNAs/fA0Sh+jE14ic 9UsZd4nYf3ofU1ZDxyx2Db50ssQGkDhNSFV5wE8CR2/DVlefX7gxOtf33CCWur4DKsas 2UcWpB8HKiCvO25zIln0pyDD7PoS42ITmu6WpyGPhZspjsXHZXwnDa4cX2ZDedqFbvCu UTFstZJwFFTSpROCCEr84N+7iD+LF2BceV20lBkZFUIO534srDc9R5H2tyyF6Iq8y9NL 0lCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844515; x=1684436515; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3f1EZFPL8iHspGFGaVTxk55voCz6/hxKfdvRSWrACZU=; b=P1+DDLHv40E4ZYmS3n2uSu74mF34DxcGgwuPO+KvXSB5hiXwzVv3Aabo91PAjjNu7y L5ZZQbWRZ5183y3EPMvxgw50LSp0wtiUTYTAecDGZdaEQeYzAExpW8pf47bJSSrhCppw nM8CnYHqguxMde3DTWFwUsliYgdg3bPZqp+d6I8V8tpmlFNGNKzq8iI4Y6YYbuCCjoSe 5xTkI63GiNZnQ7Hpehq/G+wNWvfGcFjwJQWtp3auGgZsM0aRdEgRE0JmVPpwmebiU/jl Gy5TI9K4OmFjUL8F4KTnG3rJNrgY7x3oGwg85+o+IllQO9szjQIeVdsa9HtK+wfSNu0b oyJA== X-Gm-Message-State: AAQBX9dYop3vw/NsHOPshM6vsUBDAQ6unx3uqvJkY4DNvZY4/Vu+e62h 0dqpw5xxaCLpGCtHa8l7+mQimzWOlhcAsg== X-Received: from pranav-first.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:390b]) (user=pranavpp job=sendgmr) by 2002:a81:b304:0:b0:54f:b95f:8999 with SMTP id r4-20020a81b304000000b0054fb95f8999mr490174ywh.6.1681844515385; Tue, 18 Apr 2023 12:01:55 -0700 (PDT) Date: Tue, 18 Apr 2023 19:01:00 +0000 In-Reply-To: <20230418190101.696345-1-pranavpp@google.com> Mime-Version: 1.0 References: <20230418190101.696345-1-pranavpp@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418190101.696345-6-pranavpp@google.com> Subject: [PATCH 5/6] scsi: pm80xx: Log port state during HW event From: Pranav Prasad To: Jack Wang , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Akshat Jain , Pranav Prasad X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763541958759941076?= X-GMAIL-MSGID: =?utf-8?q?1763541958759941076?= From: Akshat Jain Log port state during PHY_DOWN event to understand reasoning for PHY_DOWNs. Signed-off-by: Akshat Jain Signed-off-by: Pranav Prasad Acked-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.c | 43 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 8571f6222eb8..85908068b8d7 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3239,9 +3239,9 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) struct pm8001_port *port = &pm8001_ha->port[port_id]; struct pm8001_phy *phy = &pm8001_ha->phy[phy_id]; unsigned long flags; - pm8001_dbg(pm8001_ha, DEVIO, - "port id %d, phy id %d link_rate %d portstate 0x%x\n", - port_id, phy_id, link_rate, portstate); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_SATA_PHY_UP phyid:%#x port_id:%#x link_rate:%d portstate:%#x\n", + phy_id, port_id, link_rate, portstate); phy->port = port; port->port_id = port_id; @@ -3291,10 +3291,14 @@ hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, void *piomb) phy->phy_attached = 0; switch (portstate) { case PORT_VALID: + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x portstate: PORT_VALID\n", + phy_id, port_id); break; case PORT_INVALID: - pm8001_dbg(pm8001_ha, MSG, " PortInvalid portID %d\n", - port_id); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x portstate: PORT_INVALID\n", + phy_id, port_id); pm8001_dbg(pm8001_ha, MSG, " Last phy Down and port invalid\n"); if (port_sata) { @@ -3306,18 +3310,21 @@ hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, void *piomb) sas_phy_disconnected(&phy->sas_phy); break; case PORT_IN_RESET: - pm8001_dbg(pm8001_ha, MSG, " Port In Reset portID %d\n", - port_id); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x portstate: PORT_IN_RESET\n", + phy_id, port_id); break; case PORT_NOT_ESTABLISHED: - pm8001_dbg(pm8001_ha, MSG, - " Phy Down and PORT_NOT_ESTABLISHED\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x portstate: PORT_NOT_ESTABLISHED\n", + phy_id, port_id); port->port_attached = 0; break; case PORT_LOSTCOMM: - pm8001_dbg(pm8001_ha, MSG, " Phy Down and PORT_LOSTCOMM\n"); - pm8001_dbg(pm8001_ha, MSG, - " Last phy Down and port invalid\n"); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x portstate: PORT_LOSTCOMM\n", + phy_id, port_id); + pm8001_dbg(pm8001_ha, MSG, " Last phy Down and port invalid\n"); if (port_sata) { port->port_attached = 0; phy->phy_type = 0; @@ -3328,9 +3335,9 @@ hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, void *piomb) break; default: port->port_attached = 0; - pm8001_dbg(pm8001_ha, DEVIO, - " Phy Down and(default) = 0x%x\n", - portstate); + pm8001_dbg(pm8001_ha, EVENT, + "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x portstate:%#x\n", + phy_id, port_id, portstate); break; } @@ -3431,9 +3438,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) hw_event_sas_phy_up(pm8001_ha, piomb); break; case HW_EVENT_SATA_PHY_UP: - pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_SATA_PHY_UP phyid:%#x port_id:%#x\n", - phy_id, port_id); hw_event_sata_phy_up(pm8001_ha, piomb); break; case HW_EVENT_SATA_SPINUP_HOLD: @@ -3444,9 +3448,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) GFP_ATOMIC); break; case HW_EVENT_PHY_DOWN: - pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_PHY_DOWN phyid:%#x port_id:%#x\n", - phy_id, port_id); hw_event_phy_down(pm8001_ha, piomb); phy->phy_attached = 0; phy->phy_state = PHY_LINK_DISABLE; From patchwork Tue Apr 18 19:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranav Prasad X-Patchwork-Id: 85027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3071678vqo; Tue, 18 Apr 2023 12:14:38 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwgMBjmERD+MISn9GcGQxyHD9FTT4ctz9ZWYa947Dem6U2m+OjFfuWeR6KNHiDQLEruGRx X-Received: by 2002:a05:6a21:6d8a:b0:ee:a546:d439 with SMTP id wl10-20020a056a216d8a00b000eea546d439mr860307pzb.38.1681845278119; Tue, 18 Apr 2023 12:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681845278; cv=none; d=google.com; s=arc-20160816; b=tpr7oX6MjogkeLKU5eLIuULZzkryo/Qoj5qwARomzNnxsKv7oaYDBj30nx7pjE7SmE f++yzu1Y5n9SS0j8EkTzBtvl4/ei3kBiljd0AeM6V3tY5r+fyLDXSMJs63Q595BW3dj2 HQQl/djx8tLRPWrWPeQuXWtkyMAOKyKMFJEVq7Bf+ccCj68gsqSYlBb316VV979PD14y MvgalBDx+1OviO8lZvPoDY+jlYSl7a6fob0/Uf2ZIIw+Ypv53sAjpd4lScnTnQBzJ0Zi CnBbvK6pWPQSnRRvnwJyj7laJQveLU3gdB0wZSkkaX0dK4xxmp+qeIhbsG7o85xqjWHx YBqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=qpvX6zUZ3jJSuVnzz4zMHHsJJxYIrejED2Kgcd4VmHE=; b=sjcw7GWJfDzEI7tRQAVjC8AQ46Spe9GoGatFbQySdc271MCjhf5XwmO3nxw/6JveBn eZtT2pky4ZEDEevycIwdL3/ApTolYnQaYzFD2ky+M0XQOYjjHip3qoagTxFGGNojbLJF sBsPNy6ZkTcZTKlFA7k4l+OLrxTrDxp4dF4R4+pfgViCkW9Sl6rMzf/ah43lcB0M5/81 6+aBUjq7lLJ+38YubOve45/UPvJgOb6cEellYp5HPmKqVzPgQ2nLMC4nMrVF7g60amis b24En2ct5Ad39j/baf6NC4hF1yS7yy8RDdwUB9t9fwcjRDbTWMQ7MiM8IA6tcz0AiLuq 0TcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=lrLE+nDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020aa79d0c000000b0063b8dc46d4dsi6039234pfp.19.2023.04.18.12.14.25; Tue, 18 Apr 2023 12:14:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=lrLE+nDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232719AbjDRTC2 (ORCPT + 99 others); Tue, 18 Apr 2023 15:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232656AbjDRTCG (ORCPT ); Tue, 18 Apr 2023 15:02:06 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB41AC147 for ; Tue, 18 Apr 2023 12:01:57 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54f69fb5cafso211707887b3.12 for ; Tue, 18 Apr 2023 12:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681844516; x=1684436516; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=qpvX6zUZ3jJSuVnzz4zMHHsJJxYIrejED2Kgcd4VmHE=; b=lrLE+nDGD3TZMrxvhsLtTXo+MNZ85rg5PEI9Nq6nxIGe6cjQJsYwtEVVtXsZvhPACp I+clHOcIZHU3sn0gZwgImhOcecFYUu2CF3TDngh8xKkpf839M9bc5GGFLd72Bhb0TvMc qz+OBU8XG1j8DkyljpLzjQh8qHIm8UpTufz0UUz7eEjof9zws82ra68q99kqYl8kMP/r uII2BDiN1wlpPZzd5POZ6XwzrbF1n3XYQZza6YnLSHtFX95okvT1Wpo07CrT5DzU0Fos QxTT/dNYmSHv1mQVBqX32MQ0+ebXb5Hq04VriTzYf+nyGMgXHDF15TEk2wKSiWl7Pi1J hUbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681844516; x=1684436516; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qpvX6zUZ3jJSuVnzz4zMHHsJJxYIrejED2Kgcd4VmHE=; b=DmwG4kDQQU5woqqIQaeGMtN00MnOzz4JfpKQsvXiovl+p4hffJjW8K7g0AbxKI/P2j QI157QNa6j/S5xWTBWH8m62lzB1OrPSmAwOlf8qVLP+3u1daBbMDDQMogsbaq7yWXhpK vfSh3EhRnvU4zIeTIN8/MJscOKBu/8sTzRIqQ1NRdn3pTm9XZ0hbCr+4hhmn8TAg/NJk NuJjm1C4gj9gqDJYlUQnYqKXeNKc4VNzHUea9Xw/OpH/30SHFJwwRsEcGloF7E8R0tvJ QIEOsoAEeL3srCTitksEh/usA9EMtAHnFOVKMQ4PzzgPduqfnDuagbpCAvfd4FCeO/Cs 4ZmA== X-Gm-Message-State: AAQBX9cLRz3mOL4wiOh1DfECOoiC5oWYahajF7tTRaoGiaOoXg52ZsN8 UbOy5tLu0vxctQRkR7NpbSGECB/0ftNqKA== X-Received: from pranav-first.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:390b]) (user=pranavpp job=sendgmr) by 2002:a25:df41:0:b0:b8b:eea7:525e with SMTP id w62-20020a25df41000000b00b8beea7525emr12896039ybg.5.1681844516750; Tue, 18 Apr 2023 12:01:56 -0700 (PDT) Date: Tue, 18 Apr 2023 19:01:01 +0000 In-Reply-To: <20230418190101.696345-1-pranavpp@google.com> Mime-Version: 1.0 References: <20230418190101.696345-1-pranavpp@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418190101.696345-7-pranavpp@google.com> Subject: [PATCH 6/6] scsi: pm80xx: Update PHY state after hard reset From: Pranav Prasad To: Jack Wang , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Changyuan Lyu , Pranav Prasad X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763542594393815567?= X-GMAIL-MSGID: =?utf-8?q?1763542594393815567?= From: Changyuan Lyu Update phy_attached, phy_state, and port_state to correct values after a hard rest. Without this patch, after a successful hard reset, phy_attached is still 0, as a result, any following hard reset will cause a PHY START to be issued first. Signed-off-by: Changyuan Lyu Signed-off-by: Pranav Prasad Acked-by: Jack Wang --- 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 85908068b8d7..39a12ee94a72 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3417,6 +3417,7 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) u8 port_id = (u8)(lr_status_evt_portid & 0x000000FF); u8 phy_id = (u8)((phyid_npip_portstate & 0xFF0000) >> 16); + u8 portstate = (u8)(phyid_npip_portstate & 0x0000000F); u16 eventType = (u16)((lr_status_evt_portid & 0x00FFFF00) >> 8); u8 status = @@ -3449,7 +3450,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) break; case HW_EVENT_PHY_DOWN: hw_event_phy_down(pm8001_ha, piomb); - phy->phy_attached = 0; phy->phy_state = PHY_LINK_DISABLE; break; case HW_EVENT_PORT_INVALID: @@ -3567,14 +3567,15 @@ 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, EVENT, - "HW_EVENT_PORT_RESET_TIMER_TMO phyid:%#x port_id:%#x\n", - phy_id, port_id); + "HW_EVENT_PORT_RESET_TIMER_TMO phyid:%#x port_id:%#x portstate:%#x\n", + phy_id, port_id, portstate); 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; + port->port_state = portstate; sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR, GFP_ATOMIC); if (pm8001_ha->phy[phy_id].reset_completion) { @@ -3608,14 +3609,17 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) break; case HW_EVENT_PORT_RESET_COMPLETE: pm8001_dbg(pm8001_ha, EVENT, - "HW_EVENT_PORT_RESET_COMPLETE phyid:%#x port_id:%#x\n", - phy_id, port_id); + "HW_EVENT_PORT_RESET_COMPLETE phyid:%#x port_id:%#x portstate:%#x\n", + phy_id, port_id, portstate); if (pm8001_ha->phy[phy_id].reset_completion) { pm8001_ha->phy[phy_id].port_reset_status = PORT_RESET_SUCCESS; complete(pm8001_ha->phy[phy_id].reset_completion); pm8001_ha->phy[phy_id].reset_completion = NULL; } + phy->phy_attached = 1; + phy->phy_state = PHY_STATE_LINK_UP_SPCV; + port->port_state = portstate; break; case EVENT_BROADCAST_ASYNCH_EVENT: pm8001_dbg(pm8001_ha, MSG, "EVENT_BROADCAST_ASYNCH_EVENT\n");