[PATCH 0/1] MIPS: fix optimised memset returning garbage

2022-03-10 Thread Denis Orlov
the assembler to properly place move in delay slot (as it is done in Linux now - see 68dec269ee29c3abfd09596fbee7e40d875a6ab3) - that is what is done in patch. Denis Orlov (1): MIPS: fix optimised memset returning garbage arch/mips/lib/memset.S | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 1/1] MIPS: fix optimised memset returning garbage

2022-03-10 Thread Denis Orlov
There is a subtle bug in arch/mips/lib/memset.S, which results in not writing the correct return value into v0 register if the value to fill memory with is 0. Signed-off-by: Denis Orlov --- arch/mips/lib/memset.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/lib

[PATCH v2] MIPS: fix optimised memset returning garbage

2022-03-10 Thread Denis Orlov
a583158c9ce822c96a718fbf877cec1e5f9ad75d). Or, rather, the move and the branch instruction could be swapped, thus allowing the assembler to properly place move in delay slot (as it is done in Linux now - see 68dec269ee29c3abfd09596fbee7e40d875a6ab3) - that is what is done in this patch. Signed-off-by: Denis Orlov --- arch

[PATCH 2/2] usb: host: ehci: reorder code in ehci_probe()

2022-03-01 Thread Denis Orlov
Currently, after successful memory region requests the driver initialization could still fail, leaving those regions allocated. By reordering the code those requests can be placed later, after the possibly failing calls. Signed-off-by: Denis Orlov --- drivers/usb/host/ehci-hcd.c | 28

[PATCH 1/2] usb: host: ehci: add GENERIC_PHY dependency to Kconfig

2022-03-01 Thread Denis Orlov
With GENERIC_PHY disabled, EHCI driver initialization fails in ehci_probe() as calling phy_optional_get() returns "Function not implemented" value. So it seems reasonable to make USB_EHCI explicitly depend on GENERIC_PHY. Signed-off-by: Denis Orlov --- drivers/usb/host/Kconfig | 1

[PATCH] ata: ide-sff: fix integer overflow in ata_wait_busy()

2022-03-29 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ide-sff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ide-sff.c b/drivers/ata/ide-sff.c index 7884b62bab..69055e0585 100644 --- a/drivers/ata/ide-sff.c +++ b/drivers/ata/ide-sff.c @@ -96,7 +96,7 @@ static int

[PATCH] ata: disk_ata_drive: clean up code in ata_dump_id()

2022-04-26 Thread Denis Orlov
Add missing macros and fix misspellings. Signed-off-by: Denis Orlov --- drivers/ata/disk_ata_drive.c | 23 +-- include/ata_drive.h | 5 + 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata

[PATCH] clk: fix clk_round_rate() behaviour

2022-05-16 Thread Denis Orlov
that clk_round_rate() returns the frequency that was given as argument in this case. Signed-off-by: Denis Orlov --- drivers/clk/clk.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 52e309e877..7492717d3c 100644 --- a/drivers/clk/clk.c

[PATCH] clk: fix clk_round_rate command description

