Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: "Alexander Ivanov" <amivanov@fastmail.com>
To: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
	"Bjørn Mork" <bjorn@mork.no>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: GPIO Driver for Skylake-Y PCH
Date: Fri, 14 Jun 2019 13:25:32 -0700
Message-ID: <ca51e853-1de4-4315-ae70-57bda467c96b@www.fastmail.com> (raw)
In-Reply-To: <25501.1560539366@turing-police>

[-- Attachment #1.1: Type: text/plain, Size: 2646 bytes --]



On Fri, 14 Jun 2019 12:09 -07:00, Valdis Klētnieks <valdis.kletnieks@vt.edu> wrote:
> On Fri, 14 Jun 2019 12:01:28 -0700, you said:
> 
> > > static const struct pci_device_id pch_gpio_pcidev_id[] = {
> > > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) },
> > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) },
> > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) },
> > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) },
> > > { 0, }
> > > };
> > > MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id);
> 
> > It is a PCI device with 8086/9d20 IDs.
> 
> Give this patch a try, if it works I'll push it upstream for you...
> 
> diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
> index 1d99293096f2..19884b5b2a74 100644
> --- a/drivers/gpio/gpio-pch.c
> +++ b/drivers/gpio/gpio-pch.c
> @@ -439,6 +439,7 @@ static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume);
> 
> static const struct pci_device_id pch_gpio_pcidev_id[] = {
> { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) },
> + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d20) },
> { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) },
> { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) },
> { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) },
> 


I did try this. It did not enumerate.
There is one little detail. This device is hidden by default in motherboard FW. However, I manually un-hide it before trying to enumerate the device.

gpio-pch driver's patched as you described, built out-of-tree and loaded. Then, I un-hide the device and rescan the bus:

# echo 1 > /sys/bus/pcie/rescan




On Fri, 14 Jun 2019 12:13 -07:00, Bjørn Mork <bjorn@mork.no> wrote:
> "Valdis Klētnieks" <valdis.kletnieks@vt.edu> writes:
>
> > Though I'm having a hard time aligning that with "D31:F2". Are you confusing
> > a PCI address with a PCI ID, or is this on a non-PCI bus?
>
> "D31:F2" is device 31, function 2. We're used to see this as "1f.2".
>
> The question is really: Is there such a device in the system? And if so:
> What's the ID? That's easy to find out:
>
> lspci -vvvnns 0:1f.2
>

Device is indeed there:
lspci -vvvnns 1f.1
00:1f.1 Memory controller [0580]: Intel Corporation Device [8086:9d20] (rev 21)
 Subsystem: Gigabyte Technology Co., Ltd Device [1458:1000]
 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-
 Latency: 0
 Region 0: Memory at 7d000000 (64-bit, non-prefetchable) [size=16M]


ps. I misstyped device address in my original post, it is supposed to be function 1 not 2: d31:f1.

