mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cameron Williams <cang1@live.co.uk>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Jiri Slaby" <jirislaby@kernel.org>,
	"Joshua Rogers" <linux@joshua.hu>,
	"Chris Mason" <mason@kernel.org>,
	"Josef Bacik" <josef@toxicpanda.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Rafael Gago Castano" <rgc@hms.se>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Peter Hurley" <peter@hurleysoftware.com>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Crescent Hsieh" <crescentcy.hsieh@moxa.com>,
	"Frank Li" <Frank.Li@nxp.com>, "Sherry Sun" <sherry.sun@nxp.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Olof Johansson" <olof@lixom.net>,
	"Andreas Färber" <afaerber@suse.de>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Peter Griffin" <peter.griffin@linaro.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	"Robert Baldyga" <r.baldyga@samsung.com>,
	"Thomas Abraham" <thomas.abraham@linaro.org>,
	"Kukjin Kim" <kgene.kim@samsung.com>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Srinivas Kandagatla" <srini@kernel.org>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Vladimir Zapolskiy" <vladimir_zapolskiy@mentor.com>,
	"Al Cooper" <alcooperx@gmail.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	"Uwe Kleine-König (The Capable Hub)"
	<u.kleine-koenig@baylibre.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lukas Wunner" <lukas@wunner.de>,
	"Marnix Rijnart" <marnix.rijnart@iwell.eu>,
	stable <stable@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 11/24] serial: 8250: cap OxSemi Tornado UART count against BAR size
Date: Wed, 28 Oct 2026 10:52:10 +0000	[thread overview]
Message-ID: <GVXPR02MB12019B3EB555B0F744F294A3EC46F2@GVXPR02MB12019.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2610271300480.42255@angie.orcam.me.uk>



On 27/10/2026 14:29, Maciej W. Rozycki wrote:
> 
>   So I think overall this ought to look like (unchecked):
> 
> static int pci_oxsemi_tornado_init(struct pci_dev *dev)
> {
> 	u8 __iomem *p;
> 	unsigned long deviceID;
> 	int number_uarts = -ENXIO;
> 
> 	if (!pci_oxsemi_tornado_p(dev) || pci_resource_len(dev, 0) < 8)
> 		return -ENXIO;
> 
> 	p = pci_iomap(dev, 0, 5);
> 	if (p == NULL)
> 		return -ENOMEM;
> 
> 	deviceID = ioread32(p);
> 	/* Tornado device */
> 	if (deviceID == 0x07000200) {
> 		number_uarts = ioread8(p + 4);
> 		pci_dbg(dev, "%d ports detected on %s PCI Express device\n",
> 			number_uarts,
> 			dev->vendor == PCI_VENDOR_ID_ENDRUN ?
> 			"EndRun" : "Oxford");
> 		if (number_uarts < 1)
> 			number_uarts = -ENXIO;
> 	}
> 	pci_iounmap(dev, p);
> 	return number_uarts;
> }
> 
> with the FL_REGION_SZ_CAP flag set for the relevant entries, and possibly
> setting ->num_ports to 0 too since we need to determine that at run time.
> 
>   Not sure how this interferes with Brainboxes devices, support for which
> seems not to have been fully merged given that pci_oxsemi_tornado_p() does
> not let PCI_VENDOR_ID_INTASHIELD devices through.  Cameron?

The Oxford cards all work even though not explicitly mentioned in 
pci_oxsemi_tornado_p(). The cards all report 16K for BAR0, so I would 
assume this patch should not cause any issues?
See lspci -nnvvv output below for a 4-port card (PX-420). This should be 
OK? Thanks for checking in.

02:00.0 Serial controller [0700]: Brainboxes Ltd PX-420 3 + 1 port 
RS-232 card [135a:4011] (rev 02) (prog-if 06 [16950])
         Subsystem: Brainboxes Ltd PX-420 3 + 1 port RS-232 card [135a:4011]
         Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- 
ParErr- Stepping- SERR- FastB2B- DisINTx-
         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- 
