linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <robh@kernel.org>,
	<mka@chromium.org>
Subject: Re: [PATCH v7 5/9] ath11k: Fetch device information via QMI for WCN6750
Date: Mon, 02 May 2022 12:29:10 +0300	[thread overview]
Message-ID: <87k0b4b7vd.fsf@kernel.org> (raw)
In-Reply-To: <20220429170502.20080-6-quic_mpubbise@quicinc.com> (Manikanta Pubbisetty's message of "Fri, 29 Apr 2022 22:34:58 +0530")

Manikanta Pubbisetty <quic_mpubbise@quicinc.com> writes:

> Since WPPS Q6 does the PCIe enumeration of WCN6750, device
> information like BAR and BAR size is not known to the APPS
> processor (Application Processor SubSystem). In order to
> fetch these details, a QMI message called device info request
> will be sent to the target. Therefore, add logic to fetch
> BAR details from the target.
>
> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>

[...]

> +static int ath11k_qmi_request_device_info(struct ath11k_base *ab)
> +{
> +	struct qmi_wlanfw_device_info_req_msg_v01 req = {};
> +	struct qmi_wlanfw_device_info_resp_msg_v01 resp = {};
> +	struct qmi_txn txn;
> +	void __iomem *bar_addr_va;
> +	int ret;
> +
> +	/* device info message req is only sent for hybrid bus devices */
> +	if (!ab->hw_params.hybrid_bus_type)
> +		return 0;
> +
> +	ret = qmi_txn_init(&ab->qmi.handle, &txn,
> +			   qmi_wlfw_device_info_resp_msg_v01_ei, &resp);
> +	if (ret < 0)
> +		goto out;
> +
> +	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
> +			       QMI_WLANFW_DEVICE_INFO_REQ_V01,
> +			       QMI_WLANFW_DEVICE_INFO_REQ_MSG_V01_MAX_LEN,
> +			       qmi_wlanfw_device_info_req_msg_v01_ei, &req);
> +	if (ret < 0) {
> +		qmi_txn_cancel(&txn);
> +		ath11k_warn(ab, "qmi failed to send target device info request, err = %d\n",
> +			    ret);
> +		goto out;
> +	}
> +
> +	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS));
> +	if (ret < 0) {
> +		ath11k_warn(ab, "qmi failed target device info request %d\n", ret);
> +		goto out;
> +	}
> +
> +	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
> +		ath11k_warn(ab, "qmi device info req failed, result: %d, err: %d\n",
> +			    resp.resp.result, resp.resp.error);
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	if (!resp.bar_addr_valid || !resp.bar_size_valid) {
> +		ath11k_warn(ab, "qmi device info response invalid, result: %d, err: %d\n",
> +			    resp.resp.result, resp.resp.error);
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	if (!resp.bar_addr ||
> +	    resp.bar_size != ATH11K_QMI_DEVICE_BAR_SIZE) {
> +		ath11k_warn(ab, "qmi device info invalid addr and size, result: %d, err: %d\n",
> +			    resp.resp.result, resp.resp.error);
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	bar_addr_va = devm_ioremap(ab->dev, resp.bar_addr, resp.bar_size);
> +
> +	if (!bar_addr_va) {
> +		ath11k_warn(ab, "qmi device info ioremap failed\n");
> +		ab->mem_len = 0;
> +		ret = -EIO;
> +		goto out;
> +	}
> +
> +	ab->mem = bar_addr_va;
> +	ab->mem_len = resp.bar_size;
> +
> +	return 0;
> +out:
> +	return ret;
> +}

In the pending branch I changed the warning messages to follow the style
used in ath11k.

> +
>  static int ath11k_qmi_request_target_cap(struct ath11k_base *ab)
>  {
>  	struct qmi_wlanfw_cap_req_msg_v01 req;
> @@ -2749,6 +2886,12 @@ static int ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi)
>  		return ret;
>  	}
>  
> +	ret = ath11k_qmi_request_device_info(ab);
> +	if (ret < 0) {
> +		ath11k_warn(ab, "failed to request qmi device info %d\n", ret);
> +		return ret;
> +	}

Here too.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2022-05-02  9:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 17:04 [PATCH v7 0/9] add support for WCN6750 Manikanta Pubbisetty
2022-04-29 17:04 ` [PATCH v7 1/9] dt: bindings: net: add bindings of WCN6750 for ath11k Manikanta Pubbisetty
2022-05-02 13:59   ` Kalle Valo
2022-04-29 17:04 ` [PATCH v7 2/9] ath11k: Move parameters in bus_params to hw_params Manikanta Pubbisetty
2022-04-29 17:04 ` [PATCH v7 3/9] ath11k: Add HW params for WCN6750 Manikanta Pubbisetty
2022-04-29 17:04 ` [PATCH v7 4/9] ath11k: Add register access logic " Manikanta Pubbisetty
2022-05-02  9:12   ` Kalle Valo
2022-05-25 18:46   ` Maxime Bizon
2022-05-26  3:42     ` Manikanta Pubbisetty
2022-05-30 14:19       ` Maxime Bizon
2022-05-30 16:17         ` Kalle Valo
2022-05-30 16:22           ` Maxime Bizon
2022-04-29 17:04 ` [PATCH v7 5/9] ath11k: Fetch device information via QMI " Manikanta Pubbisetty
2022-05-02  9:29   ` Kalle Valo [this message]
2022-04-29 17:04 ` [PATCH v7 6/9] ath11k: Add QMI changes " Manikanta Pubbisetty
2022-04-29 17:05 ` [PATCH v7 7/9] ath11k: HAL changes to support WCN6750 Manikanta Pubbisetty
2022-04-29 17:05 ` [PATCH v7 8/9] ath11k: Datapath " Manikanta Pubbisetty
2022-04-29 17:05 ` [PATCH v7 9/9] ath11k: Add support for WCN6750 device Manikanta Pubbisetty

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=87k0b4b7vd.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=quic_mpubbise@quicinc.com \
    --cc=robh@kernel.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 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).