All of lore.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punit.agrawal@oss.qualcomm.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Punit Agrawal <punit.agrawal@oss.qualcomm.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"fabioaiuto83@gmail.com" <fabioaiuto83@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jamie Iles <jamie.iles@oss.qualcomm.com>
Subject: Re: [PATCH] drivers/usb/dwc3: fix PCI parent check
Date: Thu, 06 Nov 2025 11:29:22 +0000	[thread overview]
Message-ID: <87pl9v9z71.fsf@stealth> (raw)
In-Reply-To: <20251106010123.mbtqd5epssrpbawv@synopsys.com> (Thinh Nguyen's message of "Thu, 6 Nov 2025 01:01:37 +0000")

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:

> On Wed, Nov 05, 2025, Punit Agrawal wrote:
>> From: Jamie Iles <jamie.iles@oss.qualcomm.com>
>> 
>> The sysdev_is_parent check was being used to infer PCI devices that have
>> the DMA mask set from the PCI capabilities, but sysdev_is_parent is also
>> used for non-PCI ACPI devices in which case the DMA mask would be the
>> bus default or as set by the _DMA method.
>> 
>> Without this fix the DMA mask would default to 32-bits and so allocation
>> would fail if there was no DRAM below 4GB.
>> 
>> Fixes: 47ce45906ca9 ("usb: dwc3: leave default DMA for PCI devices")
>> Signed-off-by: Jamie Iles <jamie.iles@oss.qualcomm.com>
>> Signed-off-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com>
>
> We should Cc stable also.
>
>> ---
>>  drivers/usb/dwc3/core.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index ae140c356295..c2ce2f5e60a1 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>> @@ -25,6 +25,7 @@
>>  #include <linux/of.h>
>>  #include <linux/of_graph.h>
>>  #include <linux/acpi.h>
>> +#include <linux/pci.h>
>>  #include <linux/pinctrl/consumer.h>
>>  #include <linux/pinctrl/devinfo.h>
>>  #include <linux/reset.h>
>> @@ -2241,7 +2242,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
>>  	dev_set_drvdata(dev, dwc);
>>  	dwc3_cache_hwparams(dwc);
>>  
>> -	if (!dwc->sysdev_is_parent &&
>> +	if (!dev_is_pci(dwc->sysdev) &&
>>  	    DWC3_GHWPARAMS0_AWIDTH(dwc->hwparams.hwparams0) == 64) {
>>  		ret = dma_set_mask_and_coherent(dwc->sysdev, DMA_BIT_MASK(64));
>>  		if (ret)
>> -- 
>> 2.34.1
>> 
>
> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thank you for taking a look.

Not sure if Greg prefers a repost or he can add the tag and Cc: stable
while applying. I'll resend next week with updates if there's no
response.

[...]


  reply	other threads:[~2025-11-06 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 14:58 [PATCH] drivers/usb/dwc3: fix PCI parent check Punit Agrawal
2025-11-06  1:01 ` Thinh Nguyen
2025-11-06 11:29   ` Punit Agrawal [this message]
2025-11-06 23:56     ` Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pl9v9z71.fsf@stealth \
    --to=punit.agrawal@oss.qualcomm.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jamie.iles@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.