Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2887305rdb; Mon, 4 Dec 2023 10:06:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEmhWSrs2VSQphpuwv9ZhtZ1XxGKEAwg9D0paowXTulF4+9COR+mrCT0tQFqrJpy+ANuxk X-Received: by 2002:a05:6a00:884:b0:6ce:2732:58a with SMTP id q4-20020a056a00088400b006ce2732058amr5280935pfj.59.1701713170033; Mon, 04 Dec 2023 10:06:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701713170; cv=pass; d=google.com; s=arc-20160816; b=0dmgv5/30Nh2yWI+2kC2hvzQzbC3X+DphTVOf/VxV7ixBbhWWV1VlQ0xvglgMhnsxr ONvrsuG9fPdLEH9szf/aynNH+BZTmwtWwAsl1w+wFeuwOlAk7/fpKK6U9khEi1EvO8S2 T9tZMDWj+ecsfDkLVoV1cJXXIkwRF7KAPr+OF4hCoJDhQtODmE0InOQFKkqLTSy+t+4/ 4/3vE9J1eOOx7GOqWynLIFw4NxjpPouVp+qRJhQzH6r6ZpADT6ySbAEmrYXzcvkZLUia Jnu+VIi28JBW6VblkFIn9sJBoJ+g0uNdG6W4z0GG3zv3R5SGCOOJSUY27SFF27BYy9+f rM6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:organization:from:content-language:references:cc:to :subject:user-agent:date:message-id:dkim-signature:dkim-signature; bh=+7dgLIyiw3H9pYcm8BtMKrsn83/gSMoaphSDdZwPsWI=; fh=2TJhiS9TsPhV6hKw7k/dYWTUzbt/b9u/kW/h2khhjrA=; b=MguCVouoCN1uleOAwM4kC34fvrEp0EhM7h3G1WcRkeouCU9NiIaSl9cual6xo4qTbi WL9IwFWg0p0hS3e+T2acUcfBBWtriHiKPR7jtWzLzuTSv9rM+HyskJi+IMUQPXcRL4at 9Wu3n1LIAOH53rpphHBVm91VVqPMiBPKvGwi+DjFEprPA/uJlXhpXKEZbaxQlZTQFm0N kvNbFkRjrR9zpKq+i6OQecd5IwVr0SYZcSGiVgo3WMN2/Ann8DX+w0JymQ9ppMBTHogq t0IA88jLFU5K3ZtPpH2xJO9n7nZ8jdC7X4zY/Ip362/sfwOfCruvQWhX4p0tDNyB8dFP Nppw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=jK19AabB; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RUQLPvuE; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bw9-20020a056a02048900b005b9a4673310si4160616pgb.326.2023.12.04.10.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 10:06:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=jK19AabB; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RUQLPvuE; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4994D808D4B4; Mon, 4 Dec 2023 10:06:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229659AbjLDSFs (ORCPT + 99 others); Mon, 4 Dec 2023 13:05:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjLDSFq (ORCPT ); Mon, 4 Dec 2023 13:05:46 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F51CFA; Mon, 4 Dec 2023 10:05:51 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B4I05GS029993; Mon, 4 Dec 2023 18:05:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=+7dgLIyiw3H9pYcm8BtMKrsn83/gSMoaphSDdZwPsWI=; b=jK19AabBVxY1g2KNDRvI+sMpIQRDuBrQuQMpyCPwjKgV8HK17HgOgSJtMSBe5HGxtZxk ietuiIYR+a4hcsaqNlWxuvQrV//686yXoUQtdOEGC6PFZO9iVT5Xl18o5LkusGlDvN4q gBmESlmZqrhEMa/HKHHrXZp5KKiXJVtAZvutDOTakne3wyUIJBtz60lAStf3KliFcOQZ 4Vc6OR2d6EBbCC6osTkmurEbQJfeqIT70Mg2+L4LgZm6QhdYKa3uIFhdf7yN6tzBLFl6 1VMRSugl67kZSB4gwymrbmWxeA6MgroaDQKBuO+YjVuORtb+xQ9Pbb6Tz3kyYSV1e+5j 5g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3uskddr2u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Dec 2023 18:05:34 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3B4HqEVq022601; Mon, 4 Dec 2023 18:05:33 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3uqu1cn00y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Dec 2023 18:05:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IYkQ5dIHHZnl26E4NmBU2c3/TL0hjH8LjBri4ksNy6qUuITahf/g5DM+mHNs1tJ1oUXEnc6b4/9S6B/WiuMqQBvdzKC5/Dym+jiSYoe7/vlxGP8xO+/jdSRebBhWqoytPYm8gSCrkqokjMxE0O3ZrW1AvhHWgw814d3R5uZBRX97HV6oMRDSYNq8i43DhthRjp+FlHmVb1JSlsDAFcwUvaLsN3HNAV2H0lUw5PUz5E70O5/zFqq34Byk7uKKaU00qE/AYzu0xWpJyazOtIg3FVhz7PEW85GkCUCWm4tqyVqLvRtoZbpQRgr54xYz5GzcO5r/kMmnGisc1OA9nAjuKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+7dgLIyiw3H9pYcm8BtMKrsn83/gSMoaphSDdZwPsWI=; b=n0Ea86UdNNvhTKnhCoYpAm9G6d6AXUyBroUU8fcFHnv86tH3ddlgH6FOawLMPkR5Cwbjqu/1FAgomcv+F218Prgl/kJWf152CyxHTAiCKyJEQZJe66AXw2N5X3EKRbYDR0lQ/I+wZHuXHpRymNuBWnJHjFlu1TO/zNGuyq6Fx+D6OgUzYjYB+HnENPpXjlwudPClndYK+rcKFZccHYpGgGeACY1AJ3TeQeFeeJXRlT5+YA8mi076po+u/spPDVuSVgBejr5eaU6o3SpVg7TIcTAVr9OfDqIOHivnmQeEer8d44MgI5RpzL5OtUFgSpMRjyY53M1A923uCr98/0DpiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+7dgLIyiw3H9pYcm8BtMKrsn83/gSMoaphSDdZwPsWI=; b=RUQLPvuErea1mci5Ij6ZN8b/SqQ6gsbCgWGZ3jx+UPFMj1HCdtMS9PILKUg2cWXj2B5XlPnKGxtuXNXlYXAjJPv5kaDQ5TFnEb3+SVMR8hIH7+aJv3vNMV6cctJ/dZb4Pv1XCfV93F4RFAQtQvXPD69P6Ns4T8vnecXSA9zU9Aw= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4542.namprd10.prod.outlook.com (2603:10b6:a03:2da::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.29; Mon, 4 Dec 2023 18:05:30 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::102a:f31:30c6:3187]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::102a:f31:30c6:3187%4]) with mapi id 15.20.7046.033; Mon, 4 Dec 2023 18:05:30 +0000 Message-ID: <336b3084-dfae-4e91-ba31-7e08ba4e5591@oracle.com> Date: Mon, 4 Dec 2023 18:05:27 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 3/3] scsi: libsas: Fix the failure of adding phy with zero-address to port To: Xingui Yang , yanaijie@huawei.com, jejb@linux.ibm.com, martin.petersen@oracle.com, damien.lemoal@opensource.wdc.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, prime.zeng@hisilicon.com, chenxiang66@hisilicon.com, kangfenglong@huawei.com References: <20231204122932.55741-1-yangxingui@huawei.com> <20231204122932.55741-4-yangxingui@huawei.com> Content-Language: en-US From: John Garry Organization: Oracle Corporation In-Reply-To: <20231204122932.55741-4-yangxingui@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0405.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::14) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4542:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f13766c-953b-4ade-b52a-08dbf4f39a03 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SNUJ25rdI4TxhOr+O/15GHvICDnSHqhOr9Dl5mezlr7ZitVX1bJkH2qxQhv1Be9zxCepCulOeSCQHwFZX6p6jxCZU38Nrvo3C9HcZLbZv5prJT/XUMT/BeqBVu4ID0IWA0vV2hMbsUaB3YYBGriLShRMFWXo1CDN7NbwfmRqp32Y1q/SsaNQntFQ7Vl21Pj50Aepswakb7VJsu4mjeRoVC6Lxgh+bwiw4Pxnd8bqCilrjL8mzj4xXAv93RaiDkHo9+nVhOF/J+c50C/D8DyP70ak6ACCuOY1bYLJ1MlVwYBJPqpDq5RS+nGyvoYb3ImNZIOJsjbTeSJcdX5SfhH65PRsa1r46V0m8P24wEjVXLVULwBjjKfCEdGEvLRwJ+U9TS1VzDkG8xUJhLDKFTWrnCwufEWl/JhNSpbFh+7Jeu3RJiWTepBZaf8XlnVQog5MTis1xeLI6UE+LLRvfJ/GO0+AlIlcOVof4q2G3VsSe8tZm7Xc6/0VEyxLJUVKKiCr6ZMzjByCBAFtuixGpaqqPdzxvh78vdTwE9zPwUuF7o5KELFdEUjt8ae71MgsqMVH3Q0O68boZtTlb1EGGRg9A898Dm6HT9RCy0R4OdK5Qp5k6hBpmmfr+oMSryjRW6cFYrb7/61n2QUf3tkPR2ax7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(66476007)(66556008)(66946007)(316002)(478600001)(6486002)(6666004)(38100700002)(7416002)(5660300002)(36756003)(41300700001)(2906002)(86362001)(31696002)(8936002)(31686004)(2616005)(4326008)(83380400001)(53546011)(8676002)(26005)(6512007)(36916002)(6506007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K2xsQ2tvVHloNHBORWg3TnJtL0s3WmsxMkFHNDQzUjJkblgrRk1kM1hxQTdo?= =?utf-8?B?VHVZSnh0TXJuU1VVWm81YWtvYkhCZXMrQlQzUjRmOC9ZTitPRDZqbFBQejUw?= =?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L+yaF+qfeLgyC7yGKrRKfOoODskyaqfROYx6ot2w8rowSL9k85QLSbnUD1bnLxzcNU7HcdgvLaO1f0Ftg8YB/K8aRqQ0A2FcW+Otm2VJ0TKG3BOf4p74L63G0Osv4Ig4cu4m0zmUYxRLaecZEPGJJFRTpmac0+9cbjX1+Rur/30/qBy/7rIIgasLVMja702JqszhIweiUWAKGNb6WFPjjHinTC3YBcxG8D1mMsgFPMqAxR0GfMUMN+NXD8bLJm/R80WwyvkvKq/XHeXeYJ6GXJu/MBlWSl9ONUHs7uhVeWqZE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f13766c-953b-4ade-b52a-08dbf4f39a03 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 18:05:30.3762 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7hwUzJVG1stv1UsqB4vY03Btea0zhTIKZQgxAm2lwMrVyBvG2di7ohfCaMokjjrcLhvjGJCYJGRHejwbQ+h3hQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4542 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-04_17,2023-12-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2312040138 X-Proofpoint-ORIG-GUID: uL_lHqy9m3zCwbGi_nsKmp0rotnQGfQp X-Proofpoint-GUID: uL_lHqy9m3zCwbGi_nsKmp0rotnQGfQp X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 10:06:06 -0800 (PST) On 04/12/2023 12:29, Xingui Yang wrote: > When the expander device which attached many SATA disks is connected to > the host, first disable and then enable the local phy. The following BUG() > will be triggered with a small probability: > > [562240.051046] sas: phy19 part of wide port with phy16 Please use code from latest kernel. This again seems to be the old comment format. > [562240.051197] sas: ex 500e004aaaaaaa1f phy19:U:0 attached: 0000000000000000 (no device) The log at 562240.051046 tells that phy19 formed a wideport with phy16, but then here we see that phy19 has attached SAS address 0. How did we form a wideport with a phy with sas address 0? Sorry if I asked this before, but I looked through the thread and it is not clear. > [562240.051203] sas: done REVALIDATING DOMAIN on port 0, pid:435909, res 0x0 > <...> > [562240.062536] sas: ex 500e004aaaaaaa1f phy0 new device attached > [562240.062616] sas: ex 500e004aaaaaaa1f phy00:U:5 attached: 0000000000000000 (stp) > [562240.062680] port-7:7:0: trying to add phy phy-7:7:19 fails: it's already part of another port > [562240.085064] ------------[ cut here ]------------ > [562240.096612] kernel BUG at drivers/scsi/scsi_transport_sas.c:1083! > [562240.109611] Internal error: Oops - BUG: 0 [#1] SMP > [562240.343518] Process kworker/u256:3 (pid: 435909, stack limit = 0x0000000003bcbebf) > [562240.421714] Workqueue: 0000:b4:02.0_disco_q sas_revalidate_domain [libsas] > [562240.437173] pstate: 40c00009 (nZcv daif +PAN +UAO) > [562240.450478] pc : sas_port_add_phy+0x13c/0x168 [scsi_transport_sas] > [562240.465283] lr : sas_port_add_phy+0x13c/0x168 [scsi_transport_sas] > [562240.479751] sp : ffff0000300cfa70 > [562240.674822] Call trace: > [562240.682709] sas_port_add_phy+0x13c/0x168 [scsi_transport_sas] > [562240.694013] sas_ex_get_linkrate.isra.5+0xcc/0x128 [libsas] > [562240.704957] sas_ex_discover_end_dev+0xfc/0x538 [libsas] > [562240.715508] sas_ex_discover_dev+0x3cc/0x4b8 [libsas] > [562240.725634] sas_ex_discover_devices+0x9c/0x1a8 [libsas] > [562240.735855] sas_ex_revalidate_domain+0x2f0/0x450 [libsas] > [562240.746123] sas_revalidate_domain+0x158/0x160 [libsas] > [562240.756014] process_one_work+0x1b4/0x448 > [562240.764548] worker_thread+0x54/0x468 > [562240.772562] kthread+0x134/0x138 > [562240.779989] ret_from_fork+0x10/0x18 > > What causes this problem: > 1. For phy19, when the phy is attached and added to the parent wide port, > the path is: > sas_rediscover() > ->sas_discover_new() > ->sas_ex_discover_devices() > ->sas_ex_discover_dev() > -> sas_add_parent_port() > > ex_phy->port was not set and when it is removed from parent wide port the > path is: > sas_rediscover() > ->sas_unregister_devs_sas_addr() Sorry, but that is not a callpath. Maybe you condensed it. Please expand it. > > Then the sas address of phy19 becomes 0, and since ex_phy->port is NULL, > phy19 was not removed from the parent wide port's phy_list. > > 2. For phy0, it is connected to a new sata device and the path is: > sas_rediscover() > ->sas_discover_new()->sas_ex_phy_discover() > ->sas_ex_phy_discover_helper() > ->sas_set_ex_phy() > ->sas_ex_discover_devices() > ->sas_ex_discover_dev() > ->sas_ex_discover_end_dev() > ->sas_port_alloc() // Create port-7:7:0 > ->sas_ex_get_linkrate() > ->sas_port_add_phy() > > The type of the newly connected device is stp, but the linkrate is 5 which > less than 1.5G, then the sas address is set to 0 in sas_set_ex_phy(). I don't understand why we do anything when in this state. linkrate == 5 means phy reset in progress. Can we just bail out until the SATA phy is in a decent shape? I assume that when the SATA phy is in "up" state that we get a broadcast event and can re-evaluate. > Subsequently, a new port port-7:7:0 was created and tried to add phy19 with > the same zero-address to this new port. However, phy19 still belongs to > another port, then a BUG() was triggered in sas_ex_get_linkrate(). > > Fix the problem as follows: > 1. Use sas_port_add_ex_phy() instead of sas_port_add_phy() when ex_phy is > added to the parent port. this seems ok > > 2. Set ex_dev->parent_port to NULL when the number of phy on the port > becomes 0. > > 3. When phy->attached_dev_type != NO_DEVICE, do not set the zero address > for phy->attached_sas_addr. > > Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") > Fixes: 7d1d86518118 ("[SCSI] libsas: fix false positive 'device attached' conditions") > Signed-off-by: Xingui Yang > --- > drivers/scsi/libsas/sas_expander.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c > index 7aa968b85e1e..9152152d5e10 100644 > --- a/drivers/scsi/libsas/sas_expander.c > +++ b/drivers/scsi/libsas/sas_expander.c > @@ -45,7 +45,7 @@ static void sas_add_parent_port(struct domain_device *dev, int phy_id) > BUG_ON(sas_port_add(ex->parent_port)); > sas_port_mark_backlink(ex->parent_port); > } > - sas_port_add_phy(ex->parent_port, ex_phy->phy); > + sas_port_add_ex_phy(ex->parent_port, ex_phy); > } > > /* ---------- SMP task management ---------- */ > @@ -261,8 +261,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, > /* help some expanders that fail to zero sas_address in the 'no > * device' case > */ Please pay attention to this comment. It seems that some expanders require us to explicitly zero the SAS address. > - if (phy->attached_dev_type == SAS_PHY_UNUSED || > - phy->linkrate < SAS_LINK_RATE_1_5_GBPS) > + if (phy->attached_dev_type == SAS_PHY_UNUSED) > memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); > else > memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE); > @@ -1864,9 +1863,12 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent, > if (phy->port) { > sas_port_delete_phy(phy->port, phy->phy); > sas_device_set_phy(found, phy->port); > - if (phy->port->num_phys == 0) > + if (phy->port->num_phys == 0) { > list_add_tail(&phy->port->del_list, > &parent->port->sas_port_del_list); > + if (ex_dev->parent_port == phy->port) > + ex_dev->parent_port = NULL; This does not feel like the right place to do this. So the port which we queue to free is the ex_dev->parent_port, right? BTW, do you know why it's called ex_dev->parent_port and not ex_dev->port? I find the name parent_port confusing... Thanks, John