Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4866043rdb; Fri, 15 Sep 2023 15:05:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCyW4aPuavSIZI0uHVuoJbO9LsH3IYtksKFClod9fcq3GuXrHvPpvi0M1S7UxUbMbfwCes X-Received: by 2002:a05:6a20:7d95:b0:15a:592c:130c with SMTP id v21-20020a056a207d9500b0015a592c130cmr2170455pzj.14.1694815507400; Fri, 15 Sep 2023 15:05:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694815507; cv=pass; d=google.com; s=arc-20160816; b=bxf6eWSIdlWMYsyNYezTjKly+L3Q71u42htkXPzjeCDJALfCz0Fp5P/Feqkdy2CPBz PM71bQMhduGwXlsQzfh4d6EvHNB5XEn84chWtsm/PVwwrqjGaw0P3/k9xfGuA8JG1dIz fThdyKxdkRV7ON5LIulqOutsQOE4bLINp0BtNSNfqnLB4or48o7uZZvXHbH8mz+uuiMa sQG6a8Rd+C2DUUAO9ElcP8Yxp6PmuS8KcDiN8B8QoODtHjG9gXkTHxAFVL9RPcGsLS83 WU5WQ7oCGV5KGcMUpjq6h3eaByHBaOSaFNd6Lbm81KchLihxefre+eUhJGUZKF5y9Vkd wQ2A== 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=z4Bw8QzPjcIShNhKgY2tOiAXSALOXOrDM5bIR73UmMA=; fh=qccru9uXSey5gGKzLaHJLfTz+pzbuHZKYoE/5uPKsAo=; b=PTeqASX0Rl7InRUtJYquGOHWFVhXXFNgwEdKDNWlzhEZla7v3HnYS0DbM9ssTk4Qsj qihtTc8QnmuwHjZmEsQX/j/bpCnkiOXQsRM7l8H2S65X+uxQIgmoTJf06p/aGUQiiqYB ycGPXx8Bpfjz9LLkAsZAwX7rF8MClYwVkR3mQJHY8S4PWoBBhlzWAfAl0sJ1+Mp4jz/X yyjj5DRmF7b1Mu03ifbCOME/QSXPjpYm6JogTdtbhgaM13HWDDSobb6hEa7QDTElfl44 MvdgLDy1JJHOAjFoS9sY9Xp4GHS+zU+T6Mlt9yPJGAYgMRH/XyCzgIjXokv78I1hGO8S 3lHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cornelisnetworks.com header.s=selector1 header.b=aZqWRnqm; 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.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id fo24-20020a056a00601800b00690158064aasi3842392pfb.118.2023.09.15.15.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 15:05:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@cornelisnetworks.com header.s=selector1 header.b=aZqWRnqm; 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.38 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 fry.vger.email (Postfix) with ESMTP id C6FBA80A2377; Fri, 15 Sep 2023 06:51:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234816AbjIONvZ (ORCPT + 99 others); Fri, 15 Sep 2023 09:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235310AbjIONvS (ORCPT ); Fri, 15 Sep 2023 09:51:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2127.outbound.protection.outlook.com [40.107.244.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113831FFA; Fri, 15 Sep 2023 06:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YkknUdHbjUqCBF0cnT1SSkYDVgODRqUx+MCiTDmJjVtD3Rq/ewbTcVFSfnecMBm62pKLaMYX9ZkQuIYe8XqknvUF5vlcSAxc29h4Hj2IKsJTUYxi9jtHI+sMPS04qzmsZyuV6mQmLutjvTnPqUrB8XItDgownDzmRqYoxKxwHGud1onAOYcgT322OevYfilKdJUwHZ2WHMgU3Rn3Xlg61GJa+IVPsg59+oAElYVrLLtCaVlz+3xfr+UAvkZBK9dE/7tufC3CjKyM55L37pGYvCJ23EVKGgYxkdcQ6TvEmhJ5kVFa62Jbtkm3XHXm+j4BO7kuqjRNpH5gyIuIaozR+Q== 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=z4Bw8QzPjcIShNhKgY2tOiAXSALOXOrDM5bIR73UmMA=; b=fsTilP4CrIU+lSU/SUkJ/88cAip/9InwmQAPwauktpvooOk/RNV0bVdXpvnmdMTCwanLtAejMiTOSOvt2hd9ifiuMNKllVov/SIOohB4HbPGonYwVm0JlS00v/v+gtSava5FNLwtgD9nFDMGEwcvE4JKVwJ1iWgOtZrIyeHC/OCsawKTXftU7yJNhCacEAmSptnXejDWudj5TbIYKeZjVpCqwSAfoKqE5Iw8Kbg9kSogBtbUx7jrZx8mU/BJ371ajlEt/0eczbhQ/jcfxafu+ky65vpxQxbkU9/fr6l4ioPeXpUvAXGKQK94II7SbWDoHqAd60g6BK6ou/MaPpq+Xw== 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=z4Bw8QzPjcIShNhKgY2tOiAXSALOXOrDM5bIR73UmMA=; b=aZqWRnqme1GXv/HJdSbtFioGzNxYl1srL+rUhw/Y/wHo+H19LJLyv5coWWV+i5E1D3wcsN+ZEgTvMjtBeJ0Z4z+IKSrjCjBedB5IgOHEgyDI5D74OVZD8vjhA9lvoyCbY3nyHkWImCNFgYQrjQ4yrh7nbrlPgeV8yNP917xYWY+1o0Z0fx+Xdlc2OE2pkXWQsyMtr/UM8Gj6nYvpm0LrvI3JaX8Gmc/1pa2YHqhwDAiY2xNaKar5J2jDV72eTMovuqTwHPwdcszqOSnFUyQQWXcs1ml7dt4TzzaOnhiLQJSCu1o1cAlS7rN4ldQPTDaiZX3oxSin0ipDdcYzKmW+xw== 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 SJ0PR01MB7479.prod.exchangelabs.com (2603:10b6:a03:3e1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20; Fri, 15 Sep 2023 13:51:06 +0000 Received: from BL0PR01MB4131.prod.exchangelabs.com ([fe80::57bb:9292:4cd6:5e18]) by BL0PR01MB4131.prod.exchangelabs.com ([fe80::57bb:9292:4cd6:5e18%4]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 13:51:05 +0000 Message-ID: Date: Fri, 15 Sep 2023 08:51:01 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 04/10] drm/IB/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: <20230915120142.32987-1-ilpo.jarvinen@linux.intel.com> <20230915120142.32987-5-ilpo.jarvinen@linux.intel.com> Content-Language: en-US From: Dean Luick In-Reply-To: <20230915120142.32987-5-ilpo.jarvinen@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CH0P220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::21) To BL0PR01MB4131.prod.exchangelabs.com (2603:10b6:208:42::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR01MB4131:EE_|SJ0PR01MB7479:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bb9da8d-81de-4de8-2294-08dbb5f2ce6f 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: WV8q+g+X5y+1BaaxnYHkYPM6VJ1kfVvmx5ZFl7Cn4eGVdt3U9j950fKm3MUi0Q11iNYiTgHfO3+aeuW7m6dnw4wpo3zXBnSTJvqtgg8L9INBAMKo+WCv9l+IYFmg2KSilUgA7miNUIq0jJTqYcE6Y+33/hOfxuja6dYXURFT/b2dpmx2HkTEKd/JHxIK09/UOibuWUssDplPS9m0ClzBWKyvP+zXPWmzPSl84OZ3HOs9LI5rQirXT1hku7zoewQP0hibpZo6fKMY6mJlVVkPL98espZF68HH9+CPB2b9qoVQ2V1LnwiESLXFKWyTSVHR+hTJsvXJDWe/cZsWqmLuUJFjImQZt1iKdFQ6WYPpwQy276aesrMcUNuQ5lFjqXCUNmf9zpXY4Lh42lgNLE8QBceBeSgAyO+eopQ4oKBmOuP1YUH2oXb2pDONVgp/X71xmcn7hodf91+P2coU9dWtbQSsw7UJVpNbMbZ9CMknKqjEjHX08y0B9BJkCG/PS/u9D0WwWzemvXhH6NxSYhuYCHxNjbDWdDN/pTafFnr+fm9+gFhH+FWoyGOM9Ej16nfa+Q1ZXA3+jsdD1LY+2sxkXl01cHtvZRuvvAmoZ6Z3VpCoPRWf3mbXpE4DtFL8MbeZRAKBGObSii16Lz3b98kFFw== 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)(136003)(396003)(346002)(376002)(39840400004)(366004)(1800799009)(186009)(451199024)(2906002)(83380400001)(7416002)(921005)(53546011)(6486002)(5660300002)(66946007)(54906003)(316002)(110136005)(66476007)(6666004)(478600001)(6506007)(26005)(41300700001)(44832011)(8676002)(8936002)(4326008)(2616005)(6512007)(66556008)(36756003)(38100700002)(31696002)(86362001)(31686004)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WjRVQnVNcUpNRGhuVGRhRnptbTFiaEhIVTZING1LZzhrMDIyRzNiR2tnRVkw?= =?ut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OEI3YXc1SE9LTXMyTytCZTY0?= =?utf-8?B?UnFsRExzblN5OXhTRks2NHg1UTUrSnRHVFladllBc0U2eTVIeVZZR2N5eFJC?= =?utf-8?B?YklQTkdWdmw0QXZTMFMwYjJ2MU9MWVhDdjc3N3duZlpnQ3ZSdEZLRUJDK24v?= =?utf-8?B?NzZzcXMxWG9ZTFRLSy9Nek1aYUExbEVxVTZmNWhMRUFPWmlZMG5sWDV5emRJ?= =?utf-8?B?Q3d5d2VUQjJLSGZ0d1VsOGFYOEpuYTBGZ1JWS2g2dUZvc0NkV3dxYnd0TFZp?= =?utf-8?B?UnRVeS9sZnArcUN2bUxOTjM5Smt6eWRKMmlYQ2V2NFFEWUxTbThldGl3elRt?= =?utf-8?B?UXc9PQ==?= X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bb9da8d-81de-4de8-2294-08dbb5f2ce6f X-MS-Exchange-CrossTenant-AuthSource: BL0PR01MB4131.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 13:51:05.6634 (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: +MkS+czzN0LgqM4A+peT3QNcD5PhTeqqu1+Afq/2qBqtAY86ZH0zgEHzaWCTGK5rixqRrQyHLSpp0znOdWfHD5ddX3I4v1sP/in2eAyaeLQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB7479 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 06:51:31 -0700 (PDT) On 9/15/2023 7:01 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 I believe the subject should begin with "RDMA/hfi1:", the current expectati= on for all devices in drivers/infiniband. > --- > 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..60a177f52eb5 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 PCI target speed\n= "); To differentiate from the dev_err below, add "parent", i.e. "Unable to chan= ge parent PCI target speed". > 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 PCI target speed\n"); To differentiate from the dev_err above, add "device", i.e. "Unable to chan= ge device PCI target speed". > return_error =3D 1; > goto done; > } External recipient