From patchwork Wed Sep 13 15:56:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Grzedzicki X-Patchwork-Id: 722479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86E26EDEC7E for ; Wed, 13 Sep 2023 15:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjIMP4j (ORCPT ); Wed, 13 Sep 2023 11:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbjIMP4h (ORCPT ); Wed, 13 Sep 2023 11:56:37 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4640B1BCA for ; Wed, 13 Sep 2023 08:56:33 -0700 (PDT) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38DEjWGC006340 for ; Wed, 13 Sep 2023 08:56:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=s2048-2021-q4; bh=22ok7B2PvqkfYpwpJ7o1ydqnVK288ID8TPWPyMwUpkc=; b=WQtwkF0oDXlT2fcSv0kWupviemeqjGr5Y331rfPJy0R6pXn0fq0WGzeA2ixvDemcRsbI M5zKkDXvCsU7QpBiz2EI3S9F4H6aUfsFN0EZfzw4tEKV9BTg1JNeN5uuiSzG/A3+RlGC juAMWbnogCYOidIsFujVpUuoMVFWDL42ac7a0suW5ED/JqzZya2cbT/hXfoTLoaQSC2U a0omo5uy9tdbp/NS44CVrWTwG710J02HgxgBxvochxqg8q8s+4INHb/o18wTdCM9oLTa tSrBqavmB4X0T5ThBQktj3cuM+ixjUXNka47sVP+j+9Fp+3T5jCGbc6kwgOpJyBWPRY3 uQ== Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3t336374tu-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 13 Sep 2023 08:56:32 -0700 Received: from twshared24695.38.frc1.facebook.com (2620:10d:c0a8:1b::30) by mail.thefacebook.com (2620:10d:c0a8:82::b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 13 Sep 2023 08:56:29 -0700 Received: by devvm715.rva0.facebook.com (Postfix, from userid 240176) id 7EDD52954BBFD; Wed, 13 Sep 2023 08:56:27 -0700 (PDT) From: Michal Grzedzicki To: Michal Grzedzicki CC: , , , , , Jack Wang Subject: [PATCH v2 1/2] pm80xx: Use phy specific sas address when sending PHY_START command Date: Wed, 13 Sep 2023 08:56:10 -0700 Message-ID: <20230913155611.3183612-1-mge@meta.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: dhiKTa1gYzJbYo2xlXWyfUVhDjMpZBak X-Proofpoint-GUID: dhiKTa1gYzJbYo2xlXWyfUVhDjMpZBak X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-13_10,2023-09-13_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Some cards have more than one sas addresses. Using incorrect address causes communication issues with some devices like expanders. Closes: https://lore.kernel.org/linux-kernel/A57AEA84-5CA0-403E-8053-106033C73C70@fb.com/ Signed-off-by: Michal Grzedzicki Acked-by: Jack Wang --- Changes in v2: add Closes tag drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/scsi/pm8001/pm80xx_hwi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 33053db5a713..90069c7b1642 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -4180,7 +4180,7 @@ pm8001_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) payload.sas_identify.dev_type = SAS_END_DEVICE; payload.sas_identify.initiator_bits = SAS_PROTOCOL_ALL; memcpy(payload.sas_identify.sas_addr, - pm8001_ha->sas_addr, SAS_ADDR_SIZE); + &pm8001_ha->phy[phy_id].dev_sas_addr, SAS_ADDR_SIZE); payload.sas_identify.phy_id = phy_id; return pm8001_mpi_build_cmd(pm8001_ha, 0, opcode, &payload, diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index f6857632dc7c..1b2c40b1381c 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -4671,7 +4671,7 @@ pm80xx_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) payload.sas_identify.dev_type = SAS_END_DEVICE; payload.sas_identify.initiator_bits = SAS_PROTOCOL_ALL; memcpy(payload.sas_identify.sas_addr, - &pm8001_ha->sas_addr, SAS_ADDR_SIZE); + &pm8001_ha->phy[phy_id].dev_sas_addr, SAS_ADDR_SIZE); payload.sas_identify.phy_id = phy_id; return pm8001_mpi_build_cmd(pm8001_ha, 0, opcode, &payload, From patchwork Wed Sep 13 15:56:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Grzedzicki X-Patchwork-Id: 722996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C10EBEDEC7C for ; Wed, 13 Sep 2023 15:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjIMP4z (ORCPT ); Wed, 13 Sep 2023 11:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbjIMP4x (ORCPT ); Wed, 13 Sep 2023 11:56:53 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9C501BC3 for ; Wed, 13 Sep 2023 08:56:49 -0700 (PDT) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38DEkFlp019744 for ; Wed, 13 Sep 2023 08:56:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=fiL8lHnS1pF+d9K7wzC8R+oSznDkNywF+yHkLggREm0=; b=YKg5UPqunQQMCv73yKxpZNQeVcUqZHPmdnuqdToBWfCd4n3HelL+sA7K2uQw0/dq84tJ rMfoOisluP03/wEcnQBKoa9HauizE54+A51FIEtGStBUKKwaf60cCAZV2n42hv/7viqT 4SBy2SSsNf5dqJqi+oj/DAZDeakYd9s3iqlXBDnDkY392jBQ04Xj1xM7KOxkKDdAU8Ai q9xlFRSKMEtKAKU/7tgEGiwrb5EWHr8ymjUkJylpiDtuI/jr6Dvx7lLsPEXRWM+EmYrA RfC2/NMC+U8Nhh4u3vyevkVquyt3IJ6tBNCaaGs2ROGvsWAyHmZt7neZumbkGEOUFiEt BA== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3t2y8d9a5t-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 13 Sep 2023 08:56:49 -0700 Received: from twshared1579.04.ash8.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:11d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 13 Sep 2023 08:56:44 -0700 Received: by devvm715.rva0.facebook.com (Postfix, from userid 240176) id A8A382954BC63; Wed, 13 Sep 2023 08:56:40 -0700 (PDT) From: Michal Grzedzicki To: Michal Grzedzicki CC: , , , , , Jack Wang Subject: [PATCH 2/2] pm80xx: Avoid leaking tags when processing OPC_INB_SET_CONTROLLER_CONFIG command Date: Wed, 13 Sep 2023 08:56:11 -0700 Message-ID: <20230913155611.3183612-2-mge@meta.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230913155611.3183612-1-mge@meta.com> References: <20230913155611.3183612-1-mge@meta.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: I_gcpqRs8pN9eC0DgsRISJIa3T0IuZo5 X-Proofpoint-ORIG-GUID: I_gcpqRs8pN9eC0DgsRISJIa3T0IuZo5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-13_10,2023-09-13_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Tags allocated for OPC_INB_SET_CONTROLLER_CONFIG command need to be freed when we receive the response. Fixes: f5860992db55 ("[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files") Fixes: a6cb3d012b98 ("[SCSI] pm80xx: thermal, sas controller config and error handling update") Signed-off-by: Michal Grzedzicki Acked-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 1b2c40b1381c..3afd9443c425 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3671,10 +3671,12 @@ static int mpi_set_controller_config_resp(struct pm8001_hba_info *pm8001_ha, (struct set_ctrl_cfg_resp *)(piomb + 4); u32 status = le32_to_cpu(pPayload->status); u32 err_qlfr_pgcd = le32_to_cpu(pPayload->err_qlfr_pgcd); + u32 tag = le32_to_cpu(pPayload->tag); pm8001_dbg(pm8001_ha, MSG, "SET CONTROLLER RESP: status 0x%x qlfr_pgcd 0x%x\n", status, err_qlfr_pgcd); + pm8001_tag_free(pm8001_ha, tag); return 0; }