[PATCH v10 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-08-03 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v10 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-08-03 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70

[PATCH v10 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-08-03 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci

[PATCH v10 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-08-03 Thread Sergio Paracuellos
is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos --- drivers/staging/Kconfig | 2 + drivers/staging

[PATCH v10 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-08-03 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 128

[PATCH v10 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-08-03 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion

[PATCH v10 15/15] staging: mt7621-dts: add pcie controller port registers

2018-08-03 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v10 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-08-03 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v10 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-08-03 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v10 07/15] staging: mt7621-pci: remove unused macros

2018-08-03 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621

[PATCH v10 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-08-03 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14

[PATCH v10 06/15] staging: mt7621-pci: simplify write_config function

2018-08-03 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed

[PATCH v10 05/15] staging: mt7621-pci: simplify read_config function

2018-08-03 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1

[PATCH v10 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-03 Thread Sergio Paracuellos
our of pci_generic_config_[read|write] and change map_bus implemen- tation for hopefully the right one. Best regards, Sergio Paracuellos Sergio Paracuellos (15): staging: mt7621-pci: use generic kernel pci subsystem read and write staging: mt7621-pci: remove dead code derived to not use cus

[PATCH v10 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-08-03 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v10 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-08-03 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers

[PATCH v6 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-07-30 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70

[PATCH v6 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-07-30 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14

[PATCH v6 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-07-30 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v6 06/15] staging: mt7621-pci: simplify write_config function

2018-07-30 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed

[PATCH v6 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-07-30 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v6 15/15] staging: mt7621-dts: add pcie controller port registers

2018-07-30 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v6 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-07-30 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v6 07/15] staging: mt7621-pci: remove unused macros

2018-07-30 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621

[PATCH v6 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-07-30 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v6 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-07-30 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion

[PATCH v6 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-07-30 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci

[PATCH v6 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-07-30 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 153

[PATCH v6 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-30 Thread Sergio Paracuellos
est regards, Sergio Paracuellos Sergio Paracuellos (15): staging: mt7621-pci: use generic kernel pci subsystem read and write staging: mt7621-pci: remove dead code derived to not use custom reads and writes staging: mt7621-pci: add pcie_write and pcie_read helpers staging: mt7621-pci:

[PATCH v6 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-07-30 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers

[PATCH v6 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-30 Thread Sergio Paracuellos
is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos --- drivers/staging/Kconfig | 2 + drivers/staging

[PATCH v6 05/15] staging: mt7621-pci: simplify read_config function

2018-07-30 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1

Re: [PATCH v6 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-30 Thread Sergio Paracuellos
On Tue, Jul 31, 2018 at 08:55:52AM +1000, NeilBrown wrote: > On Mon, Jul 30 2018, Sergio Paracuellos wrote: > > > This patch series include an attempt to avoid the use of custom > > read and writes in driver code and use PCI subsystem common ones. > > > > In order

Re: [PATCH v6 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-30 Thread Sergio Paracuellos
On Tue, Jul 31, 2018 at 03:25:43PM +1000, NeilBrown wrote: > On Tue, Jul 31 2018, Sergio Paracuellos wrote: > > > On Tue, Jul 31, 2018 at 08:55:52AM +1000, NeilBrown wrote: > >> On Mon, Jul 30 2018, Sergio Paracuellos wrote: > >> > >> > This patch

Re: [PATCH v6 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-30 Thread Sergio Paracuellos
On Tue, Jul 31, 2018 at 08:55:52AM +1000, NeilBrown wrote: > On Mon, Jul 30 2018, Sergio Paracuellos wrote: > > > This patch series include an attempt to avoid the use of custom > > read and writes in driver code and use PCI subsystem common ones. > > > > In order

Re: [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-26 Thread Sergio Paracuellos
On Thu, Jul 26, 2018 at 6:50 AM, NeilBrown wrote: > On Wed, Jul 25 2018, Sergio Paracuellos wrote: > >> On Wed, Jul 25, 2018 at 08:21:35AM +1000, NeilBrown wrote: >>> On Mon, Jul 16 2018, Sergio Paracuellos wrote: >>> >>> > This patch series inc

Re: [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-26 Thread Sergio Paracuellos
On Thu, Jul 26, 2018 at 04:45:41PM +1000, NeilBrown wrote: > On Thu, Jul 26 2018, Sergio Paracuellos wrote: > > > On Thu, Jul 26, 2018 at 6:50 AM, NeilBrown wrote: > >> On Wed, Jul 25 2018, Sergio Paracuellos wrote: > >> > >>> On Wed, Jul 25,

Re: [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-26 Thread Sergio Paracuellos
On Thu, Jul 26, 2018 at 04:45:41PM +1000, NeilBrown wrote: > On Thu, Jul 26 2018, Sergio Paracuellos wrote: > > > On Thu, Jul 26, 2018 at 6:50 AM, NeilBrown wrote: > >> On Wed, Jul 25 2018, Sergio Paracuellos wrote: > >> > >>> On Wed, Jul 25,

Re: [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-26 Thread Sergio Paracuellos
On Thu, Jul 26, 2018 at 08:02:17PM +1000, NeilBrown wrote: > On Thu, Jul 26 2018, Sergio Paracuellos wrote: > > > > > Ok, I think the problem is we are not setting the bridge->windows retrieved > > with devm_request_pci_bus_resources in "res".

[PATCH v7 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-07-31 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 135

[PATCH v7 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-07-31 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers

[PATCH v7 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-31 Thread Sergio Paracuellos
]32 in favour of pci_generic_config_[read|write] and change map_bus implemen- tation for hopefully the right one. Best regards, Sergio Paracuellos Sergio Paracuellos (15): staging: mt7621-pci: use generic kernel pci subsystem read and write staging: mt7621-pci: remove dead c

[PATCH v7 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-07-31 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70

[PATCH v7 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-07-31 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v7 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-07-31 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion

[PATCH v7 05/15] staging: mt7621-pci: simplify read_config function

2018-07-31 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1

[PATCH v7 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-07-31 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci

[PATCH v7 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-07-31 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v7 07/15] staging: mt7621-pci: remove unused macros

2018-07-31 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621

[PATCH v7 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-07-31 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v7 15/15] staging: mt7621-dts: add pcie controller port registers

2018-07-31 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v7 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-31 Thread Sergio Paracuellos
is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos --- drivers/staging/Kconfig | 2 + drivers/staging

[PATCH v7 06/15] staging: mt7621-pci: simplify write_config function

2018-07-31 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed

[PATCH v7 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-07-31 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v7 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-07-31 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14

Re: [PATCH v6 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-31 Thread Sergio Paracuellos
On Tue, Jul 31, 2018 at 03:25:43PM +1000, NeilBrown wrote: > On Tue, Jul 31 2018, Sergio Paracuellos wrote: > > > On Tue, Jul 31, 2018 at 08:55:52AM +1000, NeilBrown wrote: > >> On Mon, Jul 30 2018, Sergio Paracuellos wrote: > >> > >> > This patch

Re: [PATCH v7 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-31 Thread Sergio Paracuellos
On Wed, Aug 01, 2018 at 07:56:38AM +1000, NeilBrown wrote: > On Tue, Jul 31 2018, Sergio Paracuellos wrote: > > > This patch series include an attempt to avoid the use of custom > > read and writes in driver code and use PCI subsystem common ones. > > > > In order

[PATCH v8 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-08-01 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v8 05/15] staging: mt7621-pci: simplify read_config function

2018-08-01 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1

[PATCH v8 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
]32 in favour of pci_generic_config_[read|write] and change map_bus implemen- tation for hopefully the right one. Best regards, Sergio Paracuellos Sergio Paracuellos (15): staging: mt7621-pci: use generic kernel pci subsystem read and write staging: mt7621-pci: remove dead c

[PATCH v8 15/15] staging: mt7621-dts: add pcie controller port registers

2018-08-01 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v8 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v8 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-08-01 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v8 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v8 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-08-01 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion

[PATCH v8 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-08-01 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci

[PATCH v8 07/15] staging: mt7621-pci: remove unused macros

2018-08-01 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621

[PATCH v8 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-08-01 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70

[PATCH v8 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-08-01 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14

[PATCH v8 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-08-01 Thread Sergio Paracuellos
is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos --- drivers/staging/Kconfig | 2 + drivers/staging

[PATCH v8 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-08-01 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 128

[PATCH v8 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-08-01 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers

[PATCH v8 06/15] staging: mt7621-pci: simplify write_config function

2018-08-01 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed

Re: [PATCH v7 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
On Wed, Aug 1, 2018 at 6:37 AM, Sergio Paracuellos wrote: > On Wed, Aug 01, 2018 at 07:56:38AM +1000, NeilBrown wrote: >> On Tue, Jul 31 2018, Sergio Paracuellos wrote: >> >> > This patch series include an attempt to avoid the use of custom >> > read and

Re: [PATCH v8 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-01 Thread Sergio Paracuellos
On Thu, Aug 02, 2018 at 08:09:48AM +1000, NeilBrown wrote: > On Wed, Aug 01 2018, Sergio Paracuellos wrote: > > > This patch series include an attempt to avoid the use of custom > > read and writes in driver code and use PCI subsystem common ones. > > > > In order

[PATCH v9 06/15] staging: mt7621-pci: simplify write_config function

2018-08-02 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed

[PATCH v9 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers

2018-08-02 Thread Sergio Paracuellos
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers

[PATCH v9 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR

2018-08-02 Thread Sergio Paracuellos
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621

[PATCH v9 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes

2018-08-02 Thread Sergio Paracuellos
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 128

[PATCH v9 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config

2018-08-02 Thread Sergio Paracuellos
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 67 - 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v9 09/15] staging: mt7621-pci: review includes putting them in alphabethic order

2018-08-02 Thread Sergio Paracuellos
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 22 -- 1 file changed, 8 insertions(+), 14

[PATCH v9 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-08-02 Thread Sergio Paracuellos
lly the right one. Best regards, Sergio Paracuellos Sergio Paracuellos (15): staging: mt7621-pci: use generic kernel pci subsystem read and write staging: mt7621-pci: remove dead code derived to not use custom reads and writes staging: mt7621-pci: add pcie_write and pcie_read helpers stag

[PATCH v9 07/15] staging: mt7621-pci: remove unused macros

2018-08-02 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621

[PATCH v9 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-08-02 Thread Sergio Paracuellos
is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos --- drivers/staging/Kconfig | 2 + drivers/staging

[PATCH v9 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions

2018-08-02 Thread Sergio Paracuellos
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci

[PATCH v9 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition

2018-08-02 Thread Sergio Paracuellos
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621

[PATCH v9 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-08-02 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v9 05/15] staging: mt7621-pci: simplify read_config function

2018-08-02 Thread Sergio Paracuellos
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 32 +++- 1

[PATCH v9 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]

2018-08-02 Thread Sergio Paracuellos
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 70

[PATCH v9 15/15] staging: mt7621-dts: add pcie controller port registers

2018-08-02 Thread Sergio Paracuellos
The pcie node of the device tree only contains registers for the host-bridge and pcie port 0. Add the pcie port 1 and pcie port 2 also. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v9 14/15] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-08-02 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 + 1 file changed, 1 insertion

Re: [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-26 Thread Sergio Paracuellos
On Thu, Jul 26, 2018 at 1:24 PM, Sergio Paracuellos wrote: > On Thu, Jul 26, 2018 at 08:02:17PM +1000, NeilBrown wrote: >> On Thu, Jul 26 2018, Sergio Paracuellos wrote: >> >> > >> > Ok, I think the problem is we are not sett

Re: [PATCH v5 01/16] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-30 Thread Sergio Paracuellos
On Mon, Jul 30, 2018 at 03:20:47PM +1000, NeilBrown wrote: > On Fri, Jul 27 2018, Sergio Paracuellos wrote: > > > map_bus callback is called before every .read/.write operation. > > Implement it and change custom read write operations for the > > pci subsystem generics.

Re: [PATCH v5 01/16] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-29 Thread Sergio Paracuellos
On Mon, Jul 30, 2018 at 03:20:47PM +1000, NeilBrown wrote: > On Fri, Jul 27 2018, Sergio Paracuellos wrote: > > > map_bus callback is called before every .read/.write operation. > > Implement it and change custom read write operations for the > > pci subsystem generics.

Re: [PATCH v5 01/16] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-30 Thread Sergio Paracuellos
On Mon, Jul 30, 2018 at 05:05:15PM +1000, NeilBrown wrote: > On Mon, Jul 30 2018, Sergio Paracuellos wrote: > > > On Mon, Jul 30, 2018 at 03:20:47PM +1000, NeilBrown wrote: > >> On Fri, Jul 27 2018, Sergio Paracuellos wrote: > >> > >> > map_bus ca

[PATCH v5 12/18] staging: mt7621-pci: use BIT macro in preprocessor definitions

2018-07-27 Thread Sergio Paracuellos
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v5 07/18] staging: mt7621-pci: remove unused macros

2018-07-27 Thread Sergio Paracuellos
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 29 + 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging

[PATCH v5 14/18] staging: mt7621-pci: remove remaining pci_legacy dependant code

2018-07-27 Thread Sergio Paracuellos
pcibios_* remaining code is not neccessary at all. We are mapping irq using of_irq_parse_and_map_pci and swizzle_irq which are set in driver 'probe' function. Remove this code. No kernel config option CONFIG_PCI_DRIVERS_LEGACY should be included anymore. Signed-off-by: Sergio Paracuellos

[PATCH v5 00/18] staging: mt7621-pci: avoid custom pci config read and writes

2018-07-27 Thread Sergio Paracuellos
ate a new port structure (platform has 3 pcie controllers) - Replace the use of pci_generic_config_[read|write]32 in favour of pci_generic_config_[read|write] and change map_bus implemen- tation for hopefully the right one. Best regards, Sergio Paracuellos Sergio Paracuellos

[PATCH v5 06/18] staging: mt7621-pci: simplify write_config function

2018-07-27 Thread Sergio Paracuellos
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 20 +--- 1 file changed

<    4   5   6   7   8   9   10   11   12   13   >