Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965219AbbLOL4H (ORCPT ); Tue, 15 Dec 2015 06:56:07 -0500 Received: from mail-by2on0129.outbound.protection.outlook.com ([207.46.100.129]:31670 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964922AbbLOL4B (ORCPT ); Tue, 15 Dec 2015 06:56:01 -0500 From: Liberman Igal To: Andy Fleming CC: "netdev@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , Scott Wood , Madalin-Cristian Bucur , "pebolle@tiscali.nl" , Joakim Tjernlund , "ppc@mindchasers.com" , "stephen@networkplumber.org" , David Miller Subject: RE: [v9, 6/6] fsl/fman: Add FMan MAC driver Thread-Topic: [v9, 6/6] fsl/fman: Add FMan MAC driver Thread-Index: AQHRLbsquh8t2gL+4EKqwOHuND14I57Bj64AgApvxJA= Date: Tue, 15 Dec 2015 11:55:57 +0000 Message-ID: References: <1449127157-9400-1-git-send-email-igal.liberman@freescale.com> <1449127157-9400-7-git-send-email-igal.liberman@freescale.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igal.Liberman@freescale.com; x-originating-ip: [192.88.162.1] x-microsoft-exchange-diagnostics: 1;BY1PR03MB1483;5:rm3PJpn+CbieekNtFJNA8wVEY1S+L4kQMF+25WwvaFpff3Oo/y0zgRuXpmBSYJotc+FlTM3mYg4vHG5ll4vZK7PHnrW9BfAxU6RMQpyz0/ie8sS6YBQAKzxWKsPRfc/wxYXQQg2tPN+6VNa1znq85Q==;24:vFs90FpcurTOXsCDZt79p4speTgvw0O8084nIRNLgSPuEb3HGcpzui7Xfy41w97GfFDc8GRceLLCZ0EuF/7ayNWHfFIZr5rLUz81e+6dz4U= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1483; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(101931422205132); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001);SRVR:BY1PR03MB1483;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1483; x-forefront-prvs: 07915F544A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(377454003)(52084003)(189002)(24454002)(199003)(50944005)(19580405001)(1411001)(19580395003)(10400500002)(1220700001)(76576001)(101416001)(122556002)(11100500001)(189998001)(106356001)(105586002)(5004730100002)(1096002)(99286002)(81156007)(106116001)(97736004)(74316001)(5003600100002)(110136002)(92566002)(40100003)(33656002)(5002640100001)(5001960100002)(86362001)(5008740100001)(102836003)(2900100001)(2950100001)(6116002)(87936001)(54356999)(66066001)(3846002)(15975445007)(50986999)(76176999)(77096005)(586003)(19627235001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1483;H:DM2PR03MB509.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2015 11:55:58.0077 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1483 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id tBFBuCFS000776 Content-Length: 5400 Lines: 158 Hello Andy, Thank you for your feedback. Some inline answers. Regards, Igal Liberman > -----Original Message----- > From: Andy Fleming [mailto:afleming@gmail.com] > Sent: Tuesday, December 08, 2015 10:18 PM > To: Liberman Igal-B31950 > Cc: netdev@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux- > kernel@vger.kernel.org; Wood Scott-B07421 ; > Bucur Madalin-Cristian-B32716 ; > pebolle@tiscali.nl; Joakim Tjernlund ; > ppc@mindchasers.com; stephen@networkplumber.org; David Miller > > Subject: Re: [v9, 6/6] fsl/fman: Add FMan MAC driver > > On Thu, Dec 3, 2015 at 1:19 AM, wrote: > > From: Igal Liberman > > > > This patch adds the Ethernet MAC driver supporting the three different > > types of MACs: dTSEC, tGEC and mEMAC. > > > > Signed-off-by: Igal Liberman > > [...] > > > + > > +MODULE_LICENSE("Dual BSD/GPL"); > > + > > +MODULE_AUTHOR("Emil Medve "); > > I imagine this email address doesn't exist anymore, or won't soon. > This is also an issue in the ethernet driver (with my old address). > I'm not sure what the right approach is, but we shouldn't be putting obsolete > email addresses in the kernel. > > [...] > I removed MODULE_AUTHOR as per Scott's request. We'll change the way we note contributors. > > +static void mac_exception(void *_mac_dev, enum fman_mac_exceptions > > +ex) { > > + struct mac_device *mac_dev; > > + struct mac_priv_s *priv; > > + > > + mac_dev = (struct mac_device *)_mac_dev; > > > Don't cast a void * > OK, removed. > [...] > > > +static int mac_probe(struct platform_device *_of_dev) { > > + int err, i, lenp, nph; > > + struct device *dev; > > + struct device_node *mac_node, *dev_node, *tbi_node; > > + struct mac_device *mac_dev; > > + struct platform_device *of_dev; > > + struct resource res; > > + struct mac_priv_s *priv; > > + const u8 *mac_addr; > > + const char *char_prop; > > [...] > > > + /* Get the PHY connection type */ > > + char_prop = (const char *)of_get_property(mac_node, > > + "phy-connection-type", NULL); > > + if (!char_prop) { > > + dev_warn(dev, > > + "of_get_property(%s, phy-connection-type) failed. Defaulting > to MII\n", > > + mac_node->full_name); > > + priv->phy_if = PHY_INTERFACE_MODE_MII; > > + } else { > > + priv->phy_if = str2phy(char_prop); > > + } > > + > > + priv->speed = phy2speed[priv->phy_if]; > > + priv->max_speed = priv->speed; > > + mac_dev->if_support = DTSEC_SUPPORTED; > > + /* We don't support half-duplex in SGMII mode */ > > + if (strstr(char_prop, "sgmii")) > > This causes a crash if the device tree does not have a "phy-connection-type" > for this node. Also, you already have parsed the property, and put the result > in priv->phy_if. Why not use this to do all of these determinations? > Agree, changed the driver to use priv->phy_if instead of strstr in both places. In both > > > + mac_dev->if_support &= ~(SUPPORTED_10baseT_Half | > > + SUPPORTED_100baseT_Half); > > + > > + /* Gigabit support (no half-duplex) */ > > + if (priv->max_speed == 1000) > > + mac_dev->if_support |= SUPPORTED_1000baseT_Full; > > + > > + /* The 10G interface only supports one mode */ > > + if (strstr(char_prop, "xgmii")) > > + mac_dev->if_support = SUPPORTED_10000baseT_Full; > > Here, too. > > > [...] > > > + err = mac_dev->init(mac_dev); > > + if (err < 0) { > > + dev_err(dev, "mac_dev->init() = %d\n", err); > > + of_node_put(priv->phy_node); > > + goto _return_dev_set_drvdata; > > + } > > + > > + /* pause frame autonegotiation enabled */ > > + mac_dev->autoneg_pause = true; > > + > > + /* by intializing the values to false, force FMD to enable PAUSE frames > > + * on RX and TX > > + */ > > Minor comment format issue (leave blank line at top of block comment) > According to https://www.kernel.org/doc/Documentation/CodingStyle: The preferred style for long (multi-line) comments is: /* * This is the preferred style for multi-line * comments in the Linux kernel source code. * Please use it consistently. * * Description: A column of asterisks on the left side, * with beginning and ending almost-blank lines. */ For files in net/ and drivers/net/ the preferred style for long (multi-line) comments is a little different. /* The preferred comment style for files in net/ and drivers/net * looks like this. * * It is nearly the same as the generally preferred comment style, * but there is no initial almost-blank line. */ > Andy ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?