Re: [PATCHv2 1/2] usb: dwc3: pci: use build-in properties instead of platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/8/2016 12:26 AM, Heikki Krogerus wrote:
>>
>> The properties are being set here successfully but when queried in
>> core.c they all report 0.
>>
>> Any ideas?
> 
> How are you testing that? I just tested those properties with
> linux-next and:


I tried on linux-next and still see the same thing. I added debug
messages in the same place.


> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index d064ba8..22cd49b 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -47,6 +47,14 @@ static const struct acpi_gpio_mapping acpi_dwc3_byt_gpios[] = {
>  
>  static int dwc3_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc3)
>  {
> +       struct property_entry pentry[] = {
> +               PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
> +               PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
> +               PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
> +               { },
> +       };
> +       return platform_device_add_properties(dwc3, pentry);
> +
>         if (pdev->vendor == PCI_VENDOR_ID_AMD &&
>             pdev->device == PCI_DEVICE_ID_AMD_NL_USB) {
>                 struct property_entry pentry[] = {


Are you sure about this chunk? It doesn't compile as there is no
'dwc3' argument in dwc3_pci_quirks() and the
platform_device_add_properties() wants a property_set. Your original
patch had it going through dwc3_pci_add_pset().

Below is the patch I used to try to verify on latest.

Any other ideas?

Regards,
John



diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 4a0dc81..c4628e9 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -927,6 +927,10 @@ static int dwc3_probe(struct platform_device *pdev)
        device_property_read_u32(dev, "snps,quirk-frame-length-adjustment",
                                 &fladj);
 
+       dev_info(dev, "usb3_lpm_capable=%d\n", dwc->usb3_lpm_capable);
+       dev_info(dev, "has_lpm_erratum=%d\n", dwc->has_lpm_erratum);
+       dev_info(dev, "dis_enblslpm_quirk=%d\n", dwc->dis_enblslpm_quirk);
+
        /* default to superspeed if no maximum_speed passed */
        if (dwc->maximum_speed == USB_SPEED_UNKNOWN)
                dwc->maximum_speed = USB_SPEED_SUPER;
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 96dbf24..7a3fae4 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -56,6 +56,15 @@ dwc3_pci_add_pset(struct platform_device *dwc3, struct property_entry *ent)
 
 static int dwc3_pci_quirks(struct pci_dev *pdev)
 {
+       struct property_entry pentry[] = {
+               PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
+               PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
+               PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
+               { },
+       };
+
+       return dwc3_pci_add_pset(pci_get_drvdata(pdev), pentry);
+
        if (pdev->vendor == PCI_VENDOR_ID_AMD &&
            pdev->device == PCI_DEVICE_ID_AMD_NL_USB) {
                struct property_entry pentry[] = {
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux