From patchwork Fri Dec 16 14:31:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13075044 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B57EC4332F for ; Fri, 16 Dec 2022 14:31:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230413AbiLPObW (ORCPT ); Fri, 16 Dec 2022 09:31:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiLPObV (ORCPT ); Fri, 16 Dec 2022 09:31:21 -0500 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2104.outbound.protection.outlook.com [40.107.95.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90E2C13E09 for ; Fri, 16 Dec 2022 06:31:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FuWjH5Erc3YqWy1O7MOJxJBMIhOTPiHiPRahFYmJSbIcRlBpxcBZ/jQvhv+UKITl6qyu+Vs59zo/tNWuw4y8vD01iRm/mwsz5v5Od4NX/V/I/4WJrB7fiRFH5YHUpqGLdHlXk4+hmkeADKFCpJa++IBbHHcMtnnyqwR0Ifp4Ok9Np4UofDyEuuSXVVBNz7Ri2i/k33PawlYgWrx6x0MaSpeDdbRYUD33yVSamU4tSWC+qzmmjXyt/4atjp4l74jLR6qKFk5wmOZEN98Dj0gPMtAY3dBfDa3sTIzbkZizNQ9syVKH8/5anxRE48Agir0NPSWILXa3Z2D9zVkR/Kt4Gg== 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=jatVO05oLDRSmVPYbfW8Sl0oUDB9qTK2U2sof3SlRTg=; b=gU01euUAYTg/4X6gafgdIn/0YQTJmF0tHR//QIqyP9nLPZM8s5LvQq1fj6s29yce31vFyHKE3f1WkzwvN3d26ULY5Yt2SSx5MHTksCuiiZ5hz+ztQfKm1jHHQ82nkhy4ahFspIJprf8l5ruPUaecM5k4O8mh1CRfrLvVV6bSzx1cUuiawE2ZjcrD7q678l8qjaz+ZIjpfAntbX4O8crjxlCJkr8KtsZ4Gjnwmlu5cQTgEaudJA/Tpjgkll9Eg2eFq256n7ehPDVmW0PQ45knaVcS5R6DRz9jqihwXU+HiF5xfgNCXGw44FCSIarcMjTQuB6p3DOr2FEKQy5ymQ/M9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jatVO05oLDRSmVPYbfW8Sl0oUDB9qTK2U2sof3SlRTg=; b=DCnyi8jqGu4EqDEXbd88IQz36oh57Q02ZWX55LYcdVehMAQz1uhGNQJGoqdXg5AxhVNYxJ3FamWJ38IdVr3EmDj5EspbXw77WrzlExA6VKSkA6Vn3OGw7KBpWzvEI1G2LK1PiaPN/oLysXehUwKBGDJ99xTwjHsOfqcwLRKA10E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by BY3PR13MB4801.namprd13.prod.outlook.com (2603:10b6:a03:369::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.15; Fri, 16 Dec 2022 14:31:16 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30%9]) with mapi id 15.20.5880.021; Fri, 16 Dec 2022 14:31:16 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Huanhuan Wang , =?utf-8?q?Niklas_S=C3=B6derlund?= , Simon Horman Subject: [PATCH net] nfp: fix unaligned io read of capabilities word Date: Fri, 16 Dec 2022 15:31:01 +0100 Message-Id: <20221216143101.976739-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AS4P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d0::7) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|BY3PR13MB4801:EE_ X-MS-Office365-Filtering-Correlation-Id: e2dead4b-0ee1-4c6a-acd2-08dadf72305a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 458xSHHezvSb3xCQ1b2fRocc5lhmA/v04KDIjQUTNqo5dxc1RM0MzG6oBxnUBV5RZrGkC3jl7Bu7/QBBxyLFoLX1hy9HmZQcxQ+EUNIDgc+dFJCc9pSEJ9ZO15SZ/7ppndSEy4axDCbI+nEOKpE72K+3JnECTH6pPrJseGmLdBsqDfDQDWTn9Zfroz9Wxsab5Ws+COIs47JKxJ/tOlbuTKwAcQia6g4ariDMwJPRsUseaorl93k9RiST+1cP8RuRxzzAroye4O254AVYT+rNu7gRg57dg6+m4G6Zm5Be9JhDRdo7278Q+No4oZ4RmVKL/93s4G4R7Q45Ic2p3k6gfNtX+h3ylGShkdAaKEONjtQm1ySMaQmy+3dIGH+xI9wKESsJ9qn0lR7YN12OhogCgAWQKqATvHl2An6RStx7HuEqrzATThLDBw93/x0lOieXSGGGjv51LOCQEEzf6ve36ut7ExZj6zZMDlGF6n66jC9KVlnT4hCrdNKfra/kJRTdTXtMinn0foQMIM/Xk5PtdsA9HJgbw5p1pjcC1rOXDD+CTa7BmRk9oXOoSyvkbt7eG4jM9KsDKt8SjMe0w1inM3Z0TTrc9UNFpunIK/61F4G9TzF+ki/YOqkYb0FmlSVwDgj3lJ1md+9b0bO9UXspXA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(346002)(396003)(136003)(39840400004)(376002)(451199015)(36756003)(38100700002)(86362001)(2906002)(66476007)(66556008)(66946007)(8676002)(4326008)(5660300002)(44832011)(83380400001)(478600001)(6486002)(1076003)(110136005)(316002)(54906003)(52116002)(41300700001)(8936002)(6506007)(2616005)(6666004)(66574015)(107886003)(6512007)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?o4rVHVrGRnokQMNp329kkOfVfT72?= =?utf-8?q?zCbty6VSZ5ZM326Ppdjqyr28tbxHQcujzbLxH8fUpxDnhS/Uyor+FhmEITiEpXACh?= =?utf-8?q?yWW3fOLFg44fBe36kl72P5PkcrnCE6i9i3FNzx/Tu5f5q7hbmI/QqbTAXYYVoyBm7?= =?utf-8?q?SRn3jphpSIjnaB+8KGkfUcJjv0YCjRvBMsddYn5yi2gEHXufLUf7xIGpz6vgMnTYQ?= =?utf-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jfrsjt?= =?utf-8?q?mKdI3GGeVcU6b+dfOYO4Gsnb2CvIQ/suKvZl/VdT59G4CHMb2VwAAe4EVay6MzEk7?= =?utf-8?q?DtBFu+CnWdbXWNA/RtvS3iqSWNVqaLMXBTmRFApfcDPx1jLwbYU24c/oidFZ2qDOA?= =?utf-8?q?o9HbQF7hII6c3t1f290geoSevyu1DJOqGy1aXVqo7caKyz+5lbmLbTFLDiVOxuxhc?= =?utf-8?q?y2LNpmFAT+HOOap06+UwFNAq2DJAXr7nR5D+cx+cfAoGAJjS7ZP26bQC2Q7cCX6jm?= =?utf-8?q?JAY84aeH/8DCXepIAeOhdwqrTozohip+pptXypzoQLWC8EbK6cTTPUZFNk2zR4DwF?= =?utf-8?q?9B/LQLxVfX1f3A4GTqntSAVA9Vpvg3NoMDD/KzpRy/i/j7gSMTpraa6S9KRYxfZO7?= =?utf-8?q?mULqaNw3uC7XiiIBWmsfAN0NQbEBXaVaaR5xpV9GZvrphEHcMbi9fZatKGBgMQ8e2?= =?utf-8?q?SXjCK0aVREWZWVDE8BuKAOtAiqZK4hgQ5LSrOFy5gozptYYrYDVWoc7S4Mu2Nc7ar?= =?utf-8?q?6zSFCUpiuMVagSCZBlPUGLT7n13d1duyw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2dead4b-0ee1-4c6a-acd2-08dadf72305a X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2022 14:31:16.0298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZgVzVvyjc6K07R0Bv6gpazRZmpB9Q6aM6eygzkICIgAMO8r1wqbkYYnK1m6WA3ldhZ+Bq2EaRhri8h2cUEusBJMoGiFQ2TS1lU0UWGyuVKs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4801 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Huanhuan Wang The address of 32-bit extend capability is not qword aligned, and may cause exception in some arch. Fixes: 484963ce9f1e ("nfp: extend capability and control words") Signed-off-by: Huanhuan Wang Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 2314cf55e821..09053373288f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -2509,7 +2509,7 @@ static int nfp_net_read_caps(struct nfp_net *nn) { /* Get some of the read-only fields from the BAR */ nn->cap = nn_readl(nn, NFP_NET_CFG_CAP); - nn->cap_w1 = nn_readq(nn, NFP_NET_CFG_CAP_WORD1); + nn->cap_w1 = nn_readl(nn, NFP_NET_CFG_CAP_WORD1); nn->max_mtu = nn_readl(nn, NFP_NET_CFG_MAX_MTU); /* ABI 4.x and ctrl vNIC always use chained metadata, in other cases