diff mbox series

[v2,1/8] usb: dwc2: gadget: Make use of GINTMSK2

Message ID 20200715093209.3165641-2-lee.jones@linaro.org (mailing list archive)
State Mainlined
Commit 9607f3cd8b6633cae5a9c43d8a537add1af801da
Headers show
Series Mop-up left-behind fixes for W=1 warnings in USB | expand

Commit Message

Lee Jones July 15, 2020, 9:32 a.m. UTC
The value obtained from GINTSTS2 should be masked with the GINTMSK2
value.  Looks like this has been broken since
dwc2_gadget_wkup_alert_handler() was added back in 2018.

Also 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;
 | ^~~~~~~~

Cc: Minas Harutyunyan <hminas@synopsys.com>
Cc: Ben Dooks <ben@simtec.co.uk>
Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
Changelog:

v2: Re-written to *use* instad of *remove* gintmsk2

 drivers/usb/dwc2/gadget.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Minas Harutyunyan July 15, 2020, 12:23 p.m. UTC | #1
On 7/15/2020 1:32 PM, Lee Jones wrote:
> The value obtained from GINTSTS2 should be masked with the GINTMSK2
> value.  Looks like this has been broken since
> dwc2_gadget_wkup_alert_handler() was added back in 2018.
> 
> Also 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;
>   | ^~~~~~~~
> 
> Cc: Minas Harutyunyan <hminas@synopsys.com>
> Cc: Ben Dooks <ben@simtec.co.uk>
> Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Acked-by: Minas Harutyunyan <hminas@synopsys.com>

> ---
> Changelog:
> 
> v2: Re-written to *use* instad of *remove* gintmsk2
> 
>   drivers/usb/dwc2/gadget.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index df5fedaca60a0..03cf1fa856219 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -260,6 +260,7 @@ static void dwc2_gadget_wkup_alert_handler(struct dwc2_hsotg *hsotg)
>   
>   	gintsts2 = dwc2_readl(hsotg, GINTSTS2);
>   	gintmsk2 = dwc2_readl(hsotg, GINTMSK2);
> +	gintsts2 &= gintmsk2;
>   
>   	if (gintsts2 & GINTSTS2_WKUP_ALERT_INT) {
>   		dev_dbg(hsotg->dev, "%s: Wkup_Alert_Int\n", __func__);
>
Felipe Balbi July 21, 2020, 9:43 a.m. UTC | #2
Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:

> On 7/15/2020 1:32 PM, Lee Jones wrote:
>> The value obtained from GINTSTS2 should be masked with the GINTMSK2
>> value.  Looks like this has been broken since
>> dwc2_gadget_wkup_alert_handler() was added back in 2018.
>> 
>> Also 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;
>>   | ^~~~~~~~
>> 
>> Cc: Minas Harutyunyan <hminas@synopsys.com>
>> Cc: Ben Dooks <ben@simtec.co.uk>
>> Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Acked-by: Minas Harutyunyan <hminas@synopsys.com>

Should I apply the entire series or only 1/8?
Minas Harutyunyan July 21, 2020, 10:09 a.m. UTC | #3
Hi Felipe,

On 7/21/2020 1:43 PM, Felipe Balbi wrote:
> Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:
> 
>> On 7/15/2020 1:32 PM, Lee Jones wrote:
>>> The value obtained from GINTSTS2 should be masked with the GINTMSK2
>>> value.  Looks like this has been broken since
>>> dwc2_gadget_wkup_alert_handler() was added back in 2018.
>>>
>>> Also 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;
>>>    | ^~~~~~~~
>>>
>>> Cc: Minas Harutyunyan <hminas@synopsys.com>
>>> Cc: Ben Dooks <ben@simtec.co.uk>
>>> Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>>
>> Acked-by: Minas Harutyunyan <hminas@synopsys.com>
> 
> Should I apply the entire series or only 1/8?
> 
In this series only 2 patches are related to dwc2, which I'm already Acked:

[PATCH v2 1/8] usb: dwc2: gadget: Make use of GINTMSK2
[PATCH v2 2/8] usb: dwc2: gadget: Avoid pointless read of EP control 
register

I can't acked other patches from this series, because they are not 
related to dwc2.

Thanks,
Minas
Felipe Balbi July 21, 2020, 11:32 a.m. UTC | #4
Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:

> Hi Felipe,
>
> On 7/21/2020 1:43 PM, Felipe Balbi wrote:
>> Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:
>> 
>>> On 7/15/2020 1:32 PM, Lee Jones wrote:
>>>> The value obtained from GINTSTS2 should be masked with the GINTMSK2
>>>> value.  Looks like this has been broken since
>>>> dwc2_gadget_wkup_alert_handler() was added back in 2018.
>>>>
>>>> Also 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;
>>>>    | ^~~~~~~~
>>>>
>>>> Cc: Minas Harutyunyan <hminas@synopsys.com>
>>>> Cc: Ben Dooks <ben@simtec.co.uk>
>>>> Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
>>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>>>
>>> Acked-by: Minas Harutyunyan <hminas@synopsys.com>
>> 
>> Should I apply the entire series or only 1/8?
>> 
> In this series only 2 patches are related to dwc2, which I'm already Acked:
>
> [PATCH v2 1/8] usb: dwc2: gadget: Make use of GINTMSK2
> [PATCH v2 2/8] usb: dwc2: gadget: Avoid pointless read of EP control 
> register
>
> I can't acked other patches from this series, because they are not 
> related to dwc2.

heh, I saw that after sending the email, sorry :-)
Lee Jones July 21, 2020, 11:52 a.m. UTC | #5
On Tue, 21 Jul 2020, Felipe Balbi wrote:

> Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:
> 
> > Hi Felipe,
> >
> > On 7/21/2020 1:43 PM, Felipe Balbi wrote:
> >> Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:
> >> 
> >>> On 7/15/2020 1:32 PM, Lee Jones wrote:
> >>>> The value obtained from GINTSTS2 should be masked with the GINTMSK2
> >>>> value.  Looks like this has been broken since
> >>>> dwc2_gadget_wkup_alert_handler() was added back in 2018.
> >>>>
> >>>> Also 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;
> >>>>    | ^~~~~~~~
> >>>>
> >>>> Cc: Minas Harutyunyan <hminas@synopsys.com>
> >>>> Cc: Ben Dooks <ben@simtec.co.uk>
> >>>> Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
> >>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> >>>
> >>> Acked-by: Minas Harutyunyan <hminas@synopsys.com>
> >> 
> >> Should I apply the entire series or only 1/8?
> >> 
> > In this series only 2 patches are related to dwc2, which I'm already Acked:
> >
> > [PATCH v2 1/8] usb: dwc2: gadget: Make use of GINTMSK2
> > [PATCH v2 2/8] usb: dwc2: gadget: Avoid pointless read of EP control 
> > register
> >
> > I can't acked other patches from this series, because they are not 
> > related to dwc2.
> 
> heh, I saw that after sending the email, sorry :-)

Also, all patches are already in -next, courtesy of Greg.
Felipe Balbi July 21, 2020, 11:55 a.m. UTC | #6
Hi,

Lee Jones <lee.jones@linaro.org> writes:
> On Tue, 21 Jul 2020, Felipe Balbi wrote:
>
>> Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:
>> 
>> > Hi Felipe,
>> >
>> > On 7/21/2020 1:43 PM, Felipe Balbi wrote:
>> >> Minas Harutyunyan <Minas.Harutyunyan@synopsys.com> writes:
>> >> 
>> >>> On 7/15/2020 1:32 PM, Lee Jones wrote:
>> >>>> The value obtained from GINTSTS2 should be masked with the GINTMSK2
>> >>>> value.  Looks like this has been broken since
>> >>>> dwc2_gadget_wkup_alert_handler() was added back in 2018.
>> >>>>
>> >>>> Also 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;
>> >>>>    | ^~~~~~~~
>> >>>>
>> >>>> Cc: Minas Harutyunyan <hminas@synopsys.com>
>> >>>> Cc: Ben Dooks <ben@simtec.co.uk>
>> >>>> Fixes: 187c5298a1229 ("usb: dwc2: gadget: Add handler for WkupAlert interrupt")
>> >>>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> >>>
>> >>> Acked-by: Minas Harutyunyan <hminas@synopsys.com>
>> >> 
>> >> Should I apply the entire series or only 1/8?
>> >> 
>> > In this series only 2 patches are related to dwc2, which I'm already Acked:
>> >
>> > [PATCH v2 1/8] usb: dwc2: gadget: Make use of GINTMSK2
>> > [PATCH v2 2/8] usb: dwc2: gadget: Avoid pointless read of EP control 
>> > register
>> >
>> > I can't acked other patches from this series, because they are not 
>> > related to dwc2.
>> 
>> heh, I saw that after sending the email, sorry :-)
>
> Also, all patches are already in -next, courtesy of Greg.

Cool, I'll rebase on top of Greg's branch
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index df5fedaca60a0..03cf1fa856219 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -260,6 +260,7 @@  static void dwc2_gadget_wkup_alert_handler(struct dwc2_hsotg *hsotg)
 
 	gintsts2 = dwc2_readl(hsotg, GINTSTS2);
 	gintmsk2 = dwc2_readl(hsotg, GINTMSK2);
+	gintsts2 &= gintmsk2;
 
 	if (gintsts2 & GINTSTS2_WKUP_ALERT_INT) {
 		dev_dbg(hsotg->dev, "%s: Wkup_Alert_Int\n", __func__);