All of lore.kernel.org
 help / color / mirror / Atom feed
From: <sean.wang@mediatek.com>
To: <lorenzo.bianconi@redhat.com>
Cc: <nbd@nbd.name>, <sean.wang@mediatek.com>,
	<Soul.Huang@mediatek.com>, <YN.Chen@mediatek.com>,
	<Leon.Yen@mediatek.com>, <Eric-SY.Chang@mediatek.com>,
	<Mark-YW.Chen@mediatek.com>, <Deren.Wu@mediatek.com>,
	<km.lin@mediatek.com>, <jenhao.yang@mediatek.com>,
	<robin.chiu@mediatek.com>, <Eddie.Chen@mediatek.com>,
	<ch.yeh@mediatek.com>, <posh.sun@mediatek.com>,
	<ted.huang@mediatek.com>, <Eric.Liang@mediatek.com>,
	 <Stella.Chang@mediatek.com>, <Tom.Chou@mediatek.com>,
	<steve.lee@mediatek.com>, <jsiuda@google.com>,
	<frankgor@google.com>, <jemele@google.com>,
	<abhishekpandit@google.com>, <shawnku@google.com>,
	<linux-wireless@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] mt76: sdio: lock sdio when it is needed
Date: Thu, 23 Dec 2021 03:27:28 +0800	[thread overview]
Message-ID: <1640201248-14901-1-git-send-email-sean.wang@mediatek.com> (raw)
In-Reply-To: <YcMJDdDrDVIT0Y55@lore-desk--annotate>

From: Sean Wang <sean.wang@mediatek.com>

>> From: Sean Wang <sean.wang@mediatek.com>
>>
>> Acquire the SDIO as needed as possible because either MT7663S or
>> MT7921S is a multiple-function device that always includes Bluetooth
>> that would share with the same SDIO bus. So not to avoid breaking
>> Bluetooth pairing, audio, and HID such kind of time critical
>> application on that, we only lock sdio bus when it is necessary in WiFi driver.
>>
>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
>> ---
>>  drivers/net/wireless/mediatek/mt76/mt7615/sdio.c | 3 +++
>> drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 3 +++
>>  drivers/net/wireless/mediatek/mt76/sdio_txrx.c   | 8 ++++++++
>>  3 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> index 31c4a76b7f91..71162befdae8 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> @@ -56,7 +56,10 @@ static int mt7663s_parse_intr(struct mt76_dev *dev, struct mt76s_intr *intr)
>>	struct mt7663s_intr *irq_data = sdio->intr_data;
>>	int i, err;
>>
>> +	sdio_claim_host(sdio->func);
>>	err = sdio_readsb(sdio->func, irq_data, MCR_WHISR,
>> sizeof(*irq_data));
>> +	sdio_release_host(sdio->func);
>
>I guess you can move this in mt76s_rx_handler() and remove the duplicated code in mt7921_sdio.c
>

I got your point, but I still prefer we can release sdio lock as early as possible when WiFi driver doesn't need it
to allow BT driver has the chance to get the lock quickly.

>Regards,
>Lorenzo
>
>> +
>>	if (err)
>>		return err;

<snip>

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

WARNING: multiple messages have this Message-ID (diff)
From: <sean.wang@mediatek.com>
To: <lorenzo.bianconi@redhat.com>
Cc: <nbd@nbd.name>, <sean.wang@mediatek.com>,
	<Soul.Huang@mediatek.com>, <YN.Chen@mediatek.com>,
	<Leon.Yen@mediatek.com>, <Eric-SY.Chang@mediatek.com>,
	<Mark-YW.Chen@mediatek.com>, <Deren.Wu@mediatek.com>,
	<km.lin@mediatek.com>, <jenhao.yang@mediatek.com>,
	<robin.chiu@mediatek.com>, <Eddie.Chen@mediatek.com>,
	<ch.yeh@mediatek.com>, <posh.sun@mediatek.com>,
	<ted.huang@mediatek.com>, <Eric.Liang@mediatek.com>,
	<Stella.Chang@mediatek.com>, <Tom.Chou@mediatek.com>,
	<steve.lee@mediatek.com>, <jsiuda@google.com>,
	<frankgor@google.com>, <jemele@google.com>,
	<abhishekpandit@google.com>, <shawnku@google.com>,
	<linux-wireless@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] mt76: sdio: lock sdio when it is needed
Date: Thu, 23 Dec 2021 03:27:28 +0800	[thread overview]
Message-ID: <1640201248-14901-1-git-send-email-sean.wang@mediatek.com> (raw)
In-Reply-To: <YcMJDdDrDVIT0Y55@lore-desk--annotate>

From: Sean Wang <sean.wang@mediatek.com>

>> From: Sean Wang <sean.wang@mediatek.com>
>>
>> Acquire the SDIO as needed as possible because either MT7663S or
>> MT7921S is a multiple-function device that always includes Bluetooth
>> that would share with the same SDIO bus. So not to avoid breaking
>> Bluetooth pairing, audio, and HID such kind of time critical
>> application on that, we only lock sdio bus when it is necessary in WiFi driver.
>>
>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
>> ---
>>  drivers/net/wireless/mediatek/mt76/mt7615/sdio.c | 3 +++
>> drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 3 +++
>>  drivers/net/wireless/mediatek/mt76/sdio_txrx.c   | 8 ++++++++
>>  3 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> index 31c4a76b7f91..71162befdae8 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
>> @@ -56,7 +56,10 @@ static int mt7663s_parse_intr(struct mt76_dev *dev, struct mt76s_intr *intr)
>>	struct mt7663s_intr *irq_data = sdio->intr_data;
>>	int i, err;
>>
>> +	sdio_claim_host(sdio->func);
>>	err = sdio_readsb(sdio->func, irq_data, MCR_WHISR,
>> sizeof(*irq_data));
>> +	sdio_release_host(sdio->func);
>
>I guess you can move this in mt76s_rx_handler() and remove the duplicated code in mt7921_sdio.c
>

I got your point, but I still prefer we can release sdio lock as early as possible when WiFi driver doesn't need it
to allow BT driver has the chance to get the lock quickly.

>Regards,
>Lorenzo
>
>> +
>>	if (err)
>>		return err;

<snip>

       reply	other threads:[~2021-12-22 19:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <YcMJDdDrDVIT0Y55@lore-desk--annotate>
2021-12-22 19:27 ` sean.wang [this message]
2021-12-22 19:27   ` [PATCH] mt76: sdio: lock sdio when it is needed sean.wang
2021-12-22  5:56 sean.wang
2021-12-22  5:56 ` sean.wang
2021-12-22 11:16 ` Lorenzo Bianconi
2021-12-22 11:16   ` Lorenzo Bianconi

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=1640201248-14901-1-git-send-email-sean.wang@mediatek.com \
    --to=sean.wang@mediatek.com \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eddie.Chen@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Mark-YW.Chen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=Tom.Chou@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=abhishekpandit@google.com \
    --cc=ch.yeh@mediatek.com \
    --cc=frankgor@google.com \
    --cc=jemele@google.com \
    --cc=jenhao.yang@mediatek.com \
    --cc=jsiuda@google.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=shawnku@google.com \
    --cc=steve.lee@mediatek.com \
    --cc=ted.huang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.