Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-20 Thread Oliver Pinter
On 10/8/14, Yonghyeon PYUN pyu...@gmail.com wrote:
 On Thu, Oct 02, 2014 at 02:07:30PM +0900, Yonghyeon PYUN wrote:
 On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
  On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
   Hi,
   I've added support for QAC AR816x/AR817x ethernet controllers.  It
   passed my limited testing and I need more testers.  You can find
   patches from the following URLs.
  
   http://people.freebsd.org/~yongari/alc/pci.quirk.diff
   and
   http://people.freebsd.org/~yongari/alc/alc.diff.20140930
  
   pci.qurik.diff is to workaround silicon bug of AR816x. Without it
   MSI/MSIX interrupt wouldn't work.  If you just want to use
   legacy INTx interrupt you don't have to apply it but you have to
   tell alc(4) not to use MSI/MSIX interrupt with tunables(
   hw.alc.msi.disable and hw.alc.msix_disable).
  
   alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
   and E2200 controllers.  It supports all hardware features except
   RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
   controllers please test and report how the diff works for you.
   Thanks.
 
  http://people.freebsd.org/~yongari/alc/pci.quirk.diff
  http://people.freebsd.org/~yongari/alc/alc.diff.20141001
 
  Patch updated to address link establishment issue.

 http://people.freebsd.org/~yongari/alc/alc.diff.20141002
 Patch updated again to correct wrong lock assertion.

 FYI: I've committed all the changes required to support
 AR816x/AR817x.

Cool! Working fine with AR8161 on Gigabyte H87N-Wifi Mobo! Thanks!

 ___
 freebsd-current@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-current
 To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-08 Thread Yonghyeon PYUN
On Thu, Oct 02, 2014 at 02:07:30PM +0900, Yonghyeon PYUN wrote:
 On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
  On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
   Hi,
   I've added support for QAC AR816x/AR817x ethernet controllers.  It
   passed my limited testing and I need more testers.  You can find
   patches from the following URLs.
   
   http://people.freebsd.org/~yongari/alc/pci.quirk.diff
   and
   http://people.freebsd.org/~yongari/alc/alc.diff.20140930
   
   pci.qurik.diff is to workaround silicon bug of AR816x. Without it
   MSI/MSIX interrupt wouldn't work.  If you just want to use
   legacy INTx interrupt you don't have to apply it but you have to
   tell alc(4) not to use MSI/MSIX interrupt with tunables(
   hw.alc.msi.disable and hw.alc.msix_disable).
   
   alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
   and E2200 controllers.  It supports all hardware features except
   RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
   controllers please test and report how the diff works for you.
   Thanks.
  
  http://people.freebsd.org/~yongari/alc/pci.quirk.diff
  http://people.freebsd.org/~yongari/alc/alc.diff.20141001
  
  Patch updated to address link establishment issue.
 
 http://people.freebsd.org/~yongari/alc/alc.diff.20141002
 Patch updated again to correct wrong lock assertion.

FYI: I've committed all the changes required to support
AR816x/AR817x.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-06 Thread Dariusz Wierzbicki
Dnia 2014-10-06, o godz. 11:32:13
Yonghyeon PYUN pyu...@gmail.com napisał(a):

 On Fri, Oct 03, 2014 at 09:29:46PM +0200, Dariusz Wierzbicki wrote:
  Dnia 2014-10-02, o godz. 14:07:30
  Yonghyeon PYUN pyu...@gmail.com napisał(a):
  
   On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
 Hi,
 I've added support for QAC AR816x/AR817x ethernet
 controllers.  It passed my limited testing and I need more
 testers.  You can find patches from the following URLs.
 
 http://people.freebsd.org/~yongari/alc/pci.quirk.diff
 and
 http://people.freebsd.org/~yongari/alc/alc.diff.20140930
 
 pci.qurik.diff is to workaround silicon bug of AR816x.
 Without it MSI/MSIX interrupt wouldn't work.  If you just
 want to use legacy INTx interrupt you don't have to apply it
 but you have to tell alc(4) not to use MSI/MSIX interrupt
 with tunables( hw.alc.msi.disable and hw.alc.msix_disable).
 
 alc.diff.20140930 will add support for
 AR8161/AR8162/AR8171/AR8172 and E2200 controllers.  It
 supports all hardware features except RSS.  If you have any
 QAC AR816x/AR817x or old AR813x/AR815x controllers please
 test and report how the diff works for you. Thanks.

