Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1127422pxb; Wed, 6 Apr 2022 09:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztuAIkLwpfvmXuSavOLKnfuCedNj/ONInGiEvh2hJ+gDISApWxVEqli/a8ObOf7z4Zk2rk X-Received: by 2002:a17:902:c7d5:b0:156:878e:f876 with SMTP id r21-20020a170902c7d500b00156878ef876mr8921958pla.165.1649262010417; Wed, 06 Apr 2022 09:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649262010; cv=none; d=google.com; s=arc-20160816; b=AYX/Mme84Mz1JSCby/7MtJj+EaugQiZouJEvx+6uf9vIhHW4W5gmndjChfphYq7a2D cDlaENyuZ25kAyaj/AdZAvYmuKCaaKfbNg0A8vhyx5Ej5dtFnRocaT1LeduTNk3MNiQt oI3+XdIDbB5Ij8NbhP/DEUaHUdl5HTwmi0ORPkskUx6aGhWVUPIeHZpqvR8aAT70zSjm hT54807ODQYi0XstYivfFjI80HO0XlDmfi8po1YVMbSgBZ8HZdwaKTPjNn3lAPArPuhI p17WCc+NOnVevbp8muwErFtR2vfm4XWvh7ygyXc9R6m0oohvKYQHgEb4EljEThXeKdmH PFVQ== 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:dkim-signature; bh=HY9AyFTTSvyl0mlHOq1Vq0LKi+bYjw8bBCj2u/ZVLyk=; b=RDylNddRIXDAJ0PIWl+8727PgB/P9if6ohJc4lJ2dVQtfIt/5kN9JELl0N4T1iOHxB iR2O49tlNPN5s13/+1Y/tZVtLw77TDfJCU4v1SHUNfyOEBCwJxIdYzvm3kYhcNXQR3ZX OTvHBJrsjY97j8NmAecsPVKCfhKspWWQ5r3TEKBBkxYdf4eRYotQjtnPoyVknIwbqhMo eSOjzTrgCY08vly24au3a1xvFW6qJx0vGoq+OZiMo0J4VVsq9i4dZppj9DNQAtZLW+pc 8cfAvsk1KIS8jkLpWV5A2I94o01RmxnKCifQGrDaqTEMWQ7PbwxRx9foTKc1VW3skR4K BNQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=aDF2DGov; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a2-20020aa780c2000000b004fa3a8e0053si13958054pfn.266.2022.04.06.09.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 09:20:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=aDF2DGov; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C50754967A1; Wed, 6 Apr 2022 08:18:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235948AbiDFPTR (ORCPT + 99 others); Wed, 6 Apr 2022 11:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236333AbiDFPR7 (ORCPT ); Wed, 6 Apr 2022 11:17:59 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC67A5252F1; Wed, 6 Apr 2022 05:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=HY9AyFTTSvyl0mlHOq1Vq0LKi+bYjw8bBCj2u/ZVLyk=; b=aDF2DGovnriLp72Za6zAVUGbsL fhWT/9D+P1OKvm4m5O31hA6qWT6uPkpoRITU9hBGXBldGdHMmstMualOautB7X5SsmTO6CUuCExpc 30dA0WI/95RtqLgmheb/LNqrUaSikCWIlvAWMXi6uQUqIkNt/+PbqimmDrrzeV8ZJn6E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nc4bN-00ERSk-HN; Wed, 06 Apr 2022 14:17:33 +0200 Date: Wed, 6 Apr 2022 14:17:33 +0200 From: Andrew Lunn To: Potin Lai Cc: Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski , Joel Stanley , Andrew Jeffery , Patrick Williams , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] net: mdio: aspeed: Introduce read write function for c22 and c45 Message-ID: References: <20220406012002.15128-1-potin.lai@quantatw.com> <20220406012002.15128-3-potin.lai@quantatw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220406012002.15128-3-potin.lai@quantatw.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum) > +{ > + dev_dbg(&bus->dev, "%s: addr: %d, regnum: %d\n", __func__, addr, > + regnum); > + > + if (regnum & MII_ADDR_C45) > + return aspeed_mdio_read_c45(bus, addr, regnum); > + > + return aspeed_mdio_read_c22(bus, addr, regnum); > +} > + > static int aspeed_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val) > { > dev_dbg(&bus->dev, "%s: addr: %d, regnum: %d, val: 0x%x\n", > __func__, addr, regnum, val); > > - /* Just clause 22 for the moment */ > if (regnum & MII_ADDR_C45) > - return -EOPNOTSUPP; > + return aspeed_mdio_write_c45(bus, addr, regnum, val); > > - return aspeed_mdio_op(bus, ASPEED_MDIO_CTRL_ST_C22, MDIO_C22_OP_WRITE, > - addr, regnum, val); > + return aspeed_mdio_write_c22(bus, addr, regnum, val); > } Hi Portin Nice structure. This will helper with future cleanup where C22 and C45 will be completely separated, and the c45 variants will be directly passed dev_ad and reg, rather than have to extract them from regnum. A few process issues. Please read the netdev FAQ. The subject list should indicate the tree, and there should be an patch 0/3 which explains the big picture of what the patchset does. 0/3 will then be used for the merge commit. Andrew