svn commit: r269149 - head/sys/cam/ctl

2014-07-27 Thread Alexander Motin
Author: mav
Date: Sun Jul 27 06:49:55 2014
New Revision: 269149
URL: http://svnweb.freebsd.org/changeset/base/269149

Log:
  Fix several cases of NULL dereference when INQUIRY sent to absent LUN.
  
  MFC after:3 days

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sun Jul 27 05:44:42 2014(r269148)
+++ head/sys/cam/ctl/ctl.c  Sun Jul 27 06:49:55 2014(r269149)
@@ -10024,7 +10024,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s
STAILQ_FOREACH(port, softc-port_list, links) {
if ((port-status  CTL_PORT_STATUS_ONLINE) == 0)
continue;
-   if (ctl_map_lun_back(port-targ_port, lun-lun) =
+   if (lun != NULL 
+   ctl_map_lun_back(port-targ_port, lun-lun) =
CTL_MAX_LUNS)
continue;
num_target_ports++;
@@ -10080,7 +10081,8 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s
STAILQ_FOREACH(port, softc-port_list, links) {
if ((port-status  CTL_PORT_STATUS_ONLINE) == 0)
continue;
-   if (ctl_map_lun_back(port-targ_port, lun-lun) =
+   if (lun != NULL 
+   ctl_map_lun_back(port-targ_port, lun-lun) =
CTL_MAX_LUNS)
continue;
p = port-targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS;
@@ -10123,7 +10125,6 @@ ctl_inquiry_evpd_block_limits(struct ctl
int bs;
 
lun = (struct ctl_lun *)ctsio-io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
-   bs = lun-be_lun-blocksize;
 
ctsio-kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | 
M_ZERO);
bl_ptr = (struct scsi_vpd_block_limits *)ctsio-kern_data_ptr;
@@ -10157,10 +10158,13 @@ ctl_inquiry_evpd_block_limits(struct ctl
scsi_ulto2b(sizeof(*bl_ptr), bl_ptr-page_length);
bl_ptr-max_cmp_write_len = 0xff;
scsi_ulto4b(0x, bl_ptr-max_txfer_len);
-   scsi_ulto4b(MAXPHYS / bs, bl_ptr-opt_txfer_len);
-   if (lun-be_lun-flags  CTL_LUN_FLAG_UNMAP) {
-   scsi_ulto4b(0x, bl_ptr-max_unmap_lba_cnt);
-   scsi_ulto4b(0x, bl_ptr-max_unmap_blk_cnt);
+   if (lun != NULL) {
+   bs = lun-be_lun-blocksize;
+   scsi_ulto4b(MAXPHYS / bs, bl_ptr-opt_txfer_len);
+   if (lun-be_lun-flags  CTL_LUN_FLAG_UNMAP) {
+   scsi_ulto4b(0x, bl_ptr-max_unmap_lba_cnt);
+   scsi_ulto4b(0x, bl_ptr-max_unmap_blk_cnt);
+   }
}
scsi_u64to8b(UINT64_MAX, bl_ptr-max_write_same_length);
 
@@ -10177,10 +10181,8 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
 {
struct scsi_vpd_logical_block_prov *lbp_ptr;
struct ctl_lun *lun;
-   int bs;
 
lun = (struct ctl_lun *)ctsio-io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
-   bs = lun-be_lun-blocksize;
 
ctsio-kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | 
M_ZERO);
lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio-kern_data_ptr;
@@ -10211,7 +10213,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
lbp_ptr-device = (SID_QUAL_LU_OFFLINE  5) | T_DIRECT;
 
lbp_ptr-page_code = SVPD_LBP;
-   if (lun-be_lun-flags  CTL_LUN_FLAG_UNMAP)
+   if (lun != NULL  lun-be_lun-flags  CTL_LUN_FLAG_UNMAP)
lbp_ptr-flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10;
 
ctsio-scsi_status = SCSI_STATUS_OK;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r269106 - head/tools/tools/cxgbetool

2014-07-27 Thread Navdeep Parhar
On Sat, Jul 26, 2014 at 09:26:07PM +0300, Konstantin Belousov wrote:
 On Sat, Jul 26, 2014 at 12:51:45AM +, Navdeep Parhar wrote:
  Author: np
  Date: Sat Jul 26 00:51:45 2014
  New Revision: 269106
  URL: http://svnweb.freebsd.org/changeset/base/269106
  
  Log:
Add a 'raw' parameter to the 'modinfo' subcommand.  This is handy when
trying to figure out why a QSFP+/SFP+ connector or cable wasn't
identified correctly by cxgbe(4).  Its output looks like this:

# cxgbetool t5nex0 modinfo 0 raw
00:  03 04 21 00  00 00 00 00  ..!. 
08:  04 00 00 00  67 00 00 00   g...
10:  00 00 05 00  41 6d 70 68   Amph
18:  65 6e 6f 6c  20 20 20 20  enol
20:  20 20 20 20  00 41 50 48   .APH
28:  35 37 31 35  34 30 30 30  5715 4000
30:  33 20 20 20  20 20 20 20  3
38:  4b 20 20 20  01 00 00 fa  K
40:  00 00 00 00  41 50 46 31   APF1
48:  30 30 34 30  30 33 30 30  0040 0300
50:  30 33 20 20  31 30 30 31  03   1001
58:  33 30 20 20  00 00 00 97  30   

MFC after:3 days
  
  Modified:
head/tools/tools/cxgbetool/cxgbetool.c
 
 I do not remember if this question was already asked.
 
 Why cxgbetool lives in tools and not installed into /usr/sbin as
 cxgbecontrol(8) ?

cxgbetool was originally meant to be just a debug tool, not something
that would be of interest to most users (not even those using cxgbe).
But once written, it offered an easy way to interface with the driver
and chip, and so it gradually grew a number of commands for features for
which there is no system CLI (packet filtering/steering, QoS-ish stuff,
packet sniffing, pluggable optics/copper modules, etc.).

In its current state I think it fits in tools/tools or usr/sbin equally
well.  Moving it to usr/sbin will force the issue of a manpage -- I have
one that has been 80% complete for 2 years now :-(

Regards,
Navdeep
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
Hi!

ok, so how do I figure out what the right patch should be?

pcm0: Conexant CX20561 (Hermosa) (Front Analog) at nid 22 and 24 on hdaa0
pcm1: Conexant CX20561 (Hermosa) (Internal Analog) at nid 26 and 29 on hdaa0

.. and

hdac0@pci0:0:27:0: class=0x040300 card=0x20f217aa chip=0x293e8086
rev=0x03 hdr=0x00



-a


On 13 July 2014 18:44, Alexander Motin m...@freebsd.org wrote:
 On 13.07.2014 21:50, Adrian Chadd wrote:
 So I have an X230 and a T400 - both require fiddling of the default
 sound unit sysctl when I want to use headphones.

 Does this above patch outline what I need to do to get it working 
 dynamically?

 As a quick and easy solution -- quite likely yes.

 Proper general solution for all of those laptops, and not only, would be
 to rewrite the concept of default unit in sound(4) to allow it be
 switched during playback/record, and separately for playback/record
 paths. HDA driver is already able to provide all information about
 connected devices, number of their channels, etc, but there is just
 nothing above it to use that information. :(

 On 13 July 2014 03:31, Mark Johnston ma...@freebsd.org wrote:
 Author: markj
 Date: Sun Jul 13 10:31:29 2014
 New Revision: 268584
 URL: http://svnweb.freebsd.org/changeset/base/268584

 Log:
   Add a headphone redirection quirk for the Lenovo G580.

   MFC after:1 week

 Modified:
   head/sys/dev/sound/pci/hda/hdaa_patches.c
   head/sys/dev/sound/pci/hda/hdac.h

 Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
 ==
 --- head/sys/dev/sound/pci/hda/hdaa_patches.c   Sun Jul 13 09:34:59 2014
 (r268583)
 +++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Sun Jul 13 10:31:29 2014
 (r268584)
 @@ -350,7 +350,8 @@ hdac_pin_patch(struct hdaa_widget *w)
 (subid == LENOVO_X1_SUBVENDOR ||
 subid == LENOVO_X220_SUBVENDOR ||
 subid == LENOVO_T420_SUBVENDOR ||
 -   subid == LENOVO_T520_SUBVENDOR)) {
 +   subid == LENOVO_T520_SUBVENDOR ||
 +   subid == LENOVO_G580_SUBVENDOR)) {
 switch (nid) {
 case 25:
 patch = as=1 seq=15;

 Modified: head/sys/dev/sound/pci/hda/hdac.h
 ==
 --- head/sys/dev/sound/pci/hda/hdac.h   Sun Jul 13 09:34:59 2014
 (r268583)
 +++ head/sys/dev/sound/pci/hda/hdac.h   Sun Jul 13 10:31:29 2014
 (r268584)
 @@ -241,6 +241,7 @@
  #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)
  #defineLENOVO_T520_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf)
  #defineLENOVO_T530_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f6)
 +#defineLENOVO_G580_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x3977)
  #define LENOVO_ALL_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x)

  /* Samsung */




 --
 Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
Oh, and:

pci0:21:0:1: reprobing on driver added
hdacc0: Conexant CX20561 (Hermosa) HDA CODEC at cad 0 on hdac0
hdaa0: Conexant CX20561 (Hermosa) Audio Function Group at nid 1 on hdacc0
hdaa0: Subsystem ID: 0x17aa211c
hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0:  GPIO2: disabled
hdaa0:  GPIO3: disabled
hdaa0: Original pins configuration:
hdaa0: nid   0xas seq device   conn  jackloccolor   misc
hdaa0: 22 022140f0 15 0  HeadphonesJack  1/8 Front  Green   0
hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0
hdaa0: 24 02a190f0 15 0  Mic   Jack  1/8 Front  Pink0
hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0
hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=22
hdaa0: Patching pin config nid=22 0x022140f0 - 0x0221401f
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=23
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=24
hdaa0: Patching pin config nid=24 0x02a190f0 - 0x02a1901f
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=25
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=26
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=27
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=28
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=29
hdaa0: Patched pins configuration:
hdaa0: nid   0xas seq device   conn  jackloccolor   misc
hdaa0: 22 0221401f 1  15 HeadphonesJack  1/8 Front  Green   0
hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0 DISA
hdaa0: 24 02a1901f 1  15 Mic   Jack  1/8 Front  Pink0
hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0 DISA
hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
hdaa0: hdaa_audio_as_parse: Duplicate pin 15 (24) in association 1!
Disabling association.
hdaa0: hdaa_audio_as_parse: Pin 24 has wrong direction for association
1! Disabling association.
hdaa0: 3 associations found:
hdaa0: Association 0 (1) out (disabled):
hdaa0:  Pin nid=24 seq=15
hdaa0: Association 1 (15) out:
hdaa0:  Pin nid=26 seq=0
hdaa0: Association 2 (15) in:
hdaa0:  Pin nid=29 seq=0
hdaa0: Tracing association 1 (15)
hdaa0:  Pin 26 traced to DAC 16
hdaa0: Association 1 (15) trace succeeded
hdaa0: Tracing association 2 (15)
hdaa0:  Pin 29 traced to ADC 20
hdaa0: Association 2 (15) trace succeeded
hdaa0: Looking for additional DAC for association 1 (15)
hdaa0: Looking for additional ADC for association 2 (15)
hdaa0: Tracing input monitor
hdaa0: Tracing other input monitors
hdaa0:  Tracing nid 29 to out
hdaa0: Tracing beeper
hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm0: Conexant CX20561 (Hermosa) (Internal Analog) at nid 26 and 29 on hdaa0
pcm0: Playback:
pcm0:  Stream cap: 0x0001 PCM
pcm0: PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
pcm0: DAC: 16
pcm0:
pcm0: nid=26 [pin: Speaker (Fixed)]
pcm0:   + - nid=16 [audio output] [src: pcm]
pcm0:
pcm0: Record:
pcm0:  Stream cap: 0x0001 PCM
pcm0: PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm0: ADC: 20
pcm0:
pcm0: nid=20 [audio input]
pcm0:   + - nid=29 [pin: Mic (Fixed)] [src: monitor]
pcm0:
pcm0: Master Volume (OSS: vol): -74/0dB
pcm0:+- ctl  1 (nid  16 out):-74/0dB (75 steps)
pcm0:
pcm0: PCM Volume (OSS: pcm): -74/0dB
pcm0:+- ctl  1 (nid  16 out):-74/0dB (75 steps)
pcm0:
pcm0: Microphone2 Volume (OSS: monitor): 0/48dB
pcm0:+- ctl  4 (nid  20 in   0): -74/6dB (81 steps)
pcm0:+- ctl  8 (nid  29 out):0/48dB (5 steps)
pcm0:
pcm0: Speaker/Beep Volume (OSS: speaker): -18/0dB
pcm0:+- ctl  3 (nid  19 out):-18/0dB (4 steps)
pcm0:
pcm0: Recording Level (OSS: rec): -74/6dB
pcm0:+- ctl  4 (nid  20 in   0): -74/6dB (81 steps)
pcm0:+- ctl  8 (nid  29 out):0/48dB (5 steps)
pcm0:
pcm0: Mixer vol:
pcm0: Mixer pcm:
pcm0: Mixer speaker:
pcm0: Mixer rec:
pcm0: Mixer ogain:
pcm0: Mixer monitor:
pcm0: Playback channel set is: Front Left, Front Right,
pcm0: Playback channel matrix is: 2.0 (unknown)
pcm0: Automatically set rec source to: monitor
pcm0: Recording channel set is: Front Left, Front Right,
pcm0: Recording channel matrix is: 2.0 (unknown)
unknown: Conexant CX20561 (Hermosa) HDA CODEC Modem Function Group
at nid 2 on hdacc0 (no driver attached)
hdacc0: Subsystem ID: 0xc536484c



-a

Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
actually, scratch that, I had some test hacks in there. Try:

pci0:21:0:1: reprobing on driver added
hdacc0: Conexant CX20561 (Hermosa) HDA CODEC at cad 0 on hdac0
hdaa0: Conexant CX20561 (Hermosa) Audio Function Group at nid 1 on hdacc0
hdaa0: Subsystem ID: 0x17aa211c
hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0:  GPIO2: disabled
hdaa0:  GPIO3: disabled
hdaa0: Original pins configuration:
hdaa0: nid   0xas seq device   conn  jackloccolor   misc
hdaa0: 22 022140f0 15 0  HeadphonesJack  1/8 Front  Green   0
hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0
hdaa0: 24 02a190f0 15 0  Mic   Jack  1/8 Front  Pink0
hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0
hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=22
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=23
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=24
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=25
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=26
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=27
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=28
hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=29
hdaa0: Patched pins configuration:
hdaa0: nid   0xas seq device   conn  jackloccolor   misc
hdaa0: 22 022140f0 15 0  HeadphonesJack  1/8 Front  Green   0
hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0 DISA
hdaa0: 24 02a190f0 15 0  Mic   Jack  1/8 Front  Pink0
hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0 DISA
hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
hdaa0: 4 associations found:
hdaa0: Association 0 (15) out:
hdaa0:  Pin nid=22 seq=0
hdaa0: Association 1 (15) in:
hdaa0:  Pin nid=24 seq=0
hdaa0: Association 2 (15) out:
hdaa0:  Pin nid=26 seq=0
hdaa0: Association 3 (15) in:
hdaa0:  Pin nid=29 seq=0
hdaa0: Tracing association 0 (15)
hdaa0:  Pin 22 traced to DAC 16
hdaa0: Association 0 (15) trace succeeded
hdaa0: Tracing association 1 (15)
hdaa0:  Unable to trace pin 24 to ADC 20, undo traces
hdaa0:  Pin 24 traced to ADC 21
hdaa0: Association 1 (15) trace succeeded
hdaa0: Tracing association 2 (15)
hdaa0:  Pin 26 traced to DAC 17
hdaa0: Association 2 (15) trace succeeded
hdaa0: Tracing association 3 (15)
hdaa0:  Pin 29 traced to ADC 20
hdaa0: Association 3 (15) trace succeeded
hdaa0: Looking for additional DAC for association 0 (15)
hdaa0: Looking for additional ADC for association 1 (15)
hdaa0: Looking for additional DAC for association 2 (15)
hdaa0: Looking for additional ADC for association 3 (15)
hdaa0: Tracing input monitor
hdaa0: Tracing other input monitors
hdaa0:  Tracing nid 24 to out
hdaa0:  Tracing nid 29 to out
hdaa0: Tracing beeper
hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
pcm0: Conexant CX20561 (Hermosa) (Front Analog) at nid 22 and 24 on hdaa0
pcm0: Playback:
pcm0:  Stream cap: 0x0001 PCM
pcm0: PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
pcm0: DAC: 16
pcm0:
pcm0: nid=22 [pin: Headphones (Green Jack)]
pcm0:   + - nid=16 [audio output] [src: pcm]
pcm0:
pcm0: Record:
pcm0:  Stream cap: 0x0001 PCM
pcm0: PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz
pcm0: ADC: 21
pcm0:
pcm0: nid=21 [audio input]
pcm0:   + - nid=24 [pin: Mic (Pink Jack)] [src: mic]
pcm0:
pcm0: Master Volume (OSS: vol): -74/0dB
pcm0:+- ctl  1 (nid  16 out):-74/0dB (75 steps)
pcm0:
pcm0: PCM Volume (OSS: pcm): -74/0dB
pcm0:+- ctl  1 (nid  16 out):-74/0dB (75 steps)
pcm0:
pcm0: Microphone Volume (OSS: mic): 0/40dB
pcm0:+- ctl  5 (nid  21 in   0): -74/6dB (81 steps)
pcm0:+- ctl  7 (nid  24 out):0/40dB (5 steps)
pcm0:
pcm0: Speaker/Beep Volume (OSS: speaker): -18/0dB
pcm0:+- ctl  3 (nid  19 out):-18/0dB (4 steps)
pcm0:
pcm0: Recording Level (OSS: rec): -74/6dB
pcm0:+- ctl  5 (nid  21 in   0): -74/6dB (81 steps)
pcm0:+- ctl  7 (nid  24 out):0/40dB (5 steps)
pcm0:
pcm0: Mixer vol:
pcm0: Mixer pcm:
pcm0: Mixer speaker:
pcm0: Mixer mic:
pcm0: Mixer rec:
pcm0: Playback channel set is: Front Left, Front Right,
pcm0: Playback channel matrix is: 2.0 (disconnected)
pcm0: Recording channel set is: Front Left, Front Right,
pcm0: Recording channel matrix is: 2.0 (disconnected)
pcm1: 

Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Alexander Motin
On 27.07.2014 11:20, Adrian Chadd wrote:
 ok, so how do I figure out what the right patch should be?
 
 pcm0: Conexant CX20561 (Hermosa) (Front Analog) at nid 22 and 24 on hdaa0
 pcm1: Conexant CX20561 (Hermosa) (Internal Analog) at nid 26 and 29 on hdaa0
 
 .. and
 
 hdac0@pci0:0:27:0: class=0x040300 card=0x20f217aa chip=0x293e8086
 rev=0x03 hdr=0x00

Technically there is not all of required info shown above, but assuming
some likeness I would try this (just replace ZZZ with your model name):

Index: hdaa_patches.c
===
--- hdaa_patches.c  (revision 269151)
+++ hdaa_patches.c  (working copy)
@@ -340,7 +340,8 @@ hdac_pin_patch(struct hdaa_widget *w)
}
}
} else if (id == HDA_CODEC_CX20561 
-   subid == LENOVO_B450_SUBVENDOR) {
+   (subid == LENOVO_B450_SUBVENDOR ||
+   subid == LENOVO_ZZZ_SUBVENDOR)) {
switch (nid) {
case 22:
patch = as=1 seq=15;
Index: hdac.h
===
--- hdac.h  (revision 269151)
+++ hdac.h  (working copy)
@@ -236,6 +236,7 @@
 #defineLENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#define LENOVO_ZZZ_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
 #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 #defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
 #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)

-- 
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Alexander Motin
On 27.07.2014 11:27, Adrian Chadd wrote:
 actually, scratch that, I had some test hacks in there. Try:
 
 hdaa0: Patched pins configuration:
 hdaa0: nid   0xas seq device   conn  jackloccolor   misc
 hdaa0: 22 022140f0 15 0  HeadphonesJack  1/8 Front  Green   0
 hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0 DISA
 hdaa0: 24 02a190f0 15 0  Mic   Jack  1/8 Front  Pink0
 hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0 DISA
 hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
 hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
 hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
 hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
 hdaa0: 4 associations found:
 hdaa0: Association 0 (15) out:
 hdaa0:  Pin nid=22 seq=0
 hdaa0: Association 1 (15) in:
 hdaa0:  Pin nid=24 seq=0
 hdaa0: Association 2 (15) out:
 hdaa0:  Pin nid=26 seq=0
 hdaa0: Association 3 (15) in:
 hdaa0:  Pin nid=29 seq=0

Yes, that is what I'd like to see. Your situation looks a bit more
complicated, requiring some bigger patch:

Index: hdaa_patches.c
===
--- hdaa_patches.c  (revision 269151)
+++ hdaa_patches.c  (working copy)
@@ -346,6 +346,22 @@ hdac_pin_patch(struct hdaa_widget *w)
patch = as=1 seq=15;
break;
}
+   } else if (id == HDA_CODEC_CX20561 
+   subid == LENOVO_ZZZ_SUBVENDOR) {
+   switch (nid) {
+   case 22:
+   patch = as=1 seq=15;
+   break;
+   case 24:
+   patch = as=2 seq=14;
+   break;
+   case 26:
+   patch = as=1 seq=0;
+   break;
+   case 29:
+   patch = as=2 seq=0;
+   break;
+   }
} else if (id == HDA_CODEC_CX20590 
(subid == LENOVO_X1_SUBVENDOR ||
subid == LENOVO_X220_SUBVENDOR ||
Index: hdac.h
===
--- hdac.h  (revision 269151)
+++ hdac.h  (working copy)
@@ -236,6 +236,7 @@
 #defineLENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#define LENOVO_ZZZ_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
 #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 #defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
 #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)

-- 
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
On 27 July 2014 01:29, Alexander Motin m...@freebsd.org wrote:
 On 27.07.2014 11:20, Adrian Chadd wrote:
 ok, so how do I figure out what the right patch should be?

 pcm0: Conexant CX20561 (Hermosa) (Front Analog) at nid 22 and 24 on hdaa0
 pcm1: Conexant CX20561 (Hermosa) (Internal Analog) at nid 26 and 29 on 
 hdaa0

 .. and

 hdac0@pci0:0:27:0: class=0x040300 card=0x20f217aa chip=0x293e8086
 rev=0x03 hdr=0x00

 Technically there is not all of required info shown above, but assuming
 some likeness I would try this (just replace ZZZ with your model name):

 Index: hdaa_patches.c
 ===
 --- hdaa_patches.c  (revision 269151)
 +++ hdaa_patches.c  (working copy)
 @@ -340,7 +340,8 @@ hdac_pin_patch(struct hdaa_widget *w)
 }
 }
 } else if (id == HDA_CODEC_CX20561 
 -   subid == LENOVO_B450_SUBVENDOR) {
 +   (subid == LENOVO_B450_SUBVENDOR ||
 +   subid == LENOVO_ZZZ_SUBVENDOR)) {
 switch (nid) {
 case 22:
 patch = as=1 seq=15;
 Index: hdac.h
 ===
 --- hdac.h  (revision 269151)
 +++ hdac.h  (working copy)
 @@ -236,6 +236,7 @@
  #defineLENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
  #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
  #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
 +#define LENOVO_ZZZ_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
  #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
  #defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
  #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)

So I have:

adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % svn diff .
Index: hdaa_patches.c
===
--- hdaa_patches.c (revision 268931)
+++ hdaa_patches.c (working copy)
@@ -154,6 +154,8 @@
  id = hdaa_codec_id(w-devinfo);
  subid = hdaa_card_id(w-devinfo);

+ printf(%s: id=0x%08x; subid=0x%08x; nid=%d\n, __func__, id, subid, nid);
+
  /* XXX: Old patches require complete review.
  * Now they may create more problem then solve due to
  * incorrect associations.
@@ -340,9 +342,10 @@
  }
 }
  } else if (id == HDA_CODEC_CX20561 
-subid == LENOVO_B450_SUBVENDOR) {
+(subid == LENOVO_T400_SUBVENDOR ||
+subid == LENOVO_B450_SUBVENDOR)) {
  switch (nid) {
- case 22:
+ case 22: /* headphones */
  patch = as=1 seq=15;
  break;
  }
Index: hdac.h
===
--- hdac.h (revision 268931)
+++ hdac.h (working copy)
@@ -236,6 +236,7 @@
 #define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#define LENOVO_T400_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
 #define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 #define LENOVO_T430_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
 #define LENOVO_T430S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)
adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda %


But it still chooses the speakers as pcm0:

adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % dmesg
pcm0: detached
pcm1: detached
hdaa0: detached
hdacc0: detached
hdac0: detached
pci0: multimedia, HDA at device 27.0 (no driver attached)
snd_unit_init() u=0x00ff8000 [512] d=0x7c00 [32] c=0x03ff [1024]
feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=5
feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25
pci0: driver added
found- vendor=0x8086, dev=0x2a44, revid=0x07
domain=0, bus=0, slot=3, func=0
class=07-80-00, hdrtype=0x00, mfdev=1
cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=16
powerspec 3  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:3:0: reprobing on driver added
found- vendor=0x8086, dev=0x293e, revid=0x03
domain=0, bus=0, slot=27, func=0
class=04-03-00, hdrtype=0x00, mfdev=0
cmdreg=0x0506, statreg=0x0010, cachelnsz=16 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=b, irq=17
powerspec 2  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:27:0: reprobing on driver added
hdac0: Intel 82801I HDA Controller mem 0xfc02-0xfc023fff irq 17
at device 27.0 on pci0
hdac0: PCI card vendor: 0x17aa, device: 0x20f2
hdac0: HDA Driver Revision: 20120126_0002
hdac0: Config options: on=0x off=0x
hdac0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 258 to local APIC 1 vector 54
hdac0: using IRQ 258 for MSI
hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
found- vendor=0x8086, dev=0x2930, 

Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
ok, with that it looks like:

root@lucy-11i386:/home/adrian/work/freebsd/head/src # kldload sound ;
kldload snd_hda
root@lucy-11i386:/home/adrian/work/freebsd/head/src # dmesg
snd_unit_init() u=0x00ff8000 [512] d=0x7c00 [32] c=0x03ff [1024]
feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=5
feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25
pci0: driver added
found- vendor=0x8086, dev=0x2a44, revid=0x07
domain=0, bus=0, slot=3, func=0
class=07-80-00, hdrtype=0x00, mfdev=1
cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=16
powerspec 3  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:3:0: reprobing on driver added
found- vendor=0x8086, dev=0x293e, revid=0x03
domain=0, bus=0, slot=27, func=0
class=04-03-00, hdrtype=0x00, mfdev=0
cmdreg=0x0506, statreg=0x0010, cachelnsz=16 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=b, irq=17
powerspec 2  supports D0 D3  current D0
MSI supports 1 message, 64 bit
pci0:0:27:0: reprobing on driver added
hdac0: Intel 82801I HDA Controller mem 0xfc02-0xfc023fff irq 17
at device 27.0 on pci0
hdac0: PCI card vendor: 0x17aa, device: 0x20f2
hdac0: HDA Driver Revision: 20120126_0002
hdac0: Config options: on=0x off=0x
hdac0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 258 to local APIC 0 vector 52
hdac0: using IRQ 258 for MSI
hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
found- vendor=0x8086, dev=0x2930, revid=0x03
domain=0, bus=0, slot=31, func=3
class=0c-05-00, hdrtype=0x00, mfdev=0
cmdreg=0x0103, statreg=0x0280, cachelnsz=0 (dwords)
lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
intpin=a, irq=23
pci0:0:31:3: reprobing on driver added
pci2: driver added
pci3: driver added
pci5: driver added
pci13: driver added
pci21: driver added
found- vendor=0x1180, dev=0x0832, revid=0x04
domain=0, bus=21, slot=0, func=1
class=0c-00-10, hdrtype=0x00, mfdev=1
cmdreg=0x0106, statreg=0x0210, cachelnsz=16 (dwords)
lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x04 (1000 ns)
intpin=b, irq=17
powerspec 2  supports D0 D1 D2 D3  current D0
pci0:21:0:1: reprobing on driver added
hdacc0: Conexant CX20561 (Hermosa) HDA CODEC at cad 0 on hdac0
hdaa0: Conexant CX20561 (Hermosa) Audio Function Group at nid 1 on hdacc0
hdaa0: Subsystem ID: 0x17aa211c
hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0:  GPIO2: disabled
hdaa0:  GPIO3: disabled
hdaa0: Original pins configuration:
hdaa0: nid   0xas seq device   conn  jackloccolor   misc
hdaa0: 22 022140f0 15 0  HeadphonesJack  1/8 Front  Green   0
hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0
hdaa0: 24 02a190f0 15 0  Mic   Jack  1/8 Front  Pink0
hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0
hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
hdaa0: Patching pin config nid=22 0x022140f0 - 0x0221401f
hdaa0: Patching pin config nid=24 0x02a190f0 - 0x02a1902e
hdaa0: Patching pin config nid=26 0x901701f0 - 0x90170110
hdaa0: Patching pin config nid=29 0x90a601f0 - 0x90a60120
hdaa0: Patched pins configuration:
hdaa0: nid   0xas seq device   conn  jackloccolor   misc
hdaa0: 22 0221401f 1  15 HeadphonesJack  1/8 Front  Green   0
hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0 DISA
hdaa0: 24 02a1902e 2  14 Mic   Jack  1/8 Front  Pink0
hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0 DISA
hdaa0: 26 90170110 1  0  Speaker   Fixed Analog  Internal   Unknown 1
hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
hdaa0: 29 90a60120 2  0  Mic   Fixed Digital Internal   Unknown 1
hdaa0: 2 associations found:
hdaa0: Association 0 (1) out:
hdaa0:  Pin nid=26 seq=0
hdaa0:  Pin nid=22 seq=15
hdaa0: Association 1 (2) in:
hdaa0:  Pin nid=29 seq=0
hdaa0:  Pin nid=24 seq=14
hdaa0: Tracing association 0 (1)
hdaa0:  Pin 26 traced to DAC 16
hdaa0:  Pin 22 traced to DAC 16 and hpredir 0
hdaa0: Association 0 (1) trace succeeded
hdaa0: Tracing association 1 (2)
hdaa0:  Pin 29 traced to ADC 20
hdaa0:  Unable to trace pin 24 to ADC 20, undo traces
hdaa0:  Unable to trace pin 29 to ADC 21, undo traces
hdaa0: Association 1 (2) trace failed
hdaa0: Looking for additional DAC for association 0 (1)
hdaa0: Tracing input monitor
hdaa0: Tracing other input monitors
hdaa0: Tracing beeper
hdaa0: Headphones redirection for association 0 nid=22 

Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
... aaand it worked. Woo!

So how'd it actually map the correct selection between headphones and
speaker? That's now cutting back and forth correctly as I plug in and
out the headphone jack.


-a


On 27 July 2014 01:40, Adrian Chadd adr...@freebsd.org wrote:
 ok, with that it looks like:

 root@lucy-11i386:/home/adrian/work/freebsd/head/src # kldload sound ;
 kldload snd_hda
 root@lucy-11i386:/home/adrian/work/freebsd/head/src # dmesg
 snd_unit_init() u=0x00ff8000 [512] d=0x7c00 [32] c=0x03ff [1024]
 feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=5
 feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25
 pci0: driver added
 found- vendor=0x8086, dev=0x2a44, revid=0x07
 domain=0, bus=0, slot=3, func=0
 class=07-80-00, hdrtype=0x00, mfdev=1
 cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords)
 lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
 intpin=a, irq=16
 powerspec 3  supports D0 D3  current D0
 MSI supports 1 message, 64 bit
 pci0:0:3:0: reprobing on driver added
 found- vendor=0x8086, dev=0x293e, revid=0x03
 domain=0, bus=0, slot=27, func=0
 class=04-03-00, hdrtype=0x00, mfdev=0
 cmdreg=0x0506, statreg=0x0010, cachelnsz=16 (dwords)
 lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
 intpin=b, irq=17
 powerspec 2  supports D0 D3  current D0
 MSI supports 1 message, 64 bit
 pci0:0:27:0: reprobing on driver added
 hdac0: Intel 82801I HDA Controller mem 0xfc02-0xfc023fff irq 17
 at device 27.0 on pci0
 hdac0: PCI card vendor: 0x17aa, device: 0x20f2
 hdac0: HDA Driver Revision: 20120126_0002
 hdac0: Config options: on=0x off=0x
 hdac0: attempting to allocate 1 MSI vectors (1 supported)
 msi: routing MSI IRQ 258 to local APIC 0 vector 52
 hdac0: using IRQ 258 for MSI
 hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
 found- vendor=0x8086, dev=0x2930, revid=0x03
 domain=0, bus=0, slot=31, func=3
 class=0c-05-00, hdrtype=0x00, mfdev=0
 cmdreg=0x0103, statreg=0x0280, cachelnsz=0 (dwords)
 lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
 intpin=a, irq=23
 pci0:0:31:3: reprobing on driver added
 pci2: driver added
 pci3: driver added
 pci5: driver added
 pci13: driver added
 pci21: driver added
 found- vendor=0x1180, dev=0x0832, revid=0x04
 domain=0, bus=21, slot=0, func=1
 class=0c-00-10, hdrtype=0x00, mfdev=1
 cmdreg=0x0106, statreg=0x0210, cachelnsz=16 (dwords)
 lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x04 (1000 ns)
 intpin=b, irq=17
 powerspec 2  supports D0 D1 D2 D3  current D0
 pci0:21:0:1: reprobing on driver added
 hdacc0: Conexant CX20561 (Hermosa) HDA CODEC at cad 0 on hdac0
 hdaa0: Conexant CX20561 (Hermosa) Audio Function Group at nid 1 on hdacc0
 hdaa0: Subsystem ID: 0x17aa211c
 hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
 hdaa0:  GPIO0: disabled
 hdaa0:  GPIO1: disabled
 hdaa0:  GPIO2: disabled
 hdaa0:  GPIO3: disabled
 hdaa0: Original pins configuration:
 hdaa0: nid   0xas seq device   conn  jackloccolor   misc
 hdaa0: 22 022140f0 15 0  HeadphonesJack  1/8 Front  Green   0
 hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0
 hdaa0: 24 02a190f0 15 0  Mic   Jack  1/8 Front  Pink0
 hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0
 hdaa0: 26 901701f0 15 0  Speaker   Fixed Analog  Internal   Unknown 1
 hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
 hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1
 hdaa0: 29 90a601f0 15 0  Mic   Fixed Digital Internal   Unknown 1
 hdaa0: Patching pin config nid=22 0x022140f0 - 0x0221401f
 hdaa0: Patching pin config nid=24 0x02a190f0 - 0x02a1902e
 hdaa0: Patching pin config nid=26 0x901701f0 - 0x90170110
 hdaa0: Patching pin config nid=29 0x90a601f0 - 0x90a60120
 hdaa0: Patched pins configuration:
 hdaa0: nid   0xas seq device   conn  jackloccolor   misc
 hdaa0: 22 0221401f 1  15 HeadphonesJack  1/8 Front  Green   0
 hdaa0: 23 61a190f0 15 0  Mic   None  1/8 Ext-Rear   Pink0 DISA
 hdaa0: 24 02a1902e 2  14 Mic   Jack  1/8 Front  Pink0
 hdaa0: 25 40f000f0 15 0  Other None  Unknown 0x00   Unknown 0 DISA
 hdaa0: 26 90170110 1  0  Speaker   Fixed Analog  Internal   Unknown 1
 hdaa0: 27 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
 hdaa0: 28 40f001f0 15 0  Other None  Unknown 0x00   Unknown 1 DISA
 hdaa0: 29 90a60120 2  0  Mic   Fixed Digital Internal   Unknown 1
 hdaa0: 2 associations found:
 hdaa0: Association 0 (1) out:
 hdaa0:  Pin nid=26 seq=0
 hdaa0:  Pin nid=22 seq=15
 hdaa0: Association 1 (2) in:
 hdaa0:  Pin nid=29 seq=0
 hdaa0:  Pin nid=24 seq=14
 hdaa0: Tracing association 0 (1)
 hdaa0:  Pin 26 traced to DAC 16
 hdaa0:  Pin 22 traced to DAC 16 and hpredir 0
 hdaa0: Association 0 (1) trace succeeded
 hdaa0: Tracing association 1 (2)
 hdaa0:  Pin 29 

svn commit: r269152 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 27 08:44:15 2014
New Revision: 269152
URL: http://svnweb.freebsd.org/changeset/base/269152

Log:
  Add support for my Lenovo T400.
  
  Tested:
  
  * Lenovo T400, model w/ P8700 Intel CPU on-board

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c
  head/sys/dev/sound/pci/hda/hdac.h

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- head/sys/dev/sound/pci/hda/hdaa_patches.c   Sun Jul 27 08:02:24 2014
(r269151)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Sun Jul 27 08:44:15 2014
(r269152)
@@ -346,6 +346,22 @@ hdac_pin_patch(struct hdaa_widget *w)
patch = as=1 seq=15;
break;
}
+   } else if (id == HDA_CODEC_CX20561 
+   subid == LENOVO_T400_SUBVENDOR) {
+   switch (nid) {
+   case 22:
+   patch = as=1 seq=15;
+   break;
+   case 24:
+   patch = as=2 seq=14;
+   break;
+   case 26:
+   patch = as=1 seq=0;
+   break;
+   case 29:
+   patch = as=2 seq=0;
+   break;
+   }
} else if (id == HDA_CODEC_CX20590 
(subid == LENOVO_X1_SUBVENDOR ||
subid == LENOVO_X220_SUBVENDOR ||

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Sun Jul 27 08:02:24 2014
(r269151)
+++ head/sys/dev/sound/pci/hda/hdac.h   Sun Jul 27 08:44:15 2014
(r269152)
@@ -236,6 +236,7 @@
 #defineLENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#defineLENOVO_T400_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
 #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 #defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
 #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Alexander Motin
On 27.07.2014 11:42, Adrian Chadd wrote:
 ... aaand it worked. Woo!

It worked for playback, but completely broke recording. I've missed that
your CODEC does not support input switching in hardware, while driver
does not support that in software. For playback software switching is
supported by the driver, so it worked. Patch below should give you
automatic switching on playback, but still two separate recording devices.

 So how'd it actually map the correct selection between headphones and
 speaker? That's now cutting back and forth correctly as I plug in and
 out the headphone jack.

It tells the driver that those two inputs should be parts of one output
device, and driver following HDA specifications reads jack presence
information from respective CODEC pins. Sound actually played to both
outputs, but driver mutes one of them, depending on jack presence.

Lenovo engineers configured the CODEC to report each pin as separate
audio device, but the problem that our sound(4) does not support
automatic switching between them. :(

 On 27 July 2014 01:40, Adrian Chadd adr...@freebsd.org wrote:
 ok, with that it looks like:

 hdaa0: 2 associations found:
 hdaa0: Association 0 (1) out:
 hdaa0:  Pin nid=26 seq=0
 hdaa0:  Pin nid=22 seq=15
 hdaa0: Association 1 (2) in:
 hdaa0:  Pin nid=29 seq=0
 hdaa0:  Pin nid=24 seq=14
 hdaa0: Tracing association 0 (1)
 hdaa0:  Pin 26 traced to DAC 16
 hdaa0:  Pin 22 traced to DAC 16 and hpredir 0
 hdaa0: Association 0 (1) trace succeeded
 hdaa0: Tracing association 1 (2)
 hdaa0:  Pin 29 traced to ADC 20
 hdaa0:  Unable to trace pin 24 to ADC 20, undo traces
 hdaa0:  Unable to trace pin 29 to ADC 21, undo traces
 hdaa0: Association 1 (2) trace failed

Index: hdaa_patches.c
===
--- hdaa_patches.c  (revision 269151)
+++ hdaa_patches.c  (working copy)
@@ -346,6 +346,16 @@ hdac_pin_patch(struct hdaa_widget *w)
patch = as=1 seq=15;
break;
}
+   } else if (id == HDA_CODEC_CX20561 
+   subid == LENOVO_ZZZ_SUBVENDOR) {
+   switch (nid) {
+   case 22:
+   patch = as=1 seq=15;
+   break;
+   case 26:
+   patch = as=1 seq=0;
+   break;
+   }
} else if (id == HDA_CODEC_CX20590 
(subid == LENOVO_X1_SUBVENDOR ||
subid == LENOVO_X220_SUBVENDOR ||
Index: hdac.h
===
--- hdac.h  (revision 269151)
+++ hdac.h  (working copy)
@@ -236,6 +236,7 @@
 #defineLENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
 #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#define LENOVO_ZZZ_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
 #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 #defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
 #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)


-- 
Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r268584 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
Ok, I'll test this out and commit a fix to what's in -HEAD.

Thanks!


-a


On 27 July 2014 01:53, Alexander Motin m...@freebsd.org wrote:
 On 27.07.2014 11:42, Adrian Chadd wrote:
 ... aaand it worked. Woo!

 It worked for playback, but completely broke recording. I've missed that
 your CODEC does not support input switching in hardware, while driver
 does not support that in software. For playback software switching is
 supported by the driver, so it worked. Patch below should give you
 automatic switching on playback, but still two separate recording devices.

 So how'd it actually map the correct selection between headphones and
 speaker? That's now cutting back and forth correctly as I plug in and
 out the headphone jack.

 It tells the driver that those two inputs should be parts of one output
 device, and driver following HDA specifications reads jack presence
 information from respective CODEC pins. Sound actually played to both
 outputs, but driver mutes one of them, depending on jack presence.

 Lenovo engineers configured the CODEC to report each pin as separate
 audio device, but the problem that our sound(4) does not support
 automatic switching between them. :(

 On 27 July 2014 01:40, Adrian Chadd adr...@freebsd.org wrote:
 ok, with that it looks like:

 hdaa0: 2 associations found:
 hdaa0: Association 0 (1) out:
 hdaa0:  Pin nid=26 seq=0
 hdaa0:  Pin nid=22 seq=15
 hdaa0: Association 1 (2) in:
 hdaa0:  Pin nid=29 seq=0
 hdaa0:  Pin nid=24 seq=14
 hdaa0: Tracing association 0 (1)
 hdaa0:  Pin 26 traced to DAC 16
 hdaa0:  Pin 22 traced to DAC 16 and hpredir 0
 hdaa0: Association 0 (1) trace succeeded
 hdaa0: Tracing association 1 (2)
 hdaa0:  Pin 29 traced to ADC 20
 hdaa0:  Unable to trace pin 24 to ADC 20, undo traces
 hdaa0:  Unable to trace pin 29 to ADC 21, undo traces
 hdaa0: Association 1 (2) trace failed

 Index: hdaa_patches.c
 ===
 --- hdaa_patches.c  (revision 269151)
 +++ hdaa_patches.c  (working copy)
 @@ -346,6 +346,16 @@ hdac_pin_patch(struct hdaa_widget *w)
 patch = as=1 seq=15;
 break;
 }
 +   } else if (id == HDA_CODEC_CX20561 
 +   subid == LENOVO_ZZZ_SUBVENDOR) {
 +   switch (nid) {
 +   case 22:
 +   patch = as=1 seq=15;
 +   break;
 +   case 26:
 +   patch = as=1 seq=0;
 +   break;
 +   }
 } else if (id == HDA_CODEC_CX20590 
 (subid == LENOVO_X1_SUBVENDOR ||
 subid == LENOVO_X220_SUBVENDOR ||
 Index: hdac.h
 ===
 --- hdac.h  (revision 269151)
 +++ hdac.h  (working copy)
 @@ -236,6 +236,7 @@
  #defineLENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9)
  #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
  #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
 +#define LENOVO_ZZZ_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2)
  #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
  #defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
  #defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)


 --
 Alexander Motin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269153 - in head/sys/boot: amd64/efi common i386/libi386 i386/loader mips/beri/loader ofw/common pc98/loader powerpc/ps3 sparc64/loader uboot/common userboot/userboot

2014-07-27 Thread Marcel Moolenaar
Author: marcel
Date: Sun Jul 27 16:12:51 2014
New Revision: 269153
URL: http://svnweb.freebsd.org/changeset/base/269153

Log:
  Give loaders more control over the Forth initialization process. In
  particular, allow loaders to define the name of the RC script the
  interpreter needs to use. Use this new-found control to have the
  PXE loader (when compiled with TFTP support and not NFS support)
  read from ${bootfile}.4th, where ${bootfile} is the name of the
  file fetched by the PXE firmware.
  
  The normal startup process involves reading the following files:
  1.  /boot/boot.4th
  2.  /boot/loader.rc or alternatively /boot/boot.conf
  
  When these come from a FreeBSD-defined file system, this is all
  good. But when we boot over the network, subdirectories and fixed
  file names are often painful to administrators and there's really
  no way for them to change the behaviour of the loader.
  
  Obtained from:Juniper Networks, Inc.

Modified:
  head/sys/boot/amd64/efi/main.c
  head/sys/boot/common/bootstrap.h
  head/sys/boot/common/interp.c
  head/sys/boot/common/interp_forth.c
  head/sys/boot/i386/libi386/libi386.h
  head/sys/boot/i386/libi386/pxe.c
  head/sys/boot/i386/loader/main.c
  head/sys/boot/mips/beri/loader/main.c
  head/sys/boot/ofw/common/main.c
  head/sys/boot/pc98/loader/main.c
  head/sys/boot/powerpc/ps3/main.c
  head/sys/boot/sparc64/loader/main.c
  head/sys/boot/uboot/common/main.c
  head/sys/boot/userboot/userboot/main.c

Modified: head/sys/boot/amd64/efi/main.c
==
--- head/sys/boot/amd64/efi/main.c  Sun Jul 27 08:44:15 2014
(r269152)
+++ head/sys/boot/amd64/efi/main.c  Sun Jul 27 16:12:51 2014
(r269153)
@@ -124,7 +124,7 @@ main(int argc, CHAR16 *argv[])
archsw.arch_copyout = x86_efi_copyout;
archsw.arch_readin = x86_efi_readin;
 
-   interact(); /* doesn't return */
+   interact(NULL); /* doesn't return */
 
return (EFI_SUCCESS);   /* keep compiler happy */
 }

Modified: head/sys/boot/common/bootstrap.h
==
--- head/sys/boot/common/bootstrap.hSun Jul 27 08:44:15 2014
(r269152)
+++ head/sys/boot/common/bootstrap.hSun Jul 27 16:12:51 2014
(r269153)
@@ -59,7 +59,7 @@ extern char   command_errbuf[];   /* XXX bla
 #define CMD_ERROR  1
 
 /* interp.c */
-void   interact(void);
+void   interact(const char *rc);
 intinclude(const char *filename);
 
 /* interp_backslash.c */
@@ -69,7 +69,7 @@ char  *backslash(char *str);
 intparse(int *argc, char ***argv, char *str);
 
 /* interp_forth.c */
-void   bf_init(void);
+void   bf_init(const char *rc);
 intbf_run(char *line);
 
 /* boot.c */

Modified: head/sys/boot/common/interp.c
==
--- head/sys/boot/common/interp.c   Sun Jul 27 08:44:15 2014
(r269152)
+++ head/sys/boot/common/interp.c   Sun Jul 27 16:12:51 2014
(r269153)
@@ -90,7 +90,7 @@ perform(int argc, char *argv[])
  * Interactive mode
  */
 void
-interact(void)
+interact(const char *rc)
 {
 static charinput[256]; /* big enough? */
 #ifndef BOOT_FORTH
@@ -99,15 +99,18 @@ interact(void)
 #endif
 
 #ifdef BOOT_FORTH
-bf_init();
+bf_init((rc) ?  : NULL);
 #endif
 
-/*
- * Read our default configuration
- */
-if (include(/boot/loader.rc) != CMD_OK)
-   include(/boot/boot.conf);
+if (rc == NULL) {
+   /* Read our default configuration. */
+   if (include(/boot/loader.rc) != CMD_OK)
+   include(/boot/boot.conf);
+} else if (*rc != '\0')
+   include(rc);
+
 printf(\n);
+
 /*
  * Before interacting, we might want to autoboot.
  */

Modified: head/sys/boot/common/interp_forth.c
==
--- head/sys/boot/common/interp_forth.c Sun Jul 27 08:44:15 2014
(r269152)
+++ head/sys/boot/common/interp_forth.c Sun Jul 27 16:12:51 2014
(r269153)
@@ -241,7 +241,7 @@ bf_command(FICL_VM *vm)
  * Initialise the Forth interpreter, create all our commands as words.
  */
 void
-bf_init(void)
+bf_init(const char *rc)
 {
 struct bootblk_command **cmdp;
 char create_buf[41];   /* 31 characters-long builtins */
@@ -271,13 +271,20 @@ bf_init(void)
 ficlSetEnv(bf_sys, loader_version, 
   (bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0'));
 
+pInterp = ficlLookup(bf_sys, interpret);
+
 /* try to load and run init file if present */
-if ((fd = open(/boot/boot.4th, O_RDONLY)) != -1) {
-   (void)ficlExecFD(bf_vm, fd);
-   close(fd);
+if (rc == NULL)
+   rc = /boot/boot.4th;
+if (*rc != '\0') {
+   fd = open(rc, O_RDONLY);
+   if (fd != -1) {
+   

svn commit: r269154 - head/sys/boot/i386/libi386

2014-07-27 Thread Marcel Moolenaar
Author: marcel
Date: Sun Jul 27 16:29:57 2014
New Revision: 269154
URL: http://svnweb.freebsd.org/changeset/base/269154

Log:
  1.  Suppress output for the TFTP-based PXE loader, but leave it in
  place for the NFS-based PXE loader. Information like rootpath
  or rootip aren't that useful for TFTP and the gateway IP is
  typically already printed by the firmware.
  2.  Only set boot.nfsroot.* environment variables for NFS. This
  makes it possible for the OS to work either way by checking
  for the presence or absence of environment variables.
  3.  Set boot.netif.server when using TFTP so that the OS can fetch
  files as well. A typical use case for this is network-based
  installations with the installation process implemented on
  top of FreeBSD.
  4.  The pxelinux loader has a set of alternative names it tries
  for configuration files. Make it easier to do something
  similar in Forth by providing the IP address as a 32-bit hex
  number in the pxeboot.ip variable and the MAC address with
  dashes in the pxeboot.hwaddr environment variable.
  
  Obtained from:Juniper Networks, Inc.

Modified:
  head/sys/boot/i386/libi386/pxe.c

Modified: head/sys/boot/i386/libi386/pxe.c
==
--- head/sys/boot/i386/libi386/pxe.cSun Jul 27 16:12:51 2014
(r269153)
+++ head/sys/boot/i386/libi386/pxe.cSun Jul 27 16:29:57 2014
(r269154)
@@ -301,10 +301,6 @@ pxe_open(struct open_file *f, ...)
bcopy(rootpath[i], temp[0], strlen(rootpath[i])+1);
bcopy(temp[0], rootpath[0], strlen(rootpath[i])+1);
}
-   printf(pxe_open: server addr: %s\n, inet_ntoa(rootip));
-   printf(pxe_open: server path: %s\n, rootpath);
-   printf(pxe_open: gateway ip:  %s\n, inet_ntoa(gateip));
-
setenv(boot.netif.ip, inet_ntoa(myip), 1);
setenv(boot.netif.netmask, intoa(netmask), 1);
setenv(boot.netif.gateway, inet_ntoa(gateip), 1);
@@ -312,9 +308,24 @@ pxe_open(struct open_file *f, ...)
sprintf(temp, %6D, bootplayer.CAddr, :);
setenv(boot.netif.hwaddr, temp, 1);
}
+#ifdef LOADER_NFS_SUPPORT
+   printf(pxe_open: server addr: %s\n, inet_ntoa(rootip));
+   printf(pxe_open: server path: %s\n, rootpath);
+   printf(pxe_open: gateway ip:  %s\n, inet_ntoa(gateip));
+
setenv(boot.nfsroot.server, inet_ntoa(rootip), 1);
setenv(boot.nfsroot.path, rootpath, 1);
+#else
+   setenv(boot.netif.server, inet_ntoa(rootip), 1);
+#endif
setenv(dhcp.host-name, hostname, 1);
+
+   sprintf(temp, %08X, ntohl(myip.s_addr));
+   setenv(pxeboot.ip, temp, 1);
+   if (bootplayer.Hardware == ETHER_TYPE) {
+   sprintf(temp, %6D, bootplayer.CAddr, -);
+   setenv(pxeboot.hwaddr, temp, 1);
+   }
}
 }
 pxe_opens++;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269155 - head

2014-07-27 Thread Peter Wemm
Author: peter
Date: Sun Jul 27 17:34:49 2014
New Revision: 269155
URL: http://svnweb.freebsd.org/changeset/base/269155

Log:
  Forced commit - testing commit mail etc pipelines.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sun Jul 27 16:29:57 2014(r269154)
+++ head/UPDATING   Sun Jul 27 17:34:49 2014(r269155)
@@ -1,4 +1,4 @@
-Updating Information for FreeBSD current users
+Updating Information for FreeBSD current users.
 
 This file is maintained and copyrighted by M. Warner Losh i...@freebsd.org.
 See end of file for further details.  For commonly done items, please see the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r269152 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Rui Paulo
On Jul 27, 2014, at 1:44, Adrian Chadd adr...@freebsd.org wrote:

 Author: adrian
 Date: Sun Jul 27 08:44:15 2014
 New Revision: 269152
 URL: http://svnweb.freebsd.org/changeset/base/269152
 
 Log:
  Add support for my Lenovo T400.
 
  Tested:
 
  * Lenovo T400, model w/ P8700 Intel CPU on-board

Don't forget to MFC :-)

--
Rui Paulo



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


Re: svn commit: r269127 - head/sys/dev/usb/wlan

2014-07-27 Thread Hans Petter Selasky

On 07/27/14 02:10, Adrian Chadd wrote:

On 26 July 2014 12:13, Hans Petter Selasky h...@selasky.org wrote:

On 07/26/14 20:36, Adrian Chadd wrote:


Hi,

We should likely review how the PLCP bits are being used and why it's
getting a rate of 0 in the first place.

So, why's it getting a rate of 0 passed into the transmit path?




Hi Adrian,

Here is the backtrace of the panic:

Fatal trap 18: integer divide fault while in kernel mode
cpuid = 2; apic id = 02
instruction pointer = 0x20:0x807826cf
stack pointer   = 0x28:0xff8000305090
frame pointer   = 0x28:0xff80003050a0
code segment= base 0x0, limit 0xf, type 0x1b
 = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 15 (usbus0)
trap number = 18
panic: integer divide fault
cpuid = 2
KDB: stack backtrace:
#0 0x809257e6 at kdb_backtrace+0x66
#1 0x808eb3ae at panic+0x1ce
#2 0x80cd2c30 at trap_fatal+0x290
#3 0x80cd3480 at trap+0x250
#4 0x80cbc783 at calltrap+0x8
#5 0x80783d90 at ural_start+0x1d0
#6 0x809aa2ea at if_transmit+0xea
#7 0x809ef7b2 at ieee80211_start+0x542
#8 0x809aa2ea at if_transmit+0xea
#9 0x809ae8b3 at ether_output_frame+0x33
#10 0x809aee30 at ether_output+0x530
#11 0x80a186b4 at ip_output+0xd74
#12 0x80a87d2a at tcp_output+0xfea
#13 0x80a8 at tcp_do_segment+0xc02
#14 0x80a85219 at tcp_input+0xa29
#15 0x80a155fa at ip_input+0xaa
#16 0x809b7808 at netisr_dispatch_src+0x218
#17 0x809ae3fd at ether_demux+0x14d


Hm, so at some point that rate was not assigned to something. Can you
trace the ural_start path to see where it's supposed to be calculating
the rate?



Rate comes from this:

tp = vap-iv_txparms[ieee80211_chan2mode(ni-ni_chan)];
if (IEEE80211_IS_MULTICAST(wh-i_addr1))
rate = tp-mcastrate;
else if (tp-ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp-ucastrate;
else
rate = ni-ni_txrate;

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


Re: svn commit: r269152 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
On 27 July 2014 11:07, Rui Paulo rpa...@felyko.com wrote:
 On Jul 27, 2014, at 1:44, Adrian Chadd adr...@freebsd.org wrote:

 Author: adrian
 Date: Sun Jul 27 08:44:15 2014
 New Revision: 269152
 URL: http://svnweb.freebsd.org/changeset/base/269152

 Log:
  Add support for my Lenovo T400.

  Tested:

  * Lenovo T400, model w/ P8700 Intel CPU on-board

 Don't forget to MFC :-)


Once it's actually working, sure. :)


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


svn commit: r269158 - head/sys/dev/sound/pci/hda

2014-07-27 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 27 20:14:22 2014
New Revision: 269158
URL: http://svnweb.freebsd.org/changeset/base/269158

Log:
  Update from mav@ - don't break the input switching.

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- head/sys/dev/sound/pci/hda/hdaa_patches.c   Sun Jul 27 18:10:07 2014
(r269157)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Sun Jul 27 20:14:22 2014
(r269158)
@@ -352,15 +352,9 @@ hdac_pin_patch(struct hdaa_widget *w)
case 22:
patch = as=1 seq=15;
break;
-   case 24:
-   patch = as=2 seq=14;
-   break;
case 26:
patch = as=1 seq=0;
break;
-   case 29:
-   patch = as=2 seq=0;
-   break;
}
} else if (id == HDA_CODEC_CX20590 
(subid == LENOVO_X1_SUBVENDOR ||
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r269127 - head/sys/dev/usb/wlan

2014-07-27 Thread Adrian Chadd
Hi,

Ok. So, which one of those is showing up as 0?

Maybe refactor out the rate lookup code and if it's zero, log an error
and reset it to either 2 (for 11ng) or 12 (11a.) '2' isn't valid for
11a - the minimum rate is 6mb.

-a


On 27 July 2014 13:11, Hans Petter Selasky h...@selasky.org wrote:
 On 07/27/14 02:10, Adrian Chadd wrote:

 On 26 July 2014 12:13, Hans Petter Selasky h...@selasky.org wrote:

 On 07/26/14 20:36, Adrian Chadd wrote:


 Hi,

 We should likely review how the PLCP bits are being used and why it's
 getting a rate of 0 in the first place.

 So, why's it getting a rate of 0 passed into the transmit path?



 Hi Adrian,

 Here is the backtrace of the panic:

 Fatal trap 18: integer divide fault while in kernel mode
 cpuid = 2; apic id = 02
 instruction pointer = 0x20:0x807826cf
 stack pointer   = 0x28:0xff8000305090
 frame pointer   = 0x28:0xff80003050a0
 code segment= base 0x0, limit 0xf, type 0x1b
  = DPL 0, pres 1, long 1, def32 0, gran 1
 processor eflags= interrupt enabled, resume, IOPL = 0
 current process = 15 (usbus0)
 trap number = 18
 panic: integer divide fault
 cpuid = 2
 KDB: stack backtrace:
 #0 0x809257e6 at kdb_backtrace+0x66
 #1 0x808eb3ae at panic+0x1ce
 #2 0x80cd2c30 at trap_fatal+0x290
 #3 0x80cd3480 at trap+0x250
 #4 0x80cbc783 at calltrap+0x8
 #5 0x80783d90 at ural_start+0x1d0
 #6 0x809aa2ea at if_transmit+0xea
 #7 0x809ef7b2 at ieee80211_start+0x542
 #8 0x809aa2ea at if_transmit+0xea
 #9 0x809ae8b3 at ether_output_frame+0x33
 #10 0x809aee30 at ether_output+0x530
 #11 0x80a186b4 at ip_output+0xd74
 #12 0x80a87d2a at tcp_output+0xfea
 #13 0x80a8 at tcp_do_segment+0xc02
 #14 0x80a85219 at tcp_input+0xa29
 #15 0x80a155fa at ip_input+0xaa
 #16 0x809b7808 at netisr_dispatch_src+0x218
 #17 0x809ae3fd at ether_demux+0x14d


 Hm, so at some point that rate was not assigned to something. Can you
 trace the ural_start path to see where it's supposed to be calculating
 the rate?


 Rate comes from this:

 tp = vap-iv_txparms[ieee80211_chan2mode(ni-ni_chan)];
 if (IEEE80211_IS_MULTICAST(wh-i_addr1))
 rate = tp-mcastrate;
 else if (tp-ucastrate != IEEE80211_FIXED_RATE_NONE)
 rate = tp-ucastrate;
 else
 rate = ni-ni_txrate;

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


svn commit: r269159 - head/share/man/man9

2014-07-27 Thread Konstantin Belousov
Author: kib
Date: Sun Jul 27 20:47:06 2014
New Revision: 269159
URL: http://svnweb.freebsd.org/changeset/base/269159

Log:
  Correct the locking statement.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/share/man/man9/VOP_INACTIVE.9

Modified: head/share/man/man9/VOP_INACTIVE.9
==
--- head/share/man/man9/VOP_INACTIVE.9  Sun Jul 27 20:14:22 2014
(r269158)
+++ head/share/man/man9/VOP_INACTIVE.9  Sun Jul 27 20:47:06 2014
(r269159)
@@ -28,7 +28,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 24, 1996
+.Dd July 27, 2014
 .Dt VOP_INACTIVE 9
 .Os
 .Sh NAME
@@ -63,17 +63,13 @@ is called when a vnode is being reused f
 Any file system specific resources associated with the vnode should be
 freed.
 .Sh LOCKS
-For VOP_INACTIVE, the
-.Fa vp
-will be locked on entry.
-Your VOP_INACTIVE code
-must unlock the
-.Fa vp
-prior to returning.
-.Pp
-For VOP_RECLAIM, the
+For both
+.Fn VOP_INACTIVE
+and
+.Fn VOP_RECLAIM ,
+the
 .Fa vp
-will not be locked on entry and should be left unlocked on return.
+will be locked on entry, and must be left locked on return.
 .Sh SEE ALSO
 .Xr vnode 9
 .Sh AUTHORS
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269160 - head/share/man/man9

2014-07-27 Thread Konstantin Belousov
Author: kib
Date: Sun Jul 27 20:48:56 2014
New Revision: 269160
URL: http://svnweb.freebsd.org/changeset/base/269160

Log:
  Remove man page for non-existent VOPs.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Deleted:
  head/share/man/man9/VOP_GETVOBJECT.9
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileSun Jul 27 20:47:06 2014
(r269159)
+++ head/share/man/man9/MakefileSun Jul 27 20:48:56 2014
(r269160)
@@ -358,7 +358,6 @@ MAN=accept_filter.9 \
VOP_GETACL.9 \
VOP_GETEXTATTR.9 \
VOP_GETPAGES.9 \
-   VOP_GETVOBJECT.9 \
VOP_INACTIVE.9 \
VOP_IOCTL.9 \
VOP_LINK.9 \
@@ -1559,8 +1558,6 @@ MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \
VOP_CREATE.9 VOP_MKNOD.9 \
VOP_CREATE.9 VOP_SYMLINK.9
 MLINKS+=VOP_GETPAGES.9 VOP_PUTPAGES.9
-MLINKS+=VOP_GETVOBJECT.9 VOP_CREATEVOBJECT.9 \
-   VOP_GETVOBJECT.9 VOP_DESTROYVOBJECT.9
 MLINKS+=VOP_INACTIVE.9 VOP_RECLAIM.9
 MLINKS+=VOP_LOCK.9 vn_lock.9 \
VOP_LOCK.9 VOP_ISLOCKED.9 \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269161 - head/share/man/man9

2014-07-27 Thread Konstantin Belousov
Author: kib
Date: Sun Jul 27 20:55:47 2014
New Revision: 269161
URL: http://svnweb.freebsd.org/changeset/base/269161

Log:
  Explicitely mention that inactivated or reclaimed vnode is locked
  exclusively.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/share/man/man9/VOP_INACTIVE.9

Modified: head/share/man/man9/VOP_INACTIVE.9
==
--- head/share/man/man9/VOP_INACTIVE.9  Sun Jul 27 20:48:56 2014
(r269160)
+++ head/share/man/man9/VOP_INACTIVE.9  Sun Jul 27 20:55:47 2014
(r269161)
@@ -69,7 +69,8 @@ and
 .Fn VOP_RECLAIM ,
 the
 .Fa vp
-will be locked on entry, and must be left locked on return.
+will be exclusively locked on entry, and must be left exclusively
+locked on return.
 .Sh SEE ALSO
 .Xr vnode 9
 .Sh AUTHORS
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269163 - head/usr.bin/m4/lib

2014-07-27 Thread Baptiste Daroussin
Author: bapt
Date: Sun Jul 27 22:56:46 2014
New Revision: 269163
URL: http://svnweb.freebsd.org/changeset/base/269163

Log:
  Remove ohash_int.h forgotten in previous commit

Deleted:
  head/usr.bin/m4/lib/ohash_int.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269178 - head/sys/arm/samsung/exynos

2014-07-27 Thread Ruslan Bukin
Author: br
Date: Mon Jul 28 05:37:10 2014
New Revision: 269178
URL: http://svnweb.freebsd.org/changeset/base/269178

Log:
  Add the rest of combined interrupt groups.

Modified:
  head/sys/arm/samsung/exynos/exynos5_combiner.c

Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c
==
--- head/sys/arm/samsung/exynos/exynos5_combiner.c  Mon Jul 28 02:07:16 
2014(r269177)
+++ head/sys/arm/samsung/exynos/exynos5_combiner.c  Mon Jul 28 05:37:10 
2014(r269178)
@@ -57,7 +57,6 @@ __FBSDID($FreeBSD$);
 #include arm/samsung/exynos/exynos5_combiner.h
 
 #define NGRP   32
-#define ITABLE_LEN 24
 
 #defineIESR(n) (0x10 * n + 0x0)/* Interrupt enable set */
 #defineIECR(n) (0x10 * n + 0x4)/* Interrupt enable clear */
@@ -118,7 +117,7 @@ struct combiner_entry {
char *source_name;
 };
 
-static struct combiner_entry interrupt_table[ITABLE_LEN] = {
+static struct combiner_entry interrupt_table[] = {
{ 63, 1, EINT[15] },
{ 63, 0, EINT[14] },
{ 62, 1, EINT[13] },
@@ -143,8 +142,116 @@ static struct combiner_entry interrupt_t
{ 55, 4, MCT_G1 },
{ 55, 3, MCT_G0 },
{ 55, 0, EINT[0] },
+   { 54, 7, CPU_nCNTVIRQ[1] },
+   { 54, 6, CPU_nCTIIRQ[1] },
+   { 54, 5, CPU_nCNTPSIRQ[1] },
+   { 54, 4, CPU_nPMUIRQ[1] },
+   { 54, 3, CPU_nCNTPNSIRQ[1] },
+   { 54, 2, CPU_PARITYFAILSCU[1] },
+   { 54, 1, CPU_nCNTHPIRQ[1] },
+   { 54, 0, PARITYFAIL[1] },
+   { 53, 1, CPU_nIRQ[1] },
+   { 52, 0, CPU_nIRQ[0] },
+   { 51, 7, CPU_nRAMERRIRQ },
+   { 51, 6, CPU_nAXIERRIRQ },
+   { 51, 4, INT_COMB_ISP_GIC },
+   { 51, 3, INT_COMB_IOP_GIC },
+   { 51, 2, CCI_nERRORIRQ },
+   { 51, 1, INT_COMB_ARMISP_GIC },
+   { 51, 0, INT_COMB_ARMIOP_GIC },
+   { 50, 7, DISP1[3] },
+   { 50, 6, DISP1[2] },
+   { 50, 5, DISP1[1] },
+   { 50, 4, DISP1[0] },
+   { 49, 3, SSCM_PULSE_IRQ_C2CIF[1] },
+   { 49, 2, SSCM_PULSE_IRQ_C2CIF[0] },
+   { 49, 1, SSCM_IRQ_C2CIF[1] },
+   { 49, 0, SSCM_IRQ_C2CIF[0] },
+   { 48, 3, PEREV_M1_CDREX },
+   { 48, 2, PEREV_M0_CDREX },
+   { 48, 1, PEREV_A1_CDREX },
+   { 48, 0, PEREV_A0_CDREX },
+   { 47, 3, MDMA0_ABORT },
+   /* 46 is fully reserved */
+   { 45, 1, MDMA1_ABORT },
+   /* 44 is fully reserved */
+   { 43, 7, SYSMMU_DRCISP[1] },
+   { 43, 6, SYSMMU_DRCISP[0] },
+   { 43, 1, SYSMMU_ODC[1] },
+   { 43, 0, SYSMMU_ODC[0] },
+   { 42, 7, SYSMMU_ISP[1] },
+   { 42, 6, SYSMMU_ISP[0] },
+   { 42, 5, SYSMMU_DIS0[1] },
+   { 42, 4, SYSMMU_DIS0[0] },
+   { 42, 3, DP1 },
+   { 41, 5, SYSMMU_DIS1[1] },
+   { 41, 4, SYSMMU_DIS1[0] },
+   { 40, 6, SYSMMU_MFCL[1] },
+   { 40, 5, SYSMMU_MFCL[0] },
+   { 39, 5, SYSMMU_TV_M0[1] },
+   { 39, 4, SYSMMU_TV_M0[0] },
+   { 39, 3, SYSMMU_MDMA1[1] },
+   { 39, 2, SYSMMU_MDMA1[0] },
+   { 39, 1, SYSMMU_MDMA0[1] },
+   { 39, 0, SYSMMU_MDMA0[0] },
+   { 38, 7, SYSMMU_SSS[1] },
+   { 38, 6, SYSMMU_SSS[0] },
+   { 38, 5, SYSMMU_RTIC[1] },
+   { 38, 4, SYSMMU_RTIC[0] },
+   { 38, 3, SYSMMU_MFCR[1] },
+   { 38, 2, SYSMMU_MFCR[0] },
+   { 38, 1, SYSMMU_ARM[1] },
+   { 38, 0, SYSMMU_ARM[0] },
+   { 37, 7, SYSMMU_3DNR[1] },
+   { 37, 6, SYSMMU_3DNR[0] },
+   { 37, 5, SYSMMU_MCUISP[1] },
+   { 37, 4, SYSMMU_MCUISP[0] },
+   { 37, 3, SYSMMU_SCALERCISP[1] },
+   { 37, 2, SYSMMU_SCALERCISP[0] },
+   { 37, 1, SYSMMU_FDISP[1] },
+   { 37, 0, SYSMMU_FDISP[0] },
+   { 36, 7, MCUIOP_CTIIRQ },
+   { 36, 6, MCUIOP_PMUIRQ },
+   { 36, 5, MCUISP_CTIIRQ },
+   { 36, 4, MCUISP_PMUIRQ },
+   { 36, 3, SYSMMU_JPEGX[1] },
+   { 36, 2, SYSMMU_JPEGX[0] },
+   { 36, 1, SYSMMU_ROTATOR[1] },
+   { 36, 0, SYSMMU_ROTATOR[0] },
+   { 35, 7, SYSMMU_SCALERPISP[1] },
+   { 35, 6, SYSMMU_SCALERPISP[0] },
+   { 35, 5, SYSMMU_FIMC_LITE0[1] },
+   { 35, 4, SYSMMU_FIMC_LITE0[0] },
+   { 35, 3, SYSMMU_DISP1_M0[1] },
+   { 35, 2, SYSMMU_DISP1_M0[0] },
+   { 35, 1, SYSMMU_FIMC_LITE2[1] },
+   { 35, 0, SYSMMU_FIMC_LITE2[0] },
+   { 34, 7, SYSMMU_GSCL3[1] },
+   { 34, 6, SYSMMU_GSCL3[0] },
+   { 34, 5, SYSMMU_GSCL2[1] },
+   { 34, 4, SYSMMU_GSCL2[0] },
+   { 34, 3, SYSMMU_GSCL1[1] },
+   { 34, 2, SYSMMU_GSCL1[0] },
+   { 34, 1, SYSMMU_GSCL0[1] },
+   { 34, 0, SYSMMU_GSCL0[0] },
+   { 33, 7, CPU_nCNTVIRQ[0] },
+   { 33, 6, CPU_nCNTPSIRQ[0] },
+   { 33, 5, CPU_nCNTPSNIRQ[0] },
+   { 33, 4, CPU_nCNTHPIRQ[0] },
+   { 33, 3, CPU_nCTIIRQ[0] },
+   { 33, 2, CPU_nPMUIRQ[0] },
+   { 33, 1, CPU_PARITYFAILSCU[0] },
+   { 33, 0, CPU_PARITYFAIL0 },
+   { 32, 7, TZASC_XR1BXW },
+   { 32, 6, TZASC_XR1BXR },
+   { 32, 5, TZASC_XLBXW },
+   { 32, 4,