Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Deren Wu <deren.wu@mediatek.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Felix Fietkau <nbd@nbd.name>, Sean Wang <sean.wang@mediatek.com>,
	"Soul Huang" <Soul.Huang@mediatek.com>,
	YN Chen <YN.Chen@mediatek.com>, Leon Yen <Leon.Yen@mediatek.com>,
	Eric-SY Chang <Eric-SY.Chang@mediatek.com>,
	KM Lin <km.lin@mediatek.com>,
	Robin Chiu <robin.chiu@mediatek.com>,
	CH Yeh <ch.yeh@mediatek.com>, Posh Sun <posh.sun@mediatek.com>,
	Eric Liang <Eric.Liang@mediatek.com>,
	Stella Chang <Stella.Chang@mediatek.com>,
	"Evelyn Tsai" <evelyn.tsai@mediatek.com>,
	Ryder Lee <ryder.lee@mediatek.com>,
	"Shayne Chen" <shayne.chen@mediatek.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] mt76: mt7921s: fix possible sdio deadlock in command fail
Date: Mon, 13 Jun 2022 23:32:24 +0800	[thread overview]
Message-ID: <77d3ba88b76dcdb973fb078263513c595e911c14.camel@mediatek.com> (raw)
In-Reply-To: <YqcrzCbeJUg3s18b@lore-desk>

On Mon, 2022-06-13 at 14:21 +0200, Lorenzo Bianconi wrote:
> > From: Deren Wu <deren.wu@mediatek.com>
> > 
> > Move sdio_release_host() to final resource handing
> > 
> > Fixes: b12deb5e86fa ("mt76: mt7921s: fix
> > mt7921s_mcu_[fw|drv]_pmctrl")
> > Reported-by: YN Chen <YN.Chen@mediatek.com>
> > Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> > ---
> >  drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> > b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> > index 54a5c712a3c3..1856d677fff4 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> > @@ -156,9 +156,9 @@ int mt7921s_mcu_fw_pmctrl(struct mt7921_dev
> > *dev)
> >  
> >  	err = readx_poll_timeout(mt76s_read_pcr, &dev->mt76, status,
> >  				 !(status & WHLPCR_IS_DRIVER_OWN),
> > 2000, 1000000);
> > +err:
> >  	sdio_release_host(func);
> >  
> > -err:
> >  	if (err < 0) {
> >  		dev_err(dev->mt76.dev, "firmware own failed\n");
> >  		clear_bit(MT76_STATE_PM, &mphy->state);
> > -- 
> > 2.18.0
> > 
> 
> Hi Deren,
> 
> in order to align the code with mt7921e, can you please fold the
> following
> changes into this patch?
> 
> Regards,
> Lorenzo
> 

Hi Lore,

Sure, I will post v2 with your patch.


Thanks,
Deren

> --- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> @@ -135,8 +135,8 @@ int mt7921s_mcu_fw_pmctrl(struct mt7921_dev *dev)
>  	struct sdio_func *func = dev->mt76.sdio.func;
>  	struct mt76_phy *mphy = &dev->mt76.phy;
>  	struct mt76_connac_pm *pm = &dev->pm;
> -	int err = 0;
>  	u32 status;
> +	int err;
>  
>  	sdio_claim_host(func);
>  
> @@ -147,7 +147,7 @@ int mt7921s_mcu_fw_pmctrl(struct mt7921_dev *dev)
>  					 2000, 1000000);
>  		if (err < 0) {
>  			dev_err(dev->mt76.dev, "mailbox ACK not
> cleared\n");
> -			goto err;
> +			goto out;
>  		}
>  	}
>  
> @@ -155,18 +155,18 @@ int mt7921s_mcu_fw_pmctrl(struct mt7921_dev
> *dev)
>  
>  	err = readx_poll_timeout(mt76s_read_pcr, &dev->mt76, status,
>  				 !(status & WHLPCR_IS_DRIVER_OWN),
> 2000, 1000000);
> -err:
> +out:
>  	sdio_release_host(func);
>  
>  	if (err < 0) {
>  		dev_err(dev->mt76.dev, "firmware own failed\n");
>  		clear_bit(MT76_STATE_PM, &mphy->state);
> -		err = -EIO;
> +		return -EIO;
>  	}
>  
>  	pm->stats.last_doze_event = jiffies;
>  	pm->stats.awake_time += pm->stats.last_doze_event -
>  				pm->stats.last_wake_event;
>  
> -	return err;
> +	return 0;
>  }
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek


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

      reply	other threads:[~2022-06-13 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12  1:59 [PATCH] mt76: mt7921s: fix possible sdio deadlock in command fail Deren Wu
2022-06-13  9:31 ` Lorenzo Bianconi
2022-06-13 12:21 ` Lorenzo Bianconi
2022-06-13 15:32   ` Deren Wu [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=77d3ba88b76dcdb973fb078263513c595e911c14.camel@mediatek.com \
    --to=deren.wu@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@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