http://people.freebsd.org/~yongari/alc/pci.quirk.diff
http://people.freebsd.org/~yongari/alc/alc.diff.20141001

Patch updated to address link establishment issue.
   
   http://people.freebsd.org/~yongari/alc/alc.diff.20141002
   Patch updated again to correct wrong lock assertion.
  
  Hi !
  
  Thanks for your work !
  
  Are your patches only for current ? I tried on 10 stable.
  
 
 No, it should be applied to stable/10 as well.  I intentionally
 didn't include additional diff for MAC statistics which will not
 work on stable/10 and stable/9 due to if_inc_counter changes made
 in HEAD.
 
 I tried to apply the diff again against stable/10 and it succeeded
 with minor fuzz and offset differences.

Thanks for your answer.
I tried again and I succeeded. I used --ignore-whitespace option with
patch command and the alc.diff applied successfully.

 
  
  My system:
  
  dw@dw:~ % uname -a
  FreeBSD dw 10.1-RC1 FreeBSD 10.1-RC1 #1 r272477M: Fri Oct  3
  20:48:05 CEST 2014 dw@dw:/usr/obj/usr/src/sys/DW  amd64
  
 
 [...]
 
  I applied that part manually. Compiled and rebooted system.
  
  
  dmesg | grep alc :
  
  alc0: could not disable Rx/Tx MAC(0x4000cb20)!
  alc0: reset timeout(0x4000cb20)!
  alc0: could not disable Rx/Tx MAC(0x4000cb20)!
   ^
 
 I'm more worried about MAC reset and master reset timeout shown
 below.  The MAC reset timeout makes me wonder how this can happen
 since driver just checks bit 0 and bit 1, the low nibble of the
 register value can't be 0.
 
  alc0: link state changed to UP
  alc0: could not disable Rx/Tx MAC(0x4000cb20)!
  alc0: Qualcomm Atheros AR8161 Gigabit Ethernet port 0xd000-0xd07f
  mem 0xf720-0xf723 irq 18 at device 0.0 on pci3
  alc0: reset timeout(0x4000cd00)!
   
 
 I think this also can't happen since driver checks bit[0-3], the
 low byte should be non-zero when the timeout triggers.
 
  alc0: 11776 Tx FIFO, 12032 Rx FIFO
  miibus0: MII bus on alc0
  alc0: Ethernet address: 74:d4:35:91:32:04
 
 [...]
 
  
  If you need other data or more testing, let me know.
  
 
 Do you have any local changes in alc(4)?  As I said, the diff
 could be applied to stable/10 without any manual modification.
 
 Thanks for testing!

You were right. I had a minor local change in if_alc.c file.
Now everything seems to work:

dw@dw:~ % dmesg | grep alc
Preloaded elf obj module /boot/kernel/if_alc.ko at 0x81bd6b38.
alc0: Atheros AR8161 PCIe Gigabit Ethernet port 0xd000-0xd07f mem
0xf720-0xf723 irq 18 at device 0.0 on pci3 alc0: PCI device
revision : 0x0010 alc0: Chip id/revision : 0xc002
alc0: AR816x revision : 0x2
alc0: 11776 Tx FIFO, 12032 Rx FIFO
alc0: Read request size : 512 bytes.
alc0: TLP payload size : 128 bytes.
alc0: MSIX count : 16
alc0: MSI count : 16
alc0: attempting to allocate 1 MSI-X vectors (16 supported)
alc0: using IRQ 268 for MSI-X
alc0: Using 1 MSIX message(s).
miibus0: MII bus on alc0
alc0: bpf attached
alc0: Ethernet address: 74:d4:35:91:32:04
alc0: link state changed to UP
alc0: Atheros AR8161 PCIe Gigabit Ethernet port 0xd000-0xd07f mem
0xf720-0xf723 irq 18 at device 0.0 on pci3 alc0: 11776 Tx FIFO,
12032 Rx FIFO alc0: Using 1 MSIX message(s).
miibus0: MII bus on alc0
alc0: Ethernet address: 74:d4:35:91:32:04
alc0: link state changed to UP

