Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2670987rdb; Mon, 4 Dec 2023 04:32:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFc48f9Ji/ABTKRVzwKZz7aeET5ouiEfuRv8vbA8U2epIioi5owAd1VPHWH1tuScSohsBZg X-Received: by 2002:a92:cb48:0:b0:35d:508f:903a with SMTP id f8-20020a92cb48000000b0035d508f903amr3388488ilq.25.1701693166438; Mon, 04 Dec 2023 04:32:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701693166; cv=none; d=google.com; s=arc-20160816; b=R122OXPZf4qoSPVviAyYnuJQwb7WZNR6tiIEXzGKI24TDte3205N/cwbpKKkIN+Gzv KIRMRIwbFwj5y1vvl9WK8PWrKIngZAdXXTQAIyGxukRnY6xUjXe1gY/mUt99iU7GikAG TV2ZPzF1mTyowXBec8H0WjzI2H1crc2NzbWeAfIUKeyGUafHNPl5f03m11fG+YQTZwGY sfsOr2SDNho2tlGsr9xC9Za8uS1X2e36wLTGvN0bNSuOYjk+T8sUIBuzMcv3p3rAIvWs e5ZIdYePpUjmtsUa00wzxgQS899ZZZbCII9LpKriHbihmn8ZBjWNXW+wMbWRtAMKYnyU 8UHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=xIMOG6YtkbR/2TDhmaj9pclcqXP+D3DH2OZKpiFMiWE=; fh=PKov2v7mtZqWrG2ToL14QCqscLF6oofVifdomTnOWI8=; b=N6h+98Q2zSFtpCzo+mCVuz1yH6bnyYugeSm/w3inBaGNrwmjhjnILNzzuFRUXkudh8 uF699sAM4b+BKHfIex+iVD69NNSCDhlMZsJ2xP9esFO/wZqhUnLGWtMUfRq/juqW1QA1 Np1Qam1AC8rMJKDve0jh/inftEY7FGRzS34XtfTmo3VEotbyRr7nx00Lq+6P5hg8+Ha6 zZzUSU3P6198DuxCJYWh+MdJzBFCaiTXqiufzpJoqOKG3A8isvYz1HoKtGe0MZVLXwBW AlpcPpclmZCBctkHVTtJqRJruBFg6/FXO4qOsq0o9ZhXv2YJxWXZzz2DNEobimZceQ+I AY3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u24-20020a631418000000b005c685a3f4acsi1989875pgl.887.2023.12.04.04.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:32:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D4EB8805D549; Mon, 4 Dec 2023 04:32:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233118AbjLDMc3 (ORCPT + 99 others); Mon, 4 Dec 2023 07:32:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbjLDMc2 (ORCPT ); Mon, 4 Dec 2023 07:32:28 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91442AB; Mon, 4 Dec 2023 04:32:34 -0800 (PST) Received: from dggpemd100001.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4SkNGb5fmwz14LB3; Mon, 4 Dec 2023 20:27:35 +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_128_GCM_SHA256) id 15.2.1258.28; Mon, 4 Dec 2023 20:32:32 +0800 From: Xingui Yang To: , , , , CC: , , , , , Subject: [PATCH v5 0/3] Fix the failure of adding phy with zero-address to port Date: Mon, 4 Dec 2023 12:29:29 +0000 Message-ID: <20231204122932.55741-1-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemd100001.china.huawei.com (7.185.36.94) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 04:32:43 -0800 (PST) This series is to solve the problem of a BUG() when adding phy with zero address to a new port. 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 (3): scsi: libsas: Add helper for port add ex_phy scsi: libsas: Move sas_add_parent_port() to sas_expander.c scsi: libsas: Fix the failure of adding phy with zero-address to port drivers/scsi/libsas/sas_expander.c | 34 ++++++++++++++++++++++++------ drivers/scsi/libsas/sas_internal.h | 15 ------------- 2 files changed, 28 insertions(+), 21 deletions(-) -- 2.17.1