Re: Samsung900X3F: wrong acpitz temperature, acpibat0 not detecting battery

2014-04-14 Thread Remi Locherer
On Mon, Apr 14, 2014 at 07:09:47PM +0300, Paul Irofti wrote:
> Thanks for testing!
> 
> I need a bit more info, could you tell me what the output is when
> applying the following diff on top of -current?

Here you go:


OpenBSD 5.5-current (GENERIC.MP) #2: Mon Apr 14 22:45:53 CEST 2014
r...@mistral.relo.ch:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3881746432 (3701MB)
avail mem = 3769651200 (3595MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xe0970 (63 entries)
bios0: vendor Phoenix Technologies Ltd. version "P00ACX" date 04/26/2013
bios0: SAMSUNG ELECTRONICS CO., LTD. 900X3F
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC SSDT ASF! HPET APIC MCFG FPDT SSDT SSDT UEFI MSDM 
UEFI UEFI
acpi0: wakeup devices P0P1(S4) GLAN(S4) XHC_(S4) HDEF(S4) PXSX(S4) RP01(S4) 
PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) PXSX(S4) RP04(S4) PXSX(S4) RP06(S4) 
PXSX(S4) RP07(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.41 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.15 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.15 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 1, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, 1696.15 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,F16C,RDRAND,NXE,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xf800, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P1)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus -1 (RP02)
acpiprt4 at acpi0: bus -1 (RP03)
acpiprt5 at acpi0: bus 2 (RP04)
acpiprt6 at acpi0: bus 3 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus -1 (RP07)
acpiprt9 at acpi0: bus -1 (RP08)
acpiprt10 at acpi0: bus -1 (PEG0)
acpiprt11 at acpi0: bus -1 (PEG1)
acpiprt12 at acpi0: bus -1 (PEG2)
acpiprt13 at acpi0: bus -1 (PEG3)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpicpu2 at acpi0: C3, C2, C1, PSS
acpicpu3 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: FN00, resource for FAN0
acpipwrres1 at acpi0: FN01, resource for FAN1
acpipwrres2 at acpi0: FN02, resource for FAN2
acpipwrres3 at acpi0: FN03, resource for FAN3
acpipwrres4 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 106 degC
acpitz1 at acpi0: critical temperature is 106 degC
acpibat0 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit offline
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD02
cpu0: Enhanced SpeedStep 1696 MHz: speeds: 1801, 1800, 1700, 1600, 1500, 1400, 
1300, 1200, 1100, 1000, 900, 800, 774 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 3G Host" rev 0x09
vga1 at pci0 dev 2 function 0 "Intel HD Graphics 4000" rev 0x09
intagp0 at vga1
agp0 at intagp0: aperture at 0xe000, size 0x1000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1920x1080
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 7 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
azalia0 at pci0 dev 27 function 0 "Intel 7 Serie

Re: Samsung900X3F: wrong acpitz temperature, acpibat0 not detecting battery

2014-04-14 Thread Paul Irofti
Thanks for testing!

I need a bit more info, could you tell me what the output is when
applying the following diff on top of -current?


Index: dsdt.c
===
RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
retrieving revision 1.205
diff -u -p -r1.205 dsdt.c
--- dsdt.c  12 Dec 2013 20:56:01 -  1.205
+++ dsdt.c  14 Apr 2014 16:06:58 -
@@ -114,6 +114,8 @@ int aml_intlen = 64;
 struct aml_nodeaml_root;
 struct aml_value   *aml_global_lock;
 
+int noisy;
+
 /* Perfect Hash key */
 #define HASH_OFF   6904
 #define HASH_SIZE  179
@@ -736,72 +738,68 @@ static long global_lock_count = 0;
 void
 acpi_glk_enter(void)
 {
-   acpi_acquire_glk(&acpi_softc->sc_facs->global_lock);
-}
-
-void
-acpi_glk_leave(void)
-{
-   int x;
-
-   if (acpi_release_glk(&acpi_softc->sc_facs->global_lock)) {
-   /*
-* If pending, notify the BIOS that the lock was released
-* by the OSPM. No locking is needed because nobody outside
-* the ACPI thread is touching this register.
-*/
-   x = acpi_read_pmreg(acpi_softc, ACPIREG_PM1_CNT, 0);
-   x |= ACPI_PM1_GBL_RLS;
-   acpi_write_pmreg(acpi_softc, ACPIREG_PM1_CNT, 0, x);
-   }
-}
-
-void
-aml_lockfield(struct aml_scope *scope, struct aml_value *field)
-{
int st = 0;
 
-   if (AML_FIELD_LOCK(field->v_field.flags) != AML_FIELD_LOCK_ON)
-   return;
-
-   /* If lock is already ours, just continue */
+   /* If lock is already ours, just continue. */
if (global_lock_count++)
return;
 
-   /* Spin to acquire lock */
+   /* Spin to acquire the lock. */
while (!st) {
st = acpi_acquire_glk(&acpi_softc->sc_facs->global_lock);
/* XXX - yield/delay? */
}
-
-   return;
 }
 
 void
