[PATCH linux dev-4.17 3/7] mmc: Aspeed: Add Aspeed sdhci core driver

Ryan Chen ryanchen.aspeed at gmail.com
Thu Jul 26 13:26:39 AEST 2018


On Thu, Jul 26, 2018 at 01:14:58PM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2018-07-26 at 11:07 +0800, Ryan Chen wrote:
> > On Thu, Jul 26, 2018 at 11:47:40AM +1000, Benjamin Herrenschmidt wrote:
> > > On Thu, 2018-07-26 at 11:41 +1000, Benjamin Herrenschmidt wrote:
> > > > Change the "irq" prefixes on the functions.. Dont' do a chained
> > > > handler, that will be too much overhead for no benefit. Your SoC aren't
> > > > very fast and you want to avoid that overhead.
> > > > 
> > > > Just do a normal interrupt handler, and have it call each port
> > > > interrupts.
> > > > 
> > > > This isn't really an interrupt controller, it has no
> > > > enable/disable/masking ability, I would just create the ports directly
> > > > from the same driver and process the interrupts.
> > > > 
> > > > I don't think there's benefit in keeping the ports as separate drivers.
> > > 
> > > Look at how shdci-pci does it, sdhci-acpi as well, they have multiple
> > > slots. You can just register multiple slots from a single driver
> > > I think. You can still use device-tree sub-nodes and iterate them
> > > from the core driver to create the slots if you want, in case you may
> > > add slots in the future, but it's not even that a big deal.
> > > 
> > > Ben.
> > > 
> > > 
> > 
> > Thanks, after look into sdhci-pci, it should only request one pci_irq, 
> > But, i am wondering where is the slot dispatch. could you help me point out it?
> 
> So the PCI one just uses the same IRQ number for all the slots in
> sdhci_pci_probe_slot(), so the IRQ ends up shared.
> 
> So on every irq it will jsut check all slots.
> 
> Not sure if that's a problem. Due to how sdhci is organized, if you
> really want to make sure it only accesses the one slot, then you indeed
> do have to use a cascaded interrupt controller as you are doing, but
> I'm not sure it's really worthwhile.
> 
> Cheers,
> Ben.
> 
> 
Yes, there is two way, to handle irq.
One is use share irq, so my sdhci driver have following outcome when share 
irq, 
	cat /proc/interrupt
	----------
	34:         82      AVIC  26 Edge      mmc0, mmc1
	---------
when use cascaded interrupt. 
	.........
	292:         35  sdhci-ic   0 Edge      mmc0
	293:         42  sdhci-ic   1 Edge      mmc1
	---------
use separate slot (actually it is) interrupt, it have advantage for each slot 
debug. if use share. the debug will not easy.






More information about the openbmc mailing list