Skip to contentSkip to conversation

patch "usb: dwc2: gadget: Do not read GINTMSK2" added to usb-testing

DISCUSSION Minas Harutyunyan 1 participant 2 messages Jul 3, 2020 3 messages not in the archive USB

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Added [email protected] to recipient list.

Quoted 21 lines · Minas Harutyunyan

Hi,

Quoted 17 lines · On 7/3/2020 11:34 AM, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

usb: dwc2: gadget: Do not read GINTMSK2

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

This patch is not correct. Please read below.

Quoted 38 lines
Quoted 38 lines

From 4f1ae9d60adb3d4f9b8ea94f02bfc883f954bed6 Mon Sep 17 00:00:00 2001
From: Lee Jones <[email protected]>
Date: Thu, 2 Jul 2020 15:46:04 +0100
Subject: usb: dwc2: gadget: Do not read GINTMSK2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The value of GINTMSK2 hasn't been checked since the inception of dwc2_gadget_wkup_alert_handler() in 2018.

Fixes the following W=1 warning:

drivers/usb/dwc2/gadget.c: In function ‘dwc2_gadget_wkup_alert_handler’:

   drivers/usb/dwc2/gadget.c:259:6: warning: variable ‘gintmsk2’ set but not used [-Wunused-but-set-variable]
   259 | u32 gintmsk2;
   | ^~~~~~~~
---
   drivers/usb/dwc2/gadget.c | 2 --
   1 file changed, 2 deletions(-)
drivers/usb/dwc2/gadget.c +0 -1
index 1def9000f936..ea7c9c73b4ff 100644
@@ -256,10 +256,8 @@ int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg)
   static void dwc2_gadget_wkup_alert_handler(struct dwc2_hsotg *hsotg)
   {
   	u32 gintsts2;
-	u32 gintmsk2;
 
Quoted 5 lines

drivers/usb/dwc2/gadget.c int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg) · line 263

Quoted 5 lines
drivers/usb/dwc2/gadget.c +0 -1
   	gintsts2 = dwc2_readl(hsotg, GINTSTS2);
-	gintmsk2 = dwc2_readl(hsotg, GINTMSK2);
 
   	if (gintsts2 & GINTSTS2_WKUP_ALERT_INT) {
   		dev_dbg(hsotg->dev, "%s: Wkup_Alert_Int\n", __func__);

Lee, 'gintsts2' can't be removed. Just, please add follow line after reading gintmsk2:

  	gintsts2 &= gintmsk2;

Please add also "Fixes:" tag and submit v2.

Thanks,
Minas

Quoted 1 line
Quoted 1 line

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi,

Quoted 70 lines · On 7/3/2020 12:19 PM, [email protected] wrote:
Quoted 69 lines · Minas Harutyunyan

Hi,

Quoted 9 lines · On 7/3/2020 11:34 AM, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

usb: dwc2: gadget: Do not read GINTMSK2

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.

Quoted 8 lines

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

This patch is not correct. Please read below.

Quoted 33 lines

From 4f1ae9d60adb3d4f9b8ea94f02bfc883f954bed6 Mon Sep 17 00:00:00 2001
From: Lee Jones <[email protected]>
Date: Thu, 2 Jul 2020 15:46:04 +0100
Subject: usb: dwc2: gadget: Do not read GINTMSK2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The value of GINTMSK2 hasn't been checked since the inception of dwc2_gadget_wkup_alert_handler() in 2018.

Fixes the following W=1 warning:

drivers/usb/dwc2/gadget.c: In function ‘dwc2_gadget_wkup_alert_handler’:

   drivers/usb/dwc2/gadget.c:259:6: warning: variable ‘gintmsk2’ set but not used [-Wunused-but-set-variable]
   259 | u32 gintmsk2;
   | ^~~~~~~~
---
   drivers/usb/dwc2/gadget.c | 2 --
   1 file changed, 2 deletions(-)
drivers/usb/dwc2/gadget.c +0 -0
index 1def9000f936..ea7c9c73b4ff 100644

drivers/usb/dwc2/gadget.c int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg) · line 263

Quoted 10 lines
drivers/usb/dwc2/gadget.c +0 -2
@@ -256,10 +256,8 @@ int dwc2_hsotg_tx_fifo_total_depth(struct dwc2_hsotg *hsotg)
   static void dwc2_gadget_wkup_alert_handler(struct dwc2_hsotg *hsotg)
   {
   	u32 gintsts2;
-	u32 gintmsk2;
 
   	gintsts2 = dwc2_readl(hsotg, GINTSTS2);
-	gintmsk2 = dwc2_readl(hsotg, GINTMSK2);
 
   	if (gintsts2 & GINTSTS2_WKUP_ALERT_INT) {
   		dev_dbg(hsotg->dev, "%s: Wkup_Alert_Int\n", __func__);

Lee, 'gintsts2' can't be removed. Just, please add follow line after reading gintmsk2:

Quoted 4 lines
Quoted 1 line
	gintsts2 &= gintmsk2;

So that's a real bugfix needed?

Yes, here real bugfix need, otherwise spurious interrupt 'wkup_alert' can be handled.

Thanks,
Minas

Quoted 4 lines

Ok, I'll drop this patch from the tree now, thanks.

greg k-h