[{"id":1765191,"web_url":"http://patchwork.ozlabs.org/comment/1765191/","msgid":"<20170908092614.GB18365@amd>","list_archive_url":null,"date":"2017-09-08T09:26:14","subject":"Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver","submitter":{"id":2109,"url":"http://patchwork.ozlabs.org/api/people/2109/","name":"Pavel Machek","email":"pavel@ucw.cz"},"content":"Hi!\n\n\n> +static int ksz_spi_read(struct ksz_device *dev, u32 reg, u8 *data,\n> +\t\t\tunsigned int len)\n> +{\n> +\tstruct spi_device *spi = dev->priv;\n> +\n> +\treturn ksz_spi_read_reg(spi, reg, data, len); }\n> +\n> +static int ksz_spi_read8(struct ksz_device *dev, u32 reg, u8 *val) {\n> +\treturn ksz_spi_read(dev, reg, val, 1); }\n> +\n> +static int ksz_spi_read16(struct ksz_device *dev, u32 reg, u16 *val) {\n> +\tint ret = ksz_spi_read(dev, reg, (u8 *)val, 2);\n> +\n> +\tif (!ret)\n> +\t\t*val = be16_to_cpu(*val);\n> +\n> +\treturn ret;\n> +}\n\n> +static int ksz_spi_read32(struct ksz_device *dev, u32 reg, u32 *val) {\n> +\tint ret = ksz_spi_read(dev, reg, (u8 *)val, 4);\n> +\n> +\tif (!ret)\n> +\t\t*val = be32_to_cpu(*val);\n> +\n> +\treturn ret;\n> +}\n\nPlease format according to CodingStyle. (Not only this.)\n\nAnd this will be common for more drivers. Can it go to a header file\nand be included...?\n\n\n\t\t\t\t\t\t\t\t\tPavel","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpX574492z9rxm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 19:26:35 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753030AbdIHJ0X (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 8 Sep 2017 05:26:23 -0400","from atrey.karlin.mff.cuni.cz ([195.113.26.193]:34437 \"EHLO\n\tatrey.karlin.mff.cuni.cz\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752074AbdIHJ0X (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 8 Sep 2017 05:26:23 -0400","by atrey.karlin.mff.cuni.cz (Postfix, from userid 512)\n\tid 82852824DD; Fri,  8 Sep 2017 11:26:21 +0200 (CEST)"],"Date":"Fri, 8 Sep 2017 11:26:14 +0200","From":"Pavel Machek <pavel@ucw.cz>","To":"Tristram.Ha@microchip.com","Cc":"andrew@lunn.ch, muvarov@gmail.com, nathan.leigh.conrad@gmail.com,\n\tvivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com,\n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tWoojung.Huh@microchip.com","Subject":"Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver","Message-ID":"<20170908092614.GB18365@amd>","References":"<93AF473E2DA327428DE3D46B72B1E9FD41121A95@CHN-SV-EXMX02.mchp-main.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tprotocol=\"application/pgp-signature\"; boundary=\"7iMSBzlTiPOCCT2k\"","Content-Disposition":"inline","In-Reply-To":"<93AF473E2DA327428DE3D46B72B1E9FD41121A95@CHN-SV-EXMX02.mchp-main.com>","User-Agent":"Mutt/1.5.23 (2014-03-12)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1765541,"web_url":"http://patchwork.ozlabs.org/comment/1765541/","msgid":"<93AF473E2DA327428DE3D46B72B1E9FD41121E1C@CHN-SV-EXMX02.mchp-main.com>","list_archive_url":null,"date":"2017-09-08T17:35:40","subject":"RE: [PATCH RFC 5/5] Add KSZ8795 SPI driver","submitter":{"id":72262,"url":"http://patchwork.ozlabs.org/api/people/72262/","name":"","email":"Tristram.Ha@microchip.com"},"content":"> -----Original Message-----\n> From: Pavel Machek [mailto:pavel@ucw.cz]\n> Sent: Friday, September 08, 2017 2:26 AM\n> To: Tristram Ha - C24268\n> Cc: andrew@lunn.ch; muvarov@gmail.com; nathan.leigh.conrad@gmail.com;\n> vivien.didelot@savoirfairelinux.com; f.fainelli@gmail.com;\n> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - C21699\n> Subject: Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver\n> \n> Hi!\n> \n> \n> > +static int ksz_spi_read(struct ksz_device *dev, u32 reg, u8 *data,\n> > +\t\t\tunsigned int len)\n> > +{\n> > +\tstruct spi_device *spi = dev->priv;\n> > +\n> > +\treturn ksz_spi_read_reg(spi, reg, data, len); }\n> > +\n> > +static int ksz_spi_read8(struct ksz_device *dev, u32 reg, u8 *val) {\n> > +\treturn ksz_spi_read(dev, reg, val, 1); }\n> > +\n> > +static int ksz_spi_read16(struct ksz_device *dev, u32 reg, u16 *val) {\n> > +\tint ret = ksz_spi_read(dev, reg, (u8 *)val, 2);\n> > +\n> > +\tif (!ret)\n> > +\t\t*val = be16_to_cpu(*val);\n> > +\n> > +\treturn ret;\n> > +}\n> \n> > +static int ksz_spi_read32(struct ksz_device *dev, u32 reg, u32 *val) {\n> > +\tint ret = ksz_spi_read(dev, reg, (u8 *)val, 4);\n> > +\n> > +\tif (!ret)\n> > +\t\t*val = be32_to_cpu(*val);\n> > +\n> > +\treturn ret;\n> > +}\n> \n> Please format according to CodingStyle. (Not only this.)\n> \n> And this will be common for more drivers. Can it go to a header file\n> and be included...?\n> \n\nSorry about the formatting.  It seems my e-mail system needs to be checked\nto make sure it does not auto-format the contents again.\n\nAbout the SPI access functions they are the same for each driver except the\nlow level ksz_spi_read_reg and ksz_spi_write_reg.  The dev_io_ops structure\nshould contain only those 2 and ksz_spi_get and ksz_spi_set.\n\nBut that requires changing ksz_spi.c.  The idea was to keep the code of\nKSZ9477 driver with little change as possible while introducing another driver.\n\nThe KSZ9477 driver will need to be updated with some of the code in KSZ8795\ndriver regarding port membership and MIB counter reading.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpkyy2RWRz9sBW\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 03:36:58 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756618AbdIHRgc convert rfc822-to-8bit (ORCPT\n\t<rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 8 Sep 2017 13:36:32 -0400","from esa6.microchip.iphmx.com ([216.71.154.253]:29425 \"EHLO\n\tesa6.microchip.iphmx.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1755541AbdIHRgb (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 8 Sep 2017 13:36:31 -0400","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t08 Sep 2017 10:35:41 -0700","from CHN-SV-EXMX02.mchp-main.com ([fe80::7dfe:3761:863e:3963]) by\n\tCHN-SV-EXCH06.mchp-main.com ([fe80::5404:4dc9:559:e436%16]) with\n\tmapi id 14.03.0352.000; Fri, 8 Sep 2017 10:35:41 -0700"],"X-IronPort-AV":"E=Sophos;i=\"5.42,362,1500966000\"; d=\"scan'208\";a=\"4307984\"","From":"<Tristram.Ha@microchip.com>","To":"<pavel@ucw.cz>","CC":"<andrew@lunn.ch>, <muvarov@gmail.com>, <nathan.leigh.conrad@gmail.com>,\n\t<vivien.didelot@savoirfairelinux.com>, <f.fainelli@gmail.com>,\n\t<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,\n\t<Woojung.Huh@microchip.com>","Subject":"RE: [PATCH RFC 5/5] Add KSZ8795 SPI driver","Thread-Topic":"[PATCH RFC 5/5] Add KSZ8795 SPI driver","Thread-Index":"AdMoGvAezSITRaBURlyseL7iLp2KMAAA4j3gACgt1gAAAdVokA==","Date":"Fri, 8 Sep 2017 17:35:40 +0000","Message-ID":"<93AF473E2DA327428DE3D46B72B1E9FD41121E1C@CHN-SV-EXMX02.mchp-main.com>","References":"<93AF473E2DA327428DE3D46B72B1E9FD41121A95@CHN-SV-EXMX02.mchp-main.com>\n\t<20170908092614.GB18365@amd>","In-Reply-To":"<20170908092614.GB18365@amd>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-originating-ip":"[10.10.76.4]","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"8BIT","MIME-Version":"1.0","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1765576,"web_url":"http://patchwork.ozlabs.org/comment/1765576/","msgid":"<20170908183729.GK25219@lunn.ch>","list_archive_url":null,"date":"2017-09-08T18:37:29","subject":"Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver","submitter":{"id":13608,"url":"http://patchwork.ozlabs.org/api/people/13608/","name":"Andrew Lunn","email":"andrew@lunn.ch"},"content":"> Sorry about the formatting.  It seems my e-mail system needs to be checked\n> to make sure it does not auto-format the contents again.\n\nI've never seen issues like this with git send-email. Please use\nit. Email problems generally happen with the client, not the\nbackend. What client did you use to send these patches?\n\n> About the SPI access functions they are the same for each driver except the\n> low level ksz_spi_read_reg and ksz_spi_write_reg.  The dev_io_ops structure\n> should contain only those 2 and ksz_spi_get and ksz_spi_set.\n> \n> But that requires changing ksz_spi.c.  The idea was to keep the code of\n> KSZ9477 driver with little change as possible while introducing another driver.\n\nMaintainability is always the primary goal. If you need to change the\nKSZ9477 code to make the whole more maintainable, do so. Just make it\nlots of small, easy to review, obviously correct changes.\n\n     Andrew","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpmK32fbQz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 04:37:43 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1756877AbdIHShc (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 8 Sep 2017 14:37:32 -0400","from vps0.lunn.ch ([178.209.37.122]:33521 \"EHLO vps0.lunn.ch\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1756750AbdIHShb (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tFri, 8 Sep 2017 14:37:31 -0400","from andrew by vps0.lunn.ch with local (Exim 4.84_2)\n\t(envelope-from <andrew@lunn.ch>)\n\tid 1dqO9h-0002qE-J4; Fri, 08 Sep 2017 20:37:29 +0200"],"Date":"Fri, 8 Sep 2017 20:37:29 +0200","From":"Andrew Lunn <andrew@lunn.ch>","To":"Tristram.Ha@microchip.com","Cc":"pavel@ucw.cz, muvarov@gmail.com, nathan.leigh.conrad@gmail.com,\n\tvivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com,\n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tWoojung.Huh@microchip.com","Subject":"Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver","Message-ID":"<20170908183729.GK25219@lunn.ch>","References":"<93AF473E2DA327428DE3D46B72B1E9FD41121A95@CHN-SV-EXMX02.mchp-main.com>\n\t<20170908092614.GB18365@amd>\n\t<93AF473E2DA327428DE3D46B72B1E9FD41121E1C@CHN-SV-EXMX02.mchp-main.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<93AF473E2DA327428DE3D46B72B1E9FD41121E1C@CHN-SV-EXMX02.mchp-main.com>","User-Agent":"Mutt/1.5.23 (2014-03-12)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1765630,"web_url":"http://patchwork.ozlabs.org/comment/1765630/","msgid":"<20170908215536.GE27428@amd>","list_archive_url":null,"date":"2017-09-08T21:55:36","subject":"Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver","submitter":{"id":2109,"url":"http://patchwork.ozlabs.org/api/people/2109/","name":"Pavel Machek","email":"pavel@ucw.cz"},"content":"Hi!\n\n> > Please format according to CodingStyle. (Not only this.)\n> > \n> > And this will be common for more drivers. Can it go to a header file\n> > and be included...?\n> > \n> \n> Sorry about the formatting.  It seems my e-mail system needs to be checked\n> to make sure it does not auto-format the contents again.\n> \n> About the SPI access functions they are the same for each driver except the\n> low level ksz_spi_read_reg and ksz_spi_write_reg.  The dev_io_ops structure\n> should contain only those 2 and ksz_spi_get and ksz_spi_set.\n> \n> But that requires changing ksz_spi.c.  The idea was to keep the code of\n> KSZ9477 driver with little change as possible while introducing another driver.\n\nSo we change ksz_spi.c. Goal is to have clean code.\n\nThanks,\n\t\t\t\t\t\t\t\t\tPavel","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xprjf4kmMz9s7h\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 07:55:50 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1757224AbdIHVzj (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 8 Sep 2017 17:55:39 -0400","from atrey.karlin.mff.cuni.cz ([195.113.26.193]:59591 \"EHLO\n\tatrey.karlin.mff.cuni.cz\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1757069AbdIHVzi (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 8 Sep 2017 17:55:38 -0400","by atrey.karlin.mff.cuni.cz (Postfix, from userid 512)\n\tid C1753823A0; Fri,  8 Sep 2017 23:55:36 +0200 (CEST)"],"Date":"Fri, 8 Sep 2017 23:55:36 +0200","From":"Pavel Machek <pavel@ucw.cz>","To":"Tristram.Ha@microchip.com","Cc":"andrew@lunn.ch, muvarov@gmail.com, nathan.leigh.conrad@gmail.com,\n\tvivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com,\n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tWoojung.Huh@microchip.com","Subject":"Re: [PATCH RFC 5/5] Add KSZ8795 SPI driver","Message-ID":"<20170908215536.GE27428@amd>","References":"<93AF473E2DA327428DE3D46B72B1E9FD41121A95@CHN-SV-EXMX02.mchp-main.com>\n\t<20170908092614.GB18365@amd>\n\t<93AF473E2DA327428DE3D46B72B1E9FD41121E1C@CHN-SV-EXMX02.mchp-main.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha1;\n\tprotocol=\"application/pgp-signature\"; boundary=\"a1QUDc0q7S3U7/Jg\"","Content-Disposition":"inline","In-Reply-To":"<93AF473E2DA327428DE3D46B72B1E9FD41121E1C@CHN-SV-EXMX02.mchp-main.com>","User-Agent":"Mutt/1.5.23 (2014-03-12)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]