Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3906360pxf; Tue, 6 Apr 2021 03:20:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLXERWzda/8BDUYl3f6ve6iaUH7r79xv+d0GoO4OA7cI9kurMMrDrNmA+2wC49XRBfmM0z X-Received: by 2002:aa7:df86:: with SMTP id b6mr37320225edy.294.1617704459278; Tue, 06 Apr 2021 03:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617704459; cv=none; d=google.com; s=arc-20160816; b=VaUa8VUhTIm7BKPfWNqy61oz8Z+vsR9lYvs4gyLSx6zqZVEXebIdNH3w97J1+7RFGM PtbDrTNRjYtrfw5zwTw/eUZ8ihqew9QgCXsdqaFYe974WGgFPh7rhZXgi+MhUob2orY3 ISUughqMycZRAeVJvBTkG77/jqeyBA3s4tMlAIa5ZImSt4UaH0Ll4wmc0Oq5vF39G3x3 8ayPPvogR8dgJKgsfmtoVEkHWz0B2f+I61c2u/LJes9G4rnt6HUOChpzELxBDDiDSCcm CeZwe27WuNO/dwkzD8wdB8nGw/FWvxToZiiSVdx/9ZHEoz7x5C54EEepbjpRaRRU7JyA zCWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=apYW0YKLaqmVgaNWqK5gXBseDsHbWix7Ev7E735tiRc=; b=kZw5hfiYNDSF3tAE5AFZvb9dB82MUW/b+8dyoa+lQz1A9pjN3yMPZLaR2EKQpjRGga 0qlcXly6Bw+fRnlfTm2K/xXKS3K+h4UKkmaZq8ay65R0MeKQfmW9UwsX+u31dr5mLnjF 5vCIVaIVZZvLCwi0w20eKDidS6VUXwaws8BrdDM5GPVxeQqioVUlpfZqS7F989M/QK/S qdBamiogp8IH7IlRsXwngFYZwUrKgMzNX9HSuWF3X02VftTB2doIhNH1Y7o7CGed5Svn tL379EF5Tl5dczP5IjPTia5SwYUV5IjJPRgGZYP/l758YAmGjbZz7/bxB9Z5cz831T40 ex3w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy6si4537757edb.67.2021.04.06.03.20.35; Tue, 06 Apr 2021 03:20:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242793AbhDEWaU (ORCPT + 99 others); Mon, 5 Apr 2021 18:30:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233086AbhDEWaT (ORCPT ); Mon, 5 Apr 2021 18:30:19 -0400 Received: from hs01.dk-develop.de (hs01.dk-develop.de [IPv6:2a02:c207:3002:6234::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92A8AC06174A; Mon, 5 Apr 2021 15:30:12 -0700 (PDT) Date: Tue, 6 Apr 2021 00:30:08 +0200 From: Danilo Krummrich To: Andrew Lunn Cc: Russell King - ARM Linux admin , davem@davemloft.net, hkallweit1@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com Subject: Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses Message-ID: References: <6f1dfc28368d098ace9564e53ed92041@dk-develop.de> <20210331183524.GV1463@shell.armlinux.org.uk> <2f0ea3c3076466e197ca2977753b07f3@dk-develop.de> <20210401084857.GW1463@shell.armlinux.org.uk> <20210402125858.GB1463@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 05, 2021 at 09:27:44PM +0200, Andrew Lunn wrote: > > Now, instead of encoding this information of the bus' capabilities at both > > places, I'd propose just checking the mii_bus->capabilities field in the > > mdiobus_c45_*() functions. IMHO this would be a little cleaner, than having two > > places where this information is stored. What do you think about that? > > You will need to review all the MDIO bus drivers to make sure they > correctly set the capabilities. There is something like 55 using > of_mdiobus_register() and 45 using mdiobus_register(). So you have 100 > drivers to review. Yes, but I think it would be enough to look at the drivers handling the MII_ADDR_C45 flag, because those are either - actually capable to do C45 bus transfers or - do properly return -EOPNOTSUPP. I counted 27 drivers handling the MII_ADDR_C45 flag. Setting the capabilities for those should be pretty easy. The remaining ones, which should be about 73 then, could be left untouched, because the default capability MDIOBUS_NO_CAP would indicate they can C22 only. Since they don't handle the MII_ADDR_C45 flag at all, this should be the correct assumption. > > Andrew >