From: Marek Vasut Subject: Re: [RFT][PATCH 4/7] net: dsa: microchip: Remove dev->txbuf Date: Fri, 21 Dec 2018 03:04:36 +0100 Message-ID: <2ce5048e-bd16-6bd6-4a48-ef6a48a7d4da@denx.de> References: <20181220010647.4059-1-marex@denx.de> <20181220010647.4059-5-marex@denx.de> <20181220094148.GA13180@lunn.ch> <8063bc0d-d6ea-4416-f7e0-f65d8a36af18@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Woojung.Huh@microchip.com, andrew@lunn.ch, f.fainelli@gmail.com To: Tristram.Ha@microchip.com Return-path: Received: from mail-out.m-online.net ([212.18.0.10]:34725 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731068AbeLUCcJ (ORCPT ); Thu, 20 Dec 2018 21:32:09 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/21/2018 02:02 AM, Tristram.Ha@microchip.com wrote: >> On 12/20/2018 10:41 AM, Andrew Lunn wrote: >>> On Wed, Dec 19, 2018 at 05:20:33PM -0800, Florian Fainelli wrote: >>>> On 12/19/18 5:06 PM, Marek Vasut wrote: >>>>> Previous patches unconver that ksz_spi_write() is always ever called >>>>> with len = 1, 2 or 4. We can thus drop the if (len > SPI_TX_BUF_LEN) >>>>> check and we can also drop the allocation of the txbuf which is part >>>>> of the driver data. This wastes 256 bytes for no reason and can be >>>>> replaced with 8-byte stack allocated buffer, which is what this patch >>>>> does. This is an intermediate step though, which will go away after >>>>> regmap conversion. > > The switch uses auto address increment and can return the whole register > space in 1 transfer. Most switches have only 256 registers, so I just stopped > at that number for KSZ9477. > > This read operation is mostly done by users to dump the registers for debugging. > The write operation can be used to setup registers from a file. > > I mentioned before the driver can use the standard Linux register access API for > users to read the chip. Maybe you also want to try that for debugging. The bulk IO is never used in the driver, ever, so that's not really a concern. Although, you can use the regmap to read (and write, if you enable it) registers via debugfs. -- Best regards, Marek Vasut