2022-05-20 Thread Denis Orlov
Signed-off-by: Denis Orlov --- commands/clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/clk.c b/commands/clk.c index 0f7d7422e9..dfbc7c988f 100644 --- a/commands/clk.c +++ b/commands/clk.c @@ -99,12 +99,12 @@ static int do_clk_round_rate(int argc, char

[PATCH 0/7] e1000 and rtl8169 drivers fixes

2022-07-20 Thread Denis Orlov
Denis Orlov (7): net: e1000: remove superfluous allocation check net: e1000: properly read/write MDI registers on 8254x cards net: e1000: do not actually acquire/put swfw_sync on 8254x cards net: e1000: configure tx/rx and rctl in open() instead of init() net: rtl8169: properly map rx/tx

[PATCH 1/7] net: e1000: remove superfluous allocation check

2022-07-20 Thread Denis Orlov
dma_alloc() calls xmemalign which panics if unable to allocate memory, so there is no need to check the returned pointer for validity. Signed-off-by: Denis Orlov --- drivers/net/e1000/main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000

[PATCH 3/7] net: e1000: do not actually acquire/put swfw_sync on 8254x cards

2022-07-20 Thread Denis Orlov
There is no Software-Firmware Synchronization register on these controllers. Signed-off-by: Denis Orlov --- drivers/net/e1000/main.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index 3b45fb3b51..4ca598eb2f 100644 --- a/drivers

[PATCH 4/7] net: e1000: configure tx/rx and rctl in open() instead of init()

2022-07-20 Thread Denis Orlov
Otherwise, ifdowning the interface leads to a state in which trying to ifup it again fails. Signed-off-by: Denis Orlov --- drivers/net/e1000/main.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index

[PATCH 7/7] net: rtl8169: free allocated memory on halt()

2022-07-20 Thread Denis Orlov
Otherwise it just leaks. Signed-off-by: Denis Orlov --- drivers/net/rtl8169.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index 4b40c539dd..e923e179bf 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -478,6

[PATCH 6/7] net: rtl8169: enable pci device bus mastering on ifup

2022-07-20 Thread Denis Orlov
Otherwise, the board hangs on doing ifup after ifdown as the latter disables bus mastering for the device in rtl8169_eth_halt(). Signed-off-by: Denis Orlov --- drivers/net/rtl8169.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index

[PATCH 2/7] net: e1000: properly read/write MDI registers on 8254x cards

2022-07-20 Thread Denis Orlov
Taken from Linux e1000 driver. Signed-off-by: Denis Orlov --- drivers/net/e1000/e1000.h | 3 +++ drivers/net/e1000/main.c | 22 ++ 2 files changed, 25 insertions(+) diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 52ad3d4cdb..3a5ee9988e 100644

[PATCH 5/7] net: rtl8169: properly map rx/tx buffers for dma

2022-07-20 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/net/rtl8169.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index 341f5f240e..e78cc40ffe 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169

[PATCH 02/16] ata: ahci: replace magic numbers with named constants

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 21 +++-- drivers/ata/ahci.h | 12 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ad9e2f950f..c64c856f94 100644 --- a/drivers/ata/ahci.c +++ b/drivers

[PATCH 03/16] ata: ahci: fix missing whitespace in ahci_add_host()

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index c64c856f94..5aab81fcef 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -596,7 +596,7 @@ int ahci_add_host(struct

[PATCH 04/16] ata: ahci: simplify fis structure creation

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 5aab81fcef..026f83046c 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -192,14 +192,12

[PATCH 01/16] ata: ahci: use abstract read/write functions uniformly

2022-05-04 Thread Denis Orlov
Currently those are used in some routines side by side with underlying functions with no apparent reason for it. Make their usage uniform, this cleans up code a bit and allows to remove unneeded variables. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 18 +++--- 1 file changed

[PATCH 16/16] ata: ahci: allocate memory in one call in ahci_init_port()

2022-05-04 Thread Denis Orlov
Memory allocated with dma_alloc_coherent() is aligned by page size. Calling it multiple times leads to unnecessary fragmentation and overhead considering that we are actually able to allocate all the memory that we need at once by issuing only one call. Signed-off-by: Denis Orlov --- drivers

[PATCH 15/16] ata: ahci: register only implemented ports

2022-05-04 Thread Denis Orlov
The value from the "ports implemented" register should be kept in mind when registering ports or detecting devices on them. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci.c b/d

[PATCH 14/16] ata: ahci: remove redundant cast in ahci_io()

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2d5adcfca9..f9056ff418 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -171,7 +171,7 @@ static int ahci_io(struct

[PATCH 13/16] ata: ahci: add missing capability in ahci_print_info()

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 23085ebe09..2d5adcfca9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -532,6 +532,7 @@ void ahci_print_info(struct ahci_device *ahci

[PATCH 08/16] ata: ahci: properly fill scatter/gather table

2022-05-04 Thread Denis Orlov
We are supposed to populate a table, but instead we were just overwriting the same entry over and over in a loop. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index f7eb35c09d..2d7b527755 100644

[PATCH 10/16] ata: ahci: map buffers properly

2022-05-04 Thread Denis Orlov
Using dma_sync_single_for_*() does not make sense in there - we are given a cpu side address of a buffer and need to actually map it for the device. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions

[PATCH 12/16] ata: ahci: make rx_fis field in ahci_port of type void*

2022-05-04 Thread Denis Orlov
It is supposed to represent a pointer so make it actually be one. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 5 ++--- drivers/ata/ahci.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index d423da3a48..23085ebe09 100644

[PATCH 11/16] ata: ahci: use 64-bit addressing if available

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ff9093c7b7..d423da3a48 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -117,8 +117,10 @@ static

[PATCH 05/16] ata: ahci: do not ignore dma handles

2022-05-04 Thread Denis Orlov
They represent addresses from the device side and should be used instead of cpu side ones when populating device registers than hold addresses. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 21 - drivers/ata/ahci.h | 3 +++ 2 files changed, 15 insertions(+), 9

[PATCH 06/16] ata: ahci: adjust debug messages in ahci_init_port()

2022-05-04 Thread Denis Orlov
The output was a bit misleading, not displaying physical addresses while for some reason using "dma" to specify a variable in one case. Make it print both types of addresses. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletion

[PATCH 07/16] ata: ahci: correct named constants values and names

2022-05-04 Thread Denis Orlov
a somewhat misleading comment that calls the command list a command table. There is a cmt_tbl field that actually holds a pointer to a different structure that is called a command table in the specification, so it seems better to more clearly disambiguate them. Signed-off-by: Denis Orlov

[PATCH 09/16] ata: ahci: use named constants for capabilities bits

2022-05-04 Thread Denis Orlov
Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 51 +++--- drivers/ata/ahci.h | 30 +++ 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 2d7b527755..1d8099c2ee 100644

[PATCH] ata: ahci: use correct macro when calculating offsets in dma memory

2022-05-05 Thread Denis Orlov
The macro that indicates the size of a single element in the command list was incorrectly used instead of the macro that stands for the size of the whole list. Signed-off-by: Denis Orlov --- drivers/ata/ahci.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH] net: e1000: fix s in log messages

2022-10-31 Thread Denis Orlov
We do not have an edev.dev set up yet when we are filling in the device structure and reading an EEPROM in probe. Besides, using hw->dev for those messages seems more appropriate. Signed-off-by: Denis Orlov --- drivers/net/e1000/eeprom.c | 6 +++--- drivers/net/e1000/main.c | 2 +- 2 fi

[PATCH] reset: add missing stub for of_reset_control_get()

2022-10-31 Thread Denis Orlov
Every other function in reset.h has a corresponding stub that is used when the option RESET_CONTROLLER is disabled in config. This allows for code that uses this function to still be compilable even when the reset controller subsystem is disabled. Signed-off-by: Denis Orlov --- include/linux

[PATCH] ddr_spd: use unsigned type for crc bytes in DDR3/4 SPD check

2023-01-13 Thread Denis Orlov
significant byte set for any of computed CRC bytes thus results in the mismatch being erroneously detected. While at it, also remove redundant type casts. Signed-off-by: Denis Orlov --- common/ddr_spd.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common

[PATCH] net: e1000: read EEPROM through EERD register on 8257x adapters

2023-01-13 Thread Denis Orlov
. Signed-off-by: Denis Orlov --- drivers/net/e1000/eeprom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c index 27143bd6d0..c90faf3a58 100644 --- a/drivers/net/e1000/eeprom.c +++ b/drivers/net/e1000/eeprom.c @@ -495,6 +495,7

[PATCH] lib: string: remove duplicated function

2023-03-16 Thread Denis Orlov
af3cd13501eb04ca61d017ff4406f1cbffafdc04). Signed-off-by: Denis Orlov --- include/linux/string.h | 3 --- lib/string.c | 48 +++--- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/include/linux/string.h b/include/linux/string.h index 0c79d3e5cf

[PATCH 1/3] dma: use dma/cpu conversions correctly in dma_map/unmap_single

2023-03-13 Thread Denis Orlov
called directly, and a virtual address treated as one when called from dma_map funcs. Signed-off-by: Denis Orlov --- drivers/dma/map.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/dma/map.c b/drivers/dma/map.c index 114c0f7db3..fea04c38a3 100644

[PATCH 0/3] MIPS: dma-default: fix dma_sync_single_for_*

2023-03-13 Thread Denis Orlov
This fixes a few issues with streaming DMA functions, which should make those work on real hardware. It also improves the code a bit, removing unnecessary cache flushing in some cases. Denis Orlov (3): dma: use dma/cpu conversions correctly in dma_map/unmap_single MIPS: dma-default: use

[PATCH 2/3] MIPS: dma-default: use virtual addresses when flushing caches

2023-03-13 Thread Denis Orlov
Cache flushing functions expect virtual addresses, so make sure those are properly converted from the physical ones in dma_sync_single_for_*. QEMU doesn't care as it ignores cache instructions, but without such change this code would result in TLB exceptions on real hardware. Signed-off-by: Denis

[PATCH 3/3] MIPS: dma-default: do not flush caches in dma_sync_single_* excessively

2023-03-13 Thread Denis Orlov
(). The functional change itself is taken from Linux commit 'MIPS: make dma_sync_*_for_cpu a little less overzealous' (hash: cbf1449ba5aec9cf4c68b69f899391a8d42e9b8f). Signed-off-by: Denis Orlov --- arch/mips/lib/dma-default.c | 36 +--- 1 file changed, 17 insertions

[PATCH 2/3] MIPS: bootm: do not leak memory on error in of_overlay_load_firmware()

2023-03-15 Thread Denis Orlov
Signed-off-by: Denis Orlov --- arch/mips/lib/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 95e9dc0d7d..69ce9b3904 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -69,7 +69,7 @@ static int

[PATCH 3/3] MIPS: bootm: remove unnecessary phys/virt conversions

2023-03-15 Thread Denis Orlov
They are not doing anything there - we should already have proper virtual addresses represented by those pointers. Signed-off-by: Denis Orlov --- arch/mips/lib/bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index

[PATCH 1/3] MIPS: bootm: do not free fdt pointer that contains an error

2023-03-15 Thread Denis Orlov
Also add a proper error message. Signed-off-by: Denis Orlov --- arch/mips/lib/bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 655535737e..95e9dc0d7d 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c

[PATCH 0/3] MIPS: bootm: tiny fixes in do_bootm_elf()

2023-03-15 Thread Denis Orlov
Denis Orlov (3): MIPS: bootm: do not free fdt pointer that contains an error MIPS: bootm: do not leak memory on error in of_overlay_load_firmware() MIPS: bootm: remove unnecessary phys/virt conversions arch/mips/lib/bootm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions

[PATCH] common: elf: use proper field to get segment memory size

2023-03-15 Thread Denis Orlov
', instead of 'p_memsz', to 'request_sdram_region', resulting in potentially smaller amount of memory to be reserved. As 'p_memsz' is always greater or equal to 'p_filesz', use only the former for checking memory requirements in 'request_elf_segment'. Signed-off-by: Denis Orlov --- common/elf.c | 7

Re: [RFC 1/2] dma: rework dma_sync_single interface

2023-03-06 Thread Denis Orlov
Hi! On Fri, 3 Mar 2023 at 13:06, Sascha Hauer wrote: > > Hi Denis, > > On Tue, Feb 28, 2023 at 01:32:47PM +0300, Denis Orlov wrote: > > -#ifndef dma_sync_single_for_device > > -static inline void dma_sync_single_for_device(dma_addr_t a

[RFC 2/2] dma: update dma_sync_single uses in drivers

2023-02-28 Thread Denis Orlov
for those. This should not make any functional change, as there is no driver at the moment that requires non 1-to-1 dma mappings, and thus would actually utilize those device pointers. Signed-off-by: Denis Orlov --- arch/arm/mach-bcm283x/mbox.c| 4 ++-- drivers/crypto/caam/caam

[RFC 1/2] dma: rework dma_sync_single interface

2023-02-28 Thread Denis Orlov
t, i.e. we would have to do all dma/cpu conversions in arch-specific code, unlike how it is done in this patch. This would lead to some code duplication though. TODO: dma_alloc/free_coherent do need same kind of changes to utilise cpu/dma conversions properly Signed-off-by: Denis Orlov --- arch/a

[RFC 0/2] dma: clean up streaming DMA API

2023-02-28 Thread Denis Orlov
usage in drivers. Denis Orlov (2): dma: rework dma_sync_single interface dma: update dma_sync_single uses in drivers arch/arm/cpu/mmu-common.c| 9 +-- arch/arm/cpu/mmu.c | 17 +++-- arch/arm/cpu/mmu_64.c| 13 ++-- arch/arm/include/asm/dma.h

[PATCH] nvme: parse partition table when registering a block device

2023-02-09 Thread Denis Orlov
Otherwise, we can not access file systems located on partitioned NVME drives. Signed-off-by: Denis Orlov --- drivers/nvme/host/core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 79a5f9325e..bf9176ce09 100644 --- a/drivers

[PATCH 1/2] net: rtl8139: remove dependence on MIPS

2023-02-08 Thread Denis Orlov
This driver seems to work fine on ARM64 Virtual Machine in QEMU. Signed-off-by: Denis Orlov --- drivers/net/Kconfig | 1 - drivers/net/rtl8139.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 30de1f544c..86096c07e2 100644 --- a/drivers

[PATCH 2/2] net: rtl8139: fix ifdown/ifup issues

2023-02-08 Thread Denis Orlov
This moves PCI bus-mastering enable from 'init' to 'open', allowing to bring an interface up after bringing it down. Also add corresponding dma_free_coherent() calls into 'close', getting rid of memory leaks. Signed-off-by: Denis Orlov --- drivers/net/rtl8139.c | 8 +++- 1 file changed, 7

[PATCH] fixup! net: rtl8139: fix ifdown/ifup issues

2023-02-08 Thread Denis Orlov
Fixes a typo. Signed-off-by: Denis Orlov --- drivers/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index 1cd2ae14de..5c91c10fea 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -412,7 +412,7

[PATCH 1/2] net: e1000: properly map dma allocations

2023-02-10 Thread Denis Orlov
From: Antony Pavlov Signed-off-by: Antony Pavlov Signed-off-by: Denis Orlov --- drivers/net/e1000/e1000.h | 2 ++ drivers/net/e1000/main.c | 8 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 558a4ac271

[PATCH 0/2] make e1000 work on MIPS

2023-02-10 Thread Denis Orlov
With these changes, e1000 driver now works on MIPS Malta in QEMU with the corresponding network controller attached: -netdev user,tftp=/tftpboot,id=net0 -device e1000,netdev=net0 Antony Pavlov (1): net: e1000: properly map dma allocations Denis Orlov (1): dma: use virt/phys conversions

[PATCH 2/2] dma: use virt/phys conversions when no dma_offset is specified

2023-02-10 Thread Denis Orlov
. Signed-off-by: Denis Orlov --- drivers/dma/map.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/dma/map.c b/drivers/dma/map.c index a00abf6421..13dbf2840f 100644 --- a/drivers/dma/map.c +++ b/drivers/dma/map.c @@ -3,25 +3,20

[PATCH 0/4] MIPS: dma: random fixes and improvements

2023-02-10 Thread Denis Orlov
Denis Orlov (4): MIPS: dma: fix nullptr handling in dma_free_coherent MIPS: dma: remove unnecessary ifdefs MIPS: dma: add arch-specific dma_alloc() implementation MIPS: dma: simplify source structure arch/mips/include/asm/dma-mapping.h | 40 --- arch/mips/include

[PATCH 1/4] MIPS: dma: fix nullptr handling in dma_free_coherent

2023-02-10 Thread Denis Orlov
it to free(), actually trying to deallocate stuff. Signed-off-by: Denis Orlov --- arch/mips/include/asm/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index 8e6ea08168..9f6ec03e3b 100644

[PATCH 3/4] MIPS: dma: add arch-specific dma_alloc() implementation

2023-02-10 Thread Denis Orlov
-by: Denis Orlov --- arch/mips/include/asm/dma.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/mips/include/asm/dma.h b/arch/mips/include/asm/dma.h index e0b4689172..49eeaac1a2 100644 --- a/arch/mips/include/asm/dma.h +++ b/arch/mips/include/asm/dma.h @@ -6,6 +6,18 @@ #ifndef

[PATCH 2/4] MIPS: dma: remove unnecessary ifdefs

2023-02-10 Thread Denis Orlov
We do not support any MIPS CPUs that are not MIPS32/MIPS64, so there is no reason to check for those. Signed-off-by: Denis Orlov --- arch/mips/lib/dma-default.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/mips/lib/dma-default.c b/arch/mips/lib/dma-default.c index fbe627c24c

[PATCH 4/4] MIPS: dma: simplify source structure

2023-02-10 Thread Denis Orlov
There is no reason to keep code from 'dma-mapping.h' in a separate file, so merge it into 'dma.h'. Signed-off-by: Denis Orlov --- arch/mips/include/asm/dma-mapping.h | 40 - arch/mips/include/asm/dma.h | 31 +- 2 files changed, 30

Re: [PATCH] Revert "dma: use dma/cpu conversions correctly in dma_map/unmap_single"

2023-05-31 Thread Denis Orlov
Hi! > > On 31.05.23 12:23, Sascha Hauer wrote: > > This reverts commit d13d870986eeecc58d8652268557e4a159b9d4c4. > > > > While the patch itself is correct, it at least breaks USB on the > > Raspberry Pi 3b. > > > > With this patch dma_sync_single_for_device() is passed the DMA address. > > This

[PATCH 1/2] dma: rework dma_sync_single_for_*() interface

2023-06-04 Thread Denis Orlov
he virtual address argument of those arch-side functions be properly represented with a void* type. Apply the required changes in device drivers that use the affected functions, making them pass the appropriate device pointer. Signed-off-by: Denis Orlov --- arch/arm/cpu/dma_32.c | 17 ++

[PATCH v2 0/2] dma: rework streaming DMA interface

2023-06-04 Thread Denis Orlov
merging two parts of the patch and dropping changes not really related to the matter at hand. Denis Orlov (2): dma: rework dma_sync_single_for_*() interface net: macb: remove const from dev pointer in macb_device arch/arm/cpu/dma_32.c | 17 +++--- arch/arm/cpu/dma_64.c

[PATCH 2/2] net: macb: remove const from dev pointer in macb_device

2023-06-04 Thread Denis Orlov
Otherwise, it leads to a bunch of warnings on passing those pointers to dma_*() functions. As every other driver seem to be having non-const dev pointers in their private structs, do the same here. Signed-off-by: Denis Orlov --- drivers/net/macb.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] net: r8169: fix builds on archs without system.h header

2023-06-04 Thread Denis Orlov
that. Signed-off-by: Denis Orlov --- drivers/net/r8169_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/r8169_main.c b/drivers/net/r8169_main.c index 5b448fa029..2225c26190 100644 --- a/drivers/net/r8169_main.c +++ b/drivers/net/r8169_main.c @@ -17,7 +17,6 @@ #include #include

Re: [PATCH 2/3] test: mips: add QEMU Malta 64le labgrid config

2023-06-09 Thread Denis Orlov
On Fri, 9 Jun 2023 at 10:21, Ahmad Fatoum wrote: > > On 09.06.23 09:14, Denis Orlov wrote: > > Hello Ahmad, > > > > On Fri, 9 Jun 2023 at 09:36, Ahmad Fatoum wrote: > >> > >> On 07.06.23 06:59, Denis Orlov wrote: > >>> Signe

Re: [PATCH 2/3] test: mips: add QEMU Malta 64le labgrid config

2023-06-09 Thread Denis Orlov
On Fri, 9 Jun 2023 at 12:28, Ahmad Fatoum wrote: > > On 09.06.23 11:17, Denis Orlov wrote: > > On Fri, 9 Jun 2023 at 10:21, Ahmad Fatoum wrote: > >> > >> On 09.06.23 09:14, Denis Orlov wrote: > >>> Hello Ahmad, > >>>

[PATCH 1/3] include: const: make UL/ULL() macros commonly available

2023-06-08 Thread Denis Orlov
. Signed-off-by: Denis Orlov --- arch/arm/include/asm/memory.h| 5 - arch/arm/include/asm/pgtable64.h | 2 -- arch/kvx/include/asm/sfr_defs.h | 2 -- include/linux/const.h| 10 -- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/arm/include/asm

[PATCH 0/3] include: bitops/const: partial update from Linux

2023-06-08 Thread Denis Orlov
This updates some of the definitions in those files, mainly to make BIT*/GENMASK() macros usable in assembly code. Denis Orlov (3): include: const: make UL/ULL() macros commonly available include: bitops: allow BIT* macros to be used in assembly code include: bitops: import more BITS_TO_

[PATCH 3/3] include: bitops: import more BITS_TO_* defines from linux

2023-06-08 Thread Denis Orlov
Those seem quite useful, e.g. when defining bitmasks. Signed-off-by: Denis Orlov --- include/linux/bitops.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index d9a5a81a9c..a5f6ac6545 100644 --- a/include/linux/bitops.h

[PATCH 2/3] include: bitops: allow BIT* macros to be used in assembly code

2023-06-08 Thread Denis Orlov
Use UL/ULL() macros for those so that corresponding suffixes only appear when we are compiling C code. Hide all the other functions/macros that we can't use in assembly with '#ifndef __ASSEMBLY__'. Signed-off-by: Denis Orlov --- include/linux/bitops.h | 18 -- 1 file changed, 12

Re: [PATCH 3/3] ci: add a job for testing 64BIT MIPS with labgrid

2023-06-09 Thread Denis Orlov
On Fri, 9 Jun 2023 at 09:38, Ahmad Fatoum wrote: > > On 07.06.23 06:59, Denis Orlov wrote: > > Signed-off-by: Denis Orlov > > https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.1.0/ > has a dedicated mips64 toolchain. Given that you don't touch the

Re: [PATCH 2/3] test: mips: add QEMU Malta 64le labgrid config

2023-06-09 Thread Denis Orlov
Hello Ahmad, On Fri, 9 Jun 2023 at 09:36, Ahmad Fatoum wrote: > > On 07.06.23 06:59, Denis Orlov wrote: > > Signed-off-by: Denis Orlov > > --- > > test/mips/qemu-malta64el_defconfig.yaml | 22 ++ > > 1 file changed, 22 insertions(+) > >

[PATCH 0/3] Add CI for MIPS64

2023-06-06 Thread Denis Orlov
supported, so naming it as that seems more fitting for me. And if more MIPS64 boards will get support in the future, then this defconfig might be renamed appropriately. Denis Orlov (3): MIPS: add qemu-malta64el_defconfig test: mips: add QEMU Malta 64le labgrid config ci: add a job for testing

[PATCH 2/3] test: mips: add QEMU Malta 64le labgrid config

2023-06-06 Thread Denis Orlov
Signed-off-by: Denis Orlov --- test/mips/qemu-malta64el_defconfig.yaml | 22 ++ 1 file changed, 22 insertions(+) create mode 100644 test/mips/qemu-malta64el_defconfig.yaml diff --git a/test/mips/qemu-malta64el_defconfig.yaml b/test/mips/qemu-malta64el_defconfig.yaml new

[PATCH 1/3] MIPS: add qemu-malta64el_defconfig

2023-06-06 Thread Denis Orlov
-by: Denis Orlov --- arch/mips/configs/qemu-malta64el_defconfig | 87 ++ 1 file changed, 87 insertions(+) create mode 100644 arch/mips/configs/qemu-malta64el_defconfig diff --git a/arch/mips/configs/qemu-malta64el_defconfig b/arch/mips/configs/qemu-malta64el_defconfig new file

[PATCH 3/3] ci: add a job for testing 64BIT MIPS with labgrid

2023-06-06 Thread Denis Orlov
Signed-off-by: Denis Orlov --- .github/workflows/test-labgrid-pytest.yml | 4 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml index 2c74150066..674e4251d1 100644 --- a/.github/workflows/test-labgrid

[PATCH 15/17] MIPS: add 64-bit support for optimized string functions

2023-06-05 Thread Denis Orlov
at it, this also removes an unused macro define. Signed-off-by: Denis Orlov --- arch/mips/Kconfig | 1 - arch/mips/lib/memcpy.S | 37 - 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index ab8c8cf176..de2f539cc1

[PATCH 05/17] MIPS: pbl: use o32/n64 compatible register definitions

2023-06-05 Thread Denis Orlov
This allows to compile PBL code with n64 ABI, which we use when CONFIG_64BIT is set. Signed-off-by: Denis Orlov --- arch/mips/include/asm/pbl_macros.h | 28 ++-- arch/mips/include/asm/pbl_nmon.h | 10 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff

[PATCH 00/17] MIPS: fix and improve 64BIT support

2023-06-05 Thread Denis Orlov
The existing 64BIT support for MIPS was somewhat incomplete with no board having MIPS64 CPUs specified to be available as targets. Define Malta as supporting those and fix all the compilation and linking errors. Make some optional features available with 64BIT too. Denis Orlov (17): MIPS: malta

[PATCH 10/17] MIPS: fix *ADDR macro usage warnings on CONFIG_64BIT

2023-06-05 Thread Denis Orlov
Fixes "warning: cast from pointer to integer of different size" messages. Signed-off-by: Denis Orlov --- arch/mips/include/asm/dma.h | 16 +--- arch/mips/include/asm/io.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/mips/include/asm/dm

[PATCH 09/17] MIPS: fix addresses of exception vectors in 64-bit mode

2023-06-05 Thread Denis Orlov
Do not (accidentally?) truncate addresses when setting them in the handler array. Signed-off-by: Denis Orlov --- arch/mips/boot/main_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/boot/main_entry.c b/arch/mips/boot/main_entry.c index 2c18bc81c3..d061a0e987

[PATCH 12/17] MIPS: enable 64-bit kernel segment addressing on CONFIG_64BIT

2023-06-05 Thread Denis Orlov
boots into 64BIT barebox in QEMU. Signed-off-by: Denis Orlov --- arch/mips/boot/start.S | 2 ++ arch/mips/include/asm/pbl_macros.h | 11 +++ 2 files changed, 13 insertions(+) diff --git a/arch/mips/boot/start.S b/arch/mips/boot/start.S index 5f134f9ae9..30828ad9ef 100644

[PATCH 07/17] MIPS: use MIPS32/MIPS64 generic instruction macros

2023-06-05 Thread Denis Orlov
stead" warnings when compiling assembly code with CONFIG_64BIT. Signed-off-by: Denis Orlov --- arch/mips/boot/start.S | 2 +- arch/mips/include/asm/asm.h | 10 +- arch/mips/include/asm/debug_ll_ns16550.h | 6 +++--- arch/mips/include/asm/pbl_macros.h

[PATCH 11/17] MIPS: Makefile: sign-extend TEXT_BASE value on CONFIG_64BIT

2023-06-05 Thread Denis Orlov
The code that uses TEXT_BASE will fail on reading truncated 32-bit address if running with 64BIT enabled. As we only support running from compatibility segments (i.e. no 'proper' 64-bit base addresses), simply make sure the value is sign-extended when passing it as a define. Signed-off-by: Denis

[PATCH 14/17] MIPS: pbl_macros: use generic load/store macros in copy_to_link_location

2023-06-05 Thread Denis Orlov
This may speed up this code a little on MIPS64, however this also allows us to get rid of unnecessary macro definition there, simplifying the code a tiny bit. Signed-off-by: Denis Orlov --- arch/mips/include/asm/pbl_macros.h | 21 ++--- 1 file changed, 10 insertions(+), 11

[PATCH 17/17] MIPS: main_entry-pbl: fix conversion warnings on CONFIG_64BIT

2023-06-05 Thread Denis Orlov
Fix "cast from pointer to integer of different size" warnings by casting pointers into unsigned long values when calculating sizes. While at it, simplify code a bit, removing unnecessary variables and instead giving another variable a more comprehensible name. Signed-off-by: D

[PATCH 04/17] MIPS: o32: provide ta0..ta3 register definitions

2023-06-05 Thread Denis Orlov
-by: Denis Orlov --- arch/mips/include/asm/regdef.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/include/asm/regdef.h b/arch/mips/include/asm/regdef.h index 1300251661..df87582e8e 100644 --- a/arch/mips/include/asm/regdef.h +++ b/arch/mips/include/asm/regdef.h @@ -3,6 +3,8

[PATCH 03/17] MIPS: reloc: fix relocation with CONFIG_64BIT enabled

2023-06-05 Thread Denis Orlov
Use CKSEG instead of KSEG, allowing it to compile on 64BIT configurations. Also make sure that we do not truncate target relocation address by writing it into a 32-bit wide variable. Signed-off-by: Denis Orlov --- arch/mips/lib/reloc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions

[PATCH 01/17] MIPS: malta: allow to choose MIPS64 target CPU in config

2023-06-05 Thread Denis Orlov
QEMU is able to emulate malta machine with a variety of MIPS CPUs, including MIPS64 ones, so allow to compile barebox for such configurations. Signed-off-by: Denis Orlov --- arch/mips/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index

[PATCH 08/17] MIPS: malta: fix GT64120 base virtual address on 64BIT

2023-06-05 Thread Denis Orlov
Use CKSEG1ADDR for it to be properly converted to the 64-bit sign-extended address when building with CONFIG_64BIT set. Signed-off-by: Denis Orlov --- arch/mips/mach-malta/include/mach/mach-gt64120.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/mach-malta

[PATCH 06/17] MIPS: pbl: fix linking errors with CONFIG_64BIT

2023-06-05 Thread Denis Orlov
For some reasons, object file format was not passed to the linker when linking PBL, leading for a bunch of "ABI is incompatible with that of the selected emulation" errors. Fix it, and also remove duplicate flags being passed when linking barebox proper. Signed-off-by: Denis Orlov ---

[PATCH 02/17] MIPS: malta: use CKSEG instead of KSEG macros

2023-06-05 Thread Denis Orlov
KSEG macro is not available when compiling with CONFIG_64BIT enabled, so use CKSEG instead. Signed-off-by: Denis Orlov --- arch/mips/boards/qemu-malta/lowlevel.S | 4 ++-- arch/mips/mach-malta/pci.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips

[PATCH 16/17] MIPS: make setjmp/longjmp/initjmp available in 64BIT builds

2023-06-05 Thread Denis Orlov
Make the code compatible with 64-bit configurations by storing saved register values with unsigned long type and using generic macros in assembly code. Signed-off-by: Denis Orlov --- arch/mips/Kconfig | 2 +- arch/mips/include/asm/setjmp.h | 2 +- arch/mips/lib/setjmp.S

[PATCH 13/17] MIPS: traps: fix passing wrong sp when returning from exception

2023-06-05 Thread Denis Orlov
the stack pointer. Signed-off-by: Denis Orlov --- arch/mips/lib/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c index ff0a54af8e..45694fe7ef 100644 --- a/arch/mips/lib/traps.c +++ b/arch/mips/lib/traps.c @@ -173,7 +173

[PATCH 2/2] MIPS: enable more options in malta defconfigs

2023-06-10 Thread Denis Orlov
This mainly enables virtio stuff, but also turns on EXT4 and GPT support. The latter two simplify things somewhat, allowing to mount appropriate images, and are enabled in generic defconfigs for other archs. Signed-off-by: Denis Orlov --- arch/mips/configs/qemu-malta64el_defconfig | 10

  1   2   >