Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1660387pxy; Mon, 2 Aug 2021 07:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCbZ1oyHAvXAPWHSfMjh9GkVnQ0g93sOjYgFgPkrm20ZXHQUhjnE48bv+btBNeoydksvXp X-Received: by 2002:a6b:c98e:: with SMTP id z136mr1903401iof.110.1627913835100; Mon, 02 Aug 2021 07:17:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1627913835; cv=pass; d=google.com; s=arc-20160816; b=lByq9Pr8EMl2vL27eMyl3qtgoYqPkvdtIGyv5Tr+ZXylw7kL/3cCbRIokkH2JdpmVg bDTBliyOfuWX9DCXqdA6mAoZFVcCRk/GMdIRpWGKZt5NhwG+JXqSwYSlUoZHqRaLo6Un ptaQxppDEPx3yZb9XzADIuEr8Prp6j9J27mXRmVoBcTb88691HnQJZ5TeQenO2RUmGvx yfeP83yR26DiCN2II8LH/jtKWvHLTnqTRMFJS4UXT0pETbs70IvHGRJ4m8FNNNDNJdMn o7AMqEO7QqZUh8Q7bRw0XQTt4BvaOwP80ioHkJ9VCyHlLbA9aWsObxrXQxKaptU9kQ9Q agpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LxSjiu8IfMhD2mbGIqePBMiVmiMtjHrQJ4FJ1AwMn1k=; b=X6A5EIMjnZQZR8h6E/qMlyatsjAvI4cQ5k3B+eCtTxMqGHzRYXny5PHRj1aZi8eaez sZnDEYCW+4jFPqBaEcEI3bW1KnJza2B9qwSTRZnSmjhtDy0h/vOX9Wr7Uy5Q8YSGRtil x4VfqzHY1N/wM6wt5nwUxbOjSzxRW+zfAAcOOsBsAqbq5WUJ17z+H21WfRglCVFDE9a9 ZI9JMEECNHMzapw9F1lXACxQru3YDAGCtie9IJdUfF/KdF4vA8WbcX3iZiQWDnoHRhV2 zhjMS9fVDMv+ManBrTzJHBc4recW61umvBd9h6kBr/dnY9LjZ2V1V/ARrVZu/CHwid/8 lUeQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b=eRdHMNj2; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=plvision.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si13315724ilq.134.2021.08.02.07.17.03; Mon, 02 Aug 2021 07:17:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b=eRdHMNj2; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=plvision.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238860AbhHBOQU (ORCPT + 99 others); Mon, 2 Aug 2021 10:16:20 -0400 Received: from mail-am6eur05on2133.outbound.protection.outlook.com ([40.107.22.133]:56059 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237755AbhHBOKT (ORCPT ); Mon, 2 Aug 2021 10:10:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GtHe2xsIjgMbGS4W98BqsKfa8dsvXm8ogXU4j1nPDJ+y8fUq2zhIHHDlTgzeDxKnWh4REzI+OLEXdEoP0mSMn4WMyjMQCQPpD5bME7PqIJ1FxBKMHEucRXT1fKcyOrXbAH2zdTNu1IDYYKTyvMcFAS7tbY88ekKtvMi4/ypCQz8FosL2FvaYKC4fGanTzKquUHDUQM/UR2B1oEFObciwcD38GeVQymCdeSQ1MQtLV5yEod0DjPSbrQXaWcfD865MAlmEqi8Qt5q4f/ncBS9KbM/8J/mUYCB542IhMjLNvpPO/e3Whd89er9P08gSJnT39j0IloPufnM+RWHOP95Vfg== 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-SenderADCheck; bh=LxSjiu8IfMhD2mbGIqePBMiVmiMtjHrQJ4FJ1AwMn1k=; b=fDzVFjkOxC3bzUxSEdZG2k8M2HPmVqswSbFiqPyALs2Anq5KZW+NngxQSIvHKboyuqEjvooULBwxco/ddwHpAWd4zDxpULId80iIOB0g6RFNbKRqI0HfTLr5aFhJo2+BO70YjBBww0TRQ8TZyVXC48A6Ktx5QL4HxeV7dhigxh/s1Rqw+vr1zUpUfTXT0qyWbV0qFrAusqTjo8YjDk5FETFzd9pkMnnCK2hvTIUfPpzpr2NesQQZgrKc3Zd6nfa1l+BRjq5TpeRDZvuZkdx5zItgYiCdRo5sXMNj3p3DJcYhKwjYbunBSXWW8n8Qqss+79IHiYzbOSPehyD4B2F8Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LxSjiu8IfMhD2mbGIqePBMiVmiMtjHrQJ4FJ1AwMn1k=; b=eRdHMNj2YeY76X7kOwnYCyMFdx2ORZpUoN1UauBwJy+6DVNePw7MDodz0Fk54iIjrbokubouo7P2jPq0bysBVK4G0EZR29U+A7PhSEFN2KtuYpmDiQxMka0GEc04BsiOh9hhA02kSwVhQt4sXzTdCTJx9Panr5ZPMAKoIhQmBBc= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=plvision.eu; Received: from AS8P190MB1063.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:2e4::5) by AM5P190MB0306.EURP190.PROD.OUTLOOK.COM (2603:10a6:206:20::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.26; Mon, 2 Aug 2021 14:09:23 +0000 Received: from AS8P190MB1063.EURP190.PROD.OUTLOOK.COM ([fe80::380c:126f:278d:b230]) by AS8P190MB1063.EURP190.PROD.OUTLOOK.COM ([fe80::380c:126f:278d:b230%9]) with mapi id 15.20.4373.026; Mon, 2 Aug 2021 14:09:23 +0000 From: Vadym Kochan To: "David S. Miller" , Jakub Kicinski , Jamal Hadi Salim , Cong Wang , Andrew Lunn , Vladimir Oltean , Serhiy Boiko , Volodymyr Mytnyk , Taras Chornyi Cc: Vadym Kochan , Taras Chornyi , Mickey Rachamim , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vadym Kochan Subject: [PATCH net-next v2 1/4] net: marvell: prestera: do not fail if FW reply is bigger Date: Mon, 2 Aug 2021 17:08:46 +0300 Message-Id: <20210802140849.2050-2-vadym.kochan@plvision.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210802140849.2050-1-vadym.kochan@plvision.eu> References: <20210802140849.2050-1-vadym.kochan@plvision.eu> Content-Type: text/plain X-ClientProxiedBy: AM6P193CA0066.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::43) To AS8P190MB1063.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:2e4::5) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc60716vkochan.x.ow.s (217.20.186.93) by AM6P193CA0066.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17 via Frontend Transport; Mon, 2 Aug 2021 14:09:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c28be3c0-9593-4519-0a47-08d955bf2138 X-MS-TrafficTypeDiagnostic: AM5P190MB0306: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +4kiN8dCHMMN5i/AMszGuq+qTHiMGALXoGgj6Opm233S47r87wWBrCEdf1J6R4nVXgQx1r6UXJ2ye8JELxZ6gPORI9Zk7NV3VwSVWk4YbqQnrgJ+S8zsUxGGtRAMzl3x+D10QwrxPtARwulznRFW2mJh45f4V9vPOaIowWBo8QxlN3irqhnhi7V98dfV3eNljtPqHIwf02hVnRPJzdrTpB22pKZIzEpFwgFzvI9Kg3m8hRTEbz00phn4wO64wWb1c/XyVaMsiE/qKHdXe6UkYq/K+EKgG6F5u3zC6ESdtSq+y/NM2IWXorZElp+aXyY/FN3fD2P++xJ8NYHsSwwGu3n3M3IfGB5ujkP0kRLXZPYhDksbDYbMBEiCjXZgNHi9epfRXIltfaa1OMiytkvCzn4esEgRVshP2gMJwKCjXxxU5vdIJ9vG7Ue4Bnz1tBF2GXdqaFb4gf7QtKEwjTVM6Hbv7qqEeFP+QPtyk72Nn8cXkDX9FKLj97zSUTBowqAfwQYQr6RAEDlHtPyt8dIO4xOBZ3w39M9qfzehuJ75rPUiuXk81WTQAoJu6DW/gameQiYTQTi7LJ0lIP0FbYHPuurVWbsyA/7OMST7mRJAFedMy9bG1/vpsSFyQ36AHNb6TZXyEXroTBCgP/6TXecxPE2DGHTMWq+J22WsP2dbx9BAhuJv3iJlHClND4of2eQadrXMFGHQBZOFcUPQEsCW3+RVAxHtG6S6hWa8rqdxaTg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8P190MB1063.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(346002)(396003)(376002)(39830400003)(136003)(4326008)(44832011)(2616005)(478600001)(8936002)(956004)(186003)(6486002)(5660300002)(86362001)(66476007)(8676002)(6636002)(66556008)(52116002)(66946007)(1076003)(2906002)(36756003)(6512007)(6506007)(7416002)(83380400001)(26005)(110136005)(54906003)(38350700002)(316002)(38100700002)(6666004)(135533001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?p7jbaTM93DjDXrFPfigqMOo0INOd1uQ0wAkcCh6DexnkrOCxFnjzvsBALfE+?= =?us-ascii?Q?4CmuCEfVZilUjlmBdp86+YeKqLllWLBbatc4PVD+vi5doIb9xyf3H2kTFQKx?= =?us-ascii?Q?YFyTiwgZynuYsF7tWixSWXTluyiNodPMVWqUm3EsjRBK+CWbFFumkuXQQy+V?= =?us-ascii?Q?7UFxZH3r5+8nJZ4nIjXuzdlSXUozhPnv1uZE95BnkJpZzKeDwqmYYGbfFEFL?= =?us-ascii?Q?qriwLjlt4CFKCXWWapZTd+GgI/HylxOWUgGOsG39T0sGscHVagMAlVbd4Xmc?= =?us-ascii?Q?ges9xvlZXlMUUvyQvo9GQrq7MKAkru0xEAKTIeL8upoJvaGTCZ38hAjAhFDG?= =?us-ascii?Q?UXXlpLcoe4BeKxrCjPURaphm/6JBYbxlnmrI2PWBUA8wkauScUlBtxcEJ6/p?= =?us-ascii?Q?X2oJNTsTD88oYdVjK0j6ONrWLhWtyl4N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=?us-ascii?Q?s4sVZuFswPkmJbkqYilglPIV?= X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: c28be3c0-9593-4519-0a47-08d955bf2138 X-MS-Exchange-CrossTenant-AuthSource: AS8P190MB1063.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2021 14:09:23.5206 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K8DzNGhi5T3szAsI0MfLWAZoCiP77lIKbajpXWKmgjKKOit47QxaiBC7g4DPP95ukq+/8iaJ++/UlDaW/qwbuxTX1h6wzXeET1Z8l+Yr8Fo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5P190MB0306 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadym Kochan There might be a case when driver talks to the newer FW version which has extended message packets with extra fields, in that case lets just copy minimum what we need/can. Signed-off-by: Vadym Kochan --- drivers/net/ethernet/marvell/prestera/prestera_pci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_pci.c b/drivers/net/ethernet/marvell/prestera/prestera_pci.c index a250d394da38..58642b540322 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_pci.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_pci.c @@ -359,12 +359,7 @@ static int prestera_fw_cmd_send(struct prestera_fw *fw, } ret_size = prestera_fw_read(fw, PRESTERA_CMD_RCV_LEN_REG); - if (ret_size > out_size) { - dev_err(fw->dev.dev, "ret_size (%u) > out_len(%zu)\n", - ret_size, out_size); - err = -EMSGSIZE; - goto cmd_exit; - } + ret_size = min_t(u32, ret_size, out_size); memcpy_fromio(out_msg, fw->cmd_mbox + in_size, ret_size); -- 2.17.1