All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-wireless@vger.kernel.org,
	"Yan-Hsuan Chuang" <tony0620emma@gmail.com>,
	"Kalle Valo" <kvalo@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-mmc@vger.kernel.org,
	"Chris Morgan" <macroalpha82@gmail.com>,
	"Nitin Gupta" <nitin.gupta981@gmail.com>,
	"Neo Jou" <neojou@gmail.com>, Pkshih <pkshih@realtek.com>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Larry Finger" <Larry.Finger@lwfinger.net>,
	"Pali Rohár" <pali@kernel.org>
Subject: Re: [PATCH v4 2/9] wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets
Date: Tue, 4 Apr 2023 17:14:49 +0200	[thread overview]
Message-ID: <ZCw+6QC230iydL9A@corigine.com> (raw)
In-Reply-To: <20230403202440.276757-3-martin.blumenstingl@googlemail.com>

On Mon, Apr 03, 2023 at 10:24:33PM +0200, Martin Blumenstingl wrote:
> Add a sub-driver for SDIO based chipsets which implements the following
> functionality:
> - register accessors for 8, 16 and 32 bits for all states of the card
>   (including usage of 4x 8 bit access for one 32 bit buffer if the card
>   is not fully powered on yet - or if it's fully powered on then 1x 32
>   bit access is used)
> - checking whether there's space in the TX FIFO queue to transmit data
> - transfers from the host to the device for actual network traffic,
>   reserved pages (for firmware download) and H2C (host-to-card)
>   transfers
> - receiving data from the device
> - deep power saving state
> 
> The transmit path is optimized so DMA-capable SDIO host controllers can
> directly use the buffers provided because the buffer's physical
> addresses are 8 byte aligned.
> 
> The receive path is prepared to support RX aggregation where the
> chipset combines multiple MAC frames into one bigger buffer to reduce
> SDIO transfer overhead.
> 
> Co-developed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Hi Martin,

some minor nits from my side that you may wish to consider
if you need to respin the series for some other reason.

> diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
> new file mode 100644
> index 000000000000..038e209e6107
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/sdio.c
> @@ -0,0 +1,1387 @@
> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
> +/* Copyright (C) 2021 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> + * Copyright (C) 2021 Jernej Skrabec <jernej.skrabec@gmail.com>
> + *
> + * Based on rtw88/pci.c:
> + *   Copyright(c) 2018-2019  Realtek Corporation
> + */
> +
> +#include <linux/module.h>
> +#include <linux/mmc/host.h>
> +#include <linux/mmc/sdio_func.h>
> +#include "main.h"
> +#include "debug.h"
> +#include "fw.h"
> +#include "ps.h"
> +#include "reg.h"
> +#include "rx.h"
> +#include "sdio.h"
> +#include "tx.h"
> +
> +#define RTW_SDIO_INDIRECT_RW_RETRIES			50
> +
> +static bool rtw_sdio_is_bus_addr(u32 addr)
> +{
> +	return (addr & RTW_SDIO_BUS_MSK) != 0;
> +}

nit: this could be.

	return !!(addr & RTW_SDIO_BUS_MSK)

...

> +static void rtw_sdio_handle_interrupt(struct sdio_func *sdio_func)
> +{
> +	struct ieee80211_hw *hw = sdio_get_drvdata(sdio_func);
> +	struct rtw_dev *rtwdev = hw->priv;
> +	struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
> +	u32 hisr;

nit: reverse xmas tree - longest line to shortest - for local variable
     declarations.

     So I guess (*completely untested*):

	struct ieee80211_hw *hw = sdio_get_drvdata(sdio_func);
	struct rtw_dev *rtwdev = hw->priv;
	struct rtw_sdio *rtwsdio;
	u32 hisr;

	rtwsdio = (struct rtw_sdio *)rtwdev->priv;

...

> +static void rtw_sdio_tx_handler(struct work_struct *work)
> +{
> +	struct rtw_sdio_work_data *work_data =
> +		container_of(work, struct rtw_sdio_work_data, work);
> +	struct rtw_dev *rtwdev = work_data->rtwdev;
> +	struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
> +	int limit, queue;

Reverse xmas tree again.

...

> +void rtw_sdio_shutdown(struct device *dev)
> +{
> +	struct sdio_func *sdio_func = dev_to_sdio_func(dev);
> +	struct ieee80211_hw *hw = sdio_get_drvdata(sdio_func);
> +	const struct rtw_chip_info *chip;
> +	struct rtw_dev *rtwdev;

Ditto.

...

> diff --git a/drivers/net/wireless/realtek/rtw88/sdio.h b/drivers/net/wireless/realtek/rtw88/sdio.h

...

> +/* Free Tx Page Sequence */
> +#define REG_SDIO_FREE_TXPG_SEQ			(SDIO_LOCAL_OFFSET + 0x0028)
> +/* HTSF Informaion */

nit: s/Informaion/Information/

...

  reply	other threads:[~2023-04-04 15:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 20:24 [PATCH v4 0/9] rtw88: Add SDIO support Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 1/9] wifi: rtw88: Clear RTW_FLAG_POWERON early in rtw_mac_power_switch() Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 2/9] wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets Martin Blumenstingl
2023-04-04 15:14   ` Simon Horman [this message]
2023-04-03 20:24 ` [PATCH v4 3/9] wifi: rtw88: mac: Support SDIO specific bits in the power on sequence Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 4/9] wifi: rtw88: main: Add the {cpwm,rpwm}_addr for SDIO based chipsets Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 5/9] wifi: rtw88: main: Reserve 8 bytes of extra TX headroom for SDIO cards Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 6/9] mmc: sdio: add Realtek SDIO vendor ID and various wifi device IDs Martin Blumenstingl
2023-04-03 20:59   ` Pali Rohár
2023-04-03 20:24 ` [PATCH v4 7/9] wifi: rtw88: Add support for the SDIO based RTL8822BS chipset Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 8/9] wifi: rtw88: Add support for the SDIO based RTL8822CS chipset Martin Blumenstingl
2023-04-03 20:24 ` [PATCH v4 9/9] wifi: rtw88: Add support for the SDIO based RTL8821CS chipset Martin Blumenstingl
2023-04-04 17:38   ` Chris Morgan
2023-04-04 18:16     ` Chris Morgan
2023-04-04 21:27       ` Martin Blumenstingl
2023-04-05 15:02         ` Chris Morgan
2023-04-05 19:51           ` Martin Blumenstingl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZCw+6QC230iydL9A@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=jernej.skrabec@gmail.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=macroalpha82@gmail.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neojou@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nitin.gupta981@gmail.com \
    --cc=pali@kernel.org \
    --cc=pkshih@realtek.com \
    --cc=tony0620emma@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.