[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN1PR11MB04466F00195C1B566E415355ECBD0@SN1PR11MB0446.namprd11.prod.outlook.com>
Date: Tue, 18 Dec 2018 04:16:31 +0000
From: <Tristram.Ha@...rochip.com>
To: <sergio.paracuellos@...il.com>
CC: <vivien.didelot@...oirfairelinux.com>,
<UNGLinuxDriver@...rochip.com>, <netdev@...r.kernel.org>,
<dan.carpenter@...cle.com>, <marex@...x.de>,
<f.fainelli@...il.com>, <andrew@...n.ch>, <pavel@....cz>
Subject: RE: [PATCH RFC net-next] net: dsa: microchip: add KSZ9477 I2C driver
Sorry about the patch. I know you were using the code from the new SPI and old I2C drivers to come up with your patch. You can incorporate the changes and test the driver and re-submit the patch if you want.
Your i2c_probe function displays an error message when ksz9477_switch_register is not successful. It is likely the error code is from the dsa_register_switch function when the core DSA driver is not loaded yet.
All the register access functions in ksz_io_ops structure will be called by the driver code. The length should always be non-zero. The set and get functions can be invoked by the standard kernel register access API, which is called in user space. The functions that handle this API make sure the length is non-zero before continuing. For switches with simple register set the get function can dump all registers in one call.
I am not sure this register access API is allowed anymore as this may create a security hole in the kernel, but it helps greatly during development and testing as the driver is quite opaque to display the hardware state when something is wrong.
A little out-of-topic is the modalias now returns a different string rather than "i2c:ksz9477." This is done with the "cat /sys/bus/i2c/devices/0-005f/modalias" command. The string looks legit but it is difficult for regular users to get anything from it.
Powered by blists - more mailing lists