From patchwork Tue Mar 5 20:04:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582927 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3435A18639 for ; Tue, 5 Mar 2024 19:49:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668148; cv=none; b=gLfy7FJCo9hrrQDq7SxLbNc/Dk6TakoBVnicGqmLihXn5M80CvAj5TyojT1ELLgi4HYVwfgPL64rH2CVzZ4fOBN3KDrzKrAC6fCjQm6pxKaAUsQ/UrMjcuTtTgDz6rTzLbUgyMrtH+f8qWA101hmez5oAu5UE7hu9jmgKqKTPeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668148; c=relaxed/simple; bh=fAYu/3ZYnBoC4sdVkhLq1OnTV7uGYF9fez843cbKrOI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XWZu58wSFUHnr2oHAME1HqnkPPjw22uIYsnlg+TikyXYgSTCxDazqm7B2GoACuJQbq1ERobBZcVe0KqVOdR7F968EdFlfSSXfADUX0zAd/a3kkW6kvg1C4qk4xdUskyrGqKqosDciFnSBAFS1EijYvZgLEH6PIqMMaELbRfW7PA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ys0HiA9n; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ys0HiA9n" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-788251ac2f5so16307285a.0 for ; Tue, 05 Mar 2024 11:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668146; x=1710272946; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ddTpIQsjU40JpxkVRBtuFU7xCGs8zXtmzscIjPLqOSg=; b=Ys0HiA9nQYn/NoIGoQ2irhkpDrS9sxnhfg/FMHYl4m+tM+41Jj4yhxNlAhxiN0YZDE vXDV5hsJOWNz9ScUb9v8xq1MezOqJvIaWmR6HCm8rSrEgBPUga66VBZA4kbrSXrBEVJh XV6T6tJ2v2YOfvI9pmoJHx5zPvReB8tcOf86DYT4f4YwxMqsBHpJWjm8KF6u9IMyF/Ik VqAW639XQc5dUpSM7youc56nFZRDsm4rO/vMAVG824aJpY0vV43g8rd7ipOnUVUlbtD9 iLJBHl0IV5caZOX+ELDTl/nhEDXGcH0DQlMcAKwcqNVE1t+mDD0v4eruQoLgOnk5niI6 e3iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668146; x=1710272946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ddTpIQsjU40JpxkVRBtuFU7xCGs8zXtmzscIjPLqOSg=; b=u+qi9DTjh8tS5PTS/NEtdnhaq18i5zEiyqLZWfUWwoAV1qOtJ8lmlRbNnBvrV8MXs1 yk1SxmBqtpgKRqOvIXLuTWiyE0RSItbtm9vR93PPL8omcYRQswiog74Ev21sljjaYHke OjTffNkLgp4tefzSSbtw/DIT3xh0vD9hyyir9Aryumo0IfGmD2eJIUuELiviRC3Inw8r VOsPIp0hIDIfc78UMWLvy3GO0TBqSs1X7t8uokEBPQa1vWd96I7FJWdUk3kIBIBnRmYR 5mmykEtUsWL8gWyoq//5Lyq76qVH/1vnJ65YB8wNvuPQzGbMPFl1Bv4TBet5vbXS5+8y MrKQ== X-Gm-Message-State: AOJu0Yw8xIVfLCjmV5P2g+zpGKmnmu6uhFQu0kidIJ32m3Pl8+jJAFcz kmZ7rri1PjCbbWxyTCYhU6N6QiK697GA36HYvmegV1OKJmIeiqBGKs1PAJR6 X-Google-Smtp-Source: AGHT+IH3NPLOzLnddgrSHAQY220Qw6gcbSQ9SO+Poo+7wh2JcIYSKfUKeZQtgnXql+CYjz60/rBAZA== X-Received: by 2002:a05:622a:1c8:b0:42e:dd5b:e014 with SMTP id t8-20020a05622a01c800b0042edd5be014mr1301154qtw.4.1709668146115; Tue, 05 Mar 2024 11:49:06 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:05 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 01/12] lpfc: Remove unnecessary log message in queuecommand path Date: Tue, 5 Mar 2024 12:04:52 -0800 Message-Id: <20240305200503.57317-2-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message 9038 logs when LLDD receives SCSI_PROT_NORMAL when T10 DIF protection is configured. The event is not wrong, but the log message has not proven useful in debugging so it is removed. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_scsi.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 81fb766c7746..e7bfaa0eb811 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -5336,16 +5336,6 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) } err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd); } else { - if (vport->phba->cfg_enable_bg) { - lpfc_printf_vlog(vport, - KERN_INFO, LOG_SCSI_CMD, - "9038 BLKGRD: rcvd PROT_NORMAL cmd: " - "x%x reftag x%x cnt %u pt %x\n", - cmnd->cmnd[0], - scsi_prot_ref_tag(cmnd), - scsi_logical_block_count(cmnd), - (cmnd->cmnd[1]>>5)); - } err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd); } From patchwork Tue Mar 5 20:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582928 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 312C45C607 for ; Tue, 5 Mar 2024 19:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668150; cv=none; b=WieHUqJknhm1+ifHrHO+ly7fOrmqGt0l3ozB4W7YiGm/gEExaRrbnE+gyKZBaBka6V3QiWKZjATWEIa/Oxwn/CXF1Sc2Yezxxc1U6/cAD05bzXRFHUpIDQ90KpYzPmb8i6dM++HPMaNMMG1m/OVZduP1naWwPZOrppg269vJLf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668150; c=relaxed/simple; bh=GLFEQgE+JWw38+5XkSoZ2TdrYTWeO6y63BuaXydgmZQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U0P8cUUCLLtxUxgPpJtzRjO5a/82g2OSMv9S0AIzeYGzCtaS3XCUtcv1ujEhrnfgO2yvL3JOWhXg0WoIBY80i7zk+0/Aay0/xL/o+oFUuVUa5zBO8Za5cBvmeOMGvWfXY+llDcD5NGqVpBp0XjK248UyDqWe/6A/IfgpyEKhbOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZPahEOKm; arc=none smtp.client-ip=209.85.161.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPahEOKm" Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5a13ecfb6b8so207921eaf.1 for ; Tue, 05 Mar 2024 11:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668148; x=1710272948; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4mAgFthZgucsTp/Ggl0Ae96uDLL2cRRODY9YYTDhP9A=; b=ZPahEOKmkTqWLsysHVW8AOrnPkMVKOLjIssXe2Eh5NhDScEiGvKPf4LeaMD5i35i0c YM3bpl9FLX3EN1/OxYwpwu2krGd7klUxE7Uf2nW29spe4U4WSQ4UWl/DgXcpZlKlO8op ICTLIcKorU9GHUnMyBJp+oUYhTHVJLno8nHO9nZzkuCqZye+QcFlmqrjeFDMjOTUi7WW pYFab0HX2c35xmcMXNKAzg9jnKz4c4I3se0s9pOQOFpilUFQS1fOmGyZit/IFYx7H4oD Gyaz0U3S8hfa0cKRkLiSOBMT1mrXte7+ew/bALckD52BFH4SOHJqj8hXF9vkBUtE2zAn eh8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668148; x=1710272948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4mAgFthZgucsTp/Ggl0Ae96uDLL2cRRODY9YYTDhP9A=; b=MZIK5DqmwkmB7p4aGFQV/w42ICzZUZ52NU85UZH4EBGld12y8aTtE+Ro/0janXLlIm IjdRMP8+orgE0VL3KvU9+IU96oEqZXk40LcwXtHDNyROyYYS9Nt2PpmIUfCbdhx/U5bF BzKCCf1+RqrmSDCae9lQXvDqs7i9418JXAa09AkW+rKTYvt/HRed9Ffz+lNLFq7DzTZx 0U+mIlm3wTv2mJ5ESoFapZOvnu9QYH6coz67PgDbH6RVze24NCted+nw0ng5ZkqIRa/5 rjSmT5UN/7C0ts4WyHvKXsAou3+XGBj9sJeuN9MQ81ZDu5yK8OyM+7EEKlONnBlWWbCC tV5g== X-Gm-Message-State: AOJu0YxQAKsVbABcRCwMND2dK84rcH1UiJgLEY90n4bx5XaabZwyEocC opNf35nwDNvdivUC1QAOXGMx2dMjDi7H4P9chQfX7znHjuFzw39ZDZFD6K3G X-Google-Smtp-Source: AGHT+IH1BbPZtAn01hEsEZ1GBCDqK4BhG/l6He8YbzKg54Aard+QwkKSo+0nGE6xerQ2rcu0eHwwhQ== X-Received: by 2002:a05:6358:5926:b0:178:9f1d:65e4 with SMTP id g38-20020a056358592600b001789f1d65e4mr1767081rwf.3.1709668148029; Tue, 05 Mar 2024 11:49:08 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:07 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 02/12] lpfc: Move NPIV's transport unregistration to after resource clean up Date: Tue, 5 Mar 2024 12:04:53 -0800 Message-Id: <20240305200503.57317-3-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are cases after NPIV deletion where the fabric switch still believes the NPIV is logged into the fabric. This occurs when a vport is unregistered before the Remove All DA_ID CT and LOGO ELS are sent to the fabric. Currently fc_remove_host, which calls dev_loss_tmo for all D_IDs including the fabric D_ID, removes the last ndlp reference and frees the ndlp rport object. This sometimes causes the race condition where the final DA_ID and LOGO are skipped from being sent to the fabric switch. Fix by moving the fc_remove_host and scsi_remove_host calls after DA_ID and LOGO are sent. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_vport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 0f79840b9498..9850080ee33d 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c @@ -674,10 +674,6 @@ lpfc_vport_delete(struct fc_vport *fc_vport) lpfc_free_sysfs_attr(vport); lpfc_debugfs_terminate(vport); - /* Remove FC host to break driver binding. */ - fc_remove_host(shost); - scsi_remove_host(shost); - /* Send the DA_ID and Fabric LOGO to cleanup Nameserver entries. */ ndlp = lpfc_findnode_did(vport, Fabric_DID); if (!ndlp) @@ -721,6 +717,10 @@ lpfc_vport_delete(struct fc_vport *fc_vport) skip_logo: + /* Remove FC host to break driver binding. */ + fc_remove_host(shost); + scsi_remove_host(shost); + lpfc_cleanup(vport); /* Remove scsi host now. The nodes are cleaned up. */ From patchwork Tue Mar 5 20:04:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582929 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72BDC5C607 for ; Tue, 5 Mar 2024 19:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668152; cv=none; b=SE4MxQ2nYhG8lt4tsVO4p483XLgkoZcJ1zqREKVTRPkDMrgpHmF9nJeUOeQgJmWQ4vn7NiiZhvRvcyTK0wkZOkLmtTw5D20g7fVU3JhlXYP2vLkcdMfZnJX0dZInALbI/vQTnk2OX1/Pi1cSKuST0ffNO3UeUWBPS36oYXf4M/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668152; c=relaxed/simple; bh=3Tv335XBDQaloogBYjJslsIFJyxfpHfC6/Ms/8rZwiY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WbI+SuVL6+77CUYo31No1zGGkfKltN4zNDuqpMlhnQb8tBDIsaWyydlDLjTPhlV2wRwErgBsOD4HzNUTjMMD3sKzIBCeDkGfV8J5DIZwjHhIvArmXMK3YGvNpXk7FwQfgic/jcBPEv1HoOSpXKOO5G1PK/uyLMrt17cqQViNC1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OBqwRukh; arc=none smtp.client-ip=209.85.160.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OBqwRukh" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-42e4b89bd3cso10081841cf.0 for ; Tue, 05 Mar 2024 11:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668150; x=1710272950; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sBY88P3rtRMZpIydbDmgEuFEfCAqJBWF6YxBqP04hEw=; b=OBqwRukhxwlgkXqxwK4ITOimReccLrRjFsWeVXo9rsHlnpebmeq1zuFNBBOYiau47E VFAMmjW50I88gnYtrY8QJEziGLOzDmHNVVyXvFOVm2WRrYWLO3S/QOMIEVxzXIToYDZi nvfC3oGmhWI1Ibfo/eUPgxu5MPxCgCBjVeEfKMy7W/BgmJhbHW3IIFQ7ah7ag2I8FBRj 3TydDjM7DvbiAGahTXTKySgugZf7gdmmCZYlfy7wSvQ+JumEakFn+dRxTlvr0IMEtW0x fpYNzuss8qTXCg6rkyOAH2sPVGhTgVEARCWGJfMFlb0Ee9UHQnWVqear7KIpfxUje8/g 8K5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668150; x=1710272950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sBY88P3rtRMZpIydbDmgEuFEfCAqJBWF6YxBqP04hEw=; b=HROt2rNqMiiM0OdX6Lf/BiLGWoEhz2ck9mW+p/VrBKZN8C9N7LhwhRUaSSqHYErd1J 9+oenUV4n7+RN5eXvIZB0vWEQWO+R9Qv+XrG9jQ4fka+OWCuRqpxtU22eTxCvGORlINF 2DNGC6I5vKHK45ojWo2USHOeLPzSwGi0KztO92F4aBvQ1ZiJHnKu3QxNWbqodSn2u92c bxbw2sXiIsMscieXTiVMBF37Gh32Gvj6AcbwsohdsqCyRnvXWlbcWoOBnJkcWXsXy4n7 OiA6ckpWC90uS/bJp6AWyavlMDyndhE+o1gH1INFqC+MHyDz0OmqHqQ4wsOpUZJFzKw+ ptNA== X-Gm-Message-State: AOJu0Yw13i9yy/O9yjUSYndgfhDN6bOy7lL9r9u9YTRZ5H5nYU7FBDXQ lfFAN1fm6azijtwLb0SHRf2o4sty9aptD3k44nqlaSRZzeeZ/Fq31BoQBUsY X-Google-Smtp-Source: AGHT+IGlYkhbDaIMZWtW/d7695ijlJSu6bSF1pn4uqu3kWXc1fy5ZMJcURQ6zIV7i0n3g636sLEuqA== X-Received: by 2002:a05:620a:4150:b0:787:f4bf:507e with SMTP id k16-20020a05620a415000b00787f4bf507emr1377985qko.4.1709668150251; Tue, 05 Mar 2024 11:49:10 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:10 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 03/12] lpfc: Remove IRQF_ONESHOT flag from threaded irq handling Date: Tue, 5 Mar 2024 12:04:54 -0800 Message-Id: <20240305200503.57317-4-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 IRQF_ONESHOT is found to mask HBA generated interrupts when thread_fn is running. As a result, some EQEs/CQEs miss timely processing resulting in SCSI layer attempts to abort commands due to io_timeout. Abort CQEs are also not processed leading to the observations of hangs and spam of "0748 abort handler timed out waiting for aborting I/O" log messages. Remove the IRQF_ONESHOT flag. The cmpxchg and xchg atomic operations on lpfc_queue->queue_claimed already protect potential parallel access to an EQ/CQ should the thread_fn get interrupted by the primary irq handler. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 88b2e57d90c2..3363b0db65ae 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -13055,7 +13055,7 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) rc = request_threaded_irq(eqhdl->irq, &lpfc_sli4_hba_intr_handler, &lpfc_sli4_hba_intr_handler_th, - IRQF_ONESHOT, name, eqhdl); + 0, name, eqhdl); if (rc) { lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, "0486 MSI-X fast-path (%d) " From patchwork Tue Mar 5 20:04:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582930 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DC3279953 for ; Tue, 5 Mar 2024 19:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668154; cv=none; b=ZSqo8k1jVYn6St516Wz9Sst8oLCAnFuwPSmLt2ADSf+s9UBcpCsP2m4dvQD1iHuWDbIaoC7J36B+kfZgX1/08bjVZ07vunQ5JRsnRzYf1NT8FxtGaaDO3E+QHk2ZBB8ds2bbryf37D4HyZATH4XMb26idhr4YIV5n/XpSnDPhDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668154; c=relaxed/simple; bh=IIbhw+SwZRPcdlyiLWdehPC5LHjqM0Vs4SAlPferXR8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EXsla4qZniHX35yop2P8uApNjn8V5m29x4jyx5IvLoGzv8waR3b/P1bJ/XYZaT/ZNcaR2lWO1xSC9o84EXy/tHvESVlLQn/Hecg/t9Fu1lG+qDrqquVe9DwCksux/jOVDkgxCP3w71mr6mbEKciXOd60k5bt6cIZ5bnIbOQw40g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VudB6H5+; arc=none smtp.client-ip=209.85.160.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VudB6H5+" Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-21f10aae252so559657fac.0 for ; Tue, 05 Mar 2024 11:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668152; x=1710272952; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WMYL4XINwiJyrxByVkAt03WJ0yc5MhT9bqgD56m9lEU=; b=VudB6H5+5Y0vzJaYwY8Zx9AeJPn0wRJqz0wkdN/QcSUwRgmAUlywwtp2NT1fkFWcKK Md20fEpMozWf2WIjxGOlws+wh9CN+UfkAK4r/F7C8m5RuLwwr7kAsmUWVMtybX7Tz+1y Q5AA9UNtkkhMZ8y2p3G4hsvGzN4iug1kmhIId5PY6hrgr0zKCVuYkMyWGJx2X8qOYkiM QswmXtKpJP7LVQ2ZNgF6/wY9lzLWRNThFdtRWhwujSD9OW5QbiA/sktjGGvm+myklHQE BLuy5wybP0gBg500NitSsgp7BV5pCAF9qkBGBwXti0vsBJ5+MOBlZxsOlbIKu+2OzVZw qBmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668152; x=1710272952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WMYL4XINwiJyrxByVkAt03WJ0yc5MhT9bqgD56m9lEU=; b=pwTJdRwqrAvuNX4DK031NsiAFJM6mp5NzYqWMfhW2XEeShOXOohyqdl57z/V2wCX5L x7f0QRb+NpGmPyWJzdBHZvMZAfAnViCK0ZPYznocdUr/dnkBlPFC6LmDaprXEhvSboo6 vTxVEmci+MLXrxxkwvVNc2VqEw3vXX8mX9tM2DFF8K7bwZLtXFcKbUjT7D9D8VYja8CV z3kLNMd9vH1r3+A6tihBqrpb48HtYZSICC9UDj8UyxuElM7kiV8GGeScyOrAJ2o+uatN od/V/mFQEgViEZuemcFiQ/tNVHhCDVmauQ/F0Hfs29edC5hGNv5zH5IYc3PgTCnpXgYw sSEw== X-Gm-Message-State: AOJu0YwYrOwkalUxgiLubqroYmQEXIFcZxd0YC+6764P9n46CbogrpjS YTYenSqCdyuRqZVe2fREqyrVKf+YuwQfdJVpJcuuPKsFSvAH1Kl0NSrIKqFo X-Google-Smtp-Source: AGHT+IE2wHHc32ovQMn8vK1JLDPdhcHCjFrLvZnRFutCqOC5lCAYcQpd3PaOTreP3mOrTOcB3ODjTQ== X-Received: by 2002:a05:6870:5e53:b0:220:c30d:75d7 with SMTP id ne19-20020a0568705e5300b00220c30d75d7mr1501373oac.2.1709668152195; Tue, 05 Mar 2024 11:49:12 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:11 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 04/12] lpfc: Update lpfc_ramp_down_queue_handler logic Date: Tue, 5 Mar 2024 12:04:55 -0800 Message-Id: <20240305200503.57317-5-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Typically when an out of resource CQE status is detected, the lpfc_ramp_down_queue_handler logic is called to help reduce I/O load by reducing an sdev's queue_depth. However, the current lpfc_rampdown_queue_depth logic does not help reduce queue_depth. num_cmd_success is never updated and is always zero, which means new_queue_depth will always be set to sdev->queue_depth. So, new_queue_depth = sdev->queue_depth - new_queue_depth always sets new_queue_depth to zero. And, scsi_change_queue_depth(sdev, 0) is essentially a no-op. Change the lpfc_ramp_down_queue_handler logic to set new_queue_depth equal to sdev->queue_depth subtracted from number of times num_rsrc_err was incremented. If num_rsrc_err is >= sdev->queue_depth, then set new_queue_depth equal to 1. Eventually, the frequency of Good_Status frames will signal SCSI upper layer to auto increase the queue_depth back to the driver default of 64 via scsi_handle_queue_ramp_up. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc.h | 1 - drivers/scsi/lpfc/lpfc_scsi.c | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 30d20d37554f..18cbfd371ccc 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1333,7 +1333,6 @@ struct lpfc_hba { struct timer_list fabric_block_timer; unsigned long bit_flags; atomic_t num_rsrc_err; - atomic_t num_cmd_success; unsigned long last_rsrc_error_time; unsigned long last_ramp_down_time; #ifdef CONFIG_SCSI_LPFC_DEBUG_FS diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index e7bfaa0eb811..fc77f19547de 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -167,11 +167,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) struct Scsi_Host *shost; struct scsi_device *sdev; unsigned long new_queue_depth; - unsigned long num_rsrc_err, num_cmd_success; + unsigned long num_rsrc_err; int i; num_rsrc_err = atomic_read(&phba->num_rsrc_err); - num_cmd_success = atomic_read(&phba->num_cmd_success); /* * The error and success command counters are global per @@ -186,20 +185,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { shost = lpfc_shost_from_vport(vports[i]); shost_for_each_device(sdev, shost) { - new_queue_depth = - sdev->queue_depth * num_rsrc_err / - (num_rsrc_err + num_cmd_success); - if (!new_queue_depth) - new_queue_depth = sdev->queue_depth - 1; + if (num_rsrc_err >= sdev->queue_depth) + new_queue_depth = 1; else new_queue_depth = sdev->queue_depth - - new_queue_depth; + num_rsrc_err; scsi_change_queue_depth(sdev, new_queue_depth); } } lpfc_destroy_vport_work_array(phba, vports); atomic_set(&phba->num_rsrc_err, 0); - atomic_set(&phba->num_cmd_success, 0); } /** From patchwork Tue Mar 5 20:04:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582931 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FF325C619 for ; Tue, 5 Mar 2024 19:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668156; cv=none; b=q1sL5THmnxWLTgMCbc4T+eho6R2Odz92PZ/gIULDFEPKap+u53RPsLXrwuGZPjIvYH07Hk39aqmIfI+1iLVL3navWV3E9U0MOEMnLpJBlifQLtjTWPldd9HmutbjTWYprwUIBLVz/s3wHLSjFEElAevbXSxM4K+n1G3n45wqCOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668156; c=relaxed/simple; bh=Q07MdBdKVlbXJ86h7SfnZqBGlLoVo5nTMXLB67kNfdw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=icpqsPIDRZXivmJhBxJt3/DdQDhUyVpL7eeDO+bQwLnDjIQb+Sk2tlpDZaELqfQqXUcDOOToYmuBicYH2vTmztQEj4DTRPUBIwhOu6UN+uoaR+eWhTJ5iybQ10FvsD4VCrRWSNp2qEPeMYDiR7vtL0X8IePn19nMPel7jBVIS6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fmdXz3Hn; arc=none smtp.client-ip=209.85.222.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fmdXz3Hn" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-788251ac2f5so16309285a.0 for ; Tue, 05 Mar 2024 11:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668154; x=1710272954; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6is7PSVKtUCYDKW89JTJS1r+ufWKPOZqQX0DmMUwnCg=; b=fmdXz3Hni/F5wgW4idhDFMjKd/dWbaQG5HjvzRwnGH0MvxfJI5kVWmcMI5Xb1t8p3p 2wpIrFbbSPxVvMhuj9MnyIcMe7irw16EGgG4xicVlCMYN4WvXiEmGOsB1fzkUdU/kmLc TFnU4O1p7hNjnCyliq6QWucnwwu1Ii2SgPQegLYT5ygnbWml4WHhX1NwVzh/gxIeym/6 s7FdkSTROhHq3rsJ0v+W6gEKuLIBqc6Kd8X4TA7RdlnisxxOk++Y9DGpAnopcE6DwrwC tLNrFAdCf9ZtLSvynjVH6EDDdyvGTkuRODSybu72DTjOvKyDapeJQmADfEBqMVnnqCVX CIaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668154; x=1710272954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6is7PSVKtUCYDKW89JTJS1r+ufWKPOZqQX0DmMUwnCg=; b=DPVpPeH1a+4qMpruCKQKwoKkyOPyF3Z1kNIdfsPAvOERiKp9YfCfj5GrbOwF4+f+kk 6GKkEeGe2Myx4en1Lyg2JnetPhdpEkUI3Ym1Y1/H6n6gkhXtqhyol7AmbDOrwQsG0dVM CPBSnWmIMTWdrLbPnrr7PjgMJ/oqjKy+JpP5teYhEmCxRRm7WeHWae+oTR2ggGoH7Zq2 KnaehgB0mtsjIeSP7XlCdLHXPV2Wj/jY1ED8em3hiUleXw6Yo1va16DxW9w+FRn9Stoj K3kQ4CovgOOmXgxdnbF2dS+J6XO/SzYtkrHDYKSSjWdTU5h2U9haCzPRZlu2BmMn2TbB kTZw== X-Gm-Message-State: AOJu0Yz9ctim/NuJTRG+ACndBz+pDoQsm59SfIQnpvEIn0gmjkQ9G3su ynxxzGV//XNkvfbVs0w4JTHwIc2oF6xtWwt2HdGNIaRR4CZtlGXUU6Y+wdt2 X-Google-Smtp-Source: AGHT+IFhS0Pt1jV+AeoEcDawrjqU6/olzLdQdTjalfk1Rj71WSzSas2AjrIUZKG999qlzTMIzO9H0A== X-Received: by 2002:a05:620a:17a4:b0:788:3c9c:53ee with SMTP id ay36-20020a05620a17a400b007883c9c53eemr331697qkb.6.1709668153973; Tue, 05 Mar 2024 11:49:13 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:13 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 05/12] lpfc: Replace hbalock with ndlp lock in lpfc_nvme_unregister_port Date: Tue, 5 Mar 2024 12:04:56 -0800 Message-Id: <20240305200503.57317-6-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The ndlp object update in lpfc_nvme_unregister_port should be protected by the ndlp lock rather than hbalock. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 09c53b85bcb8..c5792eaf3f64 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -2616,9 +2616,9 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) /* No concern about the role change on the nvme remoteport. * The transport will update it. */ - spin_lock_irq(&vport->phba->hbalock); + spin_lock_irq(&ndlp->lock); ndlp->fc4_xpt_flags |= NVME_XPT_UNREG_WAIT; - spin_unlock_irq(&vport->phba->hbalock); + spin_unlock_irq(&ndlp->lock); /* Don't let the host nvme transport keep sending keep-alives * on this remoteport. Vport is unloading, no recovery. The From patchwork Tue Mar 5 20:04:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582932 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A02886167A for ; Tue, 5 Mar 2024 19:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668158; cv=none; b=gRMRc50qiI6yAMBf2ERejZwHOFDow1U7qNCYVUBeOg//50iMs6DQwMZmGwMnVA52Uc10SHft6dIVdir5wUQgaCVmuXT1RPc91Vsk5OXv2w9FNQsYmn+e7gANL/Tq5cvKDxYWk76DxxUQzKvggWwAmUieKgorRAGyyVOQwLplsgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668158; c=relaxed/simple; bh=AfN5QbEBeqvmDY+2mBdAE6ZASpjRrWBwgPPsdfLvXBA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iCH7AJ6LaQOcJ266Tc4WHSx9252sHlQuuB22j25GngObQkbuw3e14d+dDMh5y4piMI/bBcvslEykMfO4MdpQS8OrR2YcFbLr/sSi5mKGtTe+x7HqrvnjZOMIU+xmFs6poioTN+nn/HQqMi0N8Rb2scoSsUoQJ4AHORSSsc5ZDLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SjR2IpUM; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SjR2IpUM" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-68fcd9d336bso9336616d6.1 for ; Tue, 05 Mar 2024 11:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668155; x=1710272955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xEzLi8BIN57DkelYQfY/4ZqdVXOwxA9iYIklXp//HFo=; b=SjR2IpUMxNy+/lhmvWFv09R/eVxbUnzrcDCZm0EYR0VGEYbIcdOWhe4hZyGmfJ4wZH qyatJPP78gpN27UqgWQPJxWk+WzJa4VGZqDGF8mdBhrtNXFMOGwAACAkVtZeID100gaw YDgXBInql2MdDs3rl/PuFG+su13r4NMHB2Q3i0qMmowmnwN0v9ThohRr8yCzHlqT0PQW 2NDSk9mlhex9N3J9qEQFsVLiboN3LoPcCfr0KiDzKM1UaYg0PGvOarWS93RWp9fdPQn4 VeR19eXO/nVuxefACjmqnKdO8OBZoHML4Wt3K0xQpcuZRSQvf50hxEvDMCSKsiFPoskj 5Gpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668155; x=1710272955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xEzLi8BIN57DkelYQfY/4ZqdVXOwxA9iYIklXp//HFo=; b=MrFlpVV0+irAB6yrn2A7JcRFK4Bx4ohCtdJuWdEKOElDv/XtE1gD9o0PvhTZUJRudL gkXdTACQJckBPfwqCWEt50GK2k7ZARzrqNPya6eDYHf20DMQTANMaNECN9stbFtEdcvI 6/kug0lsGRjXVzAeVcVJ7mYpTLNN/+uUJIRgSoJCAACqW8uRkmN6u/FEUWGSzRclP3Yz UE3FoGpA4hooQeQQduQfDAcvHBaMBYVnmciSD8x1stTF+DQZe+mHUxrWyyB3UFp3AMIu +8nPd8XjvAD8hbAw30257uQa5q/aFqNCO8BhR9NHC8VFKFaRU95RcI6/EIM9LKSpEmRV ZsVw== X-Gm-Message-State: AOJu0Yz2vGf+oeL1HkagcLNAzCe/uk/FQ+WejFEqE2EEzvoL5j4WNZKC 5DZDeHASX0w8xjGpgBmivDzllk0cVjY5l2fVhPeyphNTHBW4rpaeMtnufhxX X-Google-Smtp-Source: AGHT+IHhsAmlFynP/AiPJtKyepj9fobN7UQb5DR6vPHily8hMLMoMQ4Dfve1V2bF3ttz+sJrpTnRaQ== X-Received: by 2002:a05:620a:4150:b0:787:f4bf:507e with SMTP id k16-20020a05620a415000b00787f4bf507emr1378144qko.4.1709668155553; Tue, 05 Mar 2024 11:49:15 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:15 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 06/12] lpfc: Release hbalock before calling lpfc_worker_wake_up Date: Tue, 5 Mar 2024 12:04:57 -0800 Message-Id: <20240305200503.57317-7-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 lpfc_worker_wake_up calls the lpfc_work_done routine, which takes the hbalock. Thus, lpfc_worker_wake_up should not be called while holding the hbalock to avoid potential deadlock. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_els.c | 20 ++++++++++---------- drivers/scsi/lpfc/lpfc_hbadisc.c | 5 ++--- drivers/scsi/lpfc/lpfc_sli.c | 14 +++++++------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 28e56542e072..157a910666db 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -4437,23 +4437,23 @@ lpfc_els_retry_delay(struct timer_list *t) unsigned long flags; struct lpfc_work_evt *evtp = &ndlp->els_retry_evt; + /* Hold a node reference for outstanding queued work */ + if (!lpfc_nlp_get(ndlp)) + return; + spin_lock_irqsave(&phba->hbalock, flags); if (!list_empty(&evtp->evt_listp)) { spin_unlock_irqrestore(&phba->hbalock, flags); + lpfc_nlp_put(ndlp); return; } - /* We need to hold the node by incrementing the reference - * count until the queued work is done - */ - evtp->evt_arg1 = lpfc_nlp_get(ndlp); - if (evtp->evt_arg1) { - evtp->evt = LPFC_EVT_ELS_RETRY; - list_add_tail(&evtp->evt_listp, &phba->work_list); - lpfc_worker_wake_up(phba); - } + evtp->evt_arg1 = ndlp; + evtp->evt = LPFC_EVT_ELS_RETRY; + list_add_tail(&evtp->evt_listp, &phba->work_list); spin_unlock_irqrestore(&phba->hbalock, flags); - return; + + lpfc_worker_wake_up(phba); } /** diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index a7a2309a629f..2ab51397f4a6 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -257,7 +257,9 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) if (evtp->evt_arg1) { evtp->evt = LPFC_EVT_DEV_LOSS; list_add_tail(&evtp->evt_listp, &phba->work_list); + spin_unlock_irqrestore(&phba->hbalock, iflags); lpfc_worker_wake_up(phba); + return; } spin_unlock_irqrestore(&phba->hbalock, iflags); } else { @@ -275,10 +277,7 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); } - } - - return; } /** diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 1f8a9b5945cb..030d7084e412 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -1217,9 +1217,9 @@ lpfc_set_rrq_active(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, empty = list_empty(&phba->active_rrq_list); list_add_tail(&rrq->list, &phba->active_rrq_list); phba->hba_flag |= HBA_RRQ_ACTIVE; + spin_unlock_irqrestore(&phba->hbalock, iflags); if (empty) lpfc_worker_wake_up(phba); - spin_unlock_irqrestore(&phba->hbalock, iflags); return 0; out: spin_unlock_irqrestore(&phba->hbalock, iflags); @@ -11373,18 +11373,18 @@ lpfc_sli_post_recovery_event(struct lpfc_hba *phba, unsigned long iflags; struct lpfc_work_evt *evtp = &ndlp->recovery_evt; + /* Hold a node reference for outstanding queued work */ + if (!lpfc_nlp_get(ndlp)) + return; + spin_lock_irqsave(&phba->hbalock, iflags); if (!list_empty(&evtp->evt_listp)) { spin_unlock_irqrestore(&phba->hbalock, iflags); + lpfc_nlp_put(ndlp); return; } - /* Incrementing the reference count until the queued work is done. */ - evtp->evt_arg1 = lpfc_nlp_get(ndlp); - if (!evtp->evt_arg1) { - spin_unlock_irqrestore(&phba->hbalock, iflags); - return; - } + evtp->evt_arg1 = ndlp; evtp->evt = LPFC_EVT_RECOVER_PORT; list_add_tail(&evtp->evt_listp, &phba->work_list); spin_unlock_irqrestore(&phba->hbalock, iflags); From patchwork Tue Mar 5 20:04:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582933 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64D0986659 for ; Tue, 5 Mar 2024 19:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668160; cv=none; b=tMUH0LGvkLlfEbrqJbq7NfBMF+5WFiQPeNweYcxrXd2X1UxP7GUJfe42KAL9+Ysx+9VNFlOyTwX0uz1z6BjZ1ow4ovNiYQMrHV4aAJqI8LGHqkhvEGlILWwEWoHfUowslG828lN5S87i9dncZg3/fbMnysWxcWTonwx/id34NS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668160; c=relaxed/simple; bh=nWCPK9j68QUS5rAaPjR0a0qOHdGvj2oAyYPoJ1Z8LgM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZKA/uxXCbHmoQiqNfJX3DyaTwjVHPbkbUxKBa+Wj1nWMfxnN77U5J2kiuZLAux3f3KXbHhrsHBsNmRpYOZ5MrnpDz+6GJaCgrzi9yoRy1xX0skFwP2GHVJQyi3BQ5dmztCRgn5RSJ/ppXuJNVfXHNyMM8kNQIxeE1DE6eucEdFw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eNWZeHCS; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eNWZeHCS" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-69069235a0eso4485356d6.0 for ; Tue, 05 Mar 2024 11:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668157; x=1710272957; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b3J0zbqv98a1aRLu4y3DHX6FmT5cBFVpbFUdAJb/thg=; b=eNWZeHCSdINqsgo2pywdIWS/1T9lFUkk5AYKmbamOoqSa52OgLZ2j+vQcDtWbS1xmr +J2gD+qEPaCMOLp/Z9laIl27Ef93pOGlaXlrmj9N6Tu2fA5dCM0ZzzVelmogl11GrCN4 UYWnFABir1ACGyKllVLJFmNXsVAYntHIjKzCiIpPHxJmfgUJWe7gkD9kPdV8U32A40G/ 50NrfPhCOJC6lBlOecOXoK+nYAREBtGmoa3tCM6R4+EarAhbpazCbI5MRJ/meq5Ur/Oe 6ALYsfe/UjKJhtY6rqKdGsupDW6OZqSAslktA5oW6sbM0Qm824aGjLvVJb+8ZppLydQl eJSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668157; x=1710272957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b3J0zbqv98a1aRLu4y3DHX6FmT5cBFVpbFUdAJb/thg=; b=jDxxXFibcqALRQ75PWRkviOe1b2UjBI8PiSCxm23USsI+SMMdVDAcg1d/NsoE+tAUL nzpr8HXW8gIjO8Leu0vzjs19/pbtV0vHUUI4IKJJRu2nYzi6+qC3JA6ytPBc1eZAzMi2 gG3Fg6/9e22sZvzCvb5tRosXvSPDwQRh6Vqr07kovPOSOlbaz9EEoQxZpm0ZLLeSWAru GnsweRkt2iu3h62XX2W7WHCQArB0WRrgyM369Ggfarfp0R3W03Lt0HvjZbEGnTsfjVxm in3EcWvvIMFda4W8vvulovybLJXhm8ww8aWq4/6tdt5j1fRRXuU5X6Nk8f0M1TelYkxh Aeaw== X-Gm-Message-State: AOJu0Yw51oAjhj3bfyKDuw405OfHCNIh61HHF41HLNYZhHMUUFkGfoze IKk54/OZEX3cXWVkIRaMkp3Hmu7DakmkO5teXqydLM0SgUoU2fm3YTUSF0gI X-Google-Smtp-Source: AGHT+IF0D557VzfvGcKRHKMXxHPOyEqoIT30pKsb4hqmPK25YeNisF6VaAzBYLpfCz2BkCwqub5DDw== X-Received: by 2002:a05:620a:24c6:b0:788:24c0:3a36 with SMTP id m6-20020a05620a24c600b0078824c03a36mr768442qkn.3.1709668157307; Tue, 05 Mar 2024 11:49:17 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:16 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 07/12] lpfc: Use a dedicated lock for ras_fwlog state Date: Tue, 5 Mar 2024 12:04:58 -0800 Message-Id: <20240305200503.57317-8-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To reduce usage of and contention for hbalock, a separate dedicated lock is used to protect ras_fwlog state. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc.h | 1 + drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- drivers/scsi/lpfc/lpfc_bsg.c | 20 ++++++++++---------- drivers/scsi/lpfc/lpfc_debugfs.c | 12 ++++++------ drivers/scsi/lpfc/lpfc_init.c | 3 +++ drivers/scsi/lpfc/lpfc_sli.c | 20 ++++++++++---------- 6 files changed, 32 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 18cbfd371ccc..98ca7df003ef 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1437,6 +1437,7 @@ struct lpfc_hba { struct timer_list inactive_vmid_poll; /* RAS Support */ + spinlock_t ras_fwlog_lock; /* do not take while holding another lock */ struct lpfc_ras_fwlog ras_fwlog; uint32_t iocb_cnt; diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 365c7e96070b..3c534b3cfe91 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -5865,9 +5865,9 @@ lpfc_ras_fwlog_buffsize_set(struct lpfc_hba *phba, uint val) if (phba->cfg_ras_fwlog_func != PCI_FUNC(phba->pcidev->devfn)) return -EINVAL; - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); state = phba->ras_fwlog.state; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); if (state == REG_INPROGRESS) { lpfc_printf_log(phba, KERN_ERR, LOG_SLI, "6147 RAS Logging " diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index d80e6e81053b..fee485e47041 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -5070,12 +5070,12 @@ lpfc_bsg_get_ras_config(struct bsg_job *job) bsg_reply->reply_data.vendor_reply.vendor_rsp; /* Current logging state */ - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); if (ras_fwlog->state == ACTIVE) ras_reply->state = LPFC_RASLOG_STATE_RUNNING; else ras_reply->state = LPFC_RASLOG_STATE_STOPPED; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); ras_reply->log_level = phba->ras_fwlog.fw_loglevel; ras_reply->log_buff_sz = phba->cfg_ras_fwlog_buffsize; @@ -5132,13 +5132,13 @@ lpfc_bsg_set_ras_config(struct bsg_job *job) if (action == LPFC_RASACTION_STOP_LOGGING) { /* Check if already disabled */ - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); if (ras_fwlog->state != ACTIVE) { - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); rc = -ESRCH; goto ras_job_error; } - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); /* Disable logging */ lpfc_ras_stop_fwlog(phba); @@ -5149,10 +5149,10 @@ lpfc_bsg_set_ras_config(struct bsg_job *job) * FW-logging with new log-level. Return status * "Logging already Running" to caller. **/ - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); if (ras_fwlog->state != INACTIVE) action_status = -EINPROGRESS; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); /* Enable logging */ rc = lpfc_sli4_ras_fwlog_init(phba, log_level, @@ -5268,13 +5268,13 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *job) goto ras_job_error; /* Logging to be stopped before reading */ - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); if (ras_fwlog->state == ACTIVE) { - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); rc = -EINPROGRESS; goto ras_job_error; } - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); if (job->request_len < sizeof(struct fc_bsg_request) + diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index ab5af10c8a16..a2d2b02b3418 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -2194,12 +2194,12 @@ static int lpfc_debugfs_ras_log_data(struct lpfc_hba *phba, memset(buffer, 0, size); - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); if (phba->ras_fwlog.state != ACTIVE) { - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); return -EINVAL; } - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); list_for_each_entry_safe(dmabuf, next, &phba->ras_fwlog.fwlog_buff_list, list) { @@ -2250,13 +2250,13 @@ lpfc_debugfs_ras_log_open(struct inode *inode, struct file *file) int size; int rc = -ENOMEM; - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); if (phba->ras_fwlog.state != ACTIVE) { - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); rc = -EINVAL; goto out; } - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); if (check_mul_overflow(LPFC_RAS_MIN_BUFF_POST_SIZE, phba->cfg_ras_fwlog_buffsize, &size)) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 3363b0db65ae..c4c305472285 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -7705,6 +7705,9 @@ lpfc_setup_driver_resource_phase1(struct lpfc_hba *phba) "NVME" : " "), (phba->nvmet_support ? "NVMET" : " ")); + /* ras_fwlog state */ + spin_lock_init(&phba->ras_fwlog_lock); + /* Initialize the IO buffer list used by driver for SLI3 SCSI */ spin_lock_init(&phba->scsi_buf_list_get_lock); INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_get); diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 030d7084e412..7f87046e64b7 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -6849,9 +6849,9 @@ lpfc_ras_stop_fwlog(struct lpfc_hba *phba) { struct lpfc_ras_fwlog *ras_fwlog = &phba->ras_fwlog; - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); ras_fwlog->state = INACTIVE; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); /* Disable FW logging to host memory */ writel(LPFC_CTL_PDEV_CTL_DDL_RAS, @@ -6894,9 +6894,9 @@ lpfc_sli4_ras_dma_free(struct lpfc_hba *phba) ras_fwlog->lwpd.virt = NULL; } - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); ras_fwlog->state = INACTIVE; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); } /** @@ -6998,9 +6998,9 @@ lpfc_sli4_ras_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) goto disable_ras; } - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); ras_fwlog->state = ACTIVE; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); mempool_free(pmb, phba->mbox_mem_pool); return; @@ -7032,9 +7032,9 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, uint32_t len = 0, fwlog_buffsize, fwlog_entry_count; int rc = 0; - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); ras_fwlog->state = INACTIVE; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); fwlog_buffsize = (LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize); @@ -7095,9 +7095,9 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, mbx_fwlog->u.request.lwpd.addr_lo = putPaddrLow(ras_fwlog->lwpd.phys); mbx_fwlog->u.request.lwpd.addr_hi = putPaddrHigh(ras_fwlog->lwpd.phys); - spin_lock_irq(&phba->hbalock); + spin_lock_irq(&phba->ras_fwlog_lock); ras_fwlog->state = REG_INPROGRESS; - spin_unlock_irq(&phba->hbalock); + spin_unlock_irq(&phba->ras_fwlog_lock); mbox->vport = phba->pport; mbox->mbox_cmpl = lpfc_sli4_ras_mbox_cmpl; From patchwork Tue Mar 5 20:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582934 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 527198664F for ; Tue, 5 Mar 2024 19:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668162; cv=none; b=OeYSvnv8i1q2FQJBV3eZO/hh+c61sfN96uugVEEcruEAEhpxMMRidJpAk6E3WnPU8Zt0OqZM01cAktDjV+XcyV0qZWK7tQMOJEOm3UKPOM8XjZ0mAHkTXRjR3rg2NPYgFVsG/gUi8v+7XDLIwmeIhrww5GLus1uSfuXNPDrIoGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668162; c=relaxed/simple; bh=JBDYrl9Rs7SwlIyy5qv0Utf0GUdWaKES/CKNLRp/+Uo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cUB35K2iGbfP+mz05+qSSkmn2X+DQ7HBA+hJZ1mEl/Jhe+UAbpYSLrTtMa1dAuoElEEzXmHE5K9LvxLQXpZKaiO07+zOV+G2MiR9oDO+RiuO0hVT5Vl9gY0wXsDXaWeiyk4squ5pZmVHQtTRtVKhgzJ5voh2pM1bMz6blsDBlXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J39bGTiN; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J39bGTiN" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-788251ac2f5so16310885a.0 for ; Tue, 05 Mar 2024 11:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668159; x=1710272959; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/zVNEEZPp8/XxtbvJiWqdZKMg/0wsT0cYyOt5Z1PzU8=; b=J39bGTiN3uYDF/Vu59hOCxOtdYq6okWTsAzYRZNCotIemKXji9zSU/FtW0yyWSiuLP WYQYDD1las7BE4+K/NdiAxpbDlOBYDLmenSboVCBpNR2sDTV1LTsoJ2Mv/aoo8/2kF5G jhSECCChZB+1vZAOf0rCsTLvI+Zm1j7caba3SLWug7TN0T0mIv8hpatqlMm6goQJA4hH phZ6HP5jnn/GzIVGcUd0aGfwKHzr6QadztgwPm9/eoXnepbWvHKLVISBL3xvNpfPp/35 Wi8gqUQm1cbh1if9NTOQxlGJ+4Bi0/yM2EQHmGr1fXI8pCJFqBqFzLeTsn/pJDhFdN74 3gPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668159; x=1710272959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/zVNEEZPp8/XxtbvJiWqdZKMg/0wsT0cYyOt5Z1PzU8=; b=urffCKN41T9Ot0Ex/UkAR6v3Lua0ULLa4Gtbiw7UT8B39s8LmYfGh+7BKtNErkn+Vl P01JV0WpLc0RqvSeCQHolklfzGW4PCMa5y8HpfBHifG++h71he/ggMvOsuD9uHCoWo95 ruweghvHBUsyZUanwF0EgTEcGNRbZPpIGD1ALoqj31UtJDRTwFqq76hSeMjrkM/U/SEW Y9XEFjncLBt/2SRMZAnU2O5sO0qmy6eXqFe++Wjv8sP1Ia/UbllBZuK/3OsEb31rTlhr EnmBLp4kh1b/i16LRxUXGzxvtG4yMQ+yHX8nxuC1ofi125AIiFsLLW6RL8GXzxJ0Z+OY uysA== X-Gm-Message-State: AOJu0Yzu3WQs4AzME1+SxvVwZoELna/P586UnTLcyHq1IjcpVI66K7zY PQhYpd+3bXTp/6kXpiuEOyGmdGHcb0Lsdn1q2bb7PuHY2fgSYGdrbU6/rNnj X-Google-Smtp-Source: AGHT+IHBwv39yVeJxBQurqQey0HRCZTkHXGPjko2iOg2rbeSNPxrEMIe7iBasWmcthjiSZx6kUp+rg== X-Received: by 2002:a05:620a:471e:b0:788:2c10:3ef3 with SMTP id bs30-20020a05620a471e00b007882c103ef3mr1288038qkb.4.1709668159209; Tue, 05 Mar 2024 11:49:19 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:18 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 08/12] lpfc: Define lpfc_nodelist type for ctx_ndlp ptr Date: Tue, 5 Mar 2024 12:04:59 -0800 Message-Id: <20240305200503.57317-9-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In LPFC_MBOXQ_t data structure, the ctx_ndlp ptr shouldn't be defined as a generic void *ptr. It is named ctx_ndlp and it should only be used as an lpfc_nodelist *ptr. Due to the void* declaration, there have been abuses of ctx_ndlp for things not related to ndlp. So, set the ptr type for *ctx_ndlp as lpfc_nodelist. Remove all type casts on ctx_ndlp because it is no longer a void *ptr. Convert the abuse of ctx_ndlp for things not related to ndlps to use the void *context3 ptr. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_bsg.c | 4 ++-- drivers/scsi/lpfc/lpfc_els.c | 10 ++++------ drivers/scsi/lpfc/lpfc_hbadisc.c | 18 +++++++++--------- drivers/scsi/lpfc/lpfc_mbox.c | 10 +++++----- drivers/scsi/lpfc/lpfc_nportdisc.c | 6 +++--- drivers/scsi/lpfc/lpfc_sli.c | 17 ++++++++--------- drivers/scsi/lpfc/lpfc_sli.h | 10 +++++----- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index fee485e47041..03605b827f3a 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -3376,7 +3376,7 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) unsigned long flags; uint8_t *pmb, *pmb_buf; - dd_data = pmboxq->ctx_ndlp; + dd_data = pmboxq->context3; /* * The outgoing buffer is readily referred from the dma buffer, @@ -4875,7 +4875,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_mbox_cmpl; /* setup context field to pass wait_queue pointer to wake function */ - pmboxq->ctx_ndlp = dd_data; + pmboxq->context3 = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 157a910666db..1c0ca5de7e1e 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -7238,7 +7238,7 @@ lpfc_get_rdp_info(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context) goto rdp_fail; mbox->vport = rdp_context->ndlp->vport; mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a0; - mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; + mbox->context3 = (struct lpfc_rdp_context *)rdp_context; rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); if (rc == MBX_NOT_FINISHED) { lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); @@ -7298,7 +7298,6 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); } mbox->vport = phba->pport; - mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30); if (rc == MBX_NOT_FINISHED) { @@ -7358,7 +7357,6 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); } - mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30); if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) { rc = 1; @@ -7500,9 +7498,9 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) int rc; mb = &pmb->u.mb; - lcb_context = (struct lpfc_lcb_context *)pmb->ctx_ndlp; + lcb_context = (struct lpfc_lcb_context *)pmb->context3; ndlp = lcb_context->ndlp; - pmb->ctx_ndlp = NULL; + pmb->context3 = NULL; pmb->ctx_buf = NULL; shdr = (union lpfc_sli4_cfg_shdr *) @@ -7642,7 +7640,7 @@ lpfc_sli4_set_beacon(struct lpfc_vport *vport, lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON, LPFC_MBOX_OPCODE_SET_BEACON_CONFIG, len, LPFC_SLI4_MBX_EMBED); - mbox->ctx_ndlp = (void *)lcb_context; + mbox->context3 = (void *)lcb_context; mbox->vport = phba->pport; mbox->mbox_cmpl = lpfc_els_lcb_rsp; bf_set(lpfc_mbx_set_beacon_port_num, &mbox->u.mqe.un.beacon_config, diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 2ab51397f4a6..c1cc2850ba71 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -3851,7 +3851,7 @@ lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { struct lpfc_vport *vport = pmb->vport; struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; /* The driver calls the state machine with the pmb pointer * but wants to make sure a stale ctx_buf isn't acted on. @@ -4168,7 +4168,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { struct lpfc_vport *vport = pmb->vport; MAILBOX_t *mb = &pmb->u.mb; - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; pmb->ctx_ndlp = NULL; @@ -4306,7 +4306,7 @@ void lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { MAILBOX_t *mb = &pmb->u.mb; - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; struct lpfc_vport *vport = pmb->vport; int rc; @@ -4430,7 +4430,7 @@ lpfc_mbx_cmpl_fc_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { struct lpfc_vport *vport = pmb->vport; MAILBOX_t *mb = &pmb->u.mb; - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; pmb->ctx_ndlp = NULL; if (mb->mbxStatus) { @@ -5173,7 +5173,7 @@ lpfc_nlp_logo_unreg(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) struct lpfc_vport *vport = pmb->vport; struct lpfc_nodelist *ndlp; - ndlp = (struct lpfc_nodelist *)(pmb->ctx_ndlp); + ndlp = pmb->ctx_ndlp; if (!ndlp) return; lpfc_issue_els_logo(vport, ndlp, 0); @@ -5495,7 +5495,7 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) if ((mb = phba->sli.mbox_active)) { if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && - (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { + (ndlp == mb->ctx_ndlp)) { mb->ctx_ndlp = NULL; mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; } @@ -5506,7 +5506,7 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) list_for_each_entry(mb, &phba->sli.mboxq_cmpl, list) { if ((mb->u.mb.mbxCommand != MBX_REG_LOGIN64) || (mb->mbox_flag & LPFC_MBX_IMED_UNREG) || - (ndlp != (struct lpfc_nodelist *)mb->ctx_ndlp)) + (ndlp != mb->ctx_ndlp)) continue; mb->ctx_ndlp = NULL; @@ -5516,7 +5516,7 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && - (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { + (ndlp == mb->ctx_ndlp)) { list_del(&mb->list); lpfc_mbox_rsrc_cleanup(phba, mb, MBOX_THD_LOCKED); @@ -6356,7 +6356,7 @@ void lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { MAILBOX_t *mb = &pmb->u.mb; - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; struct lpfc_vport *vport = pmb->vport; pmb->ctx_ndlp = NULL; diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index f7c41958036b..d4c9a537f834 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -2367,7 +2367,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) MAILBOX_t *mb; int rc = FAILURE; struct lpfc_rdp_context *rdp_context = - (struct lpfc_rdp_context *)(mboxq->ctx_ndlp); + (struct lpfc_rdp_context *)(mboxq->context3); mb = &mboxq->u.mb; if (mb->mbxStatus) @@ -2387,7 +2387,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; struct lpfc_rdp_context *rdp_context = - (struct lpfc_rdp_context *)(mbox->ctx_ndlp); + (struct lpfc_rdp_context *)(mbox->context3); if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) goto error_mbox_free; @@ -2401,7 +2401,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) /* Save the dma buffer for cleanup in the final completion. */ mbox->ctx_buf = mp; mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; - mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; + mbox->context3 = (struct lpfc_rdp_context *)rdp_context; if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED) goto error_mbox_free; @@ -2418,7 +2418,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) int rc; struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); struct lpfc_rdp_context *rdp_context = - (struct lpfc_rdp_context *)(mbox->ctx_ndlp); + (struct lpfc_rdp_context *)(mbox->context3); if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) goto error; @@ -2448,7 +2448,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; - mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; + mbox->context3 = (struct lpfc_rdp_context *)rdp_context; rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); if (rc == MBX_NOT_FINISHED) goto error; diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 8e425be7c7c9..8878f3c3cc2a 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -683,7 +683,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) uint32_t cmd; elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf; - ndlp = (struct lpfc_nodelist *)mboxq->ctx_ndlp; + ndlp = mboxq->ctx_ndlp; vport = mboxq->vport; cmd = elsiocb->drvrTimeout; @@ -1875,7 +1875,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ if ((mb = phba->sli.mbox_active)) { if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && - (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { + (ndlp == mb->ctx_ndlp)) { ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; lpfc_nlp_put(ndlp); mb->ctx_ndlp = NULL; @@ -1886,7 +1886,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, spin_lock_irq(&phba->hbalock); list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && - (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { + (ndlp == mb->ctx_ndlp)) { ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; lpfc_nlp_put(ndlp); list_del(&mb->list); diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 7f87046e64b7..236b4e7e1de1 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -2914,12 +2914,12 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) } if (pmb->u.mb.mbxCommand == MBX_REG_LOGIN64) { - ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + ndlp = pmb->ctx_ndlp; lpfc_nlp_put(ndlp); } if (pmb->u.mb.mbxCommand == MBX_UNREG_LOGIN) { - ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + ndlp = pmb->ctx_ndlp; /* Check to see if there are any deferred events to process */ if (ndlp) { @@ -2952,7 +2952,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) /* This nlp_put pairs with lpfc_sli4_resume_rpi */ if (pmb->u.mb.mbxCommand == MBX_RESUME_RPI) { - ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + ndlp = pmb->ctx_ndlp; lpfc_nlp_put(ndlp); } @@ -13832,8 +13832,7 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) if (!pmbox->mbxStatus) { mp = (struct lpfc_dmabuf *) (pmb->ctx_buf); - ndlp = (struct lpfc_nodelist *) - pmb->ctx_ndlp; + ndlp = pmb->ctx_ndlp; /* Reg_LOGIN of dflt RPI was * successful. new lets get @@ -14341,7 +14340,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe) pmbox->un.varWords[0], 0); if (mcqe_status == MB_CQE_STATUS_SUCCESS) { mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); - ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; + ndlp = pmb->ctx_ndlp; /* Reg_LOGIN of dflt RPI was successful. Mark the * node as having an UNREG_LOGIN in progress to stop @@ -21035,7 +21034,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport) (mb->u.mb.mbxCommand == MBX_REG_VPI)) mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { - act_mbx_ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; + act_mbx_ndlp = mb->ctx_ndlp; /* This reference is local to this routine. The * reference is removed at routine exit. @@ -21064,7 +21063,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport) mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { - ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; + ndlp = mb->ctx_ndlp; /* Unregister the RPI when mailbox complete */ mb->mbox_flag |= LPFC_MBX_IMED_UNREG; restart_loop = 1; @@ -21084,7 +21083,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport) while (!list_empty(&mbox_cmd_list)) { list_remove_head(&mbox_cmd_list, mb, LPFC_MBOXQ_t, list); if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { - ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; + ndlp = mb->ctx_ndlp; mb->ctx_ndlp = NULL; if (ndlp) { spin_lock(&ndlp->lock); diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index c911a39cb46b..60332de27f44 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h @@ -182,11 +182,11 @@ typedef struct lpfcMboxq { struct lpfc_mqe mqe; } u; struct lpfc_vport *vport; /* virtual port pointer */ - void *ctx_ndlp; /* an lpfc_nodelist pointer */ - void *ctx_buf; /* an lpfc_dmabuf pointer */ - void *context3; /* a generic pointer. Code must - * accommodate the actual datatype. - */ + struct lpfc_nodelist *ctx_ndlp; /* caller ndlp pointer */ + void *ctx_buf; /* caller buffer information */ + void *context3; /* a generic pointer. Code must + * accommodate the actual datatype. + */ void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *); uint8_t mbox_flag; From patchwork Tue Mar 5 20:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582935 Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DB305C5FD for ; Tue, 5 Mar 2024 19:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668171; cv=none; b=GQaLqFX7Z+0wYLoNp13r49Qbq2gu59Rffg2w9OwFuISz29OPaVkETInwAXsC6JQir+O58CgPeVIsOFw/1Jk5QTUSZsvmqWrhytZ0AcyqjBCX2YvfrHyz1Fi9vBzZHnrWXslMqkaWSh4sVefaf372sGPrz5OWcT8VgT5JZC3ToXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668171; c=relaxed/simple; bh=7pl08Ohq0BpM7jsMJA/DrBuxUS8JyV2+ty72sxwSjKg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qgrOC2WRqnlF59ukqh3bkvOyXRU78unFrN3MmcYzTkWO8XYWVc78Gg2SlZdi4OgtsbuyVe494QT8jb7N4xGS785tfnSP5QOBBq6B7/3PPWsHWfhfnyqwWvHGVsq0GhifGVqe912ZeqCRa7m112nRlYFyVe7Wi1jhx+JcyNCR4KI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QAnwo3j4; arc=none smtp.client-ip=209.85.161.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QAnwo3j4" Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-5a1358e7e16so663290eaf.0 for ; Tue, 05 Mar 2024 11:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668168; x=1710272968; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Kebv9LHLIarQcTYXttD6K6uy2ZggB3Ri0rxU3pEn7o=; b=QAnwo3j4RiSMHpmgPC5q1dRDOgQIUR64kCcasBVLSr9chJsFx9n5UjHGnZeCw3xWWy ekSdjtGXk9zxFOn/M/I/m8vd7h7q1tXfUFMyiqs8P8frO4JpPnQa36MB5ifKfNG4kU1h pn7ctO1/1cqczWpWszrOsGRFR40IMScQkpb1fuoLscXv+GOoGiHhCSgUA/qE3c79eFcT DQLMPnMCWkvJeAoyc1yyEdeExdU5uANV4dCkTJ0UuVS9vGXzQwEds94rsLdy7S4wHGtB hvU2iqe8wHPVsSIZUXUv2ChMCYjkMC73HzaiaTWcvOSD0Cp87wlIh+Mgpmp5+t5DfTrA 3jGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668168; x=1710272968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Kebv9LHLIarQcTYXttD6K6uy2ZggB3Ri0rxU3pEn7o=; b=AtqsXzGyp8AsHk5dGjg+QmXakZDEpLd76Wq1YfZCHvuwHi5FwPcbGorIo6Je3Vkw4v 9iJOt9QI8DwXIT1FeOj+55Gp6MlvLtj5pjspdLo7FjJz7TW4MzBP67Kqz66OgUyLlZtG +m9rQ8M5lTflXq4+w9XwnsAZcgXz45cLqOsN6FtAO28yKLbZ2gCgJ7n5ljVq7sLwc1Do vCUxWDHJ6Dcbh183HQlTcQoZxw10cCV7K09t89RUqTmGZ5wbOi5VLuG/xmb/z+htBcTu MixIx5uxTXU0aXYOnqG5Nzl/T2r/CwFto/8qB3UtuVCeDiI7HC0Oj3vhsBLuzQu6WmNu +RTA== X-Gm-Message-State: AOJu0Ywi4qW48Xwob44BrrA+u+YhvE9Zykc+FvBN6DM3iSZmimfnKH/0 pLxzwr40z8ybBiWl1lR4GVd8jwdFkNydPPP0hcicfidJFRUOygqAprjtWmN9 X-Google-Smtp-Source: AGHT+IHGARHjvRcgyexIniE7ehm8VoUi7y0jV2t4AyDUK7JyKbZ7E3Oe+ZipEO8PQNTCfRtnjoXr2Q== X-Received: by 2002:a05:6870:9713:b0:220:c9cd:b2b9 with SMTP id n19-20020a056870971300b00220c9cdb2b9mr1583060oaq.4.1709668168154; Tue, 05 Mar 2024 11:49:28 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:20 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 09/12] lpfc: Define lpfc_dmabuf type for ctx_buf ptr Date: Tue, 5 Mar 2024 12:05:00 -0800 Message-Id: <20240305200503.57317-10-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In LPFC_MBOXQ_t, the ctx_buf ptr shouldn't be defined as a generic void *ptr. It is named ctx_buf and it should only be used as an lpfc_dmabuf *ptr. Due to the void* declaration, there have been abuses of ctx_buf for things not related to lpfc_dmabuf. So, set the ptr type for *ctx_buf as lpfc_dmabuf. Remove all type casts on ctx_buf because it is no longer a void *ptr. Convert the abuse of ctx_buf for something not related to lpfc_dmabuf to use the void *context3 ptr. A particular abuse of the ctx_buf warranted a new void *ext_buf ptr. However, the usage of this new void *ext_buf is not generic. It is intended to only hold virtual addresses for extended mailbox commands. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_bsg.c | 12 +++++----- drivers/scsi/lpfc/lpfc_els.c | 14 ++++++------ drivers/scsi/lpfc/lpfc_hbadisc.c | 10 ++++----- drivers/scsi/lpfc/lpfc_init.c | 8 +++---- drivers/scsi/lpfc/lpfc_mbox.c | 15 ++++--------- drivers/scsi/lpfc/lpfc_nportdisc.c | 2 +- drivers/scsi/lpfc/lpfc_sli.c | 35 +++++++++++++++--------------- drivers/scsi/lpfc/lpfc_sli.h | 6 ++++- drivers/scsi/lpfc/lpfc_vport.c | 2 +- 9 files changed, 50 insertions(+), 54 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index 03605b827f3a..f784dc9b602a 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -2513,7 +2513,7 @@ static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t *rpi) return -ENOMEM; } - dmabuff = (struct lpfc_dmabuf *)mbox->ctx_buf; + dmabuff = mbox->ctx_buf; mbox->ctx_buf = NULL; mbox->ctx_ndlp = NULL; status = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); @@ -3553,7 +3553,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) struct lpfc_sli_config_mbox *sli_cfg_mbx; uint8_t *pmbx; - dd_data = pmboxq->ctx_buf; + dd_data = pmboxq->context3; /* Determine if job has been aborted */ spin_lock_irqsave(&phba->ct_ev_lock, flags); @@ -3940,7 +3940,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl; /* context fields to callback function */ - pmboxq->ctx_buf = dd_data; + pmboxq->context3 = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; @@ -4112,7 +4112,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; /* context fields to callback function */ - pmboxq->ctx_buf = dd_data; + pmboxq->context3 = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; @@ -4460,7 +4460,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; /* context fields to callback function */ - pmboxq->ctx_buf = dd_data; + pmboxq->context3 = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; @@ -4747,7 +4747,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, if (mbox_req->inExtWLen || mbox_req->outExtWLen) { from = pmbx; ext = from + sizeof(MAILBOX_t); - pmboxq->ctx_buf = ext; + pmboxq->ext_buf = ext; pmboxq->in_ext_byte_len = mbox_req->inExtWLen * sizeof(uint32_t); pmboxq->out_ext_byte_len = diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 1c0ca5de7e1e..fdb0540fa492 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -7290,7 +7290,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, mbox->in_ext_byte_len = DMP_SFF_PAGE_A0_SIZE; mbox->out_ext_byte_len = DMP_SFF_PAGE_A0_SIZE; mbox->mbox_offset_word = 5; - mbox->ctx_buf = virt; + mbox->ext_buf = virt; } else { bf_set(lpfc_mbx_memory_dump_type3_length, &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A0_SIZE); @@ -7306,7 +7306,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, } if (phba->sli_rev == LPFC_SLI_REV4) - mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); + mp = mbox->ctx_buf; else mp = mpsave; @@ -7349,7 +7349,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, mbox->in_ext_byte_len = DMP_SFF_PAGE_A2_SIZE; mbox->out_ext_byte_len = DMP_SFF_PAGE_A2_SIZE; mbox->mbox_offset_word = 5; - mbox->ctx_buf = virt; + mbox->ext_buf = virt; } else { bf_set(lpfc_mbx_memory_dump_type3_length, &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A2_SIZE); @@ -8637,9 +8637,9 @@ lpfc_els_rsp_rls_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) mb = &pmb->u.mb; ndlp = pmb->ctx_ndlp; - rxid = (uint16_t)((unsigned long)(pmb->ctx_buf) & 0xffff); - oxid = (uint16_t)(((unsigned long)(pmb->ctx_buf) >> 16) & 0xffff); - pmb->ctx_buf = NULL; + rxid = (uint16_t)((unsigned long)(pmb->context3) & 0xffff); + oxid = (uint16_t)(((unsigned long)(pmb->context3) >> 16) & 0xffff); + pmb->context3 = NULL; pmb->ctx_ndlp = NULL; if (mb->mbxStatus) { @@ -8743,7 +8743,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); if (mbox) { lpfc_read_lnk_stat(phba, mbox); - mbox->ctx_buf = (void *)((unsigned long) + mbox->context3 = (void *)((unsigned long) (ox_id << 16 | ctx)); mbox->ctx_ndlp = lpfc_nlp_get(ndlp); if (!mbox->ctx_ndlp) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index c1cc2850ba71..e42fa9c822b5 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -3428,7 +3428,7 @@ static void lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { MAILBOX_t *mb = &pmb->u.mb; - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + struct lpfc_dmabuf *mp = pmb->ctx_buf; struct lpfc_vport *vport = pmb->vport; struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct serv_parm *sp = &vport->fc_sparam; @@ -3736,7 +3736,7 @@ lpfc_mbx_cmpl_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) struct lpfc_mbx_read_top *la; struct lpfc_sli_ring *pring; MAILBOX_t *mb = &pmb->u.mb; - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); + struct lpfc_dmabuf *mp = pmb->ctx_buf; uint8_t attn_type; /* Unblock ELS traffic */ @@ -3850,7 +3850,7 @@ void lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { struct lpfc_vport *vport = pmb->vport; - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + struct lpfc_dmabuf *mp = pmb->ctx_buf; struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; /* The driver calls the state machine with the pmb pointer @@ -4065,7 +4065,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) * the dump routine is a single-use construct. */ if (pmb->ctx_buf) { - mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + mp = pmb->ctx_buf; lpfc_mbuf_free(phba, mp->virt, mp->phys); kfree(mp); pmb->ctx_buf = NULL; @@ -4088,7 +4088,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) if (phba->sli_rev == LPFC_SLI_REV4) { byte_count = pmb->u.mqe.un.mb_words[5]; - mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + mp = pmb->ctx_buf; if (byte_count > sizeof(struct static_vport_info) - offset) byte_count = sizeof(struct static_vport_info) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index c4c305472285..f7a0aa3625f4 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -460,7 +460,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) return -EIO; } - mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + mp = pmb->ctx_buf; /* This dmabuf was allocated by lpfc_read_sparam. The dmabuf is no * longer needed. Prevent unintended ctx_buf access as the mbox is @@ -2217,7 +2217,7 @@ lpfc_handle_latt(struct lpfc_hba *phba) /* Cleanup any outstanding ELS commands */ lpfc_els_flush_all_cmd(phba); psli->slistat.link_event++; - lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf); + lpfc_read_topology(phba, pmb, pmb->ctx_buf); pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology; pmb->vport = vport; /* Block ELS IOCBs until we have processed this mbox command */ @@ -5454,7 +5454,7 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba, phba->sli.slistat.link_event++; /* Create lpfc_handle_latt mailbox command from link ACQE */ - lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf); + lpfc_read_topology(phba, pmb, pmb->ctx_buf); pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology; pmb->vport = phba->pport; @@ -6347,7 +6347,7 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba *phba, struct lpfc_acqe_fc_la *acqe_fc) phba->sli.slistat.link_event++; /* Create lpfc_handle_latt mailbox command from link ACQE */ - lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf); + lpfc_read_topology(phba, pmb, pmb->ctx_buf); pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology; pmb->vport = phba->pport; diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index d4c9a537f834..eaa3f89458ec 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -102,7 +102,7 @@ lpfc_mbox_rsrc_cleanup(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox, { struct lpfc_dmabuf *mp; - mp = (struct lpfc_dmabuf *)mbox->ctx_buf; + mp = mbox->ctx_buf; mbox->ctx_buf = NULL; /* Release the generic BPL buffer memory. */ @@ -204,10 +204,8 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset, uint16_t region_id) { MAILBOX_t *mb; - void *ctx; mb = &pmb->u.mb; - ctx = pmb->ctx_buf; /* Setup to dump VPD region */ memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); @@ -219,7 +217,6 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset, mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t)); mb->un.varDmp.co = 0; mb->un.varDmp.resp_offset = 0; - pmb->ctx_buf = ctx; mb->mbxOwner = OWN_HOST; return; } @@ -236,11 +233,8 @@ void lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) { MAILBOX_t *mb; - void *ctx; mb = &pmb->u.mb; - /* Save context so that we can restore after memset */ - ctx = pmb->ctx_buf; /* Setup to dump VPD region */ memset(pmb, 0, sizeof(LPFC_MBOXQ_t)); @@ -254,7 +248,6 @@ lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE; mb->un.varDmp.co = 0; mb->un.varDmp.resp_offset = 0; - pmb->ctx_buf = ctx; return; } @@ -372,7 +365,7 @@ lpfc_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, /* Save address for later completion and set the owner to host so that * the FW knows this mailbox is available for processing. */ - pmb->ctx_buf = (uint8_t *)mp; + pmb->ctx_buf = mp; mb->mbxOwner = OWN_HOST; return (0); } @@ -2385,7 +2378,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) static void lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; + struct lpfc_dmabuf *mp = mbox->ctx_buf; struct lpfc_rdp_context *rdp_context = (struct lpfc_rdp_context *)(mbox->context3); @@ -2416,7 +2409,7 @@ void lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { int rc; - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); + struct lpfc_dmabuf *mp = mbox->ctx_buf; struct lpfc_rdp_context *rdp_context = (struct lpfc_rdp_context *)(mbox->context3); diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 8878f3c3cc2a..c6b76c3d0f70 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -682,7 +682,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) struct lpfc_nodelist *ndlp; uint32_t cmd; - elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf; + elsiocb = mboxq->context3; ndlp = mboxq->ctx_ndlp; vport = mboxq->vport; cmd = elsiocb->drvrTimeout; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 236b4e7e1de1..aa746cb08841 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -2885,7 +2885,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) if (!test_bit(FC_UNLOADING, &phba->pport->load_flag) && pmb->u.mb.mbxCommand == MBX_REG_LOGIN64 && !pmb->u.mb.mbxStatus) { - mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + mp = pmb->ctx_buf; if (mp) { pmb->ctx_buf = NULL; lpfc_mbuf_free(phba, mp->virt, mp->phys); @@ -5819,7 +5819,7 @@ lpfc_sli4_read_fcoe_params(struct lpfc_hba *phba) goto out_free_mboxq; } - mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; + mp = mboxq->ctx_buf; rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, @@ -8766,7 +8766,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) mboxq->vport = vport; rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); - mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; + mp = mboxq->ctx_buf; if (rc == MBX_SUCCESS) { memcpy(&vport->fc_sparam, mp->virt, sizeof(struct serv_parm)); rc = 0; @@ -9548,8 +9548,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, } /* Copy the mailbox extension data */ - if (pmbox->in_ext_byte_len && pmbox->ctx_buf) { - lpfc_sli_pcimem_bcopy(pmbox->ctx_buf, + if (pmbox->in_ext_byte_len && pmbox->ext_buf) { + lpfc_sli_pcimem_bcopy(pmbox->ext_buf, (uint8_t *)phba->mbox_ext, pmbox->in_ext_byte_len); } @@ -9562,10 +9562,10 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, = MAILBOX_HBA_EXT_OFFSET; /* Copy the mailbox extension data */ - if (pmbox->in_ext_byte_len && pmbox->ctx_buf) + if (pmbox->in_ext_byte_len && pmbox->ext_buf) lpfc_memcpy_to_slim(phba->MBslimaddr + MAILBOX_HBA_EXT_OFFSET, - pmbox->ctx_buf, pmbox->in_ext_byte_len); + pmbox->ext_buf, pmbox->in_ext_byte_len); if (mbx->mbxCommand == MBX_CONFIG_PORT) /* copy command data into host mbox for cmpl */ @@ -9688,9 +9688,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, lpfc_sli_pcimem_bcopy(phba->mbox, mbx, MAILBOX_CMD_SIZE); /* Copy the mailbox extension data */ - if (pmbox->out_ext_byte_len && pmbox->ctx_buf) { + if (pmbox->out_ext_byte_len && pmbox->ext_buf) { lpfc_sli_pcimem_bcopy(phba->mbox_ext, - pmbox->ctx_buf, + pmbox->ext_buf, pmbox->out_ext_byte_len); } } else { @@ -9698,9 +9698,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, lpfc_memcpy_from_slim(mbx, phba->MBslimaddr, MAILBOX_CMD_SIZE); /* Copy the mailbox extension data */ - if (pmbox->out_ext_byte_len && pmbox->ctx_buf) { + if (pmbox->out_ext_byte_len && pmbox->ext_buf) { lpfc_memcpy_from_slim( - pmbox->ctx_buf, + pmbox->ext_buf, phba->MBslimaddr + MAILBOX_HBA_EXT_OFFSET, pmbox->out_ext_byte_len); @@ -13813,10 +13813,10 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) lpfc_sli_pcimem_bcopy(mbox, pmbox, MAILBOX_CMD_SIZE); if (pmb->out_ext_byte_len && - pmb->ctx_buf) + pmb->ext_buf) lpfc_sli_pcimem_bcopy( phba->mbox_ext, - pmb->ctx_buf, + pmb->ext_buf, pmb->out_ext_byte_len); } if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) { @@ -13830,8 +13830,7 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) pmbox->un.varWords[0], 0); if (!pmbox->mbxStatus) { - mp = (struct lpfc_dmabuf *) - (pmb->ctx_buf); + mp = pmb->ctx_buf; ndlp = pmb->ctx_ndlp; /* Reg_LOGIN of dflt RPI was @@ -14339,7 +14338,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe) mcqe_status, pmbox->un.varWords[0], 0); if (mcqe_status == MB_CQE_STATUS_SUCCESS) { - mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); + mp = pmb->ctx_buf; ndlp = pmb->ctx_ndlp; /* Reg_LOGIN of dflt RPI was successful. Mark the @@ -19858,7 +19857,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, lpfc_resume_rpi(mboxq, ndlp); if (cmpl) { mboxq->mbox_cmpl = cmpl; - mboxq->ctx_buf = arg; + mboxq->context3 = arg; } else mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; mboxq->ctx_ndlp = ndlp; @@ -20675,7 +20674,7 @@ lpfc_sli4_get_config_region23(struct lpfc_hba *phba, char *rgn23_data) if (lpfc_sli4_dump_cfg_rg23(phba, mboxq)) goto out; mqe = &mboxq->u.mqe; - mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; + mp = mboxq->ctx_buf; rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); if (rc) goto out; diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 60332de27f44..29fdccd689af 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h @@ -183,7 +183,11 @@ typedef struct lpfcMboxq { } u; struct lpfc_vport *vport; /* virtual port pointer */ struct lpfc_nodelist *ctx_ndlp; /* caller ndlp pointer */ - void *ctx_buf; /* caller buffer information */ + struct lpfc_dmabuf *ctx_buf; /* caller buffer information */ + void *ext_buf; /* extended buffer for extended mbox + * cmds. Not a generic pointer. + * Use for storing virtual address. + */ void *context3; /* a generic pointer. Code must * accommodate the actual datatype. */ diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 9850080ee33d..4439167a5188 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c @@ -166,7 +166,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) } } - mp = (struct lpfc_dmabuf *)pmb->ctx_buf; + mp = pmb->ctx_buf; memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm)); memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName, sizeof (struct lpfc_name)); From patchwork Tue Mar 5 20:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582936 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D585824A1D for ; Tue, 5 Mar 2024 19:49:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668176; cv=none; b=PS9rY7EwTFLQlC2tuOgbodQTtiJ8CPoJaVkYM1n8WH9W8b+FM8pJJ9LQhaS1VWc0Dpq0SyhimMK2+nD7G16Y57UNHySHKilESzaBs+/lCthtumxyuMDGPH8vACpC+IqAGbTb/pqfg8lpQRYURlVzyz6hVDMsirXhaQ0ypzyqnZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668176; c=relaxed/simple; bh=haI7AaOnLd2eVdeEJL6FyAT/Gj1A7sZakq2LrkbtXno=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FvtIbcUYLV4PMUNLuAFCE6lnLEvsAzvgWmxYtqv94P5vEEMkzQc0nu9c3fmGr//omrvyY3B0Iv7sijwqGtgTizeE4vQAmicztRjOur2vi9CkZVkZVJwRd5j1D+kGubnlAAX5QYMMjJ4D3r7AIWMwgQ3zTE5oPpSUecvtHIzAIcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NyyFxgfg; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NyyFxgfg" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-21eab2bd67bso342941fac.0 for ; Tue, 05 Mar 2024 11:49:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668174; x=1710272974; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r2VYahat/fLILDC//SS9hGapUtLeYQGcYDcx0qSxOKg=; b=NyyFxgfgH70t0nKeYwBh7CSTT/8O4I+UVGy8SEL3DaKpVxk4QbPhGravRK4o1RaaFi +yJC8h3IpC2eJsiw4mB2WQ6n6Kf79mSj/Qu2lzaaXgU6djAfrI2dgZY6RyzasrXWNFcr CxVUFS1HRc+z/h3Hi3bcUx5rwMMrltPzcap/mCkuuzuwb6q5gNplI3m9kWufjPsFLNA8 GimZpXKjtI8LkvtR9gjGxdaqjpRV6W0cNSpruqTI1WZmq0p0WZPygKJyVNqBj78mcNfF boLJGB3t/TH18aSUv3aX2DxwXshBGgoWxzSsejbwm3TNS+n1A5fXI0106rJ75usT8t/i 6oOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668174; x=1710272974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r2VYahat/fLILDC//SS9hGapUtLeYQGcYDcx0qSxOKg=; b=VVfX1TDsoV2f8W6Q8a7InU0Wsq7mHsNSANHcz+PYCeikIxOmtk0t2XuTZWAEUzW3tU A31eSed/zAo8oB5lfvQ6n4xLXumjJz5mY+2WXE+1MgSkE3lDr78Tbuyj1LEEmGBZr8q3 s+28FTeEfnyKka1AIH9DuN6pE6hoZArsR2eoi/HHfOMfjFeCQbaHBU5JJIJO9YzAEBWL pJnY7yyL15GsBVOiWKO8YiTZHk9e/ugeGSBrcEuIaRiL9iMziafT5qrkiReJbnVjZIad /LDA0qvNZMejXfwxe3nBtF7AorGQeaLO5AHofKqNseldJNz63NSZLEzCtTo/4x6hQyUz m9yA== X-Gm-Message-State: AOJu0YwipD3/B6frvTnaJ1v7yiyscI/qYH6yNW0Fa3cSB+TZr32Ul4Jz 2gXWPgoZjjpQ2XV3og1r7nzMhN2vDJrQt1f40AlYcxFodDUrNNsEGkcqczMk X-Google-Smtp-Source: AGHT+IHwFbCQAYcgYMTK5uSj+KIk17T9h7GIJVKJEoEsmrJ3yiIZpQhGJ0OPHAMI5k7l50YGkn0ZCw== X-Received: by 2002:a05:6870:2143:b0:221:b2a:3beb with SMTP id g3-20020a056870214300b002210b2a3bebmr1006711oae.2.1709668173944; Tue, 05 Mar 2024 11:49:33 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:33 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 10/12] lpfc: Define types in a union for generic void *context3 ptr Date: Tue, 5 Mar 2024 12:05:01 -0800 Message-Id: <20240305200503.57317-11-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In LPFC_MBOXQ_t, the void *context3 ptr is used for various paths. It is treated as a generic pointer, and is type casted during its usage. The issue with this is that it can sometimes get confusing when reading code as to what the context3 ptr is being used for and mistakenly be reused in a different context. Rename context3 to ctx_u, and declare it as a union of defined ptr types. From now on, the ctx_u ptr may be used only if users define the use case type. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_bsg.c | 12 ++++++------ drivers/scsi/lpfc/lpfc_els.c | 17 ++++++++--------- drivers/scsi/lpfc/lpfc_mbox.c | 15 ++++++--------- drivers/scsi/lpfc/lpfc_nportdisc.c | 6 +++--- drivers/scsi/lpfc/lpfc_sli.c | 15 ++++++++------- drivers/scsi/lpfc/lpfc_sli.h | 20 +++++++++++++++++--- drivers/scsi/lpfc/lpfc_sli4.h | 5 +++-- 7 files changed, 51 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index f784dc9b602a..bfa63091902b 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -3376,7 +3376,7 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) unsigned long flags; uint8_t *pmb, *pmb_buf; - dd_data = pmboxq->context3; + dd_data = pmboxq->ctx_u.dd_data; /* * The outgoing buffer is readily referred from the dma buffer, @@ -3553,7 +3553,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) struct lpfc_sli_config_mbox *sli_cfg_mbx; uint8_t *pmbx; - dd_data = pmboxq->context3; + dd_data = pmboxq->ctx_u.dd_data; /* Determine if job has been aborted */ spin_lock_irqsave(&phba->ct_ev_lock, flags); @@ -3940,7 +3940,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl; /* context fields to callback function */ - pmboxq->context3 = dd_data; + pmboxq->ctx_u.dd_data = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; @@ -4112,7 +4112,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; /* context fields to callback function */ - pmboxq->context3 = dd_data; + pmboxq->ctx_u.dd_data = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; @@ -4460,7 +4460,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; /* context fields to callback function */ - pmboxq->context3 = dd_data; + pmboxq->ctx_u.dd_data = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; @@ -4875,7 +4875,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, pmboxq->mbox_cmpl = lpfc_bsg_issue_mbox_cmpl; /* setup context field to pass wait_queue pointer to wake function */ - pmboxq->context3 = dd_data; + pmboxq->ctx_u.dd_data = dd_data; dd_data->type = TYPE_MBOX; dd_data->set_job = job; dd_data->context_un.mbox.pmboxq = pmboxq; diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index fdb0540fa492..f7c28dc73bf6 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -7238,7 +7238,7 @@ lpfc_get_rdp_info(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context) goto rdp_fail; mbox->vport = rdp_context->ndlp->vport; mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a0; - mbox->context3 = (struct lpfc_rdp_context *)rdp_context; + mbox->ctx_u.rdp = rdp_context; rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); if (rc == MBX_NOT_FINISHED) { lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); @@ -7498,9 +7498,9 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) int rc; mb = &pmb->u.mb; - lcb_context = (struct lpfc_lcb_context *)pmb->context3; + lcb_context = pmb->ctx_u.lcb; ndlp = lcb_context->ndlp; - pmb->context3 = NULL; + memset(&pmb->ctx_u, 0, sizeof(pmb->ctx_u)); pmb->ctx_buf = NULL; shdr = (union lpfc_sli4_cfg_shdr *) @@ -7640,7 +7640,7 @@ lpfc_sli4_set_beacon(struct lpfc_vport *vport, lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON, LPFC_MBOX_OPCODE_SET_BEACON_CONFIG, len, LPFC_SLI4_MBX_EMBED); - mbox->context3 = (void *)lcb_context; + mbox->ctx_u.lcb = lcb_context; mbox->vport = phba->pport; mbox->mbox_cmpl = lpfc_els_lcb_rsp; bf_set(lpfc_mbx_set_beacon_port_num, &mbox->u.mqe.un.beacon_config, @@ -8637,9 +8637,9 @@ lpfc_els_rsp_rls_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) mb = &pmb->u.mb; ndlp = pmb->ctx_ndlp; - rxid = (uint16_t)((unsigned long)(pmb->context3) & 0xffff); - oxid = (uint16_t)(((unsigned long)(pmb->context3) >> 16) & 0xffff); - pmb->context3 = NULL; + rxid = (uint16_t)(pmb->ctx_u.ox_rx_id & 0xffff); + oxid = (uint16_t)((pmb->ctx_u.ox_rx_id >> 16) & 0xffff); + memset(&pmb->ctx_u, 0, sizeof(pmb->ctx_u)); pmb->ctx_ndlp = NULL; if (mb->mbxStatus) { @@ -8743,8 +8743,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); if (mbox) { lpfc_read_lnk_stat(phba, mbox); - mbox->context3 = (void *)((unsigned long) - (ox_id << 16 | ctx)); + mbox->ctx_u.ox_rx_id = ox_id << 16 | ctx; mbox->ctx_ndlp = lpfc_nlp_get(ndlp); if (!mbox->ctx_ndlp) goto node_err; diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index eaa3f89458ec..e98f1c2b2220 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -1809,7 +1809,7 @@ lpfc_sli4_mbox_cmd_free(struct lpfc_hba *phba, struct lpfcMboxq *mbox) } /* Reinitialize the context pointers to avoid stale usage. */ mbox->ctx_buf = NULL; - mbox->context3 = NULL; + memset(&mbox->ctx_u, 0, sizeof(mbox->ctx_u)); kfree(mbox->sge_array); /* Finally, free the mailbox command itself */ mempool_free(mbox, phba->mbox_mem_pool); @@ -2359,8 +2359,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) { MAILBOX_t *mb; int rc = FAILURE; - struct lpfc_rdp_context *rdp_context = - (struct lpfc_rdp_context *)(mboxq->context3); + struct lpfc_rdp_context *rdp_context = mboxq->ctx_u.rdp; mb = &mboxq->u.mb; if (mb->mbxStatus) @@ -2379,8 +2378,7 @@ static void lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { struct lpfc_dmabuf *mp = mbox->ctx_buf; - struct lpfc_rdp_context *rdp_context = - (struct lpfc_rdp_context *)(mbox->context3); + struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp; if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) goto error_mbox_free; @@ -2394,7 +2392,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) /* Save the dma buffer for cleanup in the final completion. */ mbox->ctx_buf = mp; mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; - mbox->context3 = (struct lpfc_rdp_context *)rdp_context; + mbox->ctx_u.rdp = rdp_context; if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED) goto error_mbox_free; @@ -2410,8 +2408,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { int rc; struct lpfc_dmabuf *mp = mbox->ctx_buf; - struct lpfc_rdp_context *rdp_context = - (struct lpfc_rdp_context *)(mbox->context3); + struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp; if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) goto error; @@ -2441,7 +2438,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; - mbox->context3 = (struct lpfc_rdp_context *)rdp_context; + mbox->ctx_u.rdp = rdp_context; rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); if (rc == MBX_NOT_FINISHED) goto error; diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index c6b76c3d0f70..c4172791c267 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -300,7 +300,7 @@ lpfc_defer_plogi_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *login_mbox) int rc; ndlp = login_mbox->ctx_ndlp; - save_iocb = login_mbox->context3; + save_iocb = login_mbox->ctx_u.save_iocb; if (mb->mbxStatus == MBX_SUCCESS) { /* Now that REG_RPI completed successfully, @@ -640,7 +640,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, if (!login_mbox->ctx_ndlp) goto out; - login_mbox->context3 = save_iocb; /* For PLOGI ACC */ + login_mbox->ctx_u.save_iocb = save_iocb; /* For PLOGI ACC */ spin_lock_irq(&ndlp->lock); ndlp->nlp_flag |= (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI); @@ -682,7 +682,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) struct lpfc_nodelist *ndlp; uint32_t cmd; - elsiocb = mboxq->context3; + elsiocb = mboxq->ctx_u.save_iocb; ndlp = mboxq->ctx_ndlp; vport = mboxq->vport; cmd = elsiocb->drvrTimeout; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index aa746cb08841..a028e008dd1e 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -2830,7 +2830,7 @@ lpfc_sli_wake_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) */ pmboxq->mbox_flag |= LPFC_MBX_WAKE; spin_lock_irqsave(&phba->hbalock, drvr_flag); - pmbox_done = (struct completion *)pmboxq->context3; + pmbox_done = pmboxq->ctx_u.mbox_wait; if (pmbox_done) complete(pmbox_done); spin_unlock_irqrestore(&phba->hbalock, drvr_flag); @@ -13262,9 +13262,9 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, /* setup wake call as IOCB callback */ pmboxq->mbox_cmpl = lpfc_sli_wake_mbox_wait; - /* setup context3 field to pass wait_queue pointer to wake function */ + /* setup ctx_u field to pass wait_queue pointer to wake function */ init_completion(&mbox_done); - pmboxq->context3 = &mbox_done; + pmboxq->ctx_u.mbox_wait = &mbox_done; /* now issue the command */ retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT); if (retval == MBX_BUSY || retval == MBX_SUCCESS) { @@ -13272,7 +13272,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, msecs_to_jiffies(timeout * 1000)); spin_lock_irqsave(&phba->hbalock, flag); - pmboxq->context3 = NULL; + pmboxq->ctx_u.mbox_wait = NULL; /* * if LPFC_MBX_WAKE flag is set the mailbox is completed * else do not free the resources. @@ -19821,14 +19821,15 @@ lpfc_sli4_remove_rpis(struct lpfc_hba *phba) * lpfc_sli4_resume_rpi - Remove the rpi bitmask region * @ndlp: pointer to lpfc nodelist data structure. * @cmpl: completion call-back. - * @arg: data to load as MBox 'caller buffer information' + * @iocbq: data to load as mbox ctx_u information * * This routine is invoked to remove the memory region that * provided rpi via a bitmask. **/ int lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, - void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *arg) + void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), + struct lpfc_iocbq *iocbq) { LPFC_MBOXQ_t *mboxq; struct lpfc_hba *phba = ndlp->phba; @@ -19857,7 +19858,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, lpfc_resume_rpi(mboxq, ndlp); if (cmpl) { mboxq->mbox_cmpl = cmpl; - mboxq->context3 = arg; + mboxq->ctx_u.save_iocb = iocbq; } else mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; mboxq->ctx_ndlp = ndlp; diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 29fdccd689af..39f78ef291f7 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h @@ -188,9 +188,23 @@ typedef struct lpfcMboxq { * cmds. Not a generic pointer. * Use for storing virtual address. */ - void *context3; /* a generic pointer. Code must - * accommodate the actual datatype. - */ + + /* Pointers that are seldom used during mbox execution, but require + * a saved context. + */ + union { + unsigned long ox_rx_id; /* Used in els_rsp_rls_acc */ + struct lpfc_rdp_context *rdp; /* Used in get_rdp_info */ + struct lpfc_lcb_context *lcb; /* Used in set_beacon */ + struct completion *mbox_wait; /* Used in issue_mbox_wait */ + struct bsg_job_data *dd_data; /* Used in bsg_issue_mbox_cmpl + * and + * bsg_issue_mbox_ext_handle_job + */ + struct lpfc_iocbq *save_iocb; /* Used in defer_plogi_acc and + * lpfc_mbx_cmpl_resume_rpi + */ + } ctx_u; void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *); uint8_t mbox_flag; diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 2541a8fba093..37d9ead7a7c0 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h @@ -1118,8 +1118,9 @@ void lpfc_sli4_free_rpi(struct lpfc_hba *, int); void lpfc_sli4_remove_rpis(struct lpfc_hba *); void lpfc_sli4_async_event_proc(struct lpfc_hba *); void lpfc_sli4_fcf_redisc_event_proc(struct lpfc_hba *); -int lpfc_sli4_resume_rpi(struct lpfc_nodelist *, - void (*)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *); +int lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, + void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), + struct lpfc_iocbq *iocbq); void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *phba); void lpfc_sli4_nvme_pci_offline_aborted(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_ncmd); From patchwork Tue Mar 5 20:05:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582937 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 131F85C607 for ; Tue, 5 Mar 2024 19:49:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668178; cv=none; b=nTNZ7mgYEZ1kboBzJQTNARM3MzSZxhpBJ+dwTzq72y958MMlrLsTz0GAhsGkYyckXL7DXyWEIPgasrNPIJ9SzIV84s5uJq5wLc5voK4YOE5TCzjtl/nNrYag3fgJdbL1pesLbL/iQSiuQ/4RFrA63Dxx3nyS3vIrofymSTCDGHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668178; c=relaxed/simple; bh=ATqU87LS5ezLdeXcWTeyKyLuBGCxRxxH115EhPc5+wQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lTpePEJNGMwIMltA05XXvR5vXo9Gs0KWwjNImkAtRmkD3uLL2XBlXrgqooO7eqXG35Jes1LL6V1sw859laqpPDJd0C756J3XH/ZSc7ym8OuNQM1nTTNrA2ja9FWTVvhk3+bu+lPt84ifEhtx67Y8bhKHnwUdBe745AVXcnq6iF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WUp0OiaO; arc=none smtp.client-ip=209.85.160.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WUp0OiaO" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-42e4b89bd3cso10082461cf.0 for ; Tue, 05 Mar 2024 11:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668176; x=1710272976; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KVHTt6NBiMTnG3shM3xG2Nf64zdGcTjMP0Ts5mx9Cgg=; b=WUp0OiaOGbHYL6mvJ2Ml+k+mHZrxredveJ4VjCGvnTFnj6B5pSrYzg5WE63ki+a/2l psDJf7y+hVPHFAz5csDb74v3xR0m/Etv6VXOBwGo955o2IWw7dYw9MNyGbxgPkKilhs/ 2oTIAwLpflc4SlYXv/yBj6CJDX/jmZ3ijxKcU9GhSP/YM8sffQkSrl0g9J1105FXVniv ncyQF959KNWh0hB9BXW1TdkJM4K75gg55ZfWipnsYZVS4jTBl6ratE+dDF05W4xb4URY tquzl/PDnZ0jlVno0y4BF1828B1RtGPFNUU4ON1TNwJZjjZQQENHmVAZrmSnU+Doh70w 4yCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668176; x=1710272976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KVHTt6NBiMTnG3shM3xG2Nf64zdGcTjMP0Ts5mx9Cgg=; b=V1zsijVH1DWFp/33nEOHO65wCbsuov8GlzwDdyf6S79ype+CUVDMt1SEP4cMlB7NiX FxZ4TqrRk2ydWyQCXPhwGExar3Z3P9VZlV0T8GygvZF40Mx6J8rA0sjK6iVrNM3gEfvv SDVn87Wgjr5DJS8UM226OQuWH6F1l0ROXY5Ksvyl7bT1aXxGt5VQ+r5PBIyLuMDuItnn SdJ+zdoiRzFFmOM8ZVu/wUXwzjs8b+wCuGnc3I1TYr6GYxrIk5PYUiv7SL+wZN115Jll M/WZ0ZK6PbLejtVmSnOnXj6aUL1+W83QktmukVSp9vpHGHoRvx2rEztrearpzJ5x/G9c Zuyw== X-Gm-Message-State: AOJu0Ywrxwj7VL8Ovj+744awg9QmVf//JZBnzxL3+X2HflDKJ1NxL8v7 +oa+LxKYunUvV1B9fG4GMBC5drelj7hcisvXOWx/pY6lP7H5xLdbrPAXZudZ X-Google-Smtp-Source: AGHT+IGaUOxMIluvb4IeQ1iyk4SDyFA4r/TovscU19o4EPSY5lX+qCUYQPX/hjxsWthBmOAvpMLQpg== X-Received: by 2002:a05:620a:4587:b0:788:31b8:a750 with SMTP id bp7-20020a05620a458700b0078831b8a750mr1417952qkb.1.1709668175995; Tue, 05 Mar 2024 11:49:35 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:35 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 11/12] lpfc: Update lpfc version to 14.4.0.1 Date: Tue, 5 Mar 2024 12:05:02 -0800 Message-Id: <20240305200503.57317-12-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update lpfc version to 14.4.0.1 Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 56f5889dbaf9..915f2f11fb55 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.4.0.0" +#define LPFC_DRIVER_VERSION "14.4.0.1" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ From patchwork Tue Mar 5 20:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Justin Tee X-Patchwork-Id: 13582938 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F41461272A2 for ; Tue, 5 Mar 2024 19:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668180; cv=none; b=qExNn9P0Z5thEBw/o0to8ixBJdJWhpob4WFAcF5s0krgOENqjb9TW/QYsVSriU8J8x8S0Fu19DJhBjUWCPH2kHN/+cMFfpfchjRozd2jk7eLNtAqFMBZw03qAuhwaTNgQDXIFgw6rclcv2MjPrZc4n9DPJ7hpV59qrczVDOKDcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709668180; c=relaxed/simple; bh=eArTxbds+9jJBj0X0IckQcyMO9vFBcya1CFb5iEHHqI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=KNIkCi9P09Bwdb70wdcYXwWEs+tivZHP/P8hi82jMM0YZC8axQJodb1gl/AmN7PRZsLdwR6UgZvAJf77sum/5xOkxitUEPs5LGv+txE/EInd/tJsE4brfPCzAYbLrl4oTCB7f7QOQpgWMwmOeqUVg2hTmKZm0vveGfHMPN3Upqg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IbImqtvp; arc=none smtp.client-ip=209.85.219.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IbImqtvp" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-69069235a0eso4486016d6.0 for ; Tue, 05 Mar 2024 11:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709668178; x=1710272978; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6QyepeMeNdh4dvf6RFrc0FdzXpa+q1WoVI5foLDSuwc=; b=IbImqtvpgAARTHuk0TNr9ckNIEzKo6gVS0yPrBX8XnRhFUZZhh7udAoy5iRy7pVKqH XJ88UDUAaKQ4bYctucwNJeJtNpUzZLk6bUCZFWJp3vUTOv1nXYm6yWkxVDPg9THjsmMK 0yCsNJETEhq7ZB7OudYKktK9Zo/ILCHjTqVohJAhfqP48OvGNhDU9bC1r+Te6j3TUsv/ lGS5CjJbCNsWpJrEtFWJ7l4VeIm3W/SiPHGC1Pceguj0ge/gweoQBM8k32tMCqcpxxXt Ia89052uNoxnQGWBBG2C/xJ+tn1h8uSb3aBprzm/3v3nSOTno+V/TUcEd/PV4rT/8k5d nMJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709668178; x=1710272978; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6QyepeMeNdh4dvf6RFrc0FdzXpa+q1WoVI5foLDSuwc=; b=o7YxRyKxOtSpvdIDqavzY5Ibwf9HdTxTJxs2akt8Dzafderwxs6a7dkxyUKWNjPqcz AwWERvoe4l7fWjsLX0At6sbSjTOkK4hEe6+DYIVXiGT8w4ltD1M9LB3w13BkTVfy7K89 6NatfjrojYu+JC2yX6Nnuow9zp2X6XGI0TwDP/08yRSKUGRrIqjVBTqNWQNpij1VldHR scCllx084/GgZsf7sjzU8yho2T9Iwj3xp4ndqNf4WFOinDBSR0iZyuqHDQJtDpP8i6MT pJ9hGalBkSFI9RyNdZ+Jn1sn3+cMbzbumF7fCr9F9vbYuklw5nCAa6zEIcUmJaZHaaLB amTA== X-Gm-Message-State: AOJu0YyrgNRL6+MBzJxKDQ3AfJzvWvLWZHVpdC2QT5g5R8CIfVAZuY18 X5hA07wN0NkGj2PREy+2xuKfgl/RvjfqIDSMYG0KltSC8yqyja+0zfsZ655J X-Google-Smtp-Source: AGHT+IHaJw4vDglwEy7vnHK9DKFGd30KVxm/FxI8cCIWfAeO8cm1Q0nUKnb9CJ4xFG8mBId3wcX/qw== X-Received: by 2002:a05:620a:4587:b0:788:2f7b:d3 with SMTP id bp7-20020a05620a458700b007882f7b00d3mr786377qkb.7.1709668177859; Tue, 05 Mar 2024 11:49:37 -0800 (PST) Received: from dhcp-10-231-55-133.dhcp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj13-20020a05620a190d00b007877f52a6b9sm5706050qkb.136.2024.03.05.11.49.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 11:49:37 -0800 (PST) From: Justin Tee To: linux-scsi@vger.kernel.org Cc: jsmart2021@gmail.com, justin.tee@broadcom.com, Justin Tee Subject: [PATCH 12/12] lpfc: Copyright updates for 14.4.0.1 patches Date: Tue, 5 Mar 2024 12:05:03 -0800 Message-Id: <20240305200503.57317-13-justintee8345@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20240305200503.57317-1-justintee8345@gmail.com> References: <20240305200503.57317-1-justintee8345@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update copyrights to 2024 for files modified in the 14.4.0.1 patch set. Signed-off-by: Justin Tee --- drivers/scsi/lpfc/lpfc_sli.h | 2 +- drivers/scsi/lpfc/lpfc_sli4.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 39f78ef291f7..cf7c42ec0306 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 37d9ead7a7c0..c1e9ec0243ba 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2009-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. *