Thanks again for the patches and for your work !

Darek
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-05 Thread Yonghyeon PYUN
On Sat, Oct 04, 2014 at 08:10:06PM +, Craig Wiesen wrote:
 Yonghyeon PYUN pyunyh at gmail.com writes:
 
  
  On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
   On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
Hi,
I've added support for QAC AR816x/AR817x ethernet controllers.  It
passed my limited testing and I need more testers.  You can find
patches from the following URLs.

http://people.freebsd.org/~yongari/alc/pci.quirk.diff
and
http://people.freebsd.org/~yongari/alc/alc.diff.20140930

pci.qurik.diff is to workaround silicon bug of AR816x. Without it
MSI/MSIX interrupt wouldn't work.  If you just want to use
legacy INTx interrupt you don't have to apply it but you have to
tell alc(4) not to use MSI/MSIX interrupt with tunables(
hw.alc.msi.disable and hw.alc.msix_disable).

alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
and E2200 controllers.  It supports all hardware features except
RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
controllers please test and report how the diff works for you.
Thanks.
   
   http://people.freebsd.org/~yongari/alc/pci.quirk.diff
   http://people.freebsd.org/~yongari/alc/alc.diff.20141001
   
   Patch updated to address link establishment issue.
  
  http://people.freebsd.org/~yongari/alc/alc.diff.20141002
  Patch updated again to correct wrong lock assertion.
  ___
 
 
 
 Hi-
 
 
 I can add that I tested your patches on a 9.3 Stable machine.
 The motherboard is a GA-Z77-D3H (rev. 1.1) with onboard Atheros AR816x.
 I did have to apply one of the patch hunks by hand, see below.
 I am able to ssh into the machine, and remotely access apache/poudriere.
 I have not seen any problems so far.
 I've included a few outputs for you to examine.
 

Thanks for your testing!

[...]

 
 Rejected hunk:
 # cat if_alc.c.rej

This was caused by not MFCing r240693.  I'll see whether it could
be merged to stable/9.

 ***
 *** 831,843 
   CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val);
   }
   /* Disable ASPM L0S and L1. */
 - cap = CSR_READ_2(sc, base + PCIER_LINK_CAP);
   if ((cap  PCIEM_LINK_CAP_ASPM) != 0) {
 - ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL);
   if ((ctl  PCIEM_LINK_CTL_RCB) != 0)
   sc-alc_rcb = DMA_CFG_RCB_128;
   if (bootverbose)
 - device_printf(dev, RCB %u bytes\n,
   sc-alc_rcb == DMA_CFG_RCB_64 ? 64 : 
 128);
   state = ctl  PCIEM_LINK_CTL_ASPMC;
   if (state  PCIEM_LINK_CTL_ASPMC_L0S)
 --- 1279,1291 
   CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val);
   }
   /* Disable ASPM L0S and L1. */
 + cap = CSR_READ_2(sc, sc-alc_expcap + PCIER_LINK_CAP);
   if ((cap  PCIEM_LINK_CAP_ASPM) != 0) {
 + ctl = CSR_READ_2(sc, sc-alc_expcap + 
 PCIER_LINK_CTL);
   if ((ctl  PCIEM_LINK_CTL_RCB) != 0)
   sc-alc_rcb = DMA_CFG_RCB_128;
   if (bootverbose)
 + device_printf(sc-alc_dev, RCB %u 
 bytes\n,
   sc-alc_rcb == DMA_CFG_RCB_64 ? 64 : 
 128);
   state = ctl  PCIEM_LINK_CTL_ASPMC;
   if (state  PCIEM_LINK_CTL_ASPMC_L0S)
 
 
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-05 Thread Yonghyeon PYUN
On Fri, Oct 03, 2014 at 09:29:46PM +0200, Dariusz Wierzbicki wrote:
 Dnia 2014-10-02, o godz. 14:07:30
 Yonghyeon PYUN pyu...@gmail.com napisał(a):
 
  On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
   On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
Hi,
I've added support for QAC AR816x/AR817x ethernet controllers.  It
passed my limited testing and I need more testers.  You can find
patches from the following URLs.

http://people.freebsd.org/~yongari/alc/pci.quirk.diff
and
http://people.freebsd.org/~yongari/alc/alc.diff.20140930

pci.qurik.diff is to workaround silicon bug of AR816x. Without it
MSI/MSIX interrupt wouldn't work.  If you just want to use
legacy INTx interrupt you don't have to apply it but you have to
tell alc(4) not to use MSI/MSIX interrupt with tunables(
hw.alc.msi.disable and hw.alc.msix_disable).

alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
and E2200 controllers.  It supports all hardware features except
RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
controllers please test and report how the diff works for you.
Thanks.
   
   http://people.freebsd.org/~yongari/alc/pci.quirk.diff
   http://people.freebsd.org/~yongari/alc/alc.diff.20141001
   
   Patch updated to address link establishment issue.
  
  http://people.freebsd.org/~yongari/alc/alc.diff.20141002
  Patch updated again to correct wrong lock assertion.
 
 Hi !
 
 Thanks for your work !
 
 Are your patches only for current ? I tried on 10 stable.
 

No, it should be applied to stable/10 as well.  I intentionally
didn't include additional diff for MAC statistics which will not
work on stable/10 and stable/9 due to if_inc_counter changes made
in HEAD.

I tried to apply the diff again against stable/10 and it succeeded
with minor fuzz and offset differences.

 
 My system:
 
 dw@dw:~ % uname -a
 FreeBSD dw 10.1-RC1 FreeBSD 10.1-RC1 #1 r272477M: Fri Oct  3 20:48:05
 CEST 2014 dw@dw:/usr/obj/usr/src/sys/DW  amd64
 

[...]

 I applied that part manually. Compiled and rebooted system.
 
 
 dmesg | grep alc :
 
 alc0: could not disable Rx/Tx MAC(0x4000cb20)!
 alc0: reset timeout(0x4000cb20)!
 alc0: could not disable Rx/Tx MAC(0x4000cb20)!
  ^

I'm more worried about MAC reset and master reset timeout shown
below.  The MAC reset timeout makes me wonder how this can happen
since driver just checks bit 0 and bit 1, the low nibble of the
register value can't be 0.

 alc0: link state changed to UP
 alc0: could not disable Rx/Tx MAC(0x4000cb20)!
 alc0: Qualcomm Atheros AR8161 Gigabit Ethernet port 0xd000-0xd07f mem
 0xf720-0xf723 irq 18 at device 0.0 on pci3
 alc0: reset timeout(0x4000cd00)!
  

I think this also can't happen since driver checks bit[0-3], the
low byte should be non-zero when the timeout triggers.

 alc0: 11776 Tx FIFO, 12032 Rx FIFO
 miibus0: MII bus on alc0
 alc0: Ethernet address: 74:d4:35:91:32:04

[...]

 
 If you need other data or more testing, let me know.
 

Do you have any local changes in alc(4)?  As I said, the diff
could be applied to stable/10 without any manual modification.

Thanks for testing!
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-04 Thread Craig Wiesen
Yonghyeon PYUN pyunyh at gmail.com writes:

 
 On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
  On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
   Hi,
   I've added support for QAC AR816x/AR817x ethernet controllers.  It
   passed my limited testing and I need more testers.  You can find
   patches from the following URLs.
   
   http://people.freebsd.org/~yongari/alc/pci.quirk.diff
   and
   http://people.freebsd.org/~yongari/alc/alc.diff.20140930
   
   pci.qurik.diff is to workaround silicon bug of AR816x. Without it
   MSI/MSIX interrupt wouldn't work.  If you just want to use
   legacy INTx interrupt you don't have to apply it but you have to
   tell alc(4) not to use MSI/MSIX interrupt with tunables(
   hw.alc.msi.disable and hw.alc.msix_disable).
   
   alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
   and E2200 controllers.  It supports all hardware features except
   RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
   controllers please test and report how the diff works for you.
   Thanks.
  
  http://people.freebsd.org/~yongari/alc/pci.quirk.diff
  http://people.freebsd.org/~yongari/alc/alc.diff.20141001
  
  Patch updated to address link establishment issue.
 
 http://people.freebsd.org/~yongari/alc/alc.diff.20141002
 Patch updated again to correct wrong lock assertion.
 ___



Hi-


I can add that I tested your patches on a 9.3 Stable machine.
The motherboard is a GA-Z77-D3H (rev. 1.1) with onboard Atheros AR816x.
I did have to apply one of the patch hunks by hand, see below.
I am able to ssh into the machine, and remotely access apache/poudriere.
I have not seen any problems so far.
I've included a few outputs for you to examine.


# uname -a
FreeBSD desktop.home.org 9.3-STABLE FreeBSD 9.3-STABLE #0 r272523M: Sat Oct  
4 11:50:08 CDT 2014 
r...@desktop.home.org:/usr/obj/usr/src/sys/SANDYBRIDGE  amd64


# ifconfig -a
em0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
options=4219bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO
4,WOL_MAGIC,VLAN_HWTSO
ether 68:05:ca:xx:xx:xx
inet 127.0.0.1 netmask 0xff00 broadcast 127.255.255.255
nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
media: Ethernet autoselect
status: no carrier


alc0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
options=c319aTXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_M
CAST,WOL_MAGIC,VLAN_HWTSO,LINKSTATE
ether 90:2b:34:xx:xx:xx
inet 192.168.100.48 netmask 0xff00 broadcast 192.168.100.255
inet6 -redacted-%alc0 prefixlen 64 scopeid 0x4 
nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
media: Ethernet autoselect (1000baseT full-duplex)
status: active

I left em0 above for comparison:


Rejected hunk:
# cat if_alc.c.rej
***
*** 831,843 
CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val);
}
/* Disable ASPM L0S and L1. */
-   cap = CSR_READ_2(sc, base + PCIER_LINK_CAP);
if ((cap  PCIEM_LINK_CAP_ASPM) != 0) {
-   ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL);
if ((ctl  PCIEM_LINK_CTL_RCB) != 0)
sc-alc_rcb = DMA_CFG_RCB_128;
if (bootverbose)
-   device_printf(dev, RCB %u bytes\n,
sc-alc_rcb == DMA_CFG_RCB_64 ? 64 : 
128);
state = ctl  PCIEM_LINK_CTL_ASPMC;
if (state  PCIEM_LINK_CTL_ASPMC_L0S)
--- 1279,1291 
CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val);
}
/* Disable ASPM L0S and L1. */
+   cap = CSR_READ_2(sc, sc-alc_expcap + PCIER_LINK_CAP);
if ((cap  PCIEM_LINK_CAP_ASPM) != 0) {
+   ctl = CSR_READ_2(sc, sc-alc_expcap + 
PCIER_LINK_CTL);
if ((ctl  PCIEM_LINK_CTL_RCB) != 0)
sc-alc_rcb = DMA_CFG_RCB_128;
if (bootverbose)
+   device_printf(sc-alc_dev, RCB %u 
bytes\n,
sc-alc_rcb == DMA_CFG_RCB_64 ? 64 : 
128);
state = ctl  PCIEM_LINK_CTL_ASPMC;
if (state  PCIEM_LINK_CTL_ASPMC_L0S)


From verbose boot log:
pcib5: ACPI PCI-PCI bridge irq 18 at device 28.6 on pci0
pcib0: allocated type 4 (0xd000-0xdfff) for rid 1c of pcib5
pcib0: allocated type 3 (0xf790-0xf79f) for rid 20 of pcib5
pcib5:   domain0
pcib5:   secondary bus 5
pcib5:   subordinate bus   5
pcib5:   I/O decode0xd000-0xdfff
pcib5:   memory decode 0xf790-0xf79f
pci5: ACPI PCI bus on pcib5
pci5: domain=0, physical bus=5
found- vendor=0x1969, dev=0x1091, revid=0x10

Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-03 Thread Dariusz Wierzbicki
Dnia 2014-10-02, o godz. 14:07:30
Yonghyeon PYUN pyu...@gmail.com napisał(a):

 On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
  On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
   Hi,
   I've added support for QAC AR816x/AR817x ethernet controllers.  It
   passed my limited testing and I need more testers.  You can find
   patches from the following URLs.
   
   http://people.freebsd.org/~yongari/alc/pci.quirk.diff
   and
   http://people.freebsd.org/~yongari/alc/alc.diff.20140930
   
   pci.qurik.diff is to workaround silicon bug of AR816x. Without it
   MSI/MSIX interrupt wouldn't work.  If you just want to use
   legacy INTx interrupt you don't have to apply it but you have to
   tell alc(4) not to use MSI/MSIX interrupt with tunables(
   hw.alc.msi.disable and hw.alc.msix_disable).
   
   alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
   and E2200 controllers.  It supports all hardware features except
   RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
   controllers please test and report how the diff works for you.
   Thanks.
  
  http://people.freebsd.org/~yongari/alc/pci.quirk.diff
  http://people.freebsd.org/~yongari/alc/alc.diff.20141001
  
  Patch updated to address link establishment issue.
 
 http://people.freebsd.org/~yongari/alc/alc.diff.20141002
 Patch updated again to correct wrong lock assertion.

Hi !

Thanks for your work !

Are your patches only for current ? I tried on 10 stable.


My system:

dw@dw:~ % uname -a
FreeBSD dw 10.1-RC1 FreeBSD 10.1-RC1 #1 r272477M: Fri Oct  3 20:48:05
CEST 2014 dw@dw:/usr/obj/usr/src/sys/DW  amd64

I applied your patches (pci.quirk.diff  alc.diff.20141002).
There was a minor problem with alc.diff.20141002 - hunk 1 failed:

@@ -111,17 +111,31 @@
Atheros AR8152 v1.1 PCIe Fast Ethernet },
{ VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8152_B2, 6 * 1024,
Atheros AR8152 v2.0 PCIe Fast Ethernet },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8161, 9 * 1024,
+   Atheros AR8161 PCIe Gigabit Ethernet },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8162, 9 * 1024,
+   Atheros AR8161 PCIe Fast Ethernet },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8171, 9 * 1024,
+   Atheros AR8161 PCIe Gigabit Ethernet },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8172, 9 * 1024,
+   Atheros AR8161 PCIe Fast Ethernet },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024,
+   Atheros AR8161 PCIe Killer E2200 Gigabit Ethernet },
{ 0, 0, 0, NULL}
 };
 
-static voidalc_aspm(struct alc_softc *, int);
+static voidalc_aspm(struct alc_softc *, int, int);
+static voidalc_aspm_813x(struct alc_softc *, int);
+static voidalc_aspm_816x(struct alc_softc *, int);
 static int alc_attach(device_t);
 static int alc_check_boundary(struct alc_softc *);
+static voidalc_config_msi(struct alc_softc *);
 static int alc_detach(device_t);
 static voidalc_disable_l0s_l1(struct alc_softc *);
 static int alc_dma_alloc(struct alc_softc *);
 static voidalc_dma_free(struct alc_softc *);
 static voidalc_dmamap_cb(void *, bus_dma_segment_t *, int,
int); +static void  alc_dsp_fixup(struct alc_softc *, int);
 static int alc_encap(struct alc_softc *, struct mbuf **);
 static struct alc_ident *
alc_find_ident(device_t);


I applied that part manually. Compiled and rebooted system.


dmesg | grep alc :

alc0: could not disable Rx/Tx MAC(0x4000cb20)!
alc0: reset timeout(0x4000cb20)!
alc0: could not disable Rx/Tx MAC(0x4000cb20)!
alc0: link state changed to UP
alc0: could not disable Rx/Tx MAC(0x4000cb20)!
alc0: Qualcomm Atheros AR8161 Gigabit Ethernet port 0xd000-0xd07f mem
0xf720-0xf723 irq 18 at device 0.0 on pci3
alc0: reset timeout(0x4000cd00)!
alc0: 11776 Tx FIFO, 12032 Rx FIFO
miibus0: MII bus on alc0
alc0: Ethernet address: 74:d4:35:91:32:04
alc0: could not disable Rx/Tx MAC(0x4000cd00)!
alc0: reset timeout(0x4000cd00)!
alc0: Qualcomm Atheros AR8161 Gigabit Ethernet port 0xd000-0xd07f mem
0xf720-0xf723 irq 18 at device 0.0 on pci3
alc0: reset timeout(0x4000ca00)!
alc0: 11776 Tx FIFO, 12032 Rx FIFO
miibus0: MII bus on alc0
alc0: Ethernet address: 74:d4:35:91:32:04
alc0: Qualcomm Atheros AR8161 Gigabit Ethernet port 0xd000-0xd07f mem
0xf720-0xf723 irq 18 at device 0.0 on pci3
alc0: PCI device revision : 0x0010
alc0: Chip id/revision : 0xc002
alc0: AR816x revision : 0x2
alc0: 11776 Tx FIFO, 12032 Rx FIFO
alc0: Read request size : 512 bytes.
alc0: TLP payload size : 128 bytes.
alc0: MSIX count : 16
alc0: MSI count : 16
alc0: attempting to allocate 1 MSI-X vectors (16 supported)
alc0: using IRQ 268 for MSI-X
alc0: Using 1 MSIX message(s).
miibus0: MII bus on alc0
alc0: bpf attached
alc0: Ethernet address: 74:d4:35:91:32:04
alc0: link state changed to UP



