Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp395754rdb; Mon, 22 Jan 2024 07:31:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhTuqQIKa2AHD8KtOICMQRF8uVchtR2kCvvtfm7N+olfpPlstjQvQJqNeApRsUyInaQV0L X-Received: by 2002:a05:6214:1d09:b0:681:6859:66bf with SMTP id e9-20020a0562141d0900b00681685966bfmr6068437qvd.71.1705937512005; Mon, 22 Jan 2024 07:31:52 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y6-20020a0cd986000000b006818ccaaf49si5720313qvj.89.2024.01.22.07.31.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:31:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@quicinc.com header.s=qcppdkim1 header.b=LLE5PCUi; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-33312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 201E91C211E7 for ; Mon, 22 Jan 2024 15:31:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4B326027F; Mon, 22 Jan 2024 15:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LLE5PCUi" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 667BA46559; Mon, 22 Jan 2024 15:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935763; cv=none; b=osobGjl2zqOXpPDGfJ9mIRGUBmOVoKIgb9m8A39qIjhZHsySttnQUzkV9EUKAgo5W3hLKzgZDfbERIo3/S4Zk7zCQs0UeHkUv/0fF0+jijd2JqZKjk3GkUIqifpmZWMU3KM5ch68bC3vs0w6gZa8EM80yLheETi2XEMmkWhhR8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935763; c=relaxed/simple; bh=8bGFmix80U9/t8wZwLZ5Rw+q5Uz4pSAAPOUtF8Qbh94=; h=Message-ID:Date:MIME-Version:From:Subject:To:CC:References: In-Reply-To:Content-Type; b=GhLIvtxxxHKnAUWxvWGXwoNlRMigW6piUH2xXbbfIgMhyTnybgm1s4gspC+cLD2q6yQBVsi0O6FVq5w8aTTIm+eW2Jk9jcc6oHSYWxIcBB2AgeSZ4Ec+Jm4o85ETzCn4laps2/Gd3+UtPKLmwVlkUMfLRorejL2DgZxoAlVfxy0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=LLE5PCUi; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40MEEKRt023856; Mon, 22 Jan 2024 15:01:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:from:subject:to:cc:references :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=HQT4IJbpgLyZu2gWdGASTg7GGU/7nlJGfQLF+O8FORE=; b=LL E5PCUiZBDKg8XqVuua7R999Yh9pC48m4tqG18SD1WAx0xYI+itnKZPLYT8clKoV1 9moXCOpKjo/n/9ZtvP1MRVOL5QfrxYO2RqrF0v8cucDiLRw5tOJnDo/xLq2cbRtr 9JyTOEdnirWWl/NG1i43JA7jnaNP3+HTPwGyJ94Td+MdK0mvgnCHw5oOMtc0xgDN fiA8nMxxoI/X9LoDFpMjBo2VOomcTwaHZNrk+OdEzQ+37l5EyBaQ8jV5j94d99mX ZJ1sUdS60CwKF5Wnc+IIUceB2UB0aHHc26pw0vkUK4i9yHY1EcYiPGzOyzd6U0cc vtQESgHJVipbP86uichg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vsq7w0n1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Jan 2024 15:01:39 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40MF1c2U009224 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Jan 2024 15:01:38 GMT Received: from [10.253.15.239] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 22 Jan 2024 07:01:28 -0800 Message-ID: Date: Mon, 22 Jan 2024 23:01:26 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Lei Wei Subject: Re: [PATCH net-next 18/20] net: ethernet: qualcomm: Add PPE MAC support for phylink To: "Russell King (Oracle)" , Luo Jie CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20240110114033.32575-1-quic_luoj@quicinc.com> <20240110114033.32575-19-quic_luoj@quicinc.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: rEqqTzP-nAa7s86SsOJYcDTm33YE2naW X-Proofpoint-ORIG-GUID: rEqqTzP-nAa7s86SsOJYcDTm33YE2naW 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-01-22_05,2024-01-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 mlxlogscore=742 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401220102 On 1/10/2024 8:18 PM, Russell King (Oracle) wrote: > On Wed, Jan 10, 2024 at 07:40:30PM +0800, Luo Jie wrote: >> +static void ppe_phylink_mac_link_up(struct ppe_device *ppe_dev, int port, >> + struct phy_device *phy, >> + unsigned int mode, phy_interface_t interface, >> + int speed, int duplex, bool tx_pause, bool rx_pause) >> +{ >> + struct phylink_pcs *pcs = ppe_phylink_mac_select_pcs(ppe_dev, port, interface); >> + struct ppe_uniphy *uniphy = pcs_to_ppe_uniphy(pcs); >> + struct ppe_port *ppe_port = ppe_port_get(ppe_dev, port); >> + >> + /* Wait uniphy auto-negotiation completion */ >> + ppe_uniphy_autoneg_complete_check(uniphy, port); > > Way too late... > Yes agree, this will be removed. If inband autoneg is used, pcs_get_state should report the link status. Then this function call should not be needed and should be removed. >> @@ -352,6 +1230,12 @@ static int ppe_port_maxframe_set(struct ppe_device *ppe_dev, >> } >> >> static struct ppe_device_ops qcom_ppe_ops = { >> + .phylink_setup = ppe_phylink_setup, >> + .phylink_destroy = ppe_phylink_destroy, >> + .phylink_mac_config = ppe_phylink_mac_config, >> + .phylink_mac_link_up = ppe_phylink_mac_link_up, >> + .phylink_mac_link_down = ppe_phylink_mac_link_down, >> + .phylink_mac_select_pcs = ppe_phylink_mac_select_pcs, >> .set_maxframe = ppe_port_maxframe_set, >> }; > > Why this extra layer of abstraction? If you need separate phylink > operations, why not implement separate phylink_mac_ops structures? > This PPE driver will serve as the base driver for higher level drivers such as the ethernet DMA (EDMA) driver and the DSA switch driver. The ppe_device_ops is exported to these higher level drivers, to allow access to PPE operations. For example, the EDMA driver (ethernet netdevice driver to be pushed for review after the PPE driver) will use the phylink_setup/destroy ops for managing netdevice to PHY linkage. The set_maxframe op is also to be used by the EDMA driver during MTU change operation on the ethernet port. I also mentioned it in the section "Exported PPE Device Operations" in PPE driver documentation: https://lore.kernel.org/netdev/20240110114033.32575-2-quic_luoj@quicinc.com/ Whereas the PPE DSA switch driver is expected to use the phylink_mac ops. However,we will remove the phylink_mac ops from this patch now since it is currently unused.