[-- Attachment #1.2: Type: text/html, Size: 4118 bytes --]

<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div><br></div><div>On Fri, 14 Jun 2019 12:09 -07:00, Valdis Klētnieks &lt;valdis.kletnieks@vt.edu&gt; wrote:<br></div><blockquote type="cite" id="qt"><div>On Fri, 14 Jun 2019 12:01:28 -0700, you said:<br></div><div><br></div><div>&gt; &gt; static const struct pci_device_id pch_gpio_pcidev_id[] = {<br></div><div>&gt; &gt;&nbsp; { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) },<br></div><div>&gt; &gt;&nbsp; { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) },<br></div><div>&gt; &gt;&nbsp; { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) },<br></div><div>&gt; &gt;&nbsp; { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) },<br></div><div>&gt; &gt;&nbsp; { 0, }<br></div><div>&gt; &gt; };<br></div><div>&gt; &gt; MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id);<br></div><div><br></div><div>&gt; It is a PCI device with 8086/9d20 IDs.<br></div><div><br></div><div>Give this patch a try, if it works I'll push it upstream for you...<br></div><div><br></div><div>diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c<br></div><div>index 1d99293096f2..19884b5b2a74 100644<br></div><div>--- a/drivers/gpio/gpio-pch.c<br></div><div>+++ b/drivers/gpio/gpio-pch.c<br></div><div>@@ -439,6 +439,7 @@ static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume);<br></div><div><br></div><div>static const struct pci_device_id pch_gpio_pcidev_id[] = {<br></div><div>{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) },<br></div><div>+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d20) },<br></div><div>{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) },<br></div><div>{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) },<br></div><div>{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) },<br></div><div><br></div></blockquote><div><br></div><div><br></div><div>I did try this. It did not enumerate.<br></div><div>There is one little detail. This device is hidden by default in motherboard FW. However, I manually un-hide it before trying to enumerate the device.<br></div><div><br></div><div>gpio-pch driver's patched as you described, built out-of-tree and loaded. Then, I un-hide the device and rescan the bus:<br></div><div><br></div><div># echo 1 &gt; /sys/bus/pcie/rescan<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>On Fri, 14 Jun 2019 12:13 -07:00, Bjørn Mork &lt;<a href="mailto:bjorn@mork.no">bjorn@mork.no</a>&gt; wrote:<br></div><div>&gt; "Valdis Klētnieks" &lt;<a href="mailto:valdis.kletnieks@vt.edu">valdis.kletnieks@vt.edu</a>&gt; writes:<br></div><div>&gt;<br></div><div>&gt; &gt; Though I'm having a hard time aligning that with "D31:F2". Are you confusing<br></div><div>&gt; &gt; a PCI address with a PCI ID, or is this on a non-PCI bus?<br></div><div>&gt;<br></div><div>&gt; "D31:F2" is device 31, function 2. We're used to see this as "1f.2".<br></div><div>&gt;<br></div><div>&gt; The question is really: Is there such a device in the system? And if so:<br></div><div>&gt; What's the ID? That's easy to find out:<br></div><div>&gt;<br></div><div>&gt;&nbsp;&nbsp; lspci -vvvnns 0:1f.2<br></div><div>&gt;<br></div><div><br></div><div>Device is indeed there:<br></div><div>lspci -vvvnns 1f.1<br></div><div>00:1f.1 Memory controller [0580]: Intel Corporation Device [8086:9d20] (rev 21)<br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Subsystem: Gigabyte Technology Co., Ltd Device [1458:1000]<br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-<br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast &gt;TAbort- &lt;TAbort- &lt;MAbort- &gt;SERR- &lt;PERR- INTx-<br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latency: 0<br></div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Region 0: Memory at 7d000000 (64-bit, non-prefetchable) [size=16M]<br></div><div><br></div><div><br></div><div>ps. I misstyped device address in my original post, it is supposed to be function 1 not 2: d31:f1.<br></div></body></html>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply index

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 17:58 Alexander Ivanov
2019-06-14 18:46 ` Valdis Klētnieks
2019-06-14 19:01   ` Alexander Ivanov
2019-06-14 19:09     ` Valdis Klētnieks
2019-06-14 20:25       ` Alexander Ivanov [this message]
2019-06-14 22:40         ` Alexander Ivanov
2019-06-15  8:53           ` Bjørn Mork
2019-06-15 19:30           ` Valdis Klētnieks
2019-06-15 19:38             ` Alexander Ivanov
2019-06-15 19:56               ` Greg KH
2019-06-16  1:50               ` Valdis Klētnieks
2019-06-16  2:45                 ` Alexander Ivanov
2019-06-16  8:54                   ` Bjørn Mork
2019-06-17  8:06             ` Andy Shevchenko
2019-06-18  0:00               ` Alexander Ivanov
2019-06-18  8:40                 ` Andy Shevchenko
2019-06-18 14:48                   ` Valdis Klētnieks
2019-06-18 15:57                     ` Andy Shevchenko
2019-06-18 16:17                       ` Alexander Ivanov
2019-06-20 21:02                   ` Alexander Ivanov
2019-06-21 10:12                     ` Andy Shevchenko
2019-06-21 17:39                       ` Alexander Ivanov
2019-06-24 18:39                         ` Alexander Ivanov
2019-06-25 11:08                           ` Andy Shevchenko
2019-06-25 14:10                             ` Linus Walleij
2019-07-10 16:04                               ` Andy Shevchenko
2019-06-14 19:12   ` Bjørn Mork

Reply instructions:

You may reply publically 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=ca51e853-1de4-4315-ae70-57bda467c96b@www.fastmail.com \
    --to=amivanov@fastmail.com \
    --cc=bjorn@mork.no \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=valdis.kletnieks@vt.edu \
    /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

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox