Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors
@ 2021-09-06 12:44 Andy Shevchenko
  2021-09-06 12:44 ` [PATCH v1 net-next 2/2] net: wwan: iosm: Unify IO accessors used in the driver Andy Shevchenko
  2021-09-06 16:00 ` [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-09-06 12:44 UTC (permalink / raw)
  To: M Chetan Kumar, Andy Shevchenko, netdev, linux-kernel
  Cc: Intel Corporation, Loic Poulain, Sergey Ryazanov, Johannes Berg,
	David S. Miller, Jakub Kicinski

The io.*_lo_hi() variants are not strictly needed on the x86 hardware
and especially the PCI bus. Replace them with regular accessors, but
leave headers in place in case of 32-bit build.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mmio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mmio.c b/drivers/net/wwan/iosm/iosm_ipc_mmio.c
index 06c94b1720b6..dadd8fada259 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mmio.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mmio.c
@@ -188,10 +188,10 @@ void ipc_mmio_config(struct iosm_mmio *ipc_mmio)
 	/* AP memory window (full window is open and active so that modem checks
 	 * each AP address) 0 means don't check on modem side.
 	 */
-	iowrite64_lo_hi(0, ipc_mmio->base + ipc_mmio->offset.ap_win_base);
-	iowrite64_lo_hi(0, ipc_mmio->base + ipc_mmio->offset.ap_win_end);
+	iowrite64(0, ipc_mmio->base + ipc_mmio->offset.ap_win_base);
+	iowrite64(0, ipc_mmio->base + ipc_mmio->offset.ap_win_end);
 
-	iowrite64_lo_hi(ipc_mmio->context_info_addr,
+	iowrite64(ipc_mmio->context_info_addr,
 			ipc_mmio->base + ipc_mmio->offset.context_info);
 }
 
@@ -201,7 +201,7 @@ void ipc_mmio_set_psi_addr_and_size(struct iosm_mmio *ipc_mmio, dma_addr_t addr,
 	if (!ipc_mmio)
 		return;
 
-	iowrite64_lo_hi(addr, ipc_mmio->base + ipc_mmio->offset.psi_address);
+	iowrite64(addr, ipc_mmio->base + ipc_mmio->offset.psi_address);
 	writel(size, ipc_mmio->base + ipc_mmio->offset.psi_size);
 }
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 net-next 2/2] net: wwan: iosm: Unify IO accessors used in the driver
  2021-09-06 12:44 [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors Andy Shevchenko
@ 2021-09-06 12:44 ` Andy Shevchenko
  2021-09-06 16:00 ` [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-09-06 12:44 UTC (permalink / raw)
  To: M Chetan Kumar, Andy Shevchenko, netdev, linux-kernel
  Cc: Intel Corporation, Loic Poulain, Sergey Ryazanov, Johannes Berg,
	David S. Miller, Jakub Kicinski

Currently we have readl()/writel()/ioread*()/iowrite*() APIs in use.
Let's unify to use only ioread*()/iowrite*() variants.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mmio.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mmio.c b/drivers/net/wwan/iosm/iosm_ipc_mmio.c
index dadd8fada259..09f94c123531 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mmio.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mmio.c
@@ -69,7 +69,7 @@ void ipc_mmio_update_cp_capability(struct iosm_mmio *ipc_mmio)
 	unsigned int ver;
 
 	ver = ipc_mmio_get_cp_version(ipc_mmio);
-	cp_cap = readl(ipc_mmio->base + ipc_mmio->offset.cp_capability);
+	cp_cap = ioread32(ipc_mmio->base + ipc_mmio->offset.cp_capability);
 
 	ipc_mmio->has_mux_lite = (ver >= IOSM_CP_VERSION) &&
 				 !(cp_cap & DL_AGGR) && !(cp_cap & UL_AGGR);
@@ -150,8 +150,8 @@ enum ipc_mem_exec_stage ipc_mmio_get_exec_stage(struct iosm_mmio *ipc_mmio)
 	if (!ipc_mmio)
 		return IPC_MEM_EXEC_STAGE_INVALID;
 
-	return (enum ipc_mem_exec_stage)readl(ipc_mmio->base +
-					      ipc_mmio->offset.exec_stage);
+	return (enum ipc_mem_exec_stage)ioread32(ipc_mmio->base +
+						 ipc_mmio->offset.exec_stage);
 }
 
 void ipc_mmio_copy_chip_info(struct iosm_mmio *ipc_mmio, void *dest,
@@ -167,8 +167,8 @@ enum ipc_mem_device_ipc_state ipc_mmio_get_ipc_state(struct iosm_mmio *ipc_mmio)
 	if (!ipc_mmio)
 		return IPC_MEM_DEVICE_IPC_INVALID;
 
-	return (enum ipc_mem_device_ipc_state)
-		readl(ipc_mmio->base + ipc_mmio->offset.ipc_status);
+	return (enum ipc_mem_device_ipc_state)ioread32(ipc_mmio->base +
+						       ipc_mmio->offset.ipc_status);
 }
 
 enum rom_exit_code ipc_mmio_get_rom_exit_code(struct iosm_mmio *ipc_mmio)
@@ -176,8 +176,8 @@ enum rom_exit_code ipc_mmio_get_rom_exit_code(struct iosm_mmio *ipc_mmio)
 	if (!ipc_mmio)
 		return IMEM_ROM_EXIT_FAIL;
 
-	return (enum rom_exit_code)readl(ipc_mmio->base +
-					 ipc_mmio->offset.rom_exit_code);
+	return (enum rom_exit_code)ioread32(ipc_mmio->base +
+					    ipc_mmio->offset.rom_exit_code);
 }
 
 void ipc_mmio_config(struct iosm_mmio *ipc_mmio)
