diff mbox series

[v2,1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role

Message ID 20221130081231.3127369-1-xu.yang_2@nxp.com
State Superseded
Headers show
Series [v2,1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role | expand

Commit Message

Xu Yang Nov. 30, 2022, 8:12 a.m. UTC
It should not return -EINVAL if the request role is the same with current
role, return non-error and without do anything instead.

Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
cc: <stable@vger.kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

---
changes since v1:
- no change
---
 drivers/usb/chipidea/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Xu Yang March 16, 2023, 9:57 a.m. UTC | #1
Hi Greg,

> -----Original Message-----
> From: Peter Chen <peter.chen@kernel.org>
> Sent: Friday, February 10, 2023 4:55 PM
> To: Xu Yang <xu.yang_2@nxp.com>
> Cc: gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li <jun.li@nxp.com>
> Subject: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> 
> Caution: EXT Email
> 
> On 22-11-30 16:12:29, Xu Yang wrote:
> > It should not return -EINVAL if the request role is the same with current
> > role, return non-error and without do anything instead.
> >
> > Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
> > cc: <stable@vger.kernel.org>
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> 
> Acked-by: Peter Chen <peter.chen@kernel.org>

Could you please add these three patches to your repo?

Thanks,
Xu Yang

> 
> Peter
> >
> > ---
> > changes since v1:
> > - no change
> > ---
> >  drivers/usb/chipidea/core.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> > index 484b1cd23431..fcb175b22188 100644
> > --- a/drivers/usb/chipidea/core.c
> > +++ b/drivers/usb/chipidea/core.c
> > @@ -984,9 +984,12 @@ static ssize_t role_store(struct device *dev,
> >                            strlen(ci->roles[role]->name)))
> >                       break;
> >
> > -     if (role == CI_ROLE_END || role == ci->role)
> > +     if (role == CI_ROLE_END)
> >               return -EINVAL;
> >
> > +     if (role == ci->role)
> > +             return n;
> > +
> >       pm_runtime_get_sync(dev);
> >       disable_irq(ci->irq);
> >       ci_role_stop(ci);
> > --
> > 2.34.1
> >
> 
> --
> 
> Thanks,
> Peter Chen
Greg KH March 16, 2023, 11:54 a.m. UTC | #2
On Thu, Mar 16, 2023 at 09:57:05AM +0000, Xu Yang wrote:
> Hi Greg,
> 
> > -----Original Message-----
> > From: Peter Chen <peter.chen@kernel.org>
> > Sent: Friday, February 10, 2023 4:55 PM
> > To: Xu Yang <xu.yang_2@nxp.com>
> > Cc: gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li <jun.li@nxp.com>
> > Subject: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> > 
> > Caution: EXT Email
> > 
> > On 22-11-30 16:12:29, Xu Yang wrote:
> > > It should not return -EINVAL if the request role is the same with current
> > > role, return non-error and without do anything instead.
> > >
> > > Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
> > > cc: <stable@vger.kernel.org>
> > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > 
> > Acked-by: Peter Chen <peter.chen@kernel.org>
> 
> Could you please add these three patches to your repo?

Can you please resend them, I don't seem to have them anymore.  Also
split this into 2 different series, one for bugfixes-only, that needs to
go to Linus for 6.3-final, and the others that are new features, to go
for 6.4-rc1.

thanks,

greg k-h
Xu Yang March 17, 2023, 2:37 a.m. UTC | #3
Hi Greg,

> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Thursday, March 16, 2023 7:55 PM
> To: Xu Yang <xu.yang_2@nxp.com>
> Cc: Peter Chen <peter.chen@kernel.org>; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> <jun.li@nxp.com>
> Subject: Re: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> 
> Caution: EXT Email
> 
> On Thu, Mar 16, 2023 at 09:57:05AM +0000, Xu Yang wrote:
> > Hi Greg,
> >
> > > -----Original Message-----
> > > From: Peter Chen <peter.chen@kernel.org>
> > > Sent: Friday, February 10, 2023 4:55 PM
> > > To: Xu Yang <xu.yang_2@nxp.com>
> > > Cc: gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> <jun.li@nxp.com>
> > > Subject: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> > >
> > > Caution: EXT Email
> > >
> > > On 22-11-30 16:12:29, Xu Yang wrote:
> > > > It should not return -EINVAL if the request role is the same with current
> > > > role, return non-error and without do anything instead.
> > > >
> > > > Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
> > > > cc: <stable@vger.kernel.org>
> > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > >
> > > Acked-by: Peter Chen <peter.chen@kernel.org>
> >
> > Could you please add these three patches to your repo?
> 
> Can you please resend them, I don't seem to have them anymore.  Also
> split this into 2 different series, one for bugfixes-only, that needs to
> go to Linus for 6.3-final, and the others that are new features, to go
> for 6.4-rc1.

Patch 2/3 is a bugfix, but it depends on patch 1/3. I cannot simply
separate them. After I resend them, could you please let them all go
to Linus for 6.4-rc1?

Thanks,
Xu Yang

> 
> thanks,
> 
> greg k-h
Greg KH March 17, 2023, 4:50 a.m. UTC | #4
On Fri, Mar 17, 2023 at 02:37:47AM +0000, Xu Yang wrote:
> Hi Greg,
> 
> > -----Original Message-----
> > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > Sent: Thursday, March 16, 2023 7:55 PM
> > To: Xu Yang <xu.yang_2@nxp.com>
> > Cc: Peter Chen <peter.chen@kernel.org>; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> > <jun.li@nxp.com>
> > Subject: Re: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> > 
> > Caution: EXT Email
> > 
> > On Thu, Mar 16, 2023 at 09:57:05AM +0000, Xu Yang wrote:
> > > Hi Greg,
> > >
> > > > -----Original Message-----
> > > > From: Peter Chen <peter.chen@kernel.org>
> > > > Sent: Friday, February 10, 2023 4:55 PM
> > > > To: Xu Yang <xu.yang_2@nxp.com>
> > > > Cc: gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> > <jun.li@nxp.com>
> > > > Subject: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> > > >
> > > > Caution: EXT Email
> > > >
> > > > On 22-11-30 16:12:29, Xu Yang wrote:
> > > > > It should not return -EINVAL if the request role is the same with current
> > > > > role, return non-error and without do anything instead.
> > > > >
> > > > > Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
> > > > > cc: <stable@vger.kernel.org>
> > > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > > >
> > > > Acked-by: Peter Chen <peter.chen@kernel.org>
> > >
> > > Could you please add these three patches to your repo?
> > 
> > Can you please resend them, I don't seem to have them anymore.  Also
> > split this into 2 different series, one for bugfixes-only, that needs to
> > go to Linus for 6.3-final, and the others that are new features, to go
> > for 6.4-rc1.
> 
> Patch 2/3 is a bugfix, but it depends on patch 1/3. I cannot simply
> separate them. After I resend them, could you please let them all go
> to Linus for 6.4-rc1?

Resend and I will review, but that sounds like you also need to mark
patch 1 as a fix, and then patch 3 is not part of the series and can be
separate, right?

What would you do if you were in my position here?  Make it easy for
maintainers please :)

