Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1125560lqt; Sat, 20 Apr 2024 01:37:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVY9+HA7cPStmC7UvZxmkgRF6A1JpQQM7suBWiRS2NA77fgSCAgMEJlmWI0Z5gqqFON9HdS3+bZRsMi5/MYtS1WZr24E6y0oWbxYGkYHw== X-Google-Smtp-Source: AGHT+IH4xdV6q+QAWEJF2nUx4BMNkWuTyDYqyOsuMa4KITzKWOTkZ9P7aup2+4fyXMiv2rp+pqzR X-Received: by 2002:a05:6a00:21c6:b0:6ed:63e:3525 with SMTP id t6-20020a056a0021c600b006ed063e3525mr4592833pfj.31.1713602259794; Sat, 20 Apr 2024 01:37:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713602259; cv=pass; d=google.com; s=arc-20160816; b=0lujz4w+ymM6NOlhaHe3/T0AbDdt1f+nUnTEziqixC075o2DGfyQNPdDEFopDvFe9j 1iP5jAkKp5bBhU4AY1AOUZo0ZyRjzzE0xsc+9aaJ1xEV9lxVHKAfiLj9oF6OlqPVlyzS WF3u9elOSbK0r7sRtO8WFgyrGc0zDqak0B7pdiNsUfmXGgPO8WqB7d19CWe0tZfhiCB7 x5HlGPEF+eu4AIID4ZLNb5R5Bdb2GKdWCreN5z/Y2zsC+j2ouGZFHVHBDmxeOtUO6rDR 5SU0T7ycIcYAMD83mGlGtHNoAJ6u6bknIHhSdP7N7U2emIGHaeSFU4t3kcr+nKz12EkN B3Ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=1PYQHneja0E79ojR73BwgQXJbhXd4M/m787FMcA0gBo=; fh=R4AXM21x59p9UxGxb0tR4wix7tfG8vgp7u/6e38fyEc=; b=stRC1QLxHcb1um7Ldv3rRYmgdOcujppZYFfAeH/ryEnB40nv8J97Ookm0aeGrYmnBd kU82yxkdAquWrTo03YrDhKJ9pxSxg7Mi1zYyiS1ZhyV06YQTL+4kVBxq/ZEXrfihK/Hb TGGf+foJjJ1gvEEX+0mIoPCPTYhA9HEWeglBt811TXlvG1qWHUSUdb2SAQfpfkE/Om3r G7r5fo9UBOML23f8LcseFVQE9zbAUCkxeb+w+HAR62SN+kafxVhFfdTthsBCtXznEQst KpL2Hc1HRbwZhlK18NyKF/NqlQi0gDuFhqWEy0NooQ5Avfi7sVdZDGtZLL2ShXeLyiRl jkhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=ZIjrckF6; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-152179-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l4-20020a632504000000b005f808db6d9bsi1359820pgl.358.2024.04.20.01.37.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 01:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152179-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=ZIjrckF6; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-152179-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 E45E1281EAD for ; Sat, 20 Apr 2024 08:37:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6616314AA8; Sat, 20 Apr 2024 08:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ZIjrckF6" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 B195A134BE; Sat, 20 Apr 2024 08:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713602248; cv=none; b=oyp8BbYLJ8iWIBj93w1oiNKnIFeqiI8lDmM9f03MuJ5wgVY/eVeAv99LCz/7uNtmO6ZwPYem8TS+xiA33YxskE9E0UElXSoq1iVdNfkZSn2JjbDM7e2UyOgQ7TU+WuPAqH0TAKCyw7TxIpPMnGovdkntHmEUxPdhxFuAsew92T4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713602248; c=relaxed/simple; bh=pR41IxiqLUAoH+5KghyDbWvO8rxNhT9gOKkhaNznKQc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ozKFXj6YcaQEPWNTBz0yl7qTd4RwczGTesMOy9qtuvhGBO+fBMQpK//DKsFnLl0hwDMRMvUmm3PQsPuGFPyMyOkH6LeWgwpvZA2ICbeIXw3fOjcoXYG0ep1zfPjiyvA45XN2r88nr6/1tAOUUp0X5eRGGiwXnxuCfcsQ7dzq/kA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=ZIjrckF6; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1PYQHneja0E79ojR73BwgQXJbhXd4M/m787FMcA0gBo=; b=ZIjrckF6gOgjT0ULtQcRrnPTvj Kiq0gMPC4AOdVTS+Ewq0sjSyFV2T13DErUoPP6L7f+PV4fxTdItPAD5Ea4OeGll/S8FNwKdScHQlz cTYu+HISSxfyViEmxJzm9f8JTjTYkGFRg1+CY5a9TdAsDE/a5DasNhIf2s4PX0LRwb6Q2hXAo5O92 0v58Ex+UwnnOJDrAbvpXEYbecTHlkn70mxebfofXXu2FghO141qIwegVVLMjNTiPMq707C/2UEcAL nQ2LmpYBzO+2CwuB9dzGjKYmDEvT5BZKl4dczOu2XkinCO/07kYwgiLs7yP8cVJsi8x6EgkHoX81c mNgKLYWw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47398) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ry6Db-0000DC-2c; Sat, 20 Apr 2024 09:37:08 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1ry6DU-0000S0-8n; Sat, 20 Apr 2024 09:37:00 +0100 Date: Sat, 20 Apr 2024 09:37:00 +0100 From: "Russell King (Oracle)" To: renjun wang Cc: andrew@lunn.ch, hkallweit1@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: update fields of mii_ioctl_data for transferring C45 data. Message-ID: References: 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=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) On Sat, Apr 20, 2024 at 08:41:10AM +0800, renjun wang wrote: > The phy_id is used as u32 type in function mdio_phy_id_is_c45() > with the 30th bit for distinguishing C22 and C45. The reg_num is > also used as u32 type in function mdiobus_c45_read() or someplace > else. For more C45 information needed and data structure alignment > consideration, change these two fields to __u32 type which can make > user space program transferring clause 45 type information to kernel > directly. You haven't understood the user API, and are making a change that will break existing userspace users of this API. Hence this is not acceptable. mdio_phy_id_is_c45() is indeed for determining if the "phy_id" field in mii_ioctl_data is indicating a clause 45 transaction. This checks the following bits, defined using these macros: #define MDIO_PHY_ID_C45 0x8000 #define MDIO_PHY_ID_PRTAD 0x03e0 #define MDIO_PHY_ID_DEVAD 0x001f and all of these fit within the __u16. The format used by userspace pre-dates clause 45, and bit 15 was added to indicate clause 45 along with the "prtad" in bits 9 to 5. However, the kernel translates this data structure into something that the MDIO accessors can deal with. See for example phy_mii_ioctl(). Also note that the old method of shoe-horning clause 45 into just one set of mii bus methods has gone, meaning there is now no need to convert from mii_ioctl_data into a 32-bit reg_num. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!