* [v3,03/49] usb: dwc2: Remove version check in GSNPSID
@ 2017-12-26 11:22 Grigor Tovmasyan
0 siblings, 0 replies; 5+ messages in thread
From: Grigor Tovmasyan @ 2017-12-26 11:22 UTC (permalink / raw)
To: John Youn, Felipe Balbi, Greg Kroah-Hartman, linux-usb
Cc: Minas Harutyunyan, Gevorg Sahakyan, Grigor Tovmasyan, stable
From: Gevorg Sahakyan <sahakyan@synopsys.com>
Only check the ID portion of the GSNPSID register and don’t check
the version. This will allow the driver to work with version 4.00a
and later of the DWC_hsotg IP.
Cc: stable@vger.kernel.org
Signed-off-by: Gevorg Sahakyan <sahakyan@synopsys.com>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
---
drivers/usb/dwc2/core.h | 5 +++++
drivers/usb/dwc2/hw.h | 1 +
drivers/usb/dwc2/params.c | 11 +++++------
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 0f0c21cf0192..7439aa6e35f6 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -951,6 +951,11 @@ struct dwc2_hsotg {
#define DWC2_FS_IOT_REV_1_00a 0x5531100a
#define DWC2_HS_IOT_REV_1_00a 0x5532100a
+ /* DWC OTG HW Core ID */
+#define DWC2_OTG_ID 0x4f540000
+#define DWC2_FS_IOT_ID 0x55310000
+#define DWC2_HS_IOT_ID 0x55320000
+
#if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
union dwc2_hcd_internal_flags {
u32 d32;
diff --git a/drivers/usb/dwc2/hw.h b/drivers/usb/dwc2/hw.h
index 2c906d8ee465..43a3fb00f14f 100644
--- a/drivers/usb/dwc2/hw.h
+++ b/drivers/usb/dwc2/hw.h
@@ -231,6 +231,7 @@
#define GUID HSOTG_REG(0x003c)
#define GSNPSID HSOTG_REG(0x0040)
#define GHWCFG1 HSOTG_REG(0x0044)
+#define GSNPSID_ID_MASK GENMASK(31, 16)
#define GHWCFG2 HSOTG_REG(0x0048)
#define GHWCFG2_OTG_ENABLE_IC_USB BIT(31)
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 9c3ff66a2eb8..fc4d93d78ec3 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -630,14 +630,13 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
/*
* Attempt to ensure this device is really a DWC_otg Controller.
* Read and verify the GSNPSID register contents. The value should be
- * 0x45f42xxx or 0x45f43xxx, which corresponds to either "OT2" or "OT3",
- * as in "OTG version 2.xx" or "OTG version 3.xx".
+ * 0x45f4xxxx, 0x5531xxxx or 0x5532xxxx
*/
+
hw->snpsid = dwc2_readl(hsotg->regs + GSNPSID);
- if ((hw->snpsid & 0xfffff000) != 0x4f542000 &&
- (hw->snpsid & 0xfffff000) != 0x4f543000 &&
- (hw->snpsid & 0xffff0000) != 0x55310000 &&
- (hw->snpsid & 0xffff0000) != 0x55320000) {
+ if ((hw->snpsid & GSNPSID_ID_MASK) != DWC2_OTG_ID &&
+ (hw->snpsid & GSNPSID_ID_MASK) != DWC2_FS_IOT_ID &&
+ (hw->snpsid & GSNPSID_ID_MASK) != DWC2_HS_IOT_ID) {
dev_err(hsotg->dev, "Bad value for GSNPSID: 0x%08x\n",
hw->snpsid);
return -ENODEV;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [v3,03/49] usb: dwc2: Remove version check in GSNPSID
@ 2017-12-29 16:59 Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-29 16:59 UTC (permalink / raw)
To: Grigor Tovmasyan
Cc: John Youn, Felipe Balbi, linux-usb, Minas Harutyunyan,
Gevorg Sahakyan, stable
On Tue, Dec 26, 2017 at 03:22:05PM +0400, Grigor Tovmasyan wrote:
> From: Gevorg Sahakyan <sahakyan@synopsys.com>
>
> Only check the ID portion of the GSNPSID register and don’t check
> the version. This will allow the driver to work with version 4.00a
> and later of the DWC_hsotg IP.
>
> Cc: stable@vger.kernel.org
For bugfixes like this, or other stable patches, they should all be
first in the series, so that none of them depened on any previous
patches.
thanks,
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [v3,03/49] usb: dwc2: Remove version check in GSNPSID
@ 2017-12-29 19:56 Minas Harutyunyan
0 siblings, 0 replies; 5+ messages in thread
From: Minas Harutyunyan @ 2017-12-29 19:56 UTC (permalink / raw)
To: Greg KH, Grigor Tovmasyan
Cc: John Youn, Felipe Balbi, linux-usb@vger.kernel.org,
Minas Harutyunyan, Gevorg Sahakyan, stable@vger.kernel.org
Hi Greg,
On 12/29/2017 8:59 PM, Greg KH wrote:
> On Tue, Dec 26, 2017 at 03:22:05PM +0400, Grigor Tovmasyan wrote:
>> From: Gevorg Sahakyan <sahakyan@synopsys.com>
>>
>> Only check the ID portion of the GSNPSID register and don’t check
>> the version. This will allow the driver to work with version 4.00a
>> and later of the DWC_hsotg IP.
>>
>> Cc: stable@vger.kernel.org
>
> For bugfixes like this, or other stable patches, they should all be
> first in the series, so that none of them depened on any previous
> patches.
>
> thanks,
>
> greg k-h
>
1. Mentioned patch submitted to lkml as alone patch on Dec 6 by Gevorg
Sahakyan but was ignored by community.
2. This patch not dependent on any other previous patches in series.
Thanks,
Minas
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [v3,03/49] usb: dwc2: Remove version check in GSNPSID
@ 2017-12-30 14:11 Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-30 14:11 UTC (permalink / raw)
To: Minas Harutyunyan
Cc: Grigor Tovmasyan, John Youn, Felipe Balbi,
linux-usb@vger.kernel.org, Gevorg Sahakyan,
stable@vger.kernel.org
On Fri, Dec 29, 2017 at 07:56:18PM +0000, Minas Harutyunyan wrote:
> Hi Greg,
>
> On 12/29/2017 8:59 PM, Greg KH wrote:
> > On Tue, Dec 26, 2017 at 03:22:05PM +0400, Grigor Tovmasyan wrote:
> >> From: Gevorg Sahakyan <sahakyan@synopsys.com>
> >>
> >> Only check the ID portion of the GSNPSID register and don’t check
> >> the version. This will allow the driver to work with version 4.00a
> >> and later of the DWC_hsotg IP.
> >>
> >> Cc: stable@vger.kernel.org
> >
> > For bugfixes like this, or other stable patches, they should all be
> > first in the series, so that none of them depened on any previous
> > patches.
> >
> > thanks,
> >
> > greg k-h
> >
>
> 1. Mentioned patch submitted to lkml as alone patch on Dec 6 by Gevorg
> Sahakyan but was ignored by community.
lkml is not where to send dwc patches, you know better than that :)
That's what scripts/get_maintainer.pl is for, always use that.
> 2. This patch not dependent on any other previous patches in series.
How are we supposed to know that? For stuff like this that are bug
fixes and for stable kernels, they should be in a separate series so we
can apply them to the latest -rc release, all of the cleanups and new
features should be in a separate patch series.
Anyway, as others said, 49 patches is a lot, let's wait for the
maintainers to return from vacation before anything else...
thanks,
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [v3,03/49] usb: dwc2: Remove version check in GSNPSID
@ 2018-01-08 12:13 Grigor Tovmasyan
0 siblings, 0 replies; 5+ messages in thread
From: Grigor Tovmasyan @ 2018-01-08 12:13 UTC (permalink / raw)
To: Greg KH, Grigor Tovmasyan
Cc: John Youn, Felipe Balbi, linux-usb@vger.kernel.org,
Minas Harutyunyan, Gevorg Sahakyan, stable@vger.kernel.org
Hi Greg k-h
On 12/29/2017 20:59, Greg KH wrote:
> On Tue, Dec 26, 2017 at 03:22:05PM +0400, Grigor Tovmasyan wrote:
>> From: Gevorg Sahakyan <sahakyan@synopsys.com>
>>
>> Only check the ID portion of the GSNPSID register and don’t check
>> the version. This will allow the driver to work with version 4.00a
>> and later of the DWC_hsotg IP.
>>
>> Cc: stable@vger.kernel.org
>
> For bugfixes like this, or other stable patches, they should all be
> first in the series, so that none of them depened on any previous
> patches.
>
> thanks,
>
> greg k-h
>
Thank you for your response.
Actually, in v2 the "stable@vger.kernel.org" was added by my mistake. I
deleted it from CC in v3, but missed it in this patch.
Please ignore "stable@vger.kernel.org".
We will send this and other patches to "stable@vger.kernel.org"
separately if it be needed.
Thanks,
Grigor.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-08 12:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-29 16:59 [v3,03/49] usb: dwc2: Remove version check in GSNPSID Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2018-01-08 12:13 Grigor Tovmasyan
2017-12-30 14:11 Greg Kroah-Hartman
2017-12-29 19:56 Minas Harutyunyan
2017-12-26 11:22 Grigor Tovmasyan
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).