Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp453915lqi; Thu, 7 Mar 2024 02:09:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWTJRPKQmOsTWclJhREJ6P1kMsb0r/n+PeqxLdfKOSg4KU8squuIsJHpaC2d5GW8CYbGS5s12g5ZwVhMmCjVDjdhJu/8VZDbM2IRZXkMQ== X-Google-Smtp-Source: AGHT+IGV5tf8e6QjmEO05/6ukEIl/4qBIgg6VnORZmOC7OvXyfRw5yShdqi6XcYULil1qqNVfYW9 X-Received: by 2002:a05:6a00:27a0:b0:6e4:69b0:c37c with SMTP id bd32-20020a056a0027a000b006e469b0c37cmr18424832pfb.9.1709806174922; Thu, 07 Mar 2024 02:09:34 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z28-20020a056a001d9c00b006e642f5ba8bsi4344955pfw.282.2024.03.07.02.09.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 02:09:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95299-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; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=cDPueikS; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=q4wNwvNK; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-95299-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.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 61255287BFB for ; Thu, 7 Mar 2024 10:08:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4341127B5D; Thu, 7 Mar 2024 10:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="cDPueikS"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="q4wNwvNK" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 9545685279; Thu, 7 Mar 2024 10:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709805906; cv=fail; b=P7UBMJxy9JSEJf5M4JQbEOiBcdJwjYkOCE7W4qlsTTaFj3ljUrSwa86C5I3gtn2u4Zh58OE28f6aBQDXrcIGX/tcGAVmArcZcjg329DO18afdmRUIw16q6kCDaCB5gs/+Qn07zYeq5J3EuoCjqpI2qvb95ej89KEMY07DeyHwvc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709805906; c=relaxed/simple; bh=h4pRqW7qyL2xWc2o9uz2bK3EGGVqe7CvYmX96bSDSZk=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=mB9Q5I0ZgGoxHNZX3E/kqAFHQ8VGNbfIeGyraj2orzCuFlARGn/U5iUhLYr81KaMNBH63oLvMDqctmPDsnJd83AV2favYUFTeOb1LFRczpx9oFDZere4RuKpdDf1vBQutLt5O2Argwaa3O9ESpmDNg759w3m8BcEO90PeneW2/Y= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=cDPueikS; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=q4wNwvNK; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4279n5GB020679; Thu, 7 Mar 2024 10:04:48 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=gtoUi766jZfW+1o54d4FdSg9Tws06O3relubQZ1IRs8=; b=cDPueikSB+E7/OR56F7gQW2jwr644RsTJVWnhubzTK6GJGsmtfaE0F1oEQN5GIgjAwzm DAWYIMoneSRBENj05zW0c/3+A+4rWmTpw/6kfM3BnOtpqc6h1XXXx8TaWAMSGzuF79Qt mtxJSW4MOLGHgOSZCAwhRQa+fyQA5D59bjXypt7KeZohJq9VZ1mwUKDT5qLKrJ8Luz3Y 0HxIX4StH5DlKWB4OUUHOtUkthK4HeftvroudiQO8Acc+ZFUnm5UZm0tluEnJKwRVxxo oth3l+LdMeAtcASE5XGiceTmqOWjJ5mCGWL8wQ4u04Yl8aYrMqfOb7vtSFNk3HL9exfm Zg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wktw4bg3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2024 10:04:48 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 4278G5LF031907; Thu, 7 Mar 2024 10:04:47 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2041.outbound.protection.outlook.com [104.47.73.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wktjayyr9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2024 10:04:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iWxvJgLnJZXbFK/qvg8DhAWA9yJdGkE4Pb1PYol9gQVJv5oEtyrkfjCK/GBl5OBRLiM3JSwPCeZTqQbmsOTMBlxa7jgq4gIsNdJ35qpE+U0EMH03CCl6Yqs4W3bJ4MaKR+eXtKaiDgT1QSZN1Bthz8K89/K3tO/GloC8GhxlEB6K+17+EQkRm7z6CgODQssEwCvye1XaMZRTTadyUbhiYULjTXqQP8sDUsEnNx/PTfAOjXeg+pQl4RFrhP6RdQcezm8yLeDojsSyKzzO/+jRv4lRnJCHcQ/Y+a1QEcfmvu7EztSQoeQn8siA1Z9vacvlHahM6CKkeT1Ma1cSoRINPQ== 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=gtoUi766jZfW+1o54d4FdSg9Tws06O3relubQZ1IRs8=; b=Sgp5P3GCdlhIrlkXHFmr/nTcQVujBx4ner1JZNX1DURDuvWyr2b96aTuatBehqu74pgu+M32JuqbgefMiRMju7HXJRFdHdIjXIk9D9HEGRiowKwRPrTaX85wW2at3XoBFj6trfXpjf2lCRL2viwk3uXE6u8AEoZgVuTlQUWzke/u3OT4bzs0jxqD2rWlopYNkJK/goc7KSND5zf62Xxn/gctlKKT60xyrG7BxRWYslj4+FUCb7GyxwEKZXxbqaoBfUbNFbt4/b8Q4P3htXFc4GVxEYGpVSErokYm1WWLZUOGEh5v9+nB/dGeCU+JXaZnQq9Qj6kjAqpjqEDNdk0hgA== 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=gtoUi766jZfW+1o54d4FdSg9Tws06O3relubQZ1IRs8=; b=q4wNwvNKn4Np2dv2hXNdjDKe3/LGRh3Wczob+1SMEvUW7KdDb5vuDpSV7yC33iJR/ib+9owflPAXR8AS0Xcke4sifBd0p4chC1QGz419fyClJocsjSIQGdaMyPwvuPvuaArL8MDJ9AOUEJrXg2V1rbWl0av2PTKxRk4UvjmMVSY= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by CY5PR10MB6142.namprd10.prod.outlook.com (2603:10b6:930:36::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Thu, 7 Mar 2024 10:04:45 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ae68:7d51:133f:324]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ae68:7d51:133f:324%4]) with mapi id 15.20.7362.019; Thu, 7 Mar 2024 10:04:45 +0000 Message-ID: <01c09e14-e991-4c3f-a747-3cfd591c56e8@oracle.com> Date: Thu, 7 Mar 2024 10:04:41 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/3] scsi: libsas: Add a helper sas_get_sas_addr_and_dev_type() Content-Language: en-US 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: <20240307093733.41222-1-yangxingui@huawei.com> <20240307093733.41222-3-yangxingui@huawei.com> From: John Garry Organization: Oracle Corporation In-Reply-To: <20240307093733.41222-3-yangxingui@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AS4P251CA0024.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::16) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|CY5PR10MB6142:EE_ X-MS-Office365-Filtering-Correlation-Id: 99dad832-6c1b-45a5-3904-08dc3e8e03d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gfsjthl0oEvYM9cZqi5i6FJF7Au/sIOAfcO4GPGd3muYVkA3Rjcpszmxy4baNTliIouP2ESlWbcY8tZVU16dGa+Ml5c0iaxYOpaIdqBi2JWsQborOfL6a2+CapR0bpS+TVGiXfwLmH6hxJw8E/5pdX8tZ8n9Ul+4FEovRdxHoOWhDAeSwx5NCAAY1v06ETfeimglsTbzsLEoV3blcBOuUab4Z4C3Zw2jPcT9uwhVf/HTXVYhLYPxFTDAGG0m14siDXSU8VEuSfBv2JpqDqlTXwLOVqEhvzDatd3VKahmvqIQEIVxyGPRgkoOHY5pBYSV3KMpIOGajnKlG/5sn4nwp6co+PbS/IfCH5qOKoFIpib/20ZJXp+4NZpwMP4cwb65cK6r1luT8Ofr593FQaE8QGDBpAIwjrMPXSfAiOi8K2tIzwi9GmiEpfkvTB0pOBOCq6fjKT348GLBaUy48Es+GtWLrx/8oePFa9XOV5av4HGZUALGSkuAO6Xqhmk9KqC+bM8P0QwHiwXektg2BOn6POof7QuBL3cUgjoE1iv5L7ICVKINDpoXRSXh9p9C3SIdwdjin5kEiipUAgHmonGWyEREhYtN+d7nn2cUbNWJBiSTqmruWdyqnHDB6cDrf6nY5q3kb4x4HwVstdDRd0RiMJCDyji0BLCA/7F7MUUSBzE= 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)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N0dYU3BWU3B5aElTdVVadlVnVng5NU1Hazc5LzBrZE5mZFhVOEFyWUxkUEpl?= =?utf-8?B?MldxLzB5TWx0WVB6RnFDZXZpZFV4TXRuRm1mMCtHakpEWEF1Qm9YbXQvTTBz?= =?utf-8?B?U2FKME5UWGYvZkdOOFR5L3N0eFUvd1pUaEgxSXRrTEF5aG5oT0JsR3dRTVg3?= =?utf-8?B?NzR6blZudDdETkVzT2hydEdZbnp4a2ttbVFPdEhoYnpwVkF2aDI2R1ZRbG91?= =?utf-8?B?UzY5bjlOMFozS1FWYXg5aTRqNWhzck9IVUVFUnEzWkhSaXZqYm9HN0hBNWdp?= =?utf-8?B?MS9GWmYyZ0VYQ2hjWWhyRUFQdFhlM0xhUHdVdUtETUtZaXdWMnlvak4wUmpD?= =?utf-8?B?W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Gs4aTlnYTg2?= =?utf-8?B?dlE9PQ==?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: DMNofHAVmEn9m1wi5q6zMbB7IiLAHbsTgcMJONi0VueABZyxxR7c/9+R+ZfAPs+yVwh4ECVkTgqdVtsyXJ7kZADCRYHLFEr4HDnDqh8brAf+/+qzAQgCWJTVjoFnHgjw+gyHPZZ4rKqBFjGXtzakebTCtwMuwt+pW18s4K1Ubexr+Ra6VdPwknWrn7OYkacDGay7AGeR0ju4+IT6Ts3Qq7oR9EquQ+o4W+XiOyvGNEEy6RAxP7zKnipfkCA8VMIryRkQzeCAkzItt4gG5wLzKv97dtds86+3hmt5rXkWVdb3L4W9UmYtfEO33N6eyPzxAmeM11yN1ZccpKtv18/MB9DCmoBP5h0d4Un9G0jhfTT58+I7Q/U/N0KaE757KA3/xmt2lEISrj0i5H0n5qlL8Q2yFhntvDw920UQ8H3c2cnxHkI2ni4JneAHiavc9VzcuIuAjFdqPm9aDteQjXHdoipC7CZwupAoDU0EkL7Q9UutFvO8lqIah0V+NMpAv+KZ9PwNyNQnx7x1LA28MW63s6KJNCJ2GcPEWcTiUdILznWoCAS2hb9SkgjRd/2h/9X/W34RN+orvQDpV0NJURBfph+00laAvjknToGvNZR6lq8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99dad832-6c1b-45a5-3904-08dc3e8e03d1 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 10:04:45.2313 (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: ogbYF3bOzJ3ZKZb1wXdYzFM8D+yUfSHzRwmNFaMgmjlOuQYIA+a74zvVy96P6gIEkWHnh/tCNRa4mumXZhCNjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6142 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-07_06,2024-03-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403070073 X-Proofpoint-ORIG-GUID: v0vLrvm9cVxrIg4v5vLjFkxbkzKZ7Xam X-Proofpoint-GUID: v0vLrvm9cVxrIg4v5vLjFkxbkzKZ7Xam On 07/03/2024 09:37, Xingui Yang wrote: > Add a helper to get attached_sas_addr and device type from disc_resp. > > Suggested-by: John Garry > Signed-off-by: Xingui Yang Reviewed-by: John Garry > --- > drivers/scsi/libsas/sas_expander.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c > index 1eeb69cba8da..d6147616339f 100644 > --- a/drivers/scsi/libsas/sas_expander.c > +++ b/drivers/scsi/libsas/sas_expander.c > @@ -1631,6 +1631,16 @@ int sas_discover_root_expander(struct domain_device *dev) > > /* ---------- Domain revalidation ---------- */ > > +static void sas_get_sas_addr_and_dev_type(struct smp_disc_resp *disc_resp, > + u8 *sas_addr, > + enum sas_device_type *type) > +{ > + memcpy(sas_addr, disc_resp->disc.attached_sas_addr, SAS_ADDR_SIZE); > + *type = to_dev_type(&disc_resp->disc); > + if (*type == SAS_PHY_UNUSED) > + memset(sas_addr, 0, SAS_ADDR_SIZE); > +} > + > static int sas_get_phy_discover(struct domain_device *dev, > int phy_id, struct smp_disc_resp *disc_resp) > { > @@ -1684,13 +1694,8 @@ int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, > return -ENOMEM; > > res = sas_get_phy_discover(dev, phy_id, disc_resp); At some stage - I am not saying necessarily now! - it would be good to stop this function returning both a linux error code and a SAS protocol response code > - if (res == 0) { > - memcpy(sas_addr, disc_resp->disc.attached_sas_addr, > - SAS_ADDR_SIZE); > - *type = to_dev_type(&disc_resp->disc); > - if (*type == 0) > - memset(sas_addr, 0, SAS_ADDR_SIZE); > - } > + if (res == 0) > + sas_get_sas_addr_and_dev_type(disc_resp, sas_addr, type); > kfree(disc_resp); > return res; > }