linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: "linux-wireless@vger.kernel.org" <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" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Chris Morgan <macroalpha82@gmail.com>,
	"Nitin Gupta" <nitin.gupta981@gmail.com>,
	Neo Jou <neojou@gmail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>
Subject: RE: [PATCH v2 RFC 3/9] wifi: rtw88: mac: Support SDIO specific bits in the power on sequence
Date: Tue, 14 Mar 2023 00:48:09 +0000	[thread overview]
Message-ID: <8404a75a4c194fa79f8e24a9731c3ce3@realtek.com> (raw)
In-Reply-To: <CAFBinCA-OHPbwdxdDe50og787LMSnbPhYbsRL6UzQUhxWgxWbQ@mail.gmail.com>



> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Sent: Tuesday, March 14, 2023 4:12 AM
> To: Ping-Ke Shih <pkshih@realtek.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>; Jernej Skrabec <jernej.skrabec@gmail.com>
> Subject: Re: [PATCH v2 RFC 3/9] wifi: rtw88: mac: Support SDIO specific bits in the power on sequence
> 
> Hello Ping-Ke,
> 
> On Mon, Mar 13, 2023 at 10:05 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
> [...]
> > >         pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq;
> > >         ret = rtw_pwr_seq_parser(rtwdev, pwr_seq);
> > > -       if (ret)
> > > -               return ret;
> > > +
> > > +       if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO)
> > > +               rtw_write32(rtwdev, REG_SDIO_HIMR, imr);
> > >
> > >         if (pwr_on)
> > >                 set_bit(RTW_FLAG_POWERON, rtwdev->flags);
> >
> > If failed to power on, it still set RTW_FLAG_POWERON. Is it reasonable?
> That sounds very reasonable to me!

Let me clear here more.

Consider a use case:
1. Initially, it enters this function with pwr_on = true, and RTW_FLAG_POWERON is unset.
2. rtw_pwr_seq_parser() return error, so power state is uncertain.
3. Unconditionally, set RTW_FLAG_POWERON.

rtw_mac_power_on() will try to power off/on once again if it fails, so
in step 3 setting RTW_FLAG_POWERON only if rtw_pwr_seq_parser() returns 0
can have the same values as step 1, when it retries to power on.

Honestly, we don't have perfect error handle for error of rtw_pwr_seq_parser(),
but still want to make things easier understand.

> 
> > Did you meet real problem here?
> >
> > Maybe, here can be
> >
> >          if (pwr_on && !ret)
> >                  set_bit(RTW_FLAG_POWERON, rtwdev->flags);
> I can't remember any issue that I've seen. I'll verify this at the end
> of the week (until then I am pretty busy with my daytime job) and then
> go with your suggestion.

Thanks. Wait for you.

> Thanks again as always - your feedback is really appreciated!
> 
> Also thank you for commenting on the other patches. I'll take a closer
> look at your feedback at the end of the week and send another version
> of this series.
> 

I also thank you for cooking these patches voluntarily for people who
can use their own wifi happily. :-)

Ping-Ke


  reply	other threads:[~2023-03-14  0:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 20:29 [PATCH v2 RFC 0/9] rtw88: Add SDIO support Martin Blumenstingl
2023-03-10 20:29 ` [PATCH v2 RFC 1/9] wifi: rtw88: Clear RTW_FLAG_POWERON early in rtw_mac_power_switch() Martin Blumenstingl
2023-03-13  2:28   ` Ping-Ke Shih
2023-03-13 20:07     ` Martin Blumenstingl
2023-03-14  0:28       ` Ping-Ke Shih
2023-03-10 20:29 ` [PATCH v2 RFC 2/9] wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets Martin Blumenstingl
2023-03-13  8:58   ` Ping-Ke Shih
2023-03-10 20:29 ` [PATCH v2 RFC 3/9] wifi: rtw88: mac: Support SDIO specific bits in the power on sequence Martin Blumenstingl
2023-03-13  9:04   ` Ping-Ke Shih
2023-03-13 20:11     ` Martin Blumenstingl
2023-03-14  0:48       ` Ping-Ke Shih [this message]
2023-03-10 20:29 ` [PATCH v2 RFC 4/9] wifi: rtw88: main: Add the {cpwm,rpwm}_addr for SDIO based chipsets Martin Blumenstingl
2023-03-13  9:10   ` Ping-Ke Shih
2023-03-10 20:29 ` [PATCH v2 RFC 5/9] wifi: rtw88: main: Reserve 8 bytes of extra TX headroom for SDIO cards Martin Blumenstingl
2023-03-10 20:29 ` [PATCH v2 RFC 6/9] mmc: sdio: add Realtek SDIO vendor ID and various wifi device IDs Martin Blumenstingl
2023-03-10 20:29 ` [PATCH v2 RFC 7/9] wifi: rtw88: Add support for the SDIO based RTL8822BS chipset Martin Blumenstingl
2023-03-10 20:29 ` [PATCH v2 RFC 8/9] wifi: rtw88: Add support for the SDIO based RTL8822CS chipset Martin Blumenstingl
2023-03-10 20:29 ` [PATCH v2 RFC 9/9] wifi: rtw88: Add support for the SDIO based RTL8821CS chipset Martin Blumenstingl
2023-03-13  9:22   ` Ping-Ke Shih
2023-03-16 19:59   ` Chris Morgan
2023-03-20 20:29     ` Martin Blumenstingl
2023-03-11  2:16 ` [PATCH v2 RFC 0/9] rtw88: Add SDIO support Larry Finger
2023-03-11 20:56   ` 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=8404a75a4c194fa79f8e24a9731c3ce3@realtek.com \
    --to=pkshih@realtek.com \
    --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=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 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).