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: 674970 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 58AEFC77B75 for ; Tue, 18 Apr 2023 19:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbjDRTBw (ORCPT ); Tue, 18 Apr 2023 15:01:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjDRTBv (ORCPT ); Tue, 18 Apr 2023 15:01:51 -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 D4B476E8E for ; Tue, 18 Apr 2023 12:01:49 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-51b41410216so932260a12.0 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=fre2PFCn0WPLyLXOUXLttF4p2xXnSIR4b0NoPI1jct5IUUBKggZj17FYvgrISCAj7Y eKWUfCv+0LI/XLoh1/cmqrGuHn8SHAqJLSUpTB2CG3VVQ0K2qwMGe+LAIdkGN4Zw3vcz Vfc6vCfjFMPKu3KAmo9ubVdFHI9pz4OtXu7G7WG5DbYpC7+wejq2LRb0GMo0TbFbXVQW 5E+MqATUoOC4GF+C+dNH/In0lgKZ1xrZzy9vASph6pI24QWpqBM6Da5KZudk60NZqTxC yluVsWxlwf1N6e65FsRTKqj/UWuJMFXrCEyUEcpLOvq5aZT713S+rfXMcOM/0zAhq0J+ LRHw== X-Gm-Message-State: AAQBX9eu8xYU2hRAq4QvjZ4c8rrCWCvTvod9jDcvLO/DAoE0EXmNxNKr 7eGzjFKQXyKwOpSNIqL6o+G4CFrL6ET0OA== X-Google-Smtp-Source: AKy350al4jRaJtUaxOxGMHFbkPtkTIazmcAR/oTLEX48WJA9+S9RRnXcjeUR5tprXhryROCmLYGtzQv3TiEzOA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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: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: 674969 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 25170C77B75 for ; Tue, 18 Apr 2023 19:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232720AbjDRTCH (ORCPT ); Tue, 18 Apr 2023 15:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjDRTBy (ORCPT ); Tue, 18 Apr 2023 15:01:54 -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 B269093F4 for ; Tue, 18 Apr 2023 12:01:52 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-51b49840df8so1062329a12.2 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=G1RNh5UB30oBGbMz7CAA1i+jvj43zIWZZw7kENypC2psd/faACSEPq/Jsmg1Cdh+Dd UhnBT6eXKffDaenTKMaCKSbm2BKnO4LI3TGPbLDU1vgVRsGVmcgIDRnor1pZQVHbb+/5 SG9U39R8A/JJY92z5I2M9q6BUETOnwIxVQMSymEZ1T2/6ELJ/3i7L8xO27Liaa+pc1c5 /82tQYCYPe9eQ8Ew9ctnNJEuz+/warPaS/s7UVEHe0gLp0P4dDCKXGbmZzALX7lByRq3 rwNxWvnCuvP6rDnASF0bxXK8xiObLUwtYwNm1jxhZw4HSuq1tlc77zP7NwID9eXLEZZm j6Ug== X-Gm-Message-State: AAQBX9fKGrZagMpyTg4K70+f/hwFxR2S92MvlZezGK598hbSWyNO53tb Aqo/Rwegm2vPJiTqbWwrmvNQBlajb5yakw== X-Google-Smtp-Source: AKy350ahkWDCnkHAXgrxGxUl6RpviSG7+x8JdALBBOytT5BOZjwni8q2AuHP4V6HGxWCWoOKQscHCQMWeoHPkw== 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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: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: 674968 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 946D2C77B7D for ; Tue, 18 Apr 2023 19:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232739AbjDRTCL (ORCPT ); Tue, 18 Apr 2023 15:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232527AbjDRTCF (ORCPT ); Tue, 18 Apr 2023 15:02:05 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E269023 for ; Tue, 18 Apr 2023 12:01:56 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id n66-20020a254045000000b00b95a177fbe4so1810434yba.18 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=RVNtL4d69P1HmfSRAJ42XrAZjjoYpb0RgbaJRZXA9ldscsss1un9Xr7UM9eiHPzYbr g/YdNuc1Jn8LKxGPy/Q5npo0ela6hu4T2p1gB96tKRxULX8gvVEnZM6+qmouoPRcO6OB Zfis2C1QJCHnAElT1sPOSvfCjOHWzLPrl5VAJHZ8w5ihRnesdPdYPCeA6g9Bqs37M27Y j9xHqMf/Q2ee9CDRUEB9RUonCy8xvuAHal3X9XIsBIjYFdqMle77BESV0OobQtVIuISl ANI+S/F1OotMEvMmb0DBYBV/MHZQQmH8wYfgMI9hDBD8W/u1ew72IPdv9BAGfmdMTikB QD5w== X-Gm-Message-State: AAQBX9e3WiIbaZ5OOF8Eg1fFLUtHBF4Ex+IXeS4ko7V9hzltydfWVYaT fb1izjZ+gAT7SYMpnAD3stps9NIDbO5NPQ== X-Google-Smtp-Source: AKy350YCcbz1nJnmfXHYzGDZ/EdbGZdCqGLDcT2Qn5dSB5nMPvR+vtcQtQKi6ETPcVBjZgM5cUT+vcf8aLN3kQ== 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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;