Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1093933lql; Tue, 12 Mar 2024 07:13:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaPpCnulJwDNcUTq+8aqLMJn1TdoKu9Nd5C5u+hVHssfFdM6PBV0LKB1PiGcGWyEjpBW2v5XkCySIJGtTEb8qBbZM84fIIvBZhCVD5zw== X-Google-Smtp-Source: AGHT+IFr29DdEGdznFNav3wXPdHkuEj39Kwzd0hNnH/mE8fGQSvF7OzSZyquDaL2PxDKNb8/rWw0 X-Received: by 2002:a05:6a00:3d55:b0:6e5:e41f:fe4e with SMTP id lp21-20020a056a003d5500b006e5e41ffe4emr691215pfb.4.1710252838213; Tue, 12 Mar 2024 07:13:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710252838; cv=pass; d=google.com; s=arc-20160816; b=UzWLbsdl/cIJcJtEAmfx7/v1Qc+2O0RZ6yynbIpr0oR/pSswnXjZIn1Hlsaga6Ozk7 6y9lYfggrZcbwhIrKEE8ubzt20CopsszZpKC3XWZRSqS62qAROhJa2ZnFKNO21fn1wW2 mAvUpdTpBe8ZeFGe6553xKCk5/nRiEQ6KX5imWd1+6QJJG/8O2XaBtNRZrqMYHcQp4Sl Ta22iqz+6IAVcu9sMoKZKwGicfrDL3j0W54vFfa5o1ys7ZIg33jw1VMg5WupHtc/g5ow AfgTdt1uLGYAjVvT/yUleBCatLVsNsFo6n8RMcPD/rHFAMkKoFvGfypkYYnWb5Q4Clz5 u/mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=bN3SUIAqnN54RQpz7xGyglzSXtzF1Wr7AVp06mQ6NNM=; fh=PKov2v7mtZqWrG2ToL14QCqscLF6oofVifdomTnOWI8=; b=lfjO1YjiZnAed1CuPfkrQtwCQl4MqfjVp9chmJat4cho8wtQza0Mm7tC5BW/34b7K/ Vm613GeAvS6h2RQqMja1sWPqsQ/WiajzJFJhahCIm2zyaCTtkS2Ml/y6cILfxo9ZaitT pWU+B2GV0KF7p2EfsFixHQnrfIxze3tYWWHJfQM/j4T+EIC3nitQhRxKU8WJJmExPKVt OXbd6H59MAvAUqynwpP3VgHTy70hTtwv9CHsZO+1uxvurilzHE+2p+pONdhVErB3qNMn ReAlY4d6k135rP1CdXNcjf54x6N0PT7FtoUiG0N1rYd58s9Ml7ZZJx6vaiUdXD357q8O QLdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-100325-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c11-20020a056a000acb00b006e0945e03fasi7229171pfl.162.2024.03.12.07.13.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100325-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-100325-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3B4A82834E6 for ; Tue, 12 Mar 2024 14:12:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 780067AE4B; Tue, 12 Mar 2024 14:12:48 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CE797A72E; Tue, 12 Mar 2024 14:12:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710252768; cv=none; b=knNYf308UBqTMVKtNPcGu0qtBdbBmvZ3nQfgV7A522FqSEhlJ5NPUQ890vd01TG4PyPRYlnZrexrVchk3/RAjVz5esZQv0JCHjKyZBpq+kD8vCv4ypayn66RsBnQlqogZa2QfVl6OXyHCuwob3jWNjry4KDIVkL72CX6j86CIuc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710252768; c=relaxed/simple; bh=ewBWYCx0hbntCPFBw8DhVmmlOMYM1PWFjKYyV98nukc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ikypjJuTT8/X1OVo4EDL9LmSPuCgNel0wiz6iC7AX5bAg/K6Wh6JygvQ7yuaMcMgrGGgPyPQnyFawqTgTjAlryVm3kNXYfEma4W+czKBMaikmjtBv6GRbEfsdrNqeUtssmYLizgPJ7Cj/OkpcwQ3G23nlEZp8elJr2KJGtEDCRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4TvFvv4w2xz1FM4D; Tue, 12 Mar 2024 22:12:27 +0800 (CST) Received: from dggpemd100001.china.huawei.com (unknown [7.185.36.94]) by mail.maildlp.com (Postfix) with ESMTPS id 74036140416; Tue, 12 Mar 2024 22:12:42 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by dggpemd100001.china.huawei.com (7.185.36.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 22:12:42 +0800 From: Xingui Yang To: , , , , CC: , , , , , Subject: [PATCH v6 0/4] scsi: libsas: Fix the failure of adding phy with zero-address to port Date: Tue, 12 Mar 2024 14:10:59 +0000 Message-ID: <20240312141103.31358-1-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemd100001.china.huawei.com (7.185.36.94) This series is to solve the problem of a BUG() when adding phy with zero address to a new port. v5 -> v6 1. rename sas_add_parent_port() to sas_ex_add_parent_port() based on John's suggestion. 2. Distill port settings into a single patch. 3. Update comments information. v4 -> v5 1. Add new helper sas_port_add_ex_phy() based on John's suggestion. 2. Move sas_add_parent_port() to sas_expander.c based on John's suggestion. 3. Update the comments. v3 -> v4: 1. Update patch title and comments based on John's suggestion. v2 -> v3: 1. Set ex_dev->parent_port to NULL when the number of PHYs of the parent port becomes 0. 2. Update the comments. v1 -> v2: 1. Set ex_phy->port with parent_port when ex_phy is added to the parent port. 2. Set ex_phy to NULL when free expander. 3. Update the comments. Xingui Yang (4): scsi: libsas: Add helper for port add ex_phy scsi: libsas: Move sas_add_parent_port() to sas_expander.c scsi: libsas: Set port when ex_phy is added or deleted scsi: libsas: Fix the failure of adding phy with zero-address to port drivers/scsi/libsas/sas_expander.c | 38 +++++++++++++++++++++++------- drivers/scsi/libsas/sas_internal.h | 15 ------------ 2 files changed, 30 insertions(+), 23 deletions(-) -- 2.17.1