mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Chua <jeff.chua.linux@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Andrey Panin <pazke@centrinvest.ru>,
	lkml <linux-kernel@vger.kernel.org>,
	Matthew Garrett <mjg@redhat.com>
Subject: Re: How to access serial port that is set in BIOS as OS Controlled
Date: Fri, 12 Aug 2011 15:01:11 +0800 (SGT)	[thread overview]
Message-ID: <Pine.LNX.4.64.1108121443200.26481@boston.corp.fedex.com> (raw)



On Fri, Aug 12, 2011 at 5:49 AM, Bjorn Helgaas <bhelgaas@google.com> 
wrote:

> Oops, my mistake.  You now need "pnp.debug=1" to turn the extra debug

Now, I do see more messages and "resources" show "active" ...


# dmesg
pnp 00:00: parse allocated resources
pnp 00:01: parse allocated resources
pnp 00:01: PNP0c02: calling 0xc11c8a0c
pnp 00:02: parse allocated resources
pnp 00:02: PNP0c02: calling 0xc11c8a0c
pnp 00:03: parse allocated resources
pnp 00:04: parse allocated resources
pnp 00:05: parse allocated resources
pnp 00:06: parse allocated resources
pnp 00:07: parse allocated resources
pnp 00:08: parse resource options
pnp 00:08:   dependent set 0 (acceptable) io  min 0x3f8 max 0x3f8 align 
1 size 8 flags 0x1
pnp 00:08:   dependent set 0 (acceptable) irq 4 flags 0x1
pnp 00:08: parse allocated resources
pnp 00:08: set resources
pnp 00:09: parse resource options
pnp 00:09:   dependent set 0 (acceptable) io  min 0x2f8 max 0x2f8 align 
1 size 8 flags 0x1
pnp 00:09:   dependent set 0 (acceptable) irq 3 flags 0x1
pnp 00:09: parse allocated resources
pnp 00:09: set resources
pnp 00:0a: parse resource options
pnp 00:0a:   dependent set 0 (acceptable) io  min 0x3e8 max 0x3e8 align 
pnp 00:0a:   dependent set 0 (acceptable) irq 6 flags 0x1
pnp 00:0a: pnp_assign_resources, try dependent set 0
pnp 00:0a: pnp_assign_resources succeeded: current resources:
pnp 00:0a: [io  0x03e8-0x03ef flags 0x40000101]
pnp 00:0a:   dependent set 0 (acceptable) irq 6 flags 0x1
pnp 00:0a: pnp_assign_resources, try dependent set 0
pnp 00:0a: pnp_assign_resources succeeded: current resources:
pnp 00:0a: [io  0x03e8-0x03ef flags 0x40000101]
pnp 00:0a: [irq 6 flags 0x40000401]
pnp 00:0a: set resources
pnp 00:0b: parse resource options
pnp 00:0b:   dependent set 0 (acceptable) io  min 0x2e8 max 0x2e8 align 
1 size 8 flags 0x1
pnp 00:0b:   dependent set 0 (acceptable) irq 12 flags 0x1
pnp 00:0b: parse allocated resources
pnp 00:0b: set resources
serial 00:0a: pnp_assign_resources, try dependent set 0
serial 00:0a: pnp_assign_resources succeeded: current resources:
serial 00:0a: [io  0x03e8-0x03ef flags 0x40000101]
serial 00:0a: [irq 6 flags 0x40000401]
serial 00:0a: pnp_start_dev: current resources:
serial 00:0a: [io  0x03e8-0x03ef flags 0x40000101]
serial 00:0a: [irq 6 flags 0x40000401]
serial 00:0a: set resources
serial 00:0a: encode 2 resources
serial 00:0a:   encode io 0x3e8-0x3ef decode 0x1
serial 00:0a:   encode irq 6 edge high exclusive (2-byte descriptor)


# cat /sys/bus/pnp/devices/00:0a/resources
state = active
io 0x3e8-0x3ef
irq 6


# setserial /dev/ttyS2
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 6


# echo activate > /sys/bus/pnp/devices/00:0a/resources
-bash: echo: write error: Device or resource busy

# dmesg
serial 00:0a: in use; can't configure
serial 00:0a: in use; can't configure


# echo disable > /sys/bus/pnp/devices/00:0a/resources
-bash: echo: write error: Device or resource busy

# dmesg
serial 00:0a: in use; can't configure
serial 00:0a: in use; can't configure


> This *should* work.  My guess is that it's failing because the I/O ports 
> at 0x3e8 are still reserved.  The PNP core doesn't actually reserve 
> anything, so it would have to be the 8250 driver.  It doesn't mention 
> those ports in dmesg, so maybe they get reserved when you do the 
> "setserial."

It's working better now. But, the port is now always active and can't be 
disabled.


> The 8250 driver has no idea that you disabled the PNP device, so it 
> would never release them.  Then when you try to activate it again, 
> they're still in use.  You can test this idea a little bit by looking at 
> /proc/ioports (1) immediately after boot, (2) before "setserial", (3) 
> after "setserial", and (4) after you disable the PNP device.

It always shows the same info, except I can't disable the port.

# cat /proc/ioports
   03e8-03ef : serial


Thanks,
Jeff

             reply	other threads:[~2011-08-12  7:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12  7:01 Jeff Chua [this message]
2011-08-12 18:07 ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2011-08-12 21:59 Jeff Chua
2011-08-11  9:07 Jeff Chua
2011-08-11 21:49 ` Bjorn Helgaas
2011-07-28  5:43 Jeff Chua
2011-08-04 10:56 ` Andrey Panin
2011-08-04 17:39   ` Bjorn Helgaas
     [not found]     ` <CAAJw_ZvZEn0qVG3JVfEWFQbOSjVUCJhBwQ2Dw5KQyDx2kY4xbA@mail.gmail.com>
2011-08-05 15:20       ` Bjorn Helgaas
     [not found]         ` <CAAJw_ZvxQQ9-QrSiv9-Y4yCun4W0xvAD3OcdL8gS_hN9FE1rkQ@mail.gmail.com>
2011-08-10 16:46           ` Bjorn Helgaas

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=Pine.LNX.4.64.1108121443200.26481@boston.corp.fedex.com \
    --to=jeff.chua.linux@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=pazke@centrinvest.ru \
    /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®