pciconf -vlc  :

alc0@pci0:3:0:0:class=0x02 card=0xe0001458 

Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-10-01 Thread Yonghyeon PYUN
On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote:
 On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
  Hi,
  I've added support for QAC AR816x/AR817x ethernet controllers.  It
  passed my limited testing and I need more testers.  You can find
  patches from the following URLs.
  
  http://people.freebsd.org/~yongari/alc/pci.quirk.diff
  and
  http://people.freebsd.org/~yongari/alc/alc.diff.20140930
  
  pci.qurik.diff is to workaround silicon bug of AR816x. Without it
  MSI/MSIX interrupt wouldn't work.  If you just want to use
  legacy INTx interrupt you don't have to apply it but you have to
  tell alc(4) not to use MSI/MSIX interrupt with tunables(
  hw.alc.msi.disable and hw.alc.msix_disable).
  
  alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
  and E2200 controllers.  It supports all hardware features except
  RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
  controllers please test and report how the diff works for you.
  Thanks.
 
 http://people.freebsd.org/~yongari/alc/pci.quirk.diff
 http://people.freebsd.org/~yongari/alc/alc.diff.20141001
 
 Patch updated to address link establishment issue.

http://people.freebsd.org/~yongari/alc/alc.diff.20141002
Patch updated again to correct wrong lock assertion.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-09-30 Thread Yonghyeon PYUN
On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote:
 Hi,
 I've added support for QAC AR816x/AR817x ethernet controllers.  It
 passed my limited testing and I need more testers.  You can find
 patches from the following URLs.
 
 http://people.freebsd.org/~yongari/alc/pci.quirk.diff
 and
 http://people.freebsd.org/~yongari/alc/alc.diff.20140930
 
 pci.qurik.diff is to workaround silicon bug of AR816x. Without it
 MSI/MSIX interrupt wouldn't work.  If you just want to use
 legacy INTx interrupt you don't have to apply it but you have to
 tell alc(4) not to use MSI/MSIX interrupt with tunables(
 hw.alc.msi.disable and hw.alc.msix_disable).
 
 alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
 and E2200 controllers.  It supports all hardware features except
 RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
 controllers please test and report how the diff works for you.
 Thanks.

http://people.freebsd.org/~yongari/alc/pci.quirk.diff
http://people.freebsd.org/~yongari/alc/alc.diff.20141001

Patch updated to address link establishment issue.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


[CFT] alc(4) QAC AR816x/AR817x ethernet controller support

2014-09-29 Thread Yonghyeon PYUN
Hi,
I've added support for QAC AR816x/AR817x ethernet controllers.  It
passed my limited testing and I need more testers.  You can find
patches from the following URLs.

http://people.freebsd.org/~yongari/alc/pci.quirk.diff
and
http://people.freebsd.org/~yongari/alc/alc.diff.20140930

pci.qurik.diff is to workaround silicon bug of AR816x. Without it
MSI/MSIX interrupt wouldn't work.  If you just want to use
legacy INTx interrupt you don't have to apply it but you have to
tell alc(4) not to use MSI/MSIX interrupt with tunables(
hw.alc.msi.disable and hw.alc.msix_disable).

alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172
and E2200 controllers.  It supports all hardware features except
RSS.  If you have any QAC AR816x/AR817x or old AR813x/AR815x
controllers please test and report how the diff works for you.
Thanks.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org