-aml_unlockfield(struct aml_scope *scope, struct aml_value *field)
+acpi_glk_leave(void)
 {
-   int st, x, s;
-
-   if (AML_FIELD_LOCK(field->v_field.flags) != AML_FIELD_LOCK_ON)
-   return;
+   int st, x;
 
-   /* If we are the last ones, turn out the lights */
+   /* If we are the last one, turn out the lights. */
if (--global_lock_count)
return;
 
-   /* Release lock */
st = acpi_release_glk(&acpi_softc->sc_facs->global_lock);
if (!st)
return;
 
-   /* Signal others if someone waiting */
-   s = spltty();
+   /*
+* If pending, notify the BIOS that the lock was released by
+* OSPM.  No locking is needed because nobody outside the ACPI
+* thread is supposed to touch this register.
+*/
x = acpi_read_pmreg(acpi_softc, ACPIREG_PM1_CNT, 0);
x |= ACPI_PM1_GBL_RLS;
acpi_write_pmreg(acpi_softc, ACPIREG_PM1_CNT, 0, x);
-   splx(s);
+}
+
+void
+aml_lockfield(struct aml_scope *scope, struct aml_value *field)
+{
+   if (AML_FIELD_LOCK(field->v_field.flags) != AML_FIELD_LOCK_ON) {
+   if (noisy)
+   printf("lock not needed\n");
+   return;
+   }
+
+   if (noisy)
+   printf("locking\n");
+   acpi_glk_enter();
+}
+
+void
+aml_unlockfield(struct aml_scope *scope, struct aml_value *field)
+{
+   if (AML_FIELD_LOCK(field->v_field.flags) != AML_FIELD_LOCK_ON) {
+   if (noisy)
+   printf("unlock not needed\n");
+   return;
+   }
 
-   return;
+   if (noisy)
+   printf("unlocking\n");
+   acpi_glk_leave();
 }
 
 /*
@@ -2335,6 +2333,10 @@ aml_rwgas(struct aml_value *rgn, int bpo
}
/* Copy target bits, then write to region */
aml_bufcpy(tbit, bpos & 7, vbit, 0, blen);
+   if (noisy) {
+   printf("gasio: %d %#llx %d %d %d\n", type, pi.addr, sz,
+   slen, tbit);
+   }
acpi_gasio(acpi_softc, ACPI_IOWRITE, type, pi.addr,
sz, slen, tbit);
 
@@ -2440,6 +2442,11 @@ aml_rwfield(struct aml_value *fld, int b
aml_rwgas(ref1, fld->v_field.bitpos, fld->v_field.bitlen,
val, mode, fld->v_field.flags);
} else if (fld->v_field.type == AMLOP_FIELD) {
+   if (noisy) {
+   printf("field: aml_rwgas bitpos %d bpos %d blen %d,"
+   "flags %#x\n", fld->v_field.bitpos, bpos, blen,
+   fld->v_field.flags);
+   }
aml_rwgas(ref1, fld->v_field.bitpos + bpos, blen, val, mode,
fld->v_field.flags);
} else if (mode == ACPI_IOREAD) {
@@ -2450,6 +2457,9 @@ aml_rwfield(struct aml_value *fld, int b
} else {
/* bufferfield:write */
val = aml_conve

Re: Mount MFS problem (wrong umask)

2014-04-14 Thread Kārlis Miķelsons

I have the following problem: I would like to mount a memory fs for
/tmp, so I specifiy this in the fstab:

swap /tmp mfs rw,nodev,nosuid,-s=153600 0 0

I've experienced same issue on 5.4/amd64, it went away after
updating to current. On current umask is correct with both mfs
and tmpfs.


--
Karlis



Re: Mount MFS problem (wrong umask)

2014-04-14 Thread Otto Moerbeek
Please keep this on-list.

Can't see anything special here. 

-Otto

On Mon, Apr 14, 2014 at 08:10:56AM +0200, laurence.tintzmann wrote:

> Hi Otto.
> 
> fstab:
> ...
> swap /tmp mfs rw,nodev,nosuid,-s=153600 0 0
> 
> 
> # mount
> /dev/wd0a on / type ffs (local)
> /dev/wd0k on /home type ffs (local, nodev, nosuid)
> mfs:12987 on /tmp type mfs (asynchronous, local, nodev, nosuid, size=153600
> 512-blocks)
> /dev/wd0f on /usr type ffs (local, nodev)
> /dev/wd0g on /usr/X11R6 type ffs (local, nodev)
> /dev/wd0h on /usr/local type ffs (local, nodev)
> /dev/wd0j on /usr/obj type ffs (local, nodev, nosuid)
> /dev/wd0i on /usr/src type ffs (local, nodev, nosuid)
> /dev/wd0e on /var type ffs (local, nodev, nosuid)
> 
> Thanks for your support!
> 
> 
> 
> 
> Am 14.04.2014 08:05, schrieb Otto Moerbeek:
> >On Mon, Apr 14, 2014 at 06:36:44AM +0200, laurence.tintzmann wrote:
> >
> >>Hi.
> >>
> >>I have the following problem: I would like to mount a memory fs for /tmp, 
> >>so I specifiy this in the fstab:
> >>
> >>swap /tmp mfs rw,nodev,nosuid,-s=153600 0 0
> >>
> >>This is like the examples from the fstab-man pages. So, my mount point is 
> >>this:
> >>
> >>drwxrwxrwt   2 root  wheel   512B Apr 14 08:19 tmp
> >>
> >>but after mounting it looks like this:
> >>
> >>drwxr-xr-t   2 root  wheel   512B Apr 14 08:20 tmp.
> >>
> >>As from the man-pages of mount_mfs: "If the -P file option is not used, the 
> >>owner and mode of the created mfs file system will be the same as the owner 
> >>and mode of the mount point."
> >>
> >>If I do this with another directory, everything works fine. So where is the 
> >>problem?
> >>
> >>I am using OpenBSD/amd64 5.4 generic.
> >>
> >>Best regards
> >
> >Do you have two filesystems mounted on /tmp?
> >
> >Show the output of # mount
> >
> > -Otto