@@ -202,7 +202,7 @@ void ipc_mmio_set_psi_addr_and_size(struct iosm_mmio *ipc_mmio, dma_addr_t addr,
 		return;
 
 	iowrite64(addr, ipc_mmio->base + ipc_mmio->offset.psi_address);
-	writel(size, ipc_mmio->base + ipc_mmio->offset.psi_size);
+	iowrite32(size, ipc_mmio->base + ipc_mmio->offset.psi_size);
 }
 
 void ipc_mmio_set_contex_info_addr(struct iosm_mmio *ipc_mmio, phys_addr_t addr)
@@ -218,6 +218,8 @@ void ipc_mmio_set_contex_info_addr(struct iosm_mmio *ipc_mmio, phys_addr_t addr)
 
 int ipc_mmio_get_cp_version(struct iosm_mmio *ipc_mmio)
 {
-	return ipc_mmio ? readl(ipc_mmio->base + ipc_mmio->offset.cp_version) :
-			  -EFAULT;
+	if (ipc_mmio)
+		return ioread32(ipc_mmio->base + ipc_mmio->offset.cp_version);
+
+	return -EFAULT;
 }
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors
  2021-09-06 12:44 [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors Andy Shevchenko
  2021-09-06 12:44 ` [PATCH v1 net-next 2/2] net: wwan: iosm: Unify IO accessors used in the driver Andy Shevchenko
@ 2021-09-06 16:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-06 16:00 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: m.chetan.kumar, netdev, linux-kernel, linuxwwan, loic.poulain,
	ryazanov.s.a, johannes, davem, kuba

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Mon,  6 Sep 2021 15:44:48 +0300 you wrote:
> The io.*_lo_hi() variants are not strictly needed on the x86 hardware
> and especially the PCI bus. Replace them with regular accessors, but
> leave headers in place in case of 32-bit build.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/net/wwan/iosm/iosm_ipc_mmio.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [v1,net-next,1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors
    https://git.kernel.org/netdev/net/c/1d99411fe701
  - [v1,net-next,2/2] net: wwan: iosm: Unify IO accessors used in the driver
    https://git.kernel.org/netdev/net/c/b539c44df067

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-06 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 12:44 [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors Andy Shevchenko
2021-09-06 12:44 ` [PATCH v1 net-next 2/2] net: wwan: iosm: Unify IO accessors used in the driver Andy Shevchenko
2021-09-06 16:00 ` [PATCH v1 net-next 1/2] net: wwan: iosm: Replace io.*64_lo_hi() with regular accessors patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).