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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A573C433EF for ; Wed, 6 Apr 2022 12:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IKB7e/c47yh3Vk+BeejLhlzq6SitWjo62KRXuJy3IZE=; b=W48eZamEy4Noi6 tF5vwrr+4i2wc1yBN+z47fgZGmZkqe/Jw2/Zi+zdkwr3wecttCm6laKK9jYY9EuiBAA9ykHeRzhDv LR3SbEWcWE5pZcBEIraPuWCNv8/w7hVjfQzN/MR3Qp7YzUpGp2jkB1APGSctWEe/+xd2A1YkGQUe7 3HYGnuSk/4nRCEgfjU7fAQZvvIxr1KYoyJRHnglZPh1ARxJ3LVQVi565K7JLOxKeth5CRKZdQvpdO fA9YMxAeDqkAMnuHj+O4PBmaH6xZhawxf1V3GxUEdEdBKZztEG1h3HgWVznHDId7ljRG2cuZr6w53 B31cUqu6IaNKAm/lPkuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc4bo-005yys-Qa; Wed, 06 Apr 2022 12:18:00 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc4bm-005yxn-2C for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 12:17:59 +0000 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-Disposition: inline In-Reply-To: <20220406012002.15128-3-potin.lai@quantatw.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_051758_143810_9C8A274E X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 CFEF8C433F5 for ; Wed, 6 Apr 2022 15:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235955AbiDFPTX (ORCPT ); Wed, 6 Apr 2022 11:19:23 -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> 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