RE: [PATCH v12 11/19] PCI: dwc: Add support for triggering legacy IRQs

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

 



Hi Bjorn,

> From: Bjorn Helgaas, Sent: Saturday, April 15, 2023 4:43 AM
> 
> On Fri, Apr 14, 2023 at 03:16:14PM +0900, Yoshihiro Shimoda wrote:
> > Add support for triggering legacy IRQs by using outbound iATU.
> > Outbound iATU is utilized to send assert and de-assert INTx TLPs.
> > The message is generated based on the payloadless Msg TLP with type
> > 0x14, where 0x4 is the routing code implying the terminated at
> > Receiver message. The message code is specified as b1000xx for
> > the INTx assertion and b1001xx for the INTx de-assertion.
> 
> s/terminated at Receiver/Terminate at Receiver/, since I assume this
> refers to the Message Routing mechanisms in Table 2-20 in sec 2.2.8.

I'll revise the description on v13.

> I have a slight preference for using "INTx" instead of "legacy IRQ" in
> subject, commit log, function names, etc because it's more specific.
> "Legacy" is clear now, but tends to become obscure over time as more
> and more features are added.  Eventually it just means "something old
> that we don't like anymore."

I got it. I'll use "INTx" instead of "legacy" on v13.

> > +static int __dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no,
> > +					 int intx)
> > +{
> > +	int ret;
> > +
> > +	ret = dw_pcie_ep_send_msg(ep, func_no, PCI_CODE_ASSERT_INTA + intx,
> > +				  PCI_MSG_ROUTING_LOCAL);
> > +	if (ret)
> > +		return ret;
> > +
> > +	usleep_range(1000, 2000);
> 
> Where do these values (1000, 2000) come from?  Spec reference would be
> good if there is one.

I referred the values from drivers/pci/controller/pcie-rcar-ep.c, but modified
the second value:
	usleep_range(1000, 1001);

Today I checked the documents of PCIe and this controller, but I could not
find any specification about the period. So, I tried some cases a little.

 No sleep: Always "NOT OKAY"
 udelay(10): Sometimes "NOT OKAY"
 usleep_range(50, 100): Always "OKAY"
 usleep_range(100, 200): Always "OKAY"
 usleep_range(1000, 2000): Always "OKAY"

So, using (1000, 2000) seems too long. So, I'll change the values
as (50, 100) and add comment like below:

	/*
	 * The documents of PCIe and the controller don't mention
	 * how long the INTx should be asserted. If 10 usec, sometimes
	 * it failed. So, asserted for 50 usec.
	 */
	usleep_range(50, 100);

Best regards,
Yoshihiro Shimoda

> Bjorn




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux