Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3945236rdh; Fri, 29 Sep 2023 07:03:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKNOYtL0zYepqW9IBf7aPHTf0WxK8IBOMxMPEg5/n6tLUTixftnx7siAUm/in7A5ggC7QA X-Received: by 2002:a05:6a20:734b:b0:134:2e3c:9845 with SMTP id v11-20020a056a20734b00b001342e3c9845mr4610331pzc.22.1695996213665; Fri, 29 Sep 2023 07:03:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695996213; cv=pass; d=google.com; s=arc-20160816; b=eKtb9D/pFiav/DVOSbRdGFi3OBwVUP32uUPiSWVaEBVxcdTWApjNNQcojboLwQkFNf zRkhYvBrq/GPdR5YXIFDkKRbHy6PWUne/NX97sqEGkyua1hCK87DDrN10bc8FkZl04XZ GXDMHLGtxGDACyCbxVeTvOggrHljiYwzRULmsq3PMCSzrgwDm5XgNoXMrWfE9THoFiwZ huJpIGW6oPPiLipLCCVsNMvf7VfrqtKgGXedpdlj4Nt+vJeT0aF7zdf7eezG/HPFAWPN /b6cbIKv3CllNP1dN7h+1jPT0+dxbz9n0LKyDChcotUeFtcxUuKEhMIpl7dfnfMza9wr O6jQ== 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:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=+uVLJZuLt4gDfkyC7G/iwvFivmHrsOs+MT7wLesg13k=; fh=qccru9uXSey5gGKzLaHJLfTz+pzbuHZKYoE/5uPKsAo=; b=GpbWuP4v9l3KEVdbI1EPBK15fKGZvych+z4UKG74rsfPcuXbwbo8liMdbUWdMHpg2/ +yC+OlJs1aNxGU1HlRE+d7SgiHtz1L7V6MiZkk7tu8LEbDFRIfN/jWQ4qwe/mqi1X2bC OOD1Vd9zhSp0jxADbvHHY1yIksRJOFW1fZV13kZtrFdsYzjYOPp5GQbPG5nWWtK4A0i6 zE8S8xUxk8KXYFRvJFKhhfKPJ7jyzxuZwrPtXj1GpdWwP8k+HDRUbcp6lb7Cl8aa6z+k GNysMAjmQW0Kwv9mZPW8PWt0wQmTgMqdjLKj6zGv2/JbKsYYn5CDDYv3Z4V7KTln+0z6 JSAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cornelisnetworks.com header.s=selector1 header.b=IytekyAR; arc=pass (i=1 spf=pass spfdomain=cornelisnetworks.com dkim=pass dkdomain=cornelisnetworks.com dmarc=pass fromdomain=cornelisnetworks.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v15-20020aa7850f000000b0068fa9821905si19559572pfn.335.2023.09.29.07.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 07:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@cornelisnetworks.com header.s=selector1 header.b=IytekyAR; arc=pass (i=1 spf=pass spfdomain=cornelisnetworks.com dkim=pass dkdomain=cornelisnetworks.com dmarc=pass fromdomain=cornelisnetworks.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9A1AE8112454; Fri, 29 Sep 2023 06:03:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232997AbjI2NDR (ORCPT + 99 others); Fri, 29 Sep 2023 09:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbjI2NDP (ORCPT ); Fri, 29 Sep 2023 09:03:15 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2126.outbound.protection.outlook.com [40.107.94.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB5F1C0; Fri, 29 Sep 2023 06:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EYhqhp+4j6CgUqitFBZd3IdTQZOmikXskk5n2DqMOPiwUB2pm1fd1ggroShZNtcP13PRq//RM1+8Dgeon36bGZha7D026I/0gSWueOjgRLo9NMWanR0uWmS4fb5l3jHgY+cn2lkqNYLjc/qKuraHnHdKKhlGmAZsQItpymzp8o6O8szlFlu2egWL6tdcEcYQExunrzSN3+s2c9RHEztRoa/rsfZJTxmYwqmHwcAA8bezVT1q2RXj2jBmO+ezwuOM7k+gX+ZK+b4yjaDYB8Afqqxt6hWhqY7kus6u+j1rGuX76Yp72cMhDfni1PhpaXRr37UI2CysNFC15SI2VXderA== 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=+uVLJZuLt4gDfkyC7G/iwvFivmHrsOs+MT7wLesg13k=; b=N1C/fXl7XOXWC+wXofVtxUprvmnrrODoCsHZxUPvrBn9sNAgpX2/TrhjdhhPOeJvtJR7lQzzFYtWEkIJwWLnuEeGFJQ4UTku2MJQvuP89hR2ss6hIxL9zWjy+ZCvpyVEn7U09kHkbaMfezWvhz8XcfvIpOVPlx1B4rErCTTfJ+wF3/gt44GMHOLOj4CiR0RAHQ9Fr00AuBpDgO1EyOa9DX28mG1/yUus6BIAjHuYHrzH8Ew2m4dQSbCs4k0xdFVd5m3KfkvAvNRdV5WipZlfLadaxGFLH58/eZ98//+RWFoKgGu8dimkFHIAq6Uw99kMU47RdvUrW3mX0fwtRg8WFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+uVLJZuLt4gDfkyC7G/iwvFivmHrsOs+MT7wLesg13k=; b=IytekyAREZ2DdkpCvh+Z6aKZnlSL7IvYcPAeDTW/vy01Yo4Z1Ajnf3AG/rud+2w+UZ8OtqYWImTmbP2lXBiWyaH7RK8WPWtWz0X0wMtsI8808XLtQvBNi2dMXcnEiPISYCKv/ca0dapjPw7FQ/IIL6aBwjSqPoVJPlbRxU4PAanjqj0lkmW25lnSvNB5aLsxVprx/a9OXlRafuGHKG17g0RBkyNBbagmltfpJWz/rUZdFCqPOTfndR/QcG5D+ANjNzwNvh95BQgiTB7wPmXaoHcgpZjUbh2rcHjF3+U9RYwSYQuObRqCCMVxycX9MA/2j0zZptOz8l44Mbt01Xb3rg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cornelisnetworks.com; Received: from BL0PR01MB4131.prod.exchangelabs.com (2603:10b6:208:42::20) by SA3PR01MB8476.prod.exchangelabs.com (2603:10b6:806:37f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.25; Fri, 29 Sep 2023 13:03:09 +0000 Received: from BL0PR01MB4131.prod.exchangelabs.com ([fe80::386c:b0e1:bf68:cf1]) by BL0PR01MB4131.prod.exchangelabs.com ([fe80::386c:b0e1:bf68:cf1%7]) with mapi id 15.20.6838.024; Fri, 29 Sep 2023 13:03:09 +0000 Message-ID: <99fab1eb-1092-4b7d-8b60-b03374883302@cornelisnetworks.com> Date: Fri, 29 Sep 2023 08:03:04 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 04/10] RDMA/hfi1: Use RMW accessors for changing LNKCTL2 To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Lukas Wunner , Alexandru Gagniuc , Krishna chaitanya chundru , Srinivas Pandruvada , "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Deucher , Daniel Lezcano , Amit Kucheria , Zhang Rui References: <20230929115723.7864-1-ilpo.jarvinen@linux.intel.com> <20230929115723.7864-5-ilpo.jarvinen@linux.intel.com> Content-Language: en-US From: Dean Luick In-Reply-To: <20230929115723.7864-5-ilpo.jarvinen@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: DM6PR03CA0100.namprd03.prod.outlook.com (2603:10b6:5:333::33) To BL0PR01MB4131.prod.exchangelabs.com (2603:10b6:208:42::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR01MB4131:EE_|SA3PR01MB8476:EE_ X-MS-Office365-Filtering-Correlation-Id: adcd1129-b068-446e-c475-08dbc0ec6d60 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mgKt7NVIcWmxi1zWmNj93o7Hs8Cyh2h1z9PAS/YxYRf81Y4fv8j+pKcIsWmRswPFsauPd6V7NCimNylDydrTy9G+cnLp7BDITIdVgavsqSs6uo+o5hXedOL5szIqi43d1/IvQOG4XOkKNLg5RplhZTVIVaIUf1bwtetlf+uPVxu9DQQ6ps5Urrb2KFY0f42lOfMB0JMVjejO70Gjrewb2Ahu7N3a0dpI4o2HuwMLZQcMswClpyVHsUu+o9bkRzDQAglQYlX4Qkn3OP7JzdRWNmGnQ+W6IYOTJTuO092/a84RX+1zaglTu7gb0yDkZWv3lU6PwBGFo4I5MKVVlnxyFZtp2KystO82Z8lKxper3ESGxeJ6qp8GISvD3S+f4ruKhmKkSURzwmwD1k3jJ08b4N40bnqBn1l8AH3IEcXVbUqDs/gGwPEkxKSQygZAD6XX1ls+GCNFcxCvo9VSMsQDqWU0pTdw7Mf/ZtycogMJ4J4QBw/0T1V7p4OF+Oa9ovMC5lSrEr008k94JO00EAAVVjGcmJ9Spu53H0fOnFdxPHB0tJ91Dq2FbsVF7secMWMRMWd0u7TIKGgCTlHOfauLA8LzFN4kqKxsauTQnBFPQUHzr1XOvjgs7MAjv+8f2WABod4q51ckHg3Lg5DvBT/CUw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR01MB4131.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(346002)(39840400004)(366004)(1800799009)(186009)(451199024)(64100799003)(478600001)(44832011)(38100700002)(5660300002)(6486002)(6506007)(53546011)(6666004)(66946007)(41300700001)(54906003)(66476007)(66556008)(110136005)(316002)(4326008)(8676002)(8936002)(36756003)(86362001)(31696002)(83380400001)(2906002)(31686004)(26005)(6512007)(921005)(7416002)(2616005)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N1E3WmVPZHBYMnpSNGQvZjJMRTBjSW9FdnBwYStBbi9Oa3dnbUtt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lh2QzIwMlVobDVuTGxXS2htRzFVNnBsRTA4TUxP?= =?utf-8?B?RjE4NklvekNoU2EvTlg2VDArU2ZOaE1hNGxyNFY3MUVrazVib29oYlVrUWgz?= =?utf-8?B?SmRxOGpXYk9vVjIraUlSV3RzQWdRNm9VbnF3SjUzQXloQ0NpR3Y1QjIrSEFs?= =?utf-8?B?ekRYZmlJL053Nk1KS3JuVWtEOXY4b1lUZ29zbWd5OEZoUnQydklZVTM4SXNW?= =?utf-8?B?WDUrSWtLNENEUi9jUlUySE5wTElNRlcvMzNDYmtuV1owZHArZEgwRVpyUGFJ?= =?utf-8?B?WXE5d1BaYUVSeDR2QmRRVlh6SHNwTkw3eEtHOHRzK29lcUhJL1lDblFTVWIz?= =?utf-8?B?MHc9PQ==?= X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: adcd1129-b068-446e-c475-08dbc0ec6d60 X-MS-Exchange-CrossTenant-AuthSource: BL0PR01MB4131.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 13:03:08.9846 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rnjf3sbwG06nlqV6S9p+B0kFglCq3PNWwejdxoQzKfbC+eJ9YiXYPfTyDqEcg4rep3/UYHH8mZgAle7I6C3aOs/QZHOKo9wCYhm08ALKS54= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR01MB8476 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 06:03:30 -0700 (PDT) On 9/29/2023 6:57 AM, Ilpo J=C3=A4rvinen wrote: > Don't assume that only the driver would be accessing LNKCTL2. In the > case of upstream (parent), the driver does not even own the device it's > changing the registers for. > > Use RMW capability accessors which do proper locking to avoid losing > concurrent updates to the register value. This change is also useful as > a cleanup. > > Suggested-by: Lukas Wunner > Signed-off-by: Ilpo J=C3=A4rvinen > --- > drivers/infiniband/hw/hfi1/pcie.c | 30 ++++++++---------------------- > 1 file changed, 8 insertions(+), 22 deletions(-) > > diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hf= i1/pcie.c > index 08732e1ac966..4487a05bea04 100644 > --- a/drivers/infiniband/hw/hfi1/pcie.c > +++ b/drivers/infiniband/hw/hfi1/pcie.c > @@ -1212,14 +1212,11 @@ int do_pcie_gen3_transition(struct hfi1_devdata *= dd) > (u32)lnkctl2); > /* only write to parent if target is not as high as ours */ > if ((lnkctl2 & PCI_EXP_LNKCTL2_TLS) < target_vector) { > - lnkctl2 &=3D ~PCI_EXP_LNKCTL2_TLS; > - lnkctl2 |=3D target_vector; > - dd_dev_info(dd, "%s: ..new link control2: 0x%x\n", __func__= , > - (u32)lnkctl2); > - ret =3D pcie_capability_write_word(parent, > - PCI_EXP_LNKCTL2, lnkctl2); > + ret =3D pcie_capability_clear_and_set_word(parent, PCI_EXP_= LNKCTL2, > + PCI_EXP_LNKCTL2_TL= S, > + target_vector); > if (ret) { > - dd_dev_err(dd, "Unable to write to PCI config\n"); > + dd_dev_err(dd, "Unable to change parent PCI target = speed\n"); > return_error =3D 1; > goto done; > } > @@ -1228,22 +1225,11 @@ int do_pcie_gen3_transition(struct hfi1_devdata *= dd) > } > > dd_dev_info(dd, "%s: setting target link speed\n", __func__); > - ret =3D pcie_capability_read_word(dd->pcidev, PCI_EXP_LNKCTL2, &lnk= ctl2); > + ret =3D pcie_capability_clear_and_set_word(dd->pcidev, PCI_EXP_LNKC= TL2, > + PCI_EXP_LNKCTL2_TLS, > + target_vector); > if (ret) { > - dd_dev_err(dd, "Unable to read from PCI config\n"); > - return_error =3D 1; > - goto done; > - } > - > - dd_dev_info(dd, "%s: ..old link control2: 0x%x\n", __func__, > - (u32)lnkctl2); > - lnkctl2 &=3D ~PCI_EXP_LNKCTL2_TLS; > - lnkctl2 |=3D target_vector; > - dd_dev_info(dd, "%s: ..new link control2: 0x%x\n", __func__, > - (u32)lnkctl2); > - ret =3D pcie_capability_write_word(dd->pcidev, PCI_EXP_LNKCTL2, lnk= ctl2); > - if (ret) { > - dd_dev_err(dd, "Unable to write to PCI config\n"); > + dd_dev_err(dd, "Unable to change device PCI target speed\n"= ); > return_error =3D 1; > goto done; > } Looks good. Thank you for my suggested changes. Reviewed-by: Dean Luick -Dean External recipient