linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ryder Lee <ryder.lee@mediatek.com>
To: <sean.wang@mediatek.com>
Cc: Sean Wang <objelf@gmail.com>,
	linux-wireless@vger.kernel.org, YN Chen <YN.Chen@mediatek.com>,
	linux-mediatek@lists.infradead.org, lorenzo.bianconi@redhat.com,
	nbd@nbd.name
Subject: Re: [PATCH 1/2] mt76: mt7663: handle failure event for patch semaphore cmd
Date: Sat, 17 Oct 2020 07:14:21 +0800	[thread overview]
Message-ID: <1602890061.23114.2.camel@mtkswgap22> (raw)
In-Reply-To: <267346a9a9c5f71caec03292b6c33b39864b38c5.1602807276.git.objelf@gmail.com>

On Fri, 2020-10-16 at 08:26 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <objelf@gmail.com>
> 
> Just follow up vendor driver to retry a few times obtaining patch
> semaphore when the event is PATCH_NOT_DL_SEM_FAIL. That usually
> happens in Bluetooth and Wifi driver contends to download patch
> simultaneously.
> 
> Co-developed-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by:  Sean Wang <sean.wang@mediatek.com>

What's the difference between this and https://github.com/nbd168/wireless/commit/f55bc2f37e247729f8087434b9aafc4d0095c4ca ?

> ---
>  drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> index 2b17bd1c2a32..c990ccd6f472 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> @@ -1945,14 +1945,21 @@ static int mt7615_load_patch(struct mt7615_dev *dev, u32 addr, const char *name)
>  {
>  	const struct mt7615_patch_hdr *hdr;
>  	const struct firmware *fw = NULL;
> -	int len, ret, sem;
> +	int len, ret, sem, c = 50;
>  
> +retry:
>  	sem = mt7615_mcu_patch_sem_ctrl(dev, 1);
>  	switch (sem) {
>  	case PATCH_IS_DL:
>  		return 0;
>  	case PATCH_NOT_DL_SEM_SUCCESS:
>  		break;
> +	case PATCH_NOT_DL_SEM_FAIL:
> +		if (is_mt7663(&dev->mt76) && c--) {
> +			msleep(100);
> +			goto retry;
> +		}
> +		fallthrough;
>  	default:
>  		dev_err(dev->mt76.dev, "Failed to get patch semaphore\n");
>  		return -EAGAIN;


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

      parent reply	other threads:[~2020-10-16 23:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16  0:26 [PATCH 1/2] mt76: mt7663: handle failure event for patch semaphore cmd sean.wang
2020-10-16  0:26 ` [PATCH 2/2] mt76: mt7663s: introduce WoW support via GPIO sean.wang
2020-10-16 15:45 ` [PATCH 1/2] mt76: mt7663: handle failure event for patch semaphore cmd Lorenzo Bianconi
2020-10-16 23:14 ` Ryder Lee [this message]

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=1602890061.23114.2.camel@mtkswgap22 \
    --to=ryder.lee@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=objelf@gmail.com \
    --cc=sean.wang@mediatek.com \
    /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).