thanks,

greg k-h
Xu Yang March 17, 2023, 5:34 a.m. UTC | #5
> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Friday, March 17, 2023 12:51 PM
> To: Xu Yang <xu.yang_2@nxp.com>
> Cc: Peter Chen <peter.chen@kernel.org>; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> <jun.li@nxp.com>
> Subject: Re: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
> 
> Caution: EXT Email
> 
> On Fri, Mar 17, 2023 at 02:37:47AM +0000, Xu Yang wrote:
> > Hi Greg,
> >
> > > -----Original Message-----
> > > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > > Sent: Thursday, March 16, 2023 7:55 PM
> > > To: Xu Yang <xu.yang_2@nxp.com>
> > > Cc: Peter Chen <peter.chen@kernel.org>; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> > > <jun.li@nxp.com>
> > > Subject: Re: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current
> role
> > >
> > > Caution: EXT Email
> > >
> > > On Thu, Mar 16, 2023 at 09:57:05AM +0000, Xu Yang wrote:
> > > > Hi Greg,
> > > >
> > > > > -----Original Message-----
> > > > > From: Peter Chen <peter.chen@kernel.org>
> > > > > Sent: Friday, February 10, 2023 4:55 PM
> > > > > To: Xu Yang <xu.yang_2@nxp.com>
> > > > > Cc: gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Jun Li
> > > <jun.li@nxp.com>
> > > > > Subject: [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current
> role
> > > > >
> > > > > Caution: EXT Email
> > > > >
> > > > > On 22-11-30 16:12:29, Xu Yang wrote:
> > > > > > It should not return -EINVAL if the request role is the same with current
> > > > > > role, return non-error and without do anything instead.
> > > > > >
> > > > > > Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
> > > > > > cc: <stable@vger.kernel.org>
> > > > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > > > >
> > > > > Acked-by: Peter Chen <peter.chen@kernel.org>
> > > >
> > > > Could you please add these three patches to your repo?
> > >
> > > Can you please resend them, I don't seem to have them anymore.  Also
> > > split this into 2 different series, one for bugfixes-only, that needs to
> > > go to Linus for 6.3-final, and the others that are new features, to go
> > > for 6.4-rc1.
> >
> > Patch 2/3 is a bugfix, but it depends on patch 1/3. I cannot simply
> > separate them. After I resend them, could you please let them all go
> > to Linus for 6.4-rc1?
> 
> Resend and I will review, but that sounds like you also need to mark
> patch 1 as a fix, and then patch 3 is not part of the series and can be
> separate, right?

Yes, understood.

Thanks

> 
> What would you do if you were in my position here?  Make it easy for
> maintainers please :)
> 
> thanks,
> 
> greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 484b1cd23431..fcb175b22188 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -984,9 +984,12 @@  static ssize_t role_store(struct device *dev,
 			     strlen(ci->roles[role]->name)))
 			break;
 
-	if (role == CI_ROLE_END || role == ci->role)
+	if (role == CI_ROLE_END)
 		return -EINVAL;
 
+	if (role == ci->role)
+		return n;
+
 	pm_runtime_get_sync(dev);
 	disable_irq(ci->irq);
 	ci_role_stop(ci);