public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Peter Chen (CIX)" <peter.chen@kernel.org>
To: Pawel Laszczak <pawell@cadence.com>
Cc: Roger Quadros <rogerq@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH v2] usb: cdnsp: Add support for device-only configuration
Date: Thu, 7 May 2026 09:05:03 +0800	[thread overview]
Message-ID: <afvlPzS6tRDcIVAf@nchen-desktop> (raw)
In-Reply-To: <PH7PR07MB95380DF4D3F0AB37E28C05CCDD3F2@PH7PR07MB9538.namprd07.prod.outlook.com>

On 26-05-06 10:31:48, Pawel Laszczak wrote:
> >I still concern this, CIX SoC has host-only configuration, and it needs to use
> >cdns3 driver for low power purpose, eg set D3 mode for controller.
> 
> If dr_mode is set to 'host' or 'peripheral' and the OTG IRQ is not configured
> in the DTS, the driver will detect this as no_drd. This may be inconsistent
> with the actual hardware state, as the DRD component might still exist.
> It might be safer to revert to the version where no_drd is not detected
> based on the otg_irq, and instead add a no_drd property in cdnsp_pci.c.
> If necessary, this can also be added to the DTS.
> This should fully ensure the correct operation of existing platforms.
> 
> With this approach, for the sake of completeness, we could set
> USB_DR_MODE_HOST or USB_DR_MODE_PERIPHERAL in the condition
> above based on dr_mode. 

I agree with you that introduce one property for no OTG hardware
block, and make judgment in driver.

Peter
> 
> >
> >>  	regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res);
> >>  	if (IS_ERR(regs))
> >>  		return PTR_ERR(regs);
> >> @@ -500,6 +515,9 @@ int cdns_drd_exit(struct cdns *cdns)
> >>  /* Indicate the cdns3 core was power lost before */  bool
> >> cdns_power_is_lost(struct cdns *cdns)  {
> >> +	if (cdns->no_drd)
> >> +		return false;
> >> +
> >
> >You may not just return false, would you please find one host and one device
> >register to compare, we need this feature.
> 
> Also this condition will be correct for existing platforms.
> 
> Does this look correct to you?
> 
> Pawel
> >
> >Peter
> >
> >>  	if (cdns->version == CDNS3_CONTROLLER_V0) {
> >>  		if (!(readl(&cdns->otg_v0_regs->simulate) & BIT(0)))
> >>  			return true;
> >> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index
> >> 24cb42f66e4b..a6b9b6f6d8cc 100644
> >> --- a/include/linux/pci_ids.h
> >> +++ b/include/linux/pci_ids.h
> >> @@ -2424,6 +2424,7 @@
> >>  #define PCI_DEVICE_ID_CDNS_USBSS	0x0100
> >>  #define PCI_DEVICE_ID_CDNS_USB		0x0120
> >>  #define PCI_DEVICE_ID_CDNS_USBSSP	0x0200
> >> +#define PCI_DEVICE_ID_CDNS_UDC_USBSSP	0x0400
> >>
> >>  #define PCI_VENDOR_ID_ARECA		0x17d3
> >>  #define PCI_DEVICE_ID_ARECA_1110	0x1110
> >>
> >> ---
> >> base-commit: 9d0d467c3572e93c5faa2e5906a8bbcd70b24efd
> >> change-id: 20260505-device_only_branch_v2-53692f329752
> >>
> >> Best regards,
> >> --
> >> Pawel Laszczak <pawell@cadence.com>
> >>
> >>
> >
> >--
> >
> >Best regards,
> >Peter

-- 

Best regards,
Peter

      reply	other threads:[~2026-05-07  1:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05 10:02 [PATCH v2] usb: cdnsp: Add support for device-only configuration Pawel Laszczak via B4 Relay
2026-05-06  2:36 ` Peter Chen (CIX)
2026-05-06 10:31   ` Pawel Laszczak
2026-05-07  1:05     ` Peter Chen (CIX) [this message]

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=afvlPzS6tRDcIVAf@nchen-desktop \
    --to=peter.chen@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=rogerq@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox