Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1667987lqt; Wed, 20 Mar 2024 10:21:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOYPBRxLropuiLIeT2kHZQEM+2im2Qpy/XZwGgoXQ9B5hR+tk2HSmsgmZ7k1Izo+qxbIzekt/rJWOgO5oT8S6UUkkkPxkCdMco0v+qxA== X-Google-Smtp-Source: AGHT+IGtNk8OJOfrJK8m9WLedAjOCFy+2jWDyphkpSCbueg/bfnze/eVanmaRXW0yLDz7MiqB9JF X-Received: by 2002:a17:902:f7cc:b0:1dd:76f0:3dde with SMTP id h12-20020a170902f7cc00b001dd76f03ddemr15138835plw.31.1710955268679; Wed, 20 Mar 2024 10:21:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710955268; cv=pass; d=google.com; s=arc-20160816; b=wsC6p2NXqDpihYpObgqLLFr6CsiUvszcZtoI748jH8hrFG5ghYQ9SZHLellQm4LLDr +eNM5c+HonDMpN2P97n3Ev6cKbe9hQDqNhOVXtCBm1WiM1Kzz5VQMVJhx4WVngVATJ+S Vu2x+WFdVBFO4QbdHk1pYlMCriZWDDLyTN34ItK3HSWBKvO3nnVqoOQuL8XNodAa1LxY ca7Ykn1/qLUsoYiNWn8trUBXGw58XFfX2WWvL1KX0KRBQglOnfgXcU/MKoKB0CRY4B9d E/gM8uixT8W48JeZ2aQfc7DnMENSqNMaLpIvm0S02uJVtyF4Y5GjaTgbGanMCotBS4EZ Y2KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=gi7oWzeF3IUKlp7PFSXRdA2MzG072PNShX+grViVOt8=; fh=zlFnTBmEjcKjHkYJJqT31OjWQ01UVDFyonLbUfDhG7M=; b=QS9crhhzu5AuV1Ky6Nu4n2WbHcL9jDSQNth+JkprzkNSOO0nxDvEhyxpI8DhIRzqm+ 3H82B4thdEe0cdTNUwmooCQ2K5j21Dsy05vgGPlFWiGQ9BeJr2LmXcCyjXfleTyREKN+ 4v0m3cjaOJCQUWpx503rS5Og26sCQaYn3fqhRjuL9F+LKZ7tJY/+11fpLnSDlnZ/rSQ5 RxoV88MAt40OJm37HqtN8eDq5MyvMHsWwN7RdP3JJGlFimw3l3s0wvk6+S8wVRgPOKte 3kIaCqyUXIcBFHt+kd+KwFjv+oA9VmexJmit/se+HV37xIGJaoIjBQo42z8NRmfAYzf1 KyIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=TLkdxO9Q; arc=pass (i=1 dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-109225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j8-20020a170903024800b001dc84ab0940si13892331plh.378.2024.03.20.10.21.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 10:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=TLkdxO9Q; arc=pass (i=1 dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-109225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.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 5D027282D24 for ; Wed, 20 Mar 2024 17:21:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE74E6A8AC; Wed, 20 Mar 2024 17:20:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="TLkdxO9Q" Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (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 B47CD6A02D; Wed, 20 Mar 2024 17:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710955245; cv=none; b=sMO+MstoXMj+S0cgV+MOr+XSICNHDOT3iEdYH8jgm0Jlbx+PQJ2A7dMSZgS4OAOvsLb/khPkGHZWVwl/5E91SMiLC+6VBdMfF6RCCfQi37mgQ6pX9nv8YFdv3BI8GCJFZD8Fsgi05Q7xG3weg0hidclsnpPnt0NKRk2F1cP90b8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710955245; c=relaxed/simple; bh=PXbY0Ox61cikah9PXRtM5Cq8s8wbozFkrP2zNiAE6Ag=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JF9Jk7/u+7w+x3RxVg75JcEiZOUj72U11/qtXeQbBd7q8PUjsI0JxxgzAOXQSgBRsHaVtnqgAJ/Qh6EdnBwN2W0Bvpr8rhAfc2scM9mNqr8dhXdgWknKtn8kTyN0tyKYLaAhbUQ7tyXfTzKKjLXAoTTy8Ihz+qGWPyJJVPfzY14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=none smtp.helo=mx0b-0016f401.pphosted.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=TLkdxO9Q; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.helo=mx0b-0016f401.pphosted.com Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42KFIWm8003494; Wed, 20 Mar 2024 10:20:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=pfpt0220; bh=gi7oWzeF3IUKlp7PFSXRd A2MzG072PNShX+grViVOt8=; b=TLkdxO9Qg9o2wSxvCsvs/dxsAJHcjQpTF6R5/ hYhYcEYKd5RpJF0qEVGN8nFvGI79i1FKdMCZ1DKNnBwAvzoAjXUUxPbcfI3EGD4w S4j1bfG3rwTSplIFQuJ1BCpQJWYmF4qflHVYUiTfbv+ab1u6lbktla3pp7fvilD8 jgkMiIB62WlAaY0CED9mf0GJOcOPgrpgNZ1mpIP5NovWg66e8KA2GmKuodOR9by6 +TJbs//Kz9s3yFWq5zYXstJPf/sh6am4i0VEjvYe2xdiHeX19uMydqpoiRAea5TM i6s6WxzGjsy7C2LQNxskjyeDlOKpI8UsGyUjik+Br2JXDrSZA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wxka52e2y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Mar 2024 10:20:16 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.32; Wed, 20 Mar 2024 10:20:14 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1258.32 via Frontend Transport; Wed, 20 Mar 2024 10:20:14 -0700 Received: from dc3lp-swdev041.marvell.com (dc3lp-swdev041.marvell.com [10.6.60.191]) by maili.marvell.com (Postfix) with ESMTP id 807B83F7051; Wed, 20 Mar 2024 10:20:11 -0700 (PDT) From: Elad Nachman To: , , , , , , , , , , , , CC: Subject: [PATCH v2 0/5] Fix prestera driver fail to probe twice Date: Wed, 20 Mar 2024 19:20:03 +0200 Message-ID: <20240320172008.2989693-1-enachman@marvell.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: gXYJgsAoS-P74PUf3eptC7CpdzJKvQCG X-Proofpoint-ORIG-GUID: gXYJgsAoS-P74PUf3eptC7CpdzJKvQCG 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-20_10,2024-03-18_03,2023-05-22_02 From: Elad Nachman Fix issues resulting from insmod, rmmod and insmod of the prestera driver: 1. Call of firmware switch HW reset was missing, and is required in order to make the firmware loader shift to the correct state needed for loading the next firmware. 2. Time-out for waiting for firmware loader to be ready was too small. 3. memory referencing after freeing 4. MAC addresses wrapping 5. Missing SFP unbind (phylink release) of a port during the port release. v2: 1) Split first patch to firmware call for switch HW reset and to increasing of firmware loader wait to be ready timeout 2) Explain why is switch HW reset call to the firmware required before shutdown in commit message, and fix wording 3) Use a simpler bitwise-and on the last byte of the base MAC address instead of randomizing again the entire MAC address. reflect that change in the commit message, and explain why it is needed (switch HW implementation requirement). 4) Add Fixes Tags to all commits. 5) For timeout enlargement commit, fix wording in comment and move timeout units to milliseconds. 6) Add Tested-By tags. 7) Add patch to call prestera_port_sfp_unbind() from prestera_destroy_ports() in order to release phylink. Elad Nachman (5): net: marvell: prestera: fix driver reload net: marvell: prestera: enlarge fw restart time net: marvell: prestera: fix memory use after free net: marvell: prestera: force good base mac net: marvell: prestera: unbind sfp port on exit drivers/net/ethernet/marvell/prestera/prestera_hw.c | 8 ++++++++ drivers/net/ethernet/marvell/prestera/prestera_hw.h | 1 + drivers/net/ethernet/marvell/prestera/prestera_main.c | 5 ++++- drivers/net/ethernet/marvell/prestera/prestera_pci.c | 7 ++++++- drivers/net/ethernet/marvell/prestera/prestera_router.c | 1 - .../net/ethernet/marvell/prestera/prestera_router_hw.c | 1 - 6 files changed, 19 insertions(+), 4 deletions(-) -- 2.25.1