From mboxrd@z Thu Jan 1 00:00:00 1970 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 8130EC77B72 for ; Mon, 17 Apr 2023 09:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229685AbjDQJjQ (ORCPT ); Mon, 17 Apr 2023 05:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbjDQJjC (ORCPT ); Mon, 17 Apr 2023 05:39:02 -0400 Received: from h2.cmg1.smtp.forpsi.com (h2.cmg1.smtp.forpsi.com [81.2.195.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECDC3594 for ; Mon, 17 Apr 2023 02:38:14 -0700 (PDT) Received: from lenoch ([91.218.190.200]) by cmgsmtp with ESMTPSA id oLIFpknAFPm6CoLIGpSh4V; Mon, 17 Apr 2023 11:37:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1681724226; bh=fiuH0GcWevmCpKJ/ebsllotu+6NfmGBkbeZMX+tvMQw=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=XbifxrbHWa2akLpHL77M7J1IM1oSZf+O6kgZMCP1i+0mQuC2kJqxOcxzkyvBQXSO5 lCi1eVtUkNP9ylcEIxw9cWQjUptigbtxRyyF5eXGAlm24u1hYvJ3ICK303jgctEh0j /lNb4201QskdA5dpv81MZzSoHXjVtN1Z4JiEtWhlJrb/c8zkNox0ObktjQNFO8lC4z zcfpe7iX3US2H7mfVn5JLi6VWqyGWSQT2a1zxKgSvqaO7dy0v1bE1vCTu5Z3rHECUt gM/qksVzsq2KtWVbZL4l5/LqvEwdAsa356YwMvlY6iWwfK5w2vsZW6KWgjc+JKSXiE APkGYz9mdAsNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1681724226; bh=fiuH0GcWevmCpKJ/ebsllotu+6NfmGBkbeZMX+tvMQw=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=XbifxrbHWa2akLpHL77M7J1IM1oSZf+O6kgZMCP1i+0mQuC2kJqxOcxzkyvBQXSO5 lCi1eVtUkNP9ylcEIxw9cWQjUptigbtxRyyF5eXGAlm24u1hYvJ3ICK303jgctEh0j /lNb4201QskdA5dpv81MZzSoHXjVtN1Z4JiEtWhlJrb/c8zkNox0ObktjQNFO8lC4z zcfpe7iX3US2H7mfVn5JLi6VWqyGWSQT2a1zxKgSvqaO7dy0v1bE1vCTu5Z3rHECUt gM/qksVzsq2KtWVbZL4l5/LqvEwdAsa356YwMvlY6iWwfK5w2vsZW6KWgjc+JKSXiE APkGYz9mdAsNA== Date: Mon, 17 Apr 2023 11:37:02 +0200 From: Ladislav Michl To: Dan Carpenter Cc: Andrew Lunn , linux-staging@lists.linux.dev, netdev@vger.kernel.org, linux-mips@vger.kernel.org, Chris Packham Subject: Re: [PATCH 2/3] staging: octeon: avoid needless device allocation Message-ID: References: <543bfbb6-af60-4b5d-abf8-0274ab0b713f@lunn.ch> <26dd05e9-befa-4190-ac3c-bf31d58a5f1e@kili.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26dd05e9-befa-4190-ac3c-bf31d58a5f1e@kili.mountain> X-CMAE-Envelope: MS4wfEZoGX5SjGjVN9HkENAmeGDGDqi/iG6ZWS3FtNZ+NfpDCsvAiEsGbJG0frJEQz+t3qh3s9ZgEjxgF4rr/tt8EqHHyu4w5ezF4oieB+uDA7J22lrYoAGe 3L3zavGD6+BrPIeUKPRcvvcRCgOIEhYg25QqzUmq6cXBpG/W5GBY9yPCsWhw37E6k8MRpCdL3GaLMZyuVxRotSrWoPnIgLwzPFKFe3+lW5M/w2N9+4BKMQVa 07VstyGTle8yMFw/xvD6zh6CH/X8rIs7j/56AAOZovAb6EJ98qs/4yUvFOaMscg9ZNA4t8hJgCZ6Pskc1s88eDjykwdeEeLc8h7qhy5aC7VxXic6hFf/npmA 1Q8ZoCPz Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Mon, Apr 17, 2023 at 11:37:30AM +0300, Dan Carpenter wrote: > On Thu, Apr 13, 2023 at 07:20:08PM +0200, Andrew Lunn wrote: > > > I was asking this question myself and then came to this: > > > Converting driver to phylink makes separating different macs easier as > > > this driver is splitted between staging and arch/mips/cavium-octeon/executive/ > > > However I'll provide changes spotted previously as separate preparational > > > patches. Would that work for you? > > > > Is you end goal to get this out of staging? phylib vs phylink is not a > > reason to keep it in staging. > > > > It just seems odd to be adding new features to a staging driver. As a > > bit of a "carrot and stick" maybe we should say you cannot add new > > features until it is ready to move out of staging? > > We already have that rule. But I don't know anything about phy vs > phylink... Let me elaborate here a bit then. Current Octeon driver comes from Cavium's vendor kernel tree. Cavium started this about two decades ago based on their own ideas and tries to bend kernel interfaces around them. Driver is based aroud Packet Input Processing/Input Packet Data (PIP/IPD) units which can connect their data streams to various interfaces. SGMII/1000BASE-X/QSGMII and RGMII are just two of them. Currently driver iterates over all interfaces and all ports to bind interfaces to PIP/IPD. There is a lot of code deciding which interfaces/ports exits on given Octeon SoC, see arch/mips/cavium-octeon/executive/ Driver code then calls those helpers with interface/port aguments and they do the magic using switches deciding what to do based on interface type. I'm proposing to leave all that trickery behind and just follow what's written in device tree, so each I/O interface ends up as a driver with its own mac ops. While it is possible to implement that as private mac ops as some other drivers do, I think it is more convenient to use phylink_mac_ops. In case I'm missing something or I'm wrong with analysis, please let me know. Thanks, ladis