<TAbort- <MAbort- >SERR- <PERR- INTx-
         Interrupts: pin B routed to IRQ 16
         IOMMU group: 12
         Region 0: Memory at 70800000 (32-bit, non-prefetchable) [size=16K]
         Region 1: Memory at 70600000 (32-bit, non-prefetchable) [size=2M]
         Region 2: Memory at 70400000 (32-bit, non-prefetchable) [size=2M]
         Capabilities: [40] Power Management version 3
                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=55mA 
PME(D0-,D1+,D2+,D3hot+,D3cold-)
                 Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
         Capabilities: [70] Express (v1) Endpoint, IntMsgNum 0
                 DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s 
<128ns, L1 <2us
                         ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- 
SlotPowerLimit 25W TEE-IO-
                 DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
                         RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                         MaxPayload 128 bytes, MaxReadReq 512 bytes
                 DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- 
AuxPwr+ TransPend-
                 LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, 
Exit Latency L0s unlimited, L1 unlimited
                         ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
                 LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk+
                         ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt- 
FltModeDis-
                 LnkSta: Speed 2.5GT/s, Width x1
                         TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
         Capabilities: [b0] MSI-X: Enable- Count=16 Masked-
                 Vector table: BAR=1 offset=001b3000
                 PBA: BAR=1 offset=001b2000
         Capabilities: [100 v1] Device Serial Number 00-30-e0-11-11-00-02-00
         Capabilities: [110 v1] Power Budgeting <?>
         Kernel driver in use: serial
         Kernel modules: 8250_pci

> 
>   NB BAR0 size is 16k by the spec and the maximum # of UARTs is 16, for a
> dual-OXPCIe958 master/slave setup, still leaving 4k of the available space
> unoccupied.
> 
>    Maciej

Acked-by: Cameron Williams <cang1@live.co.uk>


  parent reply	other threads:[~2026-10-28 10:52 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 11:06 [PATCH 00/24] tty/serial: a bunch of llm-found fixes Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 01/24] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 02/24] serial: core: respect runtime PM when sending x_char Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 03/24] serial: 8250: don't wait for the em485 timers locked Greg Kroah-Hartman
