Message ID | 20230824055117.42309-3-dmantipov@yandex.ru (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Kalle Valo |
Headers | show |
Series | [1/6,v3] wifi: ath10k: cleanup CE ring initialization | expand |
On 8/23/2023 10:51 PM, Dmitry Antipov wrote: > Convert 'ath10k_pci_init_pipes()' and 'ath10k_snoc_init_pipes()' > to 'void' and thus simplify 'ath10k_ahb_hif_power_up()', > 'ath10k_pci_qca988x_chip_reset()' and 'ath10k_snoc_hif_power_up()'. > > Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> > --- > v3: split from the larger v2 patch > --- > drivers/net/wireless/ath/ath10k/ahb.c | 6 +----- > drivers/net/wireless/ath/ath10k/pci.c | 17 +++-------------- > drivers/net/wireless/ath/ath10k/pci.h | 2 +- > drivers/net/wireless/ath/ath10k/snoc.c | 16 ++-------------- > 4 files changed, 7 insertions(+), 34 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c > index 76efea2f1138..c3a2eeb5542d 100644 > --- a/drivers/net/wireless/ath/ath10k/ahb.c > +++ b/drivers/net/wireless/ath/ath10k/ahb.c > @@ -655,11 +655,7 @@ static int ath10k_ahb_hif_power_up(struct ath10k *ar, > goto out; > } > > - ret = ath10k_pci_init_pipes(ar); > - if (ret) { > - ath10k_err(ar, "failed to initialize CE: %d\n", ret); > - goto out; > - } > + ath10k_pci_init_pipes(ar); > > ret = ath10k_pci_init_config(ar); > if (ret) { > diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c > index 8e05326400bb..f6988075cd83 100644 > --- a/drivers/net/wireless/ath/ath10k/pci.c > +++ b/drivers/net/wireless/ath/ath10k/pci.c > @@ -2524,15 +2524,13 @@ void ath10k_pci_free_pipes(struct ath10k *ar) > ath10k_ce_free_pipe(ar, i); > } > > -int ath10k_pci_init_pipes(struct ath10k *ar) > +void ath10k_pci_init_pipes(struct ath10k *ar) > { > struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); > int i; > > for (i = 0; i < CE_COUNT; i++) > ath10k_ce_init_pipe(ar, i, &ar_pci->attr[i]); > - > - return 0; > } > > static bool ath10k_pci_has_fw_crashed(struct ath10k *ar) > @@ -2697,12 +2695,7 @@ static int ath10k_pci_qca988x_chip_reset(struct ath10k *ar) > * sufficient to verify if device is capable of booting > * firmware blob. > */ > - ret = ath10k_pci_init_pipes(ar); > - if (ret) { > - ath10k_warn(ar, "failed to init copy engine: %d\n", > - ret); > - continue; > - } > + ath10k_pci_init_pipes(ar); > > ret = ath10k_pci_diag_read32(ar, QCA988X_HOST_INTEREST_ADDRESS, > &val); > @@ -2840,11 +2833,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar, > goto err_sleep; > } > > - ret = ath10k_pci_init_pipes(ar); > - if (ret) { > - ath10k_err(ar, "failed to initialize CE: %d\n", ret); > - goto err_sleep; > - } > + ath10k_pci_init_pipes(ar); > > ret = ath10k_pci_init_config(ar); > if (ret) { > diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h > index 480cd97ab739..3b3ded87aef9 100644 > --- a/drivers/net/wireless/ath/ath10k/pci.h > +++ b/drivers/net/wireless/ath/ath10k/pci.h > @@ -238,7 +238,7 @@ void ath10k_pci_free_pipes(struct ath10k *ar); > void ath10k_pci_rx_replenish_retry(struct timer_list *t); > void ath10k_pci_ce_deinit(struct ath10k *ar); > void ath10k_pci_init_napi(struct ath10k *ar); > -int ath10k_pci_init_pipes(struct ath10k *ar); > +void ath10k_pci_init_pipes(struct ath10k *ar); > int ath10k_pci_init_config(struct ath10k *ar); > void ath10k_pci_rx_post(struct ath10k *ar); > void ath10k_pci_flush(struct ath10k *ar); > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > index 4f835ad60080..815df15f58fb 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -939,14 +939,12 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > return 0; > } > > -static int ath10k_snoc_init_pipes(struct ath10k *ar) > +static void ath10k_snoc_init_pipes(struct ath10k *ar) > { > int i; > > for (i = 0; i < CE_COUNT; i++) > ath10k_ce_init_pipe(ar, i, &host_ce_config_wlan[i]); > - > - return 0; > } > > static int ath10k_snoc_wlan_enable(struct ath10k *ar, > @@ -1078,17 +1076,7 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar, > > ath10k_ce_alloc_rri(ar); > > - ret = ath10k_snoc_init_pipes(ar); > - if (ret) { > - ath10k_err(ar, "failed to initialize CE: %d\n", ret); > - goto err_free_rri; > - } > - > - return 0; > - > -err_free_rri: > - ath10k_ce_free_rri(ar); > - ath10k_snoc_wlan_disable(ar); > + ath10k_snoc_init_pipes(ar); > > err_hw_power_off: > ath10k_hw_power_off(ar);
diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c index 76efea2f1138..c3a2eeb5542d 100644 --- a/drivers/net/wireless/ath/ath10k/ahb.c +++ b/drivers/net/wireless/ath/ath10k/ahb.c @@ -655,11 +655,7 @@ static int ath10k_ahb_hif_power_up(struct ath10k *ar, goto out; } - ret = ath10k_pci_init_pipes(ar); - if (ret) { - ath10k_err(ar, "failed to initialize CE: %d\n", ret); - goto out; - } + ath10k_pci_init_pipes(ar); ret = ath10k_pci_init_config(ar); if (ret) { diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 8e05326400bb..f6988075cd83 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2524,15 +2524,13 @@ void ath10k_pci_free_pipes(struct ath10k *ar) ath10k_ce_free_pipe(ar, i); } -int ath10k_pci_init_pipes(struct ath10k *ar) +void ath10k_pci_init_pipes(struct ath10k *ar) { struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); int i; for (i = 0; i < CE_COUNT; i++) ath10k_ce_init_pipe(ar, i, &ar_pci->attr[i]); - - return 0; } static bool ath10k_pci_has_fw_crashed(struct ath10k *ar) @@ -2697,12 +2695,7 @@ static int ath10k_pci_qca988x_chip_reset(struct ath10k *ar) * sufficient to verify if device is capable of booting * firmware blob. */ - ret = ath10k_pci_init_pipes(ar); - if (ret) { - ath10k_warn(ar, "failed to init copy engine: %d\n", - ret); - continue; - } + ath10k_pci_init_pipes(ar); ret = ath10k_pci_diag_read32(ar, QCA988X_HOST_INTEREST_ADDRESS, &val); @@ -2840,11 +2833,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar, goto err_sleep; } - ret = ath10k_pci_init_pipes(ar); - if (ret) { - ath10k_err(ar, "failed to initialize CE: %d\n", ret); - goto err_sleep; - } + ath10k_pci_init_pipes(ar); ret = ath10k_pci_init_config(ar); if (ret) { diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h index 480cd97ab739..3b3ded87aef9 100644 --- a/drivers/net/wireless/ath/ath10k/pci.h +++ b/drivers/net/wireless/ath/ath10k/pci.h @@ -238,7 +238,7 @@ void ath10k_pci_free_pipes(struct ath10k *ar); void ath10k_pci_rx_replenish_retry(struct timer_list *t); void ath10k_pci_ce_deinit(struct ath10k *ar); void ath10k_pci_init_napi(struct ath10k *ar); -int ath10k_pci_init_pipes(struct ath10k *ar); +void ath10k_pci_init_pipes(struct ath10k *ar); int ath10k_pci_init_config(struct ath10k *ar); void ath10k_pci_rx_post(struct ath10k *ar); void ath10k_pci_flush(struct ath10k *ar); diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 4f835ad60080..815df15f58fb 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -939,14 +939,12 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) return 0; } -static int ath10k_snoc_init_pipes(struct ath10k *ar) +static void ath10k_snoc_init_pipes(struct ath10k *ar) { int i; for (i = 0; i < CE_COUNT; i++) ath10k_ce_init_pipe(ar, i, &host_ce_config_wlan[i]); - - return 0; } static int ath10k_snoc_wlan_enable(struct ath10k *ar, @@ -1078,17 +1076,7 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar, ath10k_ce_alloc_rri(ar); - ret = ath10k_snoc_init_pipes(ar); - if (ret) { - ath10k_err(ar, "failed to initialize CE: %d\n", ret); - goto err_free_rri; - } - - return 0; - -err_free_rri: - ath10k_ce_free_rri(ar); - ath10k_snoc_wlan_disable(ar); + ath10k_snoc_init_pipes(ar); err_hw_power_off: ath10k_hw_power_off(ar);
Convert 'ath10k_pci_init_pipes()' and 'ath10k_snoc_init_pipes()' to 'void' and thus simplify 'ath10k_ahb_hif_power_up()', 'ath10k_pci_qca988x_chip_reset()' and 'ath10k_snoc_hif_power_up()'. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> --- v3: split from the larger v2 patch --- drivers/net/wireless/ath/ath10k/ahb.c | 6 +----- drivers/net/wireless/ath/ath10k/pci.c | 17 +++-------------- drivers/net/wireless/ath/ath10k/pci.h | 2 +- drivers/net/wireless/ath/ath10k/snoc.c | 16 ++-------------- 4 files changed, 7 insertions(+), 34 deletions(-)