2026-10-27 11:39   ` Ilpo Järvinen
2026-10-27 11:06 ` [PATCH 04/24] serial: 8250: don't report a wakeup to a closed tty Greg Kroah-Hartman
2026-10-27 11:43   ` Ilpo Järvinen
2026-10-27 11:06 ` [PATCH 05/24] serial: 8250: clear subdriver state on port unregister Greg Kroah-Hartman
2026-10-27 11:16   ` Jiri Slaby
2026-10-27 15:28     ` James Hilliard
2026-10-27 11:06 ` [PATCH 06/24] serial: 8250: add bounds check for line array in setup_serial() Greg Kroah-Hartman
2026-10-27 11:57   ` Ilpo Järvinen
2026-10-27 11:06 ` [PATCH 07/24] serial: 8250: hold hash_mutex across irq_info lookup and linking Greg Kroah-Hartman
2026-10-27 12:00   ` Ilpo Järvinen
2026-10-27 11:06 ` [PATCH 08/24] serial: 8250: cancel overrun backoff work on port shutdown and unregister Greg Kroah-Hartman
2026-10-27 12:15   ` Ilpo Järvinen
2026-10-27 11:06 ` [PATCH 09/24] serial: 8250: 8250_bcm7271: fix DMA address truncation to 32 bits Greg Kroah-Hartman
2026-10-27 12:18   ` Ilpo Järvinen
2026-10-27 15:10   ` Andy Shevchenko
2026-10-27 16:41     ` Florian Fainelli
2026-10-27 17:14       ` Andy Shevchenko
2026-10-27 17:19         ` Florian Fainelli
2026-10-27 18:37           ` Arnd Bergmann
2026-10-27 11:06 ` [PATCH 10/24] serial: 8250: pericom: validate port offset against BAR length Greg Kroah-Hartman
2026-10-27 15:13   ` Andy Shevchenko
2026-10-27 11:06 ` [PATCH 11/24] serial: 8250: cap OxSemi Tornado UART count against BAR size Greg Kroah-Hartman
2026-10-27 11:23   ` Jiri Slaby
2026-10-27 11:33     ` Greg Kroah-Hartman
2026-10-27 12:24   ` Ilpo Järvinen
2026-10-27 14:29   ` Maciej W. Rozycki
2026-10-27 15:23     ` Andy Shevchenko
2026-10-27 21:13       ` Maciej W. Rozycki
2026-10-28 10:52     ` Cameron Williams [this message]
2026-10-28 15:10       ` Maciej W. Rozycki
2026-10-27 11:06 ` [PATCH 12/24] serial: 8250: dfl: add bounds check for device-provided regshift Greg Kroah-Hartman
2026-10-27 15:36   ` Andy Shevchenko
2026-10-27 11:06 ` [PATCH 13/24] serial: 8250: dfl: validate MMIO resource size and regshift Greg Kroah-Hartman
2026-10-27 12:30   ` Ilpo Järvinen
2026-10-27 15:38   ` Andy Shevchenko
2026-10-27 11:06 ` [PATCH 14/24] serial: 8250: ioc3: store registered line number in driver data Greg Kroah-Hartman
2026-10-27 12:38   ` Ilpo Järvinen
2026-10-27 13:10     ` Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 15/24] serial: 8250: omap: acquire rx_dma_lock in DMA completion callback Greg Kroah-Hartman
2026-10-27 12:52   ` Ilpo Järvinen
2026-10-27 11:06 ` [PATCH 16/24] serial: 8250_lpss: don't divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 17/24] serial: 8250_mxpcie: handle hangup during break Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 18/24] serial: fsl_lpuart: fix tty ref of wakeup event Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 19/24] serial: imx: fix the tty reference of the " Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 20/24] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
2026-10-27 12:38   ` Manivannan Sadhasivam
2026-10-27 11:06 ` [PATCH 21/24] serial: samsung: don't leak the tty on an RX IRQ Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 22/24] serial: samsung: put the previous baud clock Greg Kroah-Hartman
2026-10-27 11:06 ` [PATCH 23/24] serial: st-asc: don't report a wakeup to a closed tty Greg Kroah-Hartman
2026-10-27 15:51   ` Andy Shevchenko
2026-10-27 11:06 ` [PATCH 24/24] serial: stm32: " Greg Kroah-Hartman
2026-10-27 13:02   ` Ilpo Järvinen
2026-10-29  5:54     ` Jiri Slaby
2026-10-29 11:56       ` Ilpo Järvinen
2026-10-30  7:06         ` Jiri Slaby
2026-10-27 15:06 ` [PATCH 00/24] tty/serial: a bunch of llm-found fixes Andy Shevchenko
2026-10-27 15:50   ` Greg Kroah-Hartman
2026-10-27 16:32     ` Andy Shevchenko

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=GVXPR02MB12019B3EB555B0F744F294A3EC46F2@GVXPR02MB12019.eurprd02.prod.outlook.com \
    --to=cang1@live.co.uk \
    --cc=Frank.Li@nxp.com \
    --cc=afaerber@suse.de \
    --cc=alcooperx@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=crescentcy.hsieh@moxa.com \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=kernel@pengutronix.de \
    --cc=kgene.kim@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@joshua.hu \
    --cc=lukas@wunner.de \
    --cc=macro@orcam.me.uk \
    --cc=mani@kernel.org \
    --cc=marnix.rijnart@iwell.eu \
    --cc=mason@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olof@lixom.net \
    --cc=patrice.chotard@foss.st.com \
    --cc=peter.griffin@linaro.org \
    --cc=peter@hurleysoftware.com \
    --cc=r.baldyga@samsung.com \
    --cc=rgc@hms.se \
    --cc=s.hauer@pengutronix.de \
    --cc=sherry.sun@nxp.com \
    --cc=srini@kernel.org \
    --cc=stable@kernel.org \
    --cc=thomas.abraham@linaro.org \
    --cc=tony@atomide.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=vladimir_zapolskiy@mentor.com \
    /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

all inboxes | Powered by JetHome®