Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common

2019-02-27 Thread Cy Schubert
In message <0563e72c-c9e3-a476-ce43-d4a67c454...@freebsd.org>, Andriy 
Gapon wri
tes:
> On 26/02/2019 22:58, Cy Schubert wrote:
> > I was talking about nested datasets, i.e. tank/freebsd/git/current and 
> > tank/freebsd/git/ports are four levels deep.
>
> We usually don't call them "nested".  In fact, I don't think that we call the
> m
> anything special because having N levels deep datasets (N > 1) is just a comm
> on
> thing.  We may call them subordinate or child datasets when mentioning a
> relation to a parent dataset.
>
> > In my case the ports 
> > dataset was mounted while the current dataset was not, though zfs 
> > believed it was. unmounting the current dataset and remounting it, zfs 
> > umount .../current; zfs mount .../current worked around the issue.
>
> Are you sure that it was not mounted?

Yes.

> Have you checked that by looking at mount output?

Yes

> I suspect that it was mounted, just not where you expected and its mount path
> was covered by another filesystem.

If you read my original email a zfs umount followed by a zfs mount for 
each affected filesystem worked around the problem. zfs properties 
showed that each and every filesystem was mounted. mount(1) and df(1) 
confirmed they were not. Furthermore nullfs mounts with the late 
attribute failed to mount because their underlying zfs datasets were 
not mounted -- this is what clued me into the problem in the first 
place, a FreeBSD system dropping into single user at boot. And, no, 
fstab on that machine had not been changed for months, them machine 
failed to boot. So, no, I was not mistaken. I was rather displeased 
because I had to try to fix the problem using ssh on a phone to a 
machine connected to a console server.

>
> E.g., lets consider this hypothetical case.
> I have two same level datasets tank/freebsd/src and tank/freebsd/sys where
> tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at
> /usr/src/sys (a child directory of /usr/src).
> If tank/freebsd/src is mounted first, then everything is okay, tank/freebsd/s
> ys
> would be mounted on top of sys directory in tank/freebsd/src.
> If, however, tank/freebsd/sys is mounted first (assuming that path /usr/src/s
> ys
> exists in a root filesystem), then mounting tank/freebsd/src would simply hid
> e
> tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in
> tank/freebsd/src.
>
> I guess that this is a kind of problem that could be introduced with parallel
> mounting.  And I guess that this is a kind of problem that you might actually
> have.  But it's just a guess.

No. I had not mistakenly mounted the datasets elsewhere, mistakenly 
deleted them or mistakenly changed their mount attributes. It was a 
real, not imagined, regression fixed by the patch posted near the end 
of the email thread.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common

2019-02-27 Thread Andriy Gapon
On 27/02/2019 15:04, Cy Schubert wrote:
> In message <0563e72c-c9e3-a476-ce43-d4a67c454...@freebsd.org>, Andriy 
> Gapon wri
> tes:
>> On 26/02/2019 22:58, Cy Schubert wrote:
>>> I was talking about nested datasets, i.e. tank/freebsd/git/current and 
>>> tank/freebsd/git/ports are four levels deep.
>>
>> We usually don't call them "nested".  In fact, I don't think that we call the
>> m
>> anything special because having N levels deep datasets (N > 1) is just a comm
>> on
>> thing.  We may call them subordinate or child datasets when mentioning a
>> relation to a parent dataset.
>>
>>> In my case the ports 
>>> dataset was mounted while the current dataset was not, though zfs 
>>> believed it was. unmounting the current dataset and remounting it, zfs 
>>> umount .../current; zfs mount .../current worked around the issue.
>>
>> Are you sure that it was not mounted?
> 
> Yes.
> 
>> Have you checked that by looking at mount output?
> 
> Yes
> 
>> I suspect that it was mounted, just not where you expected and its mount path
>> was covered by another filesystem.
> 
> If you read my original email

Apologies, I failed to read your original email when I first saw it.
I pressed Page Down a few times but was still seeing only a quoted text, so I
gave up.

> a zfs umount followed by a zfs mount for 
> each affected filesystem worked around the problem. zfs properties 
> showed that each and every filesystem was mounted. mount(1) and df(1) 
> confirmed they were not. Furthermore nullfs mounts with the late 
> attribute failed to mount because their underlying zfs datasets were 
> not mounted -- this is what clued me into the problem in the first 
> place, a FreeBSD system dropping into single user at boot. And, no, 
> fstab on that machine had not been changed for months, them machine 
> failed to boot. So, no, I was not mistaken. I was rather displeased 
> because I had to try to fix the problem using ssh on a phone to a 
> machine connected to a console server.
> 
>>
>> E.g., lets consider this hypothetical case.
>> I have two same level datasets tank/freebsd/src and tank/freebsd/sys where
>> tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at
>> /usr/src/sys (a child directory of /usr/src).
>> If tank/freebsd/src is mounted first, then everything is okay, tank/freebsd/s
>> ys
>> would be mounted on top of sys directory in tank/freebsd/src.
>> If, however, tank/freebsd/sys is mounted first (assuming that path /usr/src/s
>> ys
>> exists in a root filesystem), then mounting tank/freebsd/src would simply hid
>> e
>> tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in
>> tank/freebsd/src.
>>
>> I guess that this is a kind of problem that could be introduced with parallel
>> mounting.  And I guess that this is a kind of problem that you might actually
>> have.  But it's just a guess.
> 
> No. I had not mistakenly mounted the datasets elsewhere, mistakenly 
> deleted them or mistakenly changed their mount attributes. It was a 
> real, not imagined, regression fixed by the patch posted near the end 
> of the email thread.

Okay. Great that it is fixed and sorry for my noise.


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


svn commit: r344620 - head/usr.sbin/kldxref

2019-02-27 Thread Leandro Lupori
Author: luporl
Date: Wed Feb 27 13:24:42 2019
New Revision: 344620
URL: https://svnweb.freebsd.org/changeset/base/344620

Log:
  Fix kldxref on PowerPC64
  
  When using kldxref on kernel modules built with clang8 + lld8,
  kldxref would be unable to find the modules metadata information,
  because PowerPC64 was using the ef_nop.c implementation of
  ef_reloc().
  
  When GNU LD was used, it was also relocating the metadata section of
  the .ko file. LLD does not do this, but only generate dynamic
  relocations for it. With minor changes, ef_powerpc.c can now work
  for PowerPC64 too.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D19370

Modified:
  head/usr.sbin/kldxref/Makefile
  head/usr.sbin/kldxref/ef_powerpc.c

Modified: head/usr.sbin/kldxref/Makefile
==
--- head/usr.sbin/kldxref/Makefile  Wed Feb 27 13:01:17 2019
(r344619)
+++ head/usr.sbin/kldxref/Makefile  Wed Feb 27 13:24:42 2019
(r344620)
@@ -6,7 +6,7 @@ SRCS=   kldxref.c ef.c ef_obj.c
 
 WARNS?=2
 
-.if exists(ef_${MACHINE_CPUARCH}.c) && ${MACHINE_ARCH} != "powerpc64"
+.if exists(ef_${MACHINE_CPUARCH}.c)
 SRCS+= ef_${MACHINE_CPUARCH}.c
 .else
 SRCS+= ef_nop.c

Modified: head/usr.sbin/kldxref/ef_powerpc.c
==
--- head/usr.sbin/kldxref/ef_powerpc.c  Wed Feb 27 13:01:17 2019
(r344619)
+++ head/usr.sbin/kldxref/ef_powerpc.c  Wed Feb 27 13:24:42 2019
(r344620)
@@ -34,10 +34,17 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "ef.h"
 
+#ifdef __powerpc64__
+#define PRI_ELF_SIZE PRIu64
+#else
+#define PRI_ELF_SIZE PRIu32
+#endif
+
 /*
  * Apply relocations to the values obtained from the file. `relbase' is the
  * target relocation address of the section, and `dataoff/len' is the region
@@ -63,11 +70,11 @@ ef_reloc(struct elf_file *ef, const void *reldata, int
return (0);
 
switch (rtype) {
-   case R_PPC_RELATIVE: /* word32 B + A */
+   case R_PPC_RELATIVE: /* word32|doubleword64 B + A */
*where = relbase + addend;
break;
default:
-   warnx("unhandled relocation type %u", rtype);
+   warnx("unhandled relocation type %" PRI_ELF_SIZE, rtype);
}
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common

2019-02-27 Thread Cy Schubert
In message <19c0f590-4327-d2c8-4660-bd9f5df12...@freebsd.org>, Andriy 
Gapon wri
tes:
> On 27/02/2019 15:04, Cy Schubert wrote:
> > In message <0563e72c-c9e3-a476-ce43-d4a67c454...@freebsd.org>, Andriy 
> > Gapon wri
> > tes:
> >> On 26/02/2019 22:58, Cy Schubert wrote:
> >>> I was talking about nested datasets, i.e. tank/freebsd/git/current and 
> >>> tank/freebsd/git/ports are four levels deep.
> >>
> >> We usually don't call them "nested".  In fact, I don't think that we call 
> the
> >> m
> >> anything special because having N levels deep datasets (N > 1) is just a c
> omm
> >> on
> >> thing.  We may call them subordinate or child datasets when mentioning a
> >> relation to a parent dataset.
> >>
> >>> In my case the ports 
> >>> dataset was mounted while the current dataset was not, though zfs 
> >>> believed it was. unmounting the current dataset and remounting it, zfs 
> >>> umount .../current; zfs mount .../current worked around the issue.
> >>
> >> Are you sure that it was not mounted?
> > 
> > Yes.
> > 
> >> Have you checked that by looking at mount output?
> > 
> > Yes
> > 
> >> I suspect that it was mounted, just not where you expected and its mount p
> ath
> >> was covered by another filesystem.
> > 
> > If you read my original email
>
> Apologies, I failed to read your original email when I first saw it.
> I pressed Page Down a few times but was still seeing only a quoted text, so I
> gave up.

That was my fault but given I was using an email client on my phone, 
removing the quoted text would have taken forever. Usually in that 
circumstance I wait until I get to a real keyboard before firing off an 
email.

>
> > a zfs umount followed by a zfs mount for 
> > each affected filesystem worked around the problem. zfs properties 
> > showed that each and every filesystem was mounted. mount(1) and df(1) 
> > confirmed they were not. Furthermore nullfs mounts with the late 
> > attribute failed to mount because their underlying zfs datasets were 
> > not mounted -- this is what clued me into the problem in the first 
> > place, a FreeBSD system dropping into single user at boot. And, no, 
> > fstab on that machine had not been changed for months, them machine 
> > failed to boot. So, no, I was not mistaken. I was rather displeased 
> > because I had to try to fix the problem using ssh on a phone to a 
> > machine connected to a console server.
> > 
> >>
> >> E.g., lets consider this hypothetical case.
> >> I have two same level datasets tank/freebsd/src and tank/freebsd/sys where
> >> tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at
> >> /usr/src/sys (a child directory of /usr/src).
> >> If tank/freebsd/src is mounted first, then everything is okay, tank/freebs
> d/s
> >> ys
> >> would be mounted on top of sys directory in tank/freebsd/src.
> >> If, however, tank/freebsd/sys is mounted first (assuming that path /usr/sr
> c/s
> >> ys
> >> exists in a root filesystem), then mounting tank/freebsd/src would simply 
> hid
> >> e
> >> tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in
> >> tank/freebsd/src.
> >>
> >> I guess that this is a kind of problem that could be introduced with paral
> lel
> >> mounting.  And I guess that this is a kind of problem that you might actua
> lly
> >> have.  But it's just a guess.
> > 
> > No. I had not mistakenly mounted the datasets elsewhere, mistakenly 
> > deleted them or mistakenly changed their mount attributes. It was a 
> > real, not imagined, regression fixed by the patch posted near the end 
> > of the email thread.
>
> Okay. Great that it is fixed and sorry for my noise.

NP. I'm glad it's fixed too.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common

2019-02-27 Thread Jack Halford

There is one other minor issues that should also be addressed. The
mount message
at boot previously displayed:

Mounting ZFS filesystems:
(44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(15
9/159)^M

Now it displays:

(null): (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(159/159)^M

see https://www.illumos.org/issues/10205 [6] for this one.


Thanks Toomas for pointing out the fix in Illumos, I've opened a review 
here: https://reviews.freebsd.org/D19388


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


svn commit: r344621 - head/cddl/contrib/opensolaris/cmd/zfs

2019-02-27 Thread Baptiste Daroussin
Author: bapt
Date: Wed Feb 27 13:49:41 2019
New Revision: 344621
URL: https://svnweb.freebsd.org/changeset/base/344621

Log:
  Fix a regression introduced in r344569
  
  Import a fix from illumos (thanks Toomas Soomas for pointing at it)
  
  See https://www.illumos.org/issues/10205 for more details
  Illumos commit: 
https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215
  
  Submitted by: j...@gandi.net
  Reported by:  cy
  Reviewed by:  tsoome, cy, bapt
  Obtained from:Illumos

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cWed Feb 27 13:24:42 
2019(r344620)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cWed Feb 27 13:49:41 
2019(r344621)
@@ -6119,9 +6119,6 @@ report_mount_progress(int current, int total)
time_t now = time(NULL);
char info[32];
 
-   /* report 1..n instead of 0..n-1 */
-   ++current;
-
/* display header if we're here for the first time */
if (current == 1) {
set_progress_header(gettext("Mounting ZFS filesystems"));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344623 - head/sys/arm64/rockchip/clk

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 14:20:28 2019
New Revision: 344623
URL: https://svnweb.freebsd.org/changeset/base/344623

Log:
  arm64: rockchip: clk_pll: Multiple improvement
  
  Remove the mode_val from the clock definition as it's a bit unreadable.
  Use mode_shift to represent which bit control the mode in the register.
  Simplify some case where we can avoid a register read before changing it.
  Set the PLL back to normal mode after the PLL have stabilized.
  
  Discussed with:mmel
  MFC after:1 week

Modified:
  head/sys/arm64/rockchip/clk/rk3328_cru.c
  head/sys/arm64/rockchip/clk/rk_clk_pll.c
  head/sys/arm64/rockchip/clk/rk_clk_pll.h

Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c
==
--- head/sys/arm64/rockchip/clk/rk3328_cru.cWed Feb 27 14:01:13 2019
(r344622)
+++ head/sys/arm64/rockchip/clk/rk3328_cru.cWed Feb 27 14:20:28 2019
(r344623)
@@ -523,7 +523,7 @@ static struct rk_clk_pll_def apll = {
.gate_offset = 0x200,
.gate_shift = 0,
.mode_reg = 0x80,
-   .mode_val = 0x1,
+   .mode_shift = 1,
.flags = RK_CLK_PLL_HAVE_GATE,
.frac_rates = rk3328_pll_frac_rates,
 };
@@ -539,7 +539,7 @@ static struct rk_clk_pll_def dpll = {
.gate_offset = 0x200,
.gate_shift = 1,
.mode_reg = 0x80,
-   .mode_val = 0x8,
+   .mode_shift = 4,
.flags = RK_CLK_PLL_HAVE_GATE,
 };
 
@@ -552,7 +552,7 @@ static struct rk_clk_pll_def cpll = {
},
.base_offset = 0x40,
.mode_reg = 0x80,
-   .mode_val = 0x80,
+   .mode_shift = 8,
.rates = rk3328_pll_rates,
 };
 
@@ -567,7 +567,7 @@ static struct rk_clk_pll_def gpll = {
.gate_offset = 0x200,
.gate_shift = 2,
.mode_reg = 0x80,
-   .mode_val = 0x800,
+   .mode_shift = 12,
.flags = RK_CLK_PLL_HAVE_GATE,
.frac_rates = rk3328_pll_frac_rates,
 };
@@ -583,7 +583,7 @@ static struct rk_clk_pll_def npll = {
.gate_offset = 0x200,
.gate_shift = 12,
.mode_reg = 0x80,
-   .mode_val = 0x2,
+   .mode_shift = 1,
.flags = RK_CLK_PLL_HAVE_GATE,
.rates = rk3328_pll_rates,
 };

Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c
==
--- head/sys/arm64/rockchip/clk/rk_clk_pll.cWed Feb 27 14:01:13 2019
(r344622)
+++ head/sys/arm64/rockchip/clk/rk_clk_pll.cWed Feb 27 14:20:28 2019
(r344623)
@@ -48,7 +48,7 @@ struct rk_clk_pll_sc {
uint32_tgate_shift;
 
uint32_tmode_reg;
-   uint32_tmode_val;
+   uint32_tmode_shift;
 
uint32_tflags;
 
@@ -120,6 +120,10 @@ rk_clk_pll_set_gate(struct clknode *clk, bool enable)
 
 #defineRK3328_CLK_PLL_LOCK_MASK0x400
 
+#defineRK3328_CLK_PLL_MODE_SLOW0
+#defineRK3328_CLK_PLL_MODE_NORMAL  1
+#defineRK3328_CLK_PLL_MODE_MASK0x1
+
 static int
 rk3328_clk_pll_init(struct clknode *clk, device_t dev)
 {
@@ -207,7 +211,8 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t 
DEVICE_LOCK(clk);
 
/* Setting to slow mode during frequency change */
-   reg = sc->mode_val << 16;
+   reg = (RK3328_CLK_PLL_MODE_MASK << sc->mode_shift) <<
+   RK_CLK_PLL_MASK_SHIFT;
dprintf("Set PLL_MODEREG to %x\n", reg);
WRITE4(clk, sc->mode_reg, reg);
 
@@ -219,13 +224,12 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t 
WRITE4(clk, sc->base_offset, reg);
 
/* Setting dsmpd, postdiv2 and refdiv */
-   READ4(clk, sc->base_offset + 0x4, ®);
-   reg &= ~(RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK |
-   RK3328_CLK_PLL_REFDIV_MASK);
reg = (rates->dsmpd << RK3328_CLK_PLL_DSMPD_SHIFT) |
(rates->postdiv2 << RK3328_CLK_PLL_POSTDIV2_SHIFT) |
(rates->refdiv << RK3328_CLK_PLL_REFDIV_SHIFT);
-   reg |= (RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK | 
RK3328_CLK_PLL_REFDIV_MASK) << 16;
+   reg |= (RK3328_CLK_PLL_DSMPD_MASK |
+   RK3328_CLK_PLL_POSTDIV2_MASK |
+   RK3328_CLK_PLL_REFDIV_MASK) << RK_CLK_PLL_MASK_SHIFT;
dprintf("Set PLL_CON1 to %x\n", reg);
WRITE4(clk, sc->base_offset + 0x4, reg);
 
@@ -236,11 +240,6 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t 
dprintf("Set PLL_CON2 to %x\n", reg);
WRITE4(clk, sc->base_offset + 0x8, reg);
 
-   /* Setting to normal mode */
-   reg = sc->mode_val << 16 | sc->mode_val;
-   dprintf("Set PLL_MODEREG to %x\n", reg);
-   WRITE4(clk, sc->mode_reg, reg);
-
/* Reading lock */
for (timeout = 1000; timeout; timeout--) {
READ4(clk, sc->base_offset + 0x4, ®);
@@ -249,6 +248,13 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t 
DELAY(1);

svn commit: r344626 - head/sys/arm64/rockchip/clk

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 17:29:38 2019
New Revision: 344626
URL: https://svnweb.freebsd.org/changeset/base/344626

Log:
  arm64: rockchip: rk3399_clk: Add sd clock definitions
  
  MFC after:1 week

Modified:
  head/sys/arm64/rockchip/clk/rk3399_cru.c

Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c
==
--- head/sys/arm64/rockchip/clk/rk3399_cru.cWed Feb 27 17:00:27 2019
(r344625)
+++ head/sys/arm64/rockchip/clk/rk3399_cru.cWed Feb 27 17:29:38 2019
(r344626)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #definePCLK_I2C5   344
 #definePCLK_I2C6   345
 #definePCLK_I2C7   346
+#defineHCLK_SDMMC  462
 
 static struct rk_cru_gate rk3399_gates[] = {
/* CRU_CLKGATE_CON0 */
@@ -99,6 +100,9 @@ static struct rk_cru_gate rk3399_gates[] = {
CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive", 0x37c, 3)
CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4)
CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5)
+
+   /* CRU_CLKGATE_CON33 */
+   CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8)
 };
 
 
@@ -1385,6 +1389,60 @@ static struct rk_clk_armclk_def armclk_b = {
.nrates = nitems(rk3399_armclkb_rates),
 };
 
+/*
+ * sdmmc
+ */
+
+#defineHCLK_SD 461
+
+static const char *hclk_sd_parents[] = {"cpll", "gpll"};
+
+static struct rk_clk_composite_def hclk_sd = {
+   .clkdef = {
+   .id = HCLK_SD,
+   .name = "hclk_sd",
+   .parent_names = hclk_sd_parents,
+   .parent_cnt = nitems(hclk_sd_parents),
+   },
+
+   .muxdiv_offset = 0x134,
+   .mux_shift = 15,
+   .mux_width = 1,
+
+   .div_shift = 8,
+   .div_width = 5,
+
+   .gate_offset = 0x330,
+   .gate_shift = 13,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+};
+
+#defineSCLK_SDMMC  76
+
+static const char *sclk_sdmmc_parents[] = {"cpll", "gpll", "npll", "ppll"};
+
+static struct rk_clk_composite_def sclk_sdmmc = {
+   .clkdef = {
+   .id = SCLK_SDMMC,
+   .name = "sclk_sdmmc",
+   .parent_names = sclk_sdmmc_parents,
+   .parent_cnt = nitems(sclk_sdmmc_parents),
+   },
+
+   .muxdiv_offset = 0x140,
+   .mux_shift = 8,
+   .mux_width = 3,
+
+   .div_shift = 0,
+   .div_width = 7,
+
+   .gate_offset = 0x318,
+   .gate_shift = 1,
+
+   .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE,
+};
+
 static struct rk_clk rk3399_clks[] = {
{
.type = RK3399_CLK_PLL,
@@ -1483,6 +1541,15 @@ static struct rk_clk rk3399_clks[] = {
{
.type = RK_CLK_ARMCLK,
.clk.armclk = &armclk_b,
+   },
+
+   {
+   .type = RK_CLK_COMPOSITE,
+   .clk.composite = &hclk_sd,
+   },
+   {
+   .type = RK_CLK_COMPOSITE,
+   .clk.composite = &sclk_sdmmc,
},
 };
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344627 - head/sys/dev/mmc/host

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 17:30:28 2019
New Revision: 344627
URL: https://svnweb.freebsd.org/changeset/base/344627

Log:
  mmc: dwmmc: Match on "rockchip,rk3288-dw-mshc" compatible
  
  This is the common denominator for rockchip compatible from RK3288 to RK3399.
  The other compatible are generally present in the DTS but the controllers
  are the same.
  
  MFC after:1 week

Modified:
  head/sys/dev/mmc/host/dwmmc_rockchip.c

Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c
==
--- head/sys/dev/mmc/host/dwmmc_rockchip.c  Wed Feb 27 17:29:38 2019
(r344626)
+++ head/sys/dev/mmc/host/dwmmc_rockchip.c  Wed Feb 27 17:30:28 2019
(r344627)
@@ -49,12 +49,12 @@ __FBSDID("$FreeBSD$");
 
 enum RKTYPE {
RK2928 = 1,
-   RK3328,
+   RK3288,
 };
 
 static struct ofw_compat_data compat_data[] = {
{"rockchip,rk2928-dw-mshc", RK2928},
-   {"rockchip,rk3328-dw-mshc", RK3328},
+   {"rockchip,rk3288-dw-mshc", RK3288},
{NULL,  0},
 };
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344628 - head/lib/libc/sys

2019-02-27 Thread Ed Maste
Author: emaste
Date: Wed Feb 27 17:52:22 2019
New Revision: 344628
URL: https://svnweb.freebsd.org/changeset/base/344628

Log:
  poll.2: POLLNVAL is returned also for insufficient rights
  
  Reported by:  "Bora Özarslan" 
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/sys/poll.2

Modified: head/lib/libc/sys/poll.2
==
--- head/lib/libc/sys/poll.2Wed Feb 27 17:30:28 2019(r344627)
+++ head/lib/libc/sys/poll.2Wed Feb 27 17:52:22 2019(r344628)
@@ -28,7 +28,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 1, 2018
+.Dd February 27, 2019
 .Dt POLL 2
 .Os
 .Sh NAME
@@ -127,7 +127,8 @@ should never be present in the
 .Fa revents
 bitmask at the same time.
 .It POLLNVAL
-The file descriptor is not open.
+The file descriptor is not open,
+or in capability mode the file descriptor has insufficient rights.
 This flag is always checked, even
 if not present in the
 .Fa events
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344629 - head/usr.sbin/rtsold

2019-02-27 Thread Mark Johnston
Author: markj
Date: Wed Feb 27 18:13:41 2019
New Revision: 344629
URL: https://svnweb.freebsd.org/changeset/base/344629

Log:
  rtsol: Use vwarnx(3) to log messages to standard error.
  
  This ensures that the program name is included in the output, which
  makes it easy to identify the source of error messages printed
  during boot.
  
  MFC after:1 week

Modified:
  head/usr.sbin/rtsold/rtsold.c

Modified: head/usr.sbin/rtsold/rtsold.c
==
--- head/usr.sbin/rtsold/rtsold.c   Wed Feb 27 17:52:22 2019
(r344628)
+++ head/usr.sbin/rtsold/rtsold.c   Wed Feb 27 18:13:41 2019
(r344629)
@@ -787,10 +787,8 @@ warnmsg(int priority, const char *func, const char *ms
 
va_start(ap, msg);
if (fflag) {
-   if (priority <= log_upto) {
-   (void)vfprintf(stderr, msg, ap);
-   (void)fprintf(stderr, "\n");
-   }
+   if (priority <= log_upto)
+   vwarnx(msg, ap);
} else {
snprintf(buf, sizeof(buf), "<%s> %s", func, msg);
msg = buf;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344630 - head/tools/tools/crypto

2019-02-27 Thread Sean Eric Fagan
Author: sef
Date: Wed Feb 27 19:27:16 2019
New Revision: 344630
URL: https://svnweb.freebsd.org/changeset/base/344630

Log:
  Have cryptocheck toggle kern.cryptodevallowsoft if necessary (this
  requires root access).
  
  Reviewed by:  cem, jhb
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D19372

Modified:
  head/tools/tools/crypto/cryptocheck.c

Modified: head/tools/tools/crypto/cryptocheck.c
==
--- head/tools/tools/crypto/cryptocheck.c   Wed Feb 27 18:13:41 2019
(r344629)
+++ head/tools/tools/crypto/cryptocheck.c   Wed Feb 27 19:27:16 2019
(r344630)
@@ -111,6 +111,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -275,13 +276,41 @@ devcrypto(void)
return (fd);
 }
 
+/*
+ * Called on exit to change kern.cryptodevallowsoft back to 0
+ */
+#define CRYPT_SOFT_ALLOW   "kern.cryptodevallowsoft"
+
+static void
+reset_user_soft(void)
+{
+   int off = 0;
+   sysctlbyname(CRYPT_SOFT_ALLOW, NULL, NULL, &off, sizeof(off));
+}
+
+static void
+enable_user_soft(void)
+{
+   int curstate;
+   int on = 1;
+   size_t cursize = sizeof(curstate);
+
+   if (sysctlbyname(CRYPT_SOFT_ALLOW, &curstate, &cursize,
+   &on, sizeof(on)) == 0) {
+   if (curstate == 0)
+   atexit(reset_user_soft);
+   }
+}
+
 static int
 crlookup(const char *devname)
 {
struct crypt_find_op find;
 
-   if (strncmp(devname, "soft", 4) == 0)
+   if (strncmp(devname, "soft", 4) == 0) {
+   enable_user_soft();
return CRYPTO_FLAG_SOFTWARE;
+   }
 
find.crid = -1;
strlcpy(find.name, devname, sizeof(find.name));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344631 - head

2019-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 20:09:58 2019
New Revision: 344631
URL: https://svnweb.freebsd.org/changeset/base/344631

Log:
  Update review requests for bhyve.
  
  - Explicitly mention the #bhyve group on Phabricator.
  - Request reviews of the userland components (libvmmapi, bhyve,
bhyvectl, and bhyveload).
  
  Reviewed by:  imp, rgrimes
  Differential Revision:https://reviews.freebsd.org/D17848

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSWed Feb 27 19:27:16 2019(r344630)
+++ head/MAINTAINERSWed Feb 27 20:09:58 2019(r344631)
@@ -106,7 +106,12 @@ usr.sbin/bsdconfig dteske  Pre-commit phabricator revie
 usr.sbin/dpv   dteske  Pre-commit review requested. Keep in sync with libdpv.
 usr.sbin/pkg   pkg@Please coordinate behavior or flag changes with pkg 
team.
 usr.sbin/sysrc dteske  Pre-commit phabricator review requested. Keep in sync 
with bsdconfig(8) sysrc.subr.
-vmm(4) tychon, jhb Pre-commit review requested.
+vmm(4) tychon, jhb Pre-commit review requested via #bhyve
+   phabricator group.
+libvmmapi  tychon, jhb Pre-commit review requested via #bhyve
+   phabricator group.
+usr.sbin/bhyve*tychon, jhb Pre-commit review requested via #bhyve
+   phabricator group.
 autofs(5)  trasz   Pre-commit review recommended.
 iscsi(4)   trasz   Pre-commit review recommended.
 rctl(8)trasz   Pre-commit review recommended.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec

2019-02-27 Thread John Baldwin
On 2/26/19 10:06 AM, John Baldwin wrote:
> On 2/26/19 9:23 AM, Alexey Dokuchaev wrote:
>> On Tue, Feb 26, 2019 at 09:12:11AM -0800, John Baldwin wrote:
>>> On 2/26/19 5:49 AM, Alexey Dokuchaev wrote:
 On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote:
> ...
> Just a small nit, for future reference, from the template:
>> Differential Revision:https://reviews.freebsd.org/D###
> (*full* phabric URL needed).

 IMHO we should just fix the scripts to accept D alone, without
 the URL.  We don't do that for PR (bugzilla) references, and the fact
 that we do for the phab is both needless and confusing.  Also, that
 URL might change one day while we could probably keep the old numbers
 if we move.
>>>
>>> It makes the review clickable in many mail clients which is very handy.
>>
>> I understand that, but then again, we don't do that for PRs and people
>> don't seem to complain.  Accepting D would make this all consistent
>> and commit messages cleaner.  Arguably, if one likes to click the URLs
>> in their mail client, why not configure the client to expand the URL in
>> place?
>>
>>> --
>>> John Baldwin
>>>
>>> \x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a
>>
>> Can you do something about this horde of \x9a's appended to your every
>> email John?
> 
> Bizarre, that's the first time someone has mentioned that.  It appears to
> be a misfeature of Thunderbird which I switched to last year after kmail
> in kde5 officially moved to "unusable trash fire" status.  It doesn't show
> up locally, and the signature file I'm using doesn't contain them:
> 
> % hexdump .signature 
> 000 2d 2d 20 0a 4a 6f 68 6e 20 42 61 6c 64 77 69 6e
> 010 0a 
> 011
> 
> Switching to using an inline signature instead of a signature file didn't
> fix it either. :(  I haven't found an existing bug report for this yet.

With a tip from cem@ I narrowed the cause of this down to a "Wrap Text"
plugin I had been using to annotate where to wrap text in the compose
window.  I've disabled it, so the spam should be gone.  My mails might not
wrap sanely though. :-/

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


svn commit: r344632 - head/sys/netinet

2019-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 20:24:23 2019
New Revision: 344632
URL: https://svnweb.freebsd.org/changeset/base/344632

Log:
  Various cleanups to the management of multiple TCP stacks.
  
  - Use strlcpy() with sizeof() instead of strncpy().
  
  - Simplify initialization of TCP functions structures.
  
init_tcp_functions() was already called before the first call to
register a stack.  Just inline the work in the SYSINIT and remove
the racy helper variable.  Instead, KASSERT that the rw lock is
initialized when registering a stack.
  
  - Protect the default stack via a direct pointer comparison.
  
The default stack uses the name "freebsd" instead of "default" so
this protection wasn't working for the default stack anyway.
  
  Reviewed by:  rrs
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D19152

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Wed Feb 27 20:09:58 2019(r344631)
+++ head/sys/netinet/tcp_subr.c Wed Feb 27 20:24:23 2019(r344632)
@@ -257,21 +257,10 @@ static struct tcp_function_block tcp_def_funcblk = {
.tfb_tcp_fb_fini = tcp_default_fb_fini,
 };
 
-int t_functions_inited = 0;
 static int tcp_fb_cnt = 0;
 struct tcp_funchead t_functions;
 static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk;
 
-static void
-init_tcp_functions(void)
-{
-   if (t_functions_inited == 0) {
-   TAILQ_INIT(&t_functions);
-   rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0);
-   t_functions_inited = 1;
-   }
-}
-
 static struct tcp_function_block *
 find_tcp_functions_locked(struct tcp_function_set *fs)
 {
@@ -559,13 +548,10 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS)
bzero(&tfi, sizeof(tfi));
tfi.tfi_refcnt = f->tf_fb->tfb_refcnt;
tfi.tfi_id = f->tf_fb->tfb_id;
-   (void)strncpy(tfi.tfi_alias, f->tf_name,
-   TCP_FUNCTION_NAME_LEN_MAX);
-   tfi.tfi_alias[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0';
-   (void)strncpy(tfi.tfi_name,
-   f->tf_fb->tfb_tcp_block_name,
-   TCP_FUNCTION_NAME_LEN_MAX);
-   tfi.tfi_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0';
+   (void)strlcpy(tfi.tfi_alias, f->tf_name,
+   sizeof(tfi.tfi_alias));
+   (void)strlcpy(tfi.tfi_name,
+   f->tf_fb->tfb_tcp_block_name, sizeof(tfi.tfi_name));
error = SYSCTL_OUT(req, &tfi, sizeof(tfi));
/*
 * Don't stop on error, as that is the
@@ -781,10 +767,9 @@ register_tcp_functions_as_names(struct tcp_function_bl
KASSERT(names != NULL && *num_names > 0,
("%s: Called with 0-length name list", __func__));
KASSERT(names != NULL, ("%s: Called with NULL name list", __func__));
+   KASSERT(rw_initialized(&tcp_function_lock),
+   ("%s: called too early", __func__));
 
-   if (t_functions_inited == 0) {
-   init_tcp_functions();
-   }
if ((blk->tfb_tcp_output == NULL) ||
(blk->tfb_tcp_do_segment == NULL) ||
(blk->tfb_tcp_ctloutput == NULL) ||
@@ -824,9 +809,8 @@ register_tcp_functions_as_names(struct tcp_function_bl
}
n->tf_fb = blk;
 
-   (void)strncpy(fs.function_set_name, names[i],
-   TCP_FUNCTION_NAME_LEN_MAX);
-   fs.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0';
+   (void)strlcpy(fs.function_set_name, names[i],
+   sizeof(fs.function_set_name));
rw_wlock(&tcp_function_lock);
if (find_tcp_functions_locked(&fs) != NULL) {
/* Duplicate name space not allowed */
@@ -835,8 +819,7 @@ register_tcp_functions_as_names(struct tcp_function_bl
error = EALREADY;
goto cleanup;
}
-   (void)strncpy(n->tf_name, names[i], TCP_FUNCTION_NAME_LEN_MAX);
-   n->tf_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0';
+   (void)strlcpy(n->tf_name, names[i], sizeof(n->tf_name));
TAILQ_INSERT_TAIL(&t_functions, n, tf_next);
tcp_fb_cnt++;
rw_wunlock(&tcp_function_lock);
@@ -923,8 +906,8 @@ deregister_tcp_functions(struct tcp_function_block *bl
 bool force)
 {
struct tcp_function *f;
-   
-   if (strcmp(blk->tfb_tcp_block_name, "default") == 0) {
+
+   if (blk == &tcp_def_funcblk) {
/* You can't un-register the default */
return (EPERM);
}
@@ -1090,8 +1073,10 @@ tcp_

svn commit: r344633 - in head/sys: conf dev/usb/controller

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 20:52:35 2019
New Revision: 344633
URL: https://svnweb.freebsd.org/changeset/base/344633

Log:
  usb_nop_xceiv: Add support for this pseudo device
  
  This is a "fake" phy that handle regulator, clocks and reset gpio.
  Only clock and regulator is supported for now.
  
  Sponsored-by:  Rubicon Communications, LCC ("Netgate")

Added:
  head/sys/dev/usb/controller/usb_nop_xceiv.c   (contents, props changed)
Modified:
  head/sys/conf/files.arm64

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Wed Feb 27 20:24:23 2019(r344632)
+++ head/sys/conf/files.arm64   Wed Feb 27 20:52:35 2019(r344633)
@@ -234,6 +234,7 @@ dev/usb/controller/generic_ehci.c optional  ehci acpi
 dev/usb/controller/generic_ohci.c optional ohci fdt
 dev/usb/controller/generic_usb_if.m optional   ohci fdt
 dev/usb/controller/xhci_mv.c   optionalxhci_mv fdt
+dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources
 dev/vnic/mrml_bridge.c optionalvnic fdt
 dev/vnic/nic_main.coptionalvnic pci
 dev/vnic/nicvf_main.c  optionalvnic pci pci_iov

Added: head/sys/dev/usb/controller/usb_nop_xceiv.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/usb/controller/usb_nop_xceiv.c Wed Feb 27 20:52:35 2019
(r344633)
@@ -0,0 +1,211 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2019 Rubicon Communications, LLC (Netgate)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "phynode_if.h"
+
+struct usb_nop_xceiv_softc {
+   device_tdev;
+   regulator_t vcc_supply;
+   clk_t   clk;
+   uint32_tclk_freq;
+};
+
+static struct ofw_compat_data compat_data[] = {
+   {"usb-nop-xceiv", 1},
+   {NULL,0}
+};
+
+/* Phy class and methods. */
+static int usb_nop_xceiv_phy_enable(struct phynode *phy, bool enable);
+static phynode_usb_method_t usb_nop_xceiv_phynode_methods[] = {
+   PHYNODEMETHOD(phynode_enable, usb_nop_xceiv_phy_enable),
+
+   PHYNODEMETHOD_END
+};
+DEFINE_CLASS_1(usb_nop_xceiv_phynode, usb_nop_xceiv_phynode_class,
+usb_nop_xceiv_phynode_methods,
+sizeof(struct phynode_usb_sc), phynode_usb_class);
+
+static int
+usb_nop_xceiv_phy_enable(struct phynode *phynode, bool enable)
+{
+   struct usb_nop_xceiv_softc *sc;
+   device_t dev;
+   intptr_t phy;
+   int error;
+
+   dev = phynode_get_device(phynode);
+   phy = phynode_get_id(phynode);
+   sc = device_get_softc(dev);
+
+   if (phy != 0)
+   return (ERANGE);
+
+   /* Enable the phy clock */
+   if (sc->clk_freq != 0) {
+   if (enable) {
+   error = clk_set_freq(sc->clk, sc->clk_freq,
+ CLK_SET_ROUND_ANY);
+   if (error != 0) {
+   device_printf(dev, "Cannot set clock to 
%dMhz\n",
+ sc->clk_freq);
+   goto fail;
+   }
+
+   error = clk_enable(sc->clk);
+   } else
+   error = clk_disable(sc->clk);
+
+   if (error != 0) {
+   device_printf(dev, "Cannot %sable the c

svn commit: r344634 - in head/sys: arm64/conf conf dev/usb/controller

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 21:04:40 2019
New Revision: 344634
URL: https://svnweb.freebsd.org/changeset/base/344634

Log:
  xhci_mv: Move the driver to generic_xhci
  
  Marvell XHCI is in fact generic-xhci, so move the driver and
  add the compatible string.
  While here, get and enable the phy if the dtb provide one.
  The xhci bindings state that phys should be in a 'phys' property but
  Marvell DTS uses 'usb-phy', only add support for 'usb-phy' for now.
  
  Sponsored-by:  Rubicon Communications, LCC ("Netgate")

Added:
  head/sys/dev/usb/controller/generic_xhci.c
 - copied, changed from r344633, head/sys/dev/usb/controller/xhci_mv.c
Deleted:
  head/sys/dev/usb/controller/xhci_mv.c
Modified:
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files.arm64

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Wed Feb 27 20:52:35 2019(r344633)
+++ head/sys/arm64/conf/GENERIC Wed Feb 27 21:04:40 2019(r344634)
@@ -196,7 +196,6 @@ device  ohci# OHCI USB 
interface
 device ehci# EHCI USB interface (USB 2.0)
 device ehci_mv # Marvell EHCI USB interface
 device xhci# XHCI PCI->USB interface (USB 3.0)
-device xhci_mv # Marvell XHCI USB interface
 device usb # USB Bus (required)
 device ukbd# Keyboard
 device umass   # Disks/Mass storage - Requires scbus 
and da

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Wed Feb 27 20:52:35 2019(r344633)
+++ head/sys/conf/files.arm64   Wed Feb 27 21:04:40 2019(r344634)
@@ -233,8 +233,8 @@ dev/usb/controller/ehci_mv.coptionalehci_mv 
fdt
 dev/usb/controller/generic_ehci.c optional ehci acpi
 dev/usb/controller/generic_ohci.c optional ohci fdt
 dev/usb/controller/generic_usb_if.m optional   ohci fdt
-dev/usb/controller/xhci_mv.c   optionalxhci_mv fdt
 dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources
+dev/usb/controller/generic_xhci.c  optionalxhci fdt
 dev/vnic/mrml_bridge.c optionalvnic fdt
 dev/vnic/nic_main.coptionalvnic pci
 dev/vnic/nicvf_main.c  optionalvnic pci pci_iov

Copied and modified: head/sys/dev/usb/controller/generic_xhci.c (from r344633, 
head/sys/dev/usb/controller/xhci_mv.c)
==
--- head/sys/dev/usb/controller/xhci_mv.c   Wed Feb 27 20:52:35 2019
(r344633, copy source)
+++ head/sys/dev/usb/controller/generic_xhci.c  Wed Feb 27 21:04:40 2019
(r344634)
@@ -64,6 +64,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef EXT_RESOURCES
+#include 
+#endif
+
 #defineXHCI_HC_DEVSTR  "Marvell Integrated USB 3.0 controller"
 #defineXHCI_HC_VENDOR  "Marvell"
 
@@ -76,6 +80,7 @@ static struct ofw_compat_data compat_data[] = {
{"marvell,armada-380-xhci", true},
{"marvell,armada3700-xhci", true},
{"marvell,armada-8k-xhci",  true},
+   {"generic-xhci",true},
{NULL,  false}
 };
 
@@ -99,6 +104,10 @@ xhci_attach(device_t dev)
 {
struct xhci_softc *sc = device_get_softc(dev);
int err = 0, rid = 0;
+#ifdef EXT_RESOURCES
+   phandle_t node;
+   phy_t phy;
+#endif
 
sc->sc_bus.parent = dev;
sc->sc_bus.devices = sc->sc_devices;
@@ -123,6 +132,13 @@ xhci_attach(device_t dev)
xhci_detach(dev);
return (ENXIO);
}
+
+#ifdef EXT_RESOURCES
+   node = ofw_bus_get_node(dev);
+   if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0)
+   if (phy_enable(phy) != 0)
+   device_printf(dev, "Cannot enable phy\n");
+#endif
 
sc->sc_bus.bdev = device_add_child(dev, "usbus", -1);
if (sc->sc_bus.bdev == NULL) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344635 - in head/sys/dev: drm drm2/i915

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 21:11:13 2019
New Revision: 344635
URL: https://svnweb.freebsd.org/changeset/base/344635

Log:
  drm: Remove empty directories
  
  Discussed with: imp

Deleted:
  head/sys/dev/drm/
  head/sys/dev/drm2/i915/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2019-02-27 Thread Alexander Motin
Author: mav
Date: Wed Feb 27 21:29:21 2019
New Revision: 344636
URL: https://svnweb.freebsd.org/changeset/base/344636

Log:
  Refactor command ordering/blocking mechanism in CTL.
  
  Replace long per-LUN queue of blocked commands, scanned on each command
  completion and sometimes even twice, causing up to O(n^^2) processing cost,
  by much shorter per-command blocked queues, scanned only when respective
  command completes, and check only commands before the previous blocker,
  reducing cost to O(n).
  
  While there, unblock aborted commands to make them "complete" ASAP to be
  removed from the OOA queue and so not waste time ordering other commands
  against them.  Aborted commands that were not sent to execution yet should
  have no visible side effects, so this is safe and easy optimization now,
  comparing to commands already in processing, which are a still pain.
  
  Together those two optimizations should fix quite pathological case, when
  due to backend slowness CTL accumulated many thousands of blocked requests,
  partially aborted by initiator and so supposedly not even existing, but
  still wasting CTL CPU time.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend_ioctl.c
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Wed Feb 27 21:11:13 2019(r344635)
+++ head/sys/cam/ctl/ctl.c  Wed Feb 27 21:29:21 2019(r344636)
@@ -500,8 +500,11 @@ static ctl_action ctl_extent_check_seq(union ctl_io *i
 static ctl_action ctl_check_for_blockage(struct ctl_lun *lun,
 union ctl_io *pending_io, union ctl_io *ooa_io);
 static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io,
-   union ctl_io *starting_io);
-static int ctl_check_blocked(struct ctl_lun *lun);
+   union ctl_io **starting_io);
+static void ctl_try_unblock_io(struct ctl_lun *lun, union ctl_io *io,
+bool skip);
+static void ctl_try_unblock_others(struct ctl_lun *lun, union ctl_io *io,
+bool skip);
 static int ctl_scsiio_lun_check(struct ctl_lun *lun,
const struct ctl_cmd_entry *entry,
struct ctl_scsiio *ctsio);
@@ -2279,6 +2282,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio)
union ctl_ha_msg msg_info;
struct ctl_lun *lun;
const struct ctl_cmd_entry *entry;
+   union ctl_io *bio;
uint32_t targ_lun;
 
targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun;
@@ -2337,12 +2341,11 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio)
 #endif
TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links);
 
-   switch (ctl_check_ooa(lun, (union ctl_io *)ctsio,
-   (union ctl_io *)TAILQ_PREV(&ctsio->io_hdr, ctl_ooaq,
-ooa_links))) {
+   bio = (union ctl_io *)TAILQ_PREV(&ctsio->io_hdr, ctl_ooaq, ooa_links);
+   switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, &bio)) {
case CTL_ACTION_BLOCK:
-   ctsio->io_hdr.flags |= CTL_FLAG_BLOCKED;
-   TAILQ_INSERT_TAIL(&lun->blocked_queue, &ctsio->io_hdr,
+   ctsio->io_hdr.blocker = bio;
+   TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr,
  blocked_links);
mtx_unlock(&lun->lun_lock);
break;
@@ -2424,7 +2427,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_
 #endif
bcopy(io->scsiio.cdb, entry->cdb, io->scsiio.cdb_len);
entry->cdb_len = io->scsiio.cdb_len;
-   if (io->io_hdr.flags & CTL_FLAG_BLOCKED)
+   if (io->io_hdr.blocker != NULL)
entry->cmd_flags |= CTL_OOACMD_FLAG_BLOCKED;
 
if (io->io_hdr.flags & CTL_FLAG_DMA_INPROG)
@@ -3889,6 +3892,7 @@ ctl_alloc_io(void *pool_ref)
if (io != NULL) {
io->io_hdr.pool = pool_ref;
CTL_SOFTC(io) = pool->ctl_softc;
+   TAILQ_INIT(&io->io_hdr.blocked_queue);
}
return (io);
 }
@@ -3903,6 +3907,7 @@ ctl_alloc_io_nowait(void *pool_ref)
if (io != NULL) {
io->io_hdr.pool = pool_ref;
CTL_SOFTC(io) = pool->ctl_softc;
+   TAILQ_INIT(&io->io_hdr.blocked_queue);
}
return (io);
 }
@@ -3934,6 +3939,7 @@ ctl_zero_io(union ctl_io *io)
memset(io, 0, sizeof(*io));
io->io_hdr.pool = pool;
CTL_SOFTC(io) = pool->ctl_softc;
+   TAILQ_INIT(&io->io_hdr.blocked_queue);
 }
 
 int
@@ -4696,7 +4702,6 @@ fail:
lun->last_busy = getsbinuptime();
 #endif
TAILQ_INIT(&lun->ooa_queue);
-   TAILQ_INIT(&lun->blocked_queue);
STAILQ_INIT(&lun->error_list);
lun->ie_reported = 1;
callout_init_m

Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec

2019-02-27 Thread Eric van Gyzen

> On Feb 26, 2019, at 10:17 PM, Warner Losh  wrote:
> 
> 
> 
> On Tue, Feb 26, 2019, 6:50 AM Alexey Dokuchaev  > wrote:
> On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote:
> > > Author: sjg
> > > Date: Tue Feb 26 06:17:23 2019
> > > New Revision: 344567
> > > URL: https://svnweb.freebsd.org/changeset/base/344567 
> > > 
> > > 
> > > Log:
> > >   Add verifying manifest loader for mac_veriexec
> > >   
> > >   This tool will verify a signed manifest and load contents into
> > >   mac_veriexec for storage
> > >   
> > >   Sponsored by: Juniper Networks
> > >   Differential Revision:D16575
> > 
> > Just a small nit, for future reference, from the template:
> > > Differential Revision:https://reviews.freebsd.org/D### 
> > > 
> > (*full* phabric URL needed).
> 
> IMHO we should just fix the scripts to accept D alone, without
> the URL.  We don't do that for PR (bugzilla) references, and the fact
> that we do for the phab is both needless and confusing.  Also, that
> URL might change one day while we could probably keep the old numbers
> if we move.
> 
> When this came up before, it was an upstream decision to require the full 
> path. The reasoning is that D space isn't unique and the review may 
> happen in a different instance of phab than the default one. When those exact 
> objections were raised, the experience of moving to bugzilla was cited to 
> show the URL can remain stable. And if we went to another system's, we could 
> keep the old in place and then we would need a new URL to disambiguate. There 
> were good reasons we decided this before.
> 
> So this has been litigated before, and the consensus was we needed to break 
> with the practice of not putting URLs in commit messages for these reasons.

I completely agree.  In fact, I’d like to see full bugzilla URLs in commit logs 
instead of just the bug number.  Every app I use to read commit logs will make 
URLs clickable, even my terminal emulator.  The fact that I have to manually 
open bugzilla and copy/type the bug number is annoying.

And yes, I volunteer to make the necessary changes to accept URLs in the PR 
field.  We just need consensus.

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


svn commit: r344637 - head/sys/dev/drm2/radeon

2019-02-27 Thread Warner Losh
Author: imp
Date: Wed Feb 27 21:52:08 2019
New Revision: 344637
URL: https://svnweb.freebsd.org/changeset/base/344637

Log:
  Remove empty directories.

Deleted:
  head/sys/dev/drm2/radeon/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344638 - head/sys/arm/mv

2019-02-27 Thread Emmanuel Vadot
Author: manu
Date: Wed Feb 27 22:01:39 2019
New Revision: 344638
URL: https://svnweb.freebsd.org/changeset/base/344638

Log:
  Fix armv6/armv7 build after the move from xhci_mv to generic_xhci

Modified:
  head/sys/arm/mv/files.arm7
  head/sys/arm/mv/files.mv

Modified: head/sys/arm/mv/files.arm7
==
--- head/sys/arm/mv/files.arm7  Wed Feb 27 21:52:08 2019(r344637)
+++ head/sys/arm/mv/files.arm7  Wed Feb 27 22:01:39 2019(r344638)
@@ -34,7 +34,7 @@ dev/mvs/mvs_soc.c optionalmvs
 dev/uart/uart_dev_ns8250.c optionaluart
 dev/uart/uart_dev_snps.c   optionaluart
 dev/usb/controller/ehci_mv.c   optionalehci
-dev/usb/controller/xhci_mv.c   optionalxhci
+dev/usb/controller/generic_xhci.c  optionalxhci
 dev/ahci/ahci_mv_fdt.c optionalahci
 
 kern/kern_clocksource.cstandard

Modified: head/sys/arm/mv/files.mv
==
--- head/sys/arm/mv/files.mvWed Feb 27 21:52:08 2019(r344637)
+++ head/sys/arm/mv/files.mvWed Feb 27 22:01:39 2019(r344638)
@@ -31,7 +31,7 @@ dev/mvs/mvs_soc.c optionalmvs
 dev/uart/uart_dev_ns8250.c optionaluart
 dev/uart/uart_dev_snps.c   optionaluart
 dev/usb/controller/ehci_mv.c   optionalehci
-dev/usb/controller/xhci_mv.c   optionalxhci
+dev/usb/controller/generic_xhci.c  optionalxhci
 dev/ahci/ahci_mv_fdt.c optionalahci
 
 kern/kern_clocksource.cstandard
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344518 - head/share/man/man9

2019-02-27 Thread Mateusz Piotrowski
On Mon, 25 Feb 2019 at 16:12, Enji Cooper  wrote:

>
> > On Feb 25, 2019, at 07:03, Mateusz Piotrowski <0...@freebsd.org> wrote:
> >
> > Author: 0mp (ports committer)
> > Date: Mon Feb 25 15:03:50 2019
> > New Revision: 344518
> > URL: https://svnweb.freebsd.org/changeset/base/344518
> >
> > Log:
> >  Add missing types to the sysctl(9) manual page
> >
> >  Update the diff to include other missing sysctl types found in sysctl.h.
> >
> >  Some of these sysctls are already documented in other pages (e.g
> counter(9)
> >  and ZONE(9)), but they should at least be mentioned here for
> completeness.
> >
> >  This patch now documents all of the following:
> >  - SYSCTL_BOOL/SYSCTL_ADD_BOOL
> >  - SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64
> >  - SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY
> >  - SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC
> >  - SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC
> >  - SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR
> >  - SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX
>
[...]


> > Modified:
> >  head/share/man/man9/sysctl.9
>
> ...
>
> > @@ -52,10 +57,15 @@
> > .Nm SYSCTL_ADD_UINT ,
> > +.Nm SYSCTL_UMA_MAX
>
> Quick nit: UMA sorts before UQUAD.
>
> Also, these APIs deserve manpage links via MLINKS.
>

I'll submit a patch for this soon. Thank you!
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344640 - head/sys/dev/nvme

2019-02-27 Thread Warner Losh
Author: imp
Date: Wed Feb 27 22:05:01 2019
New Revision: 344640
URL: https://svnweb.freebsd.org/changeset/base/344640

Log:
  Remove #ifdef code to support FreeBSD versions that haven't been
  supported in years. A number of changes have been made to the driver
  that likely wouldn't work on those older versions that aren't properly
  ifdef'd and it's project policy to GC such code once it is stale.

Modified:
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c
  head/sys/dev/nvme/nvme_test.c

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hWed Feb 27 22:02:46 2019
(r344639)
+++ head/sys/dev/nvme/nvme_private.hWed Feb 27 22:05:01 2019
(r344640)
@@ -349,11 +349,6 @@ struct nvme_controller {
(val & 0xULL) >> 32);  \
} while (0);
 
-#if __FreeBSD_version < 800054
-#define wmb()  __asm volatile("sfence" ::: "memory")
-#define mb()   __asm volatile("mfence" ::: "memory")
-#endif
-
 #define nvme_printf(ctrlr, fmt, args...)   \
 device_printf(ctrlr->dev, fmt, ##args)
 

Modified: head/sys/dev/nvme/nvme_qpair.c
==
--- head/sys/dev/nvme/nvme_qpair.c  Wed Feb 27 22:02:46 2019
(r344639)
+++ head/sys/dev/nvme/nvme_qpair.c  Wed Feb 27 22:05:01 2019
(r344640)
@@ -823,13 +823,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st
ctrlr = qpair->ctrlr;
 
if (req->timeout)
-#if __FreeBSD_version >= 800030
callout_reset_curcpu(&tr->timer, ctrlr->timeout_period * hz,
nvme_timeout, tr);
-#else
-   callout_reset(&tr->timer, ctrlr->timeout_period * hz,
-   nvme_timeout, tr);
-#endif
 
/* Copy the command from the tracker to the submission queue. */
memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd));

Modified: head/sys/dev/nvme/nvme_test.c
==
--- head/sys/dev/nvme/nvme_test.c   Wed Feb 27 22:02:46 2019
(r344639)
+++ head/sys/dev/nvme/nvme_test.c   Wed Feb 27 22:05:01 2019
(r344640)
@@ -94,9 +94,7 @@ nvme_ns_bio_test(void *arg)
struct timeval  t;
uint64_tio_completed = 0, offset;
uint32_tidx;
-#if __FreeBSD_version >= 900017
int ref;
-#endif
 
buf = malloc(io_test->size, M_NVME, M_WAITOK);
idx = atomic_fetchadd_int(&io_test->td_idx, 1);
@@ -118,11 +116,7 @@ nvme_ns_bio_test(void *arg)
bio->bio_bcount = io_test->size;
 
if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
-#if __FreeBSD_version >= 900017
csw = dev_refthread(dev, &ref);
-#else
-   csw = dev_refthread(dev);
-#endif
} else
csw = dev->si_devsw;
 
@@ -133,11 +127,7 @@ nvme_ns_bio_test(void *arg)
mtx_unlock(mtx);
 
if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
-#if __FreeBSD_version >= 900017
dev_relthread(dev, ref);
-#else
-   dev_relthread(dev);
-#endif
}
 
if ((bio->bio_flags & BIO_ERROR) || (bio->bio_resid > 0))
@@ -166,11 +156,7 @@ nvme_ns_bio_test(void *arg)
atomic_subtract_int(&io_test->td_active, 1);
mb();
 
-#if __FreeBSD_version >= 80
kthread_exit();
-#else
-   kthread_exit(0);
-#endif
 }
 
 static void
@@ -246,11 +232,7 @@ nvme_ns_io_test(void *arg)
atomic_subtract_int(&io_test->td_active, 1);
mb();
 
-#if __FreeBSD_version >= 84
kthread_exit();
-#else
-   kthread_exit(0);
-#endif
 }
 
 void
@@ -287,13 +269,8 @@ nvme_ns_test(struct nvme_namespace *ns, u_long cmd, ca
getmicrouptime(&io_test_internal->start);
 
for (i = 0; i < io_test->num_threads; i++)
-#if __FreeBSD_version >= 84
kthread_add(fn, io_test_internal,
NULL, NULL, 0, 0, "nvme_io_test[%d]", i);
-#else
-   kthread_create(fn, io_test_internal,
-   NULL, 0, 0, "nvme_io_test[%d]", i);
-#endif
 
tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344642 - head/sys/dev/nvme

2019-02-27 Thread Warner Losh
Author: imp
Date: Wed Feb 27 22:16:59 2019
New Revision: 344642
URL: https://svnweb.freebsd.org/changeset/base/344642

Log:
  Unconditionally support unmapped BIOs. This was another shim for
  supporting older kernels. However, all supported versions of FreeBSD
  have unmapped I/Os (as do several that have gone EOL), remove it. It's
  unlikely the driver would work on the older kernels anyway at this
  point.

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ns.c
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Wed Feb 27 22:12:04 2019
(r344641)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Wed Feb 27 22:16:59 2019
(r344642)
@@ -1056,11 +1056,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr
buf->b_data = pt->buf;
buf->b_bufsize = pt->len;
buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE;
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
if (vmapbuf(buf, 1) < 0) {
-#else
-   if (vmapbuf(buf) < 0) {
-#endif
ret = EFAULT;
goto err;
}

Modified: head/sys/dev/nvme/nvme_ns.c
==
--- head/sys/dev/nvme/nvme_ns.c Wed Feb 27 22:12:04 2019(r344641)
+++ head/sys/dev/nvme/nvme_ns.c Wed Feb 27 22:16:59 2019(r344642)
@@ -357,10 +357,8 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali
caddr_t data;
uint32_trem_bcount;
int i;
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
struct vm_page  **ma;
uint32_tma_offset;
-#endif
 
*num_bios = nvme_get_num_segments(bp->bio_offset, bp->bio_bcount,
alignment);
@@ -373,10 +371,8 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali
cur_offset = bp->bio_offset;
rem_bcount = bp->bio_bcount;
data = bp->bio_data;
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
ma_offset = bp->bio_ma_offset;
ma = bp->bio_ma;
-#endif
 
for (i = 0; i < *num_bios; i++) {
child = child_bios[i];
@@ -386,7 +382,6 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali
child->bio_bcount = min(rem_bcount,
alignment - (cur_offset & (alignment - 1)));
child->bio_flags = bp->bio_flags;
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
if (bp->bio_flags & BIO_UNMAPPED) {
child->bio_ma_offset = ma_offset;
child->bio_ma = ma;
@@ -398,9 +393,7 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali
ma += child->bio_ma_n;
if (ma_offset != 0)
ma -= 1;
-   } else
-#endif
-   {
+   } else {
child->bio_data = data;
data += child->bio_bcount;
}
@@ -599,9 +592,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t 
if (res != 0)
return (ENXIO);
 
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
ns->cdev->si_flags |= SI_UNMAPPED;
-#endif
 
return (0);
 }

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hWed Feb 27 22:12:04 2019
(r344641)
+++ head/sys/dev/nvme/nvme_private.hWed Feb 27 22:16:59 2019
(r344642)
@@ -112,16 +112,6 @@ MALLOC_DECLARE(M_NVME);
 #define CACHE_LINE_SIZE(64)
 #endif
 
-/*
- * Use presence of the BIO_UNMAPPED flag to determine whether unmapped I/O
- *  support and the bus_dmamap_load_bio API are available on the target
- *  kernel.  This will ease porting back to earlier stable branches at a
- *  later point.
- */
-#ifdef BIO_UNMAPPED
-#define NVME_UNMAPPED_BIO_SUPPORT
-#endif
-
 extern uma_zone_t  nvme_request_zone;
 extern int32_t nvme_retry_count;
 
@@ -134,9 +124,7 @@ struct nvme_completion_poll_status {
 #define NVME_REQUEST_VADDR 1
 #define NVME_REQUEST_NULL  2 /* For requests with no payload. */
 #define NVME_REQUEST_UIO   3
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
 #define NVME_REQUEST_BIO   4
-#endif
 #define NVME_REQUEST_CCB5
 
 struct nvme_request {
@@ -506,14 +494,8 @@ nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_
 
req = _nvme_allocate_request(cb_fn, cb_arg);
if (req != NULL) {
-#ifdef NVME_UNMAPPED_BIO_SUPPORT
req->type = NVME_REQUEST_BIO;
req->u.bio = bio;
-#else
-   req->type = NVME_REQUEST_VADDR;
-   req->u.payload = bio->bio_data;
-   req->payload_size = bio->bio_bcount;
-#endif
   

svn commit: r344643 - head/sys/dev/ixgbe

2019-02-27 Thread Eric Joyner
Author: erj
Date: Wed Feb 27 22:26:18 2019
New Revision: 344643
URL: https://svnweb.freebsd.org/changeset/base/344643

Log:
  ixgbe(4): Fix panic triggered by assertion from interrupt
  
  r344162 exposed a bug in one of ixgbe's interrupt filters; they are never
  supposed to return 0. Fix the interrupt filter to return the proper nonzero
  return value.
  
  Reported by:  Oleg Ginzburg 
  MFC after:1 week
  Sponsored by: Intel Corporation

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Wed Feb 27 22:16:59 2019(r344642)
+++ head/sys/dev/ixgbe/if_ix.c  Wed Feb 27 22:26:18 2019(r344643)
@@ -2064,7 +2064,7 @@ ixgbe_msix_que(void *arg)
 
/* Protect against spurious interrupts */
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
-   return 0;
+   return (FILTER_HANDLED);
 
ixgbe_disable_queue(adapter, que->msix);
++que->irqs;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344647 - head/sys/vm

2019-02-27 Thread Mateusz Guzik
Author: mjg
Date: Wed Feb 27 22:42:29 2019
New Revision: 344647
URL: https://svnweb.freebsd.org/changeset/base/344647

Log:
  vm: remove seq.h inclusion made obsolete by NUMA rewrite
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/vm/vm_phys.c

Modified: head/sys/vm/vm_phys.c
==
--- head/sys/vm/vm_phys.c   Wed Feb 27 22:29:37 2019(r344646)
+++ head/sys/vm/vm_phys.c   Wed Feb 27 22:42:29 2019(r344647)
@@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344648 - in head: . sys/kern sys/sys

2019-02-27 Thread Mateusz Guzik
Author: mjg
Date: Wed Feb 27 22:56:55 2019
New Revision: 344648
URL: https://svnweb.freebsd.org/changeset/base/344648

Log:
  Rename seq to seqc to avoid namespace clashes with Linux
  
  Linux generates the content of procfs files using a mechanism prefixed with
  seq_*. This in particular came up with recent gcov import.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/sys/seqc.h   (contents, props changed)
Deleted:
  head/sys/sys/seq.h
Modified:
  head/ObsoleteFiles.inc
  head/sys/kern/kern_descrip.c
  head/sys/sys/filedesc.h

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Feb 27 22:42:29 2019(r344647)
+++ head/ObsoleteFiles.inc  Wed Feb 27 22:56:55 2019(r344648)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20190227: rename seq.h to seqc.h
+OLD_FILES+=usr/include/sys/seq.h
 # 20190222: libifconfig made INTERNALLIB
 OLD_FILES+=usr/lib/libprivateifconfig.a
 OLD_FILES+=usr/lib/libprivateifconfig_p.a

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cWed Feb 27 22:42:29 2019
(r344647)
+++ head/sys/kern/kern_descrip.cWed Feb 27 22:56:55 2019
(r344648)
@@ -304,11 +304,11 @@ fdfree(struct filedesc *fdp, int fd)
 
fde = &fdp->fd_ofiles[fd];
 #ifdef CAPABILITIES
-   seq_write_begin(&fde->fde_seq);
+   seqc_write_begin(&fde->fde_seqc);
 #endif
fde->fde_file = NULL;
 #ifdef CAPABILITIES
-   seq_write_end(&fde->fde_seq);
+   seqc_write_end(&fde->fde_seqc);
 #endif
fdefree_last(fde);
fdunused(fdp, fd);
@@ -908,7 +908,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int
 * Duplicate the source descriptor.
 */
 #ifdef CAPABILITIES
-   seq_write_begin(&newfde->fde_seq);
+   seqc_write_begin(&newfde->fde_seqc);
 #endif
memcpy(newfde, oldfde, fde_change_size);
filecaps_copy_finish(&oldfde->fde_caps, &newfde->fde_caps,
@@ -918,7 +918,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int
else
newfde->fde_flags = oldfde->fde_flags & ~UF_EXCLOSE;
 #ifdef CAPABILITIES
-   seq_write_end(&newfde->fde_seq);
+   seqc_write_end(&newfde->fde_seqc);
 #endif
td->td_retval[0] = new;
 
@@ -1876,7 +1876,7 @@ _finstall(struct filedesc *fdp, struct file *fp, int f
 
fde = &fdp->fd_ofiles[fd];
 #ifdef CAPABILITIES
-   seq_write_begin(&fde->fde_seq);
+   seqc_write_begin(&fde->fde_seqc);
 #endif
fde->fde_file = fp;
fde->fde_flags = (flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0;
@@ -1885,7 +1885,7 @@ _finstall(struct filedesc *fdp, struct file *fp, int f
else
filecaps_fill(&fde->fde_caps);
 #ifdef CAPABILITIES
-   seq_write_end(&fde->fde_seq);
+   seqc_write_end(&fde->fde_seqc);
 #endif
 }
 
@@ -2567,7 +2567,7 @@ fget_cap(struct thread *td, int fd, cap_rights_t *need
filecaps_fill(havecapsp);
 #else
struct file *fp;
-   seq_t seq;
+   seqc_t seq;
 
for (;;) {
error = fget_unlocked(fdp, fd, needrightsp, &fp, &seq);
@@ -2602,7 +2602,7 @@ get_locked:
 
 int
 fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
-struct file **fpp, seq_t *seqp)
+struct file **fpp, seqc_t *seqp)
 {
 #ifdef CAPABILITIES
const struct filedescent *fde;
@@ -2611,7 +2611,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights
struct file *fp;
u_int count;
 #ifdef CAPABILITIES
-   seq_t seq;
+   seqc_t seq;
cap_rights_t haverights;
int error;
 #endif
@@ -2629,11 +2629,11 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights
 */
for (;;) {
 #ifdef CAPABILITIES
-   seq = seq_load(fd_seq(fdt, fd));
+   seq = seqc_read(fd_seqc(fdt, fd));
fde = &fdt->fdt_ofiles[fd];
haverights = *cap_rights_fde_inline(fde);
fp = fde->fde_file;
-   if (!seq_consistent(fd_seq(fdt, fd), seq))
+   if (!seqc_consistent(fd_seqc(fdt, fd), seq))
continue;
 #else
fp = fdt->fdt_ofiles[fd].fde_file;
@@ -2664,7 +2664,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights
goto retry;
fdt = fdp->fd_files;
 #ifdef CAPABILITIES
-   if (seq_consistent_nomb(fd_seq(fdt, fd), seq))
+   if (seqc_consistent_nomb(fd_seqc(fdt, fd), seq))
 #else
if (fp == fdt->fdt_ofiles[fd].fde_file)
 #endif
@@ -2695,7 +2695,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights
  */
 static __inline int
 _fget(st

Re: svn commit: r344570 - head/usr.sbin/sysrc

2019-02-27 Thread Mateusz Piotrowski
On Tue, 26 Feb 2019 at 23:53, Jilles Tjoelker  wrote:

> On Tue, Feb 26, 2019 at 04:47:59AM -0800, Rodney W. Grimes wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> > > Author: 0mp (ports committer)
> > > Date: Tue Feb 26 09:28:10 2019
> > > New Revision: 344570
> > > URL: https://svnweb.freebsd.org/changeset/base/344570
>
> > > Log:
> > >   sysrc.8: Pet igor and mandoc
>
> > This only tells the source of why you changed some,
> > a good commit log entry tells me that, and what it
> > is that you changed.  You normally do not need to
> > name the file your changed in a commit log as the
> > log is attached to the file, sometimes it does make
> > since to mention a file name in a log entry when you
> > are describing the changes to just that file in a
> > commit that includes many files.
>
> > A better log might of been:
> >   Pet igor and mandoc.  Remove unneeded .Li, use .Fx as needed,
> >   escape hard stop, and sort cross references.
>

Alright! Thank you for a review ;) I'll be more precise
next time.

Naming the affected area, file or directory can be useful to make the
> commit message understandable outside of its file's context without
> needing to look at the diff or list of changed files. Even better, there
> is a convention of making the first line of the commit message a
> summary. When following this convention, displaying just the first line
> of each commit's message allows a good overview of recent changes in the
> whole tree.
>

I like it as well.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344653 - head/sbin/nvmecontrol

2019-02-27 Thread Warner Losh
Author: imp
Date: Thu Feb 28 02:29:48 2019
New Revision: 344653
URL: https://svnweb.freebsd.org/changeset/base/344653

Log:
  Add SPDX tag.

Modified:
  head/sbin/nvmecontrol/nc_util.c

Modified: head/sbin/nvmecontrol/nc_util.c
==
--- head/sbin/nvmecontrol/nc_util.c Thu Feb 28 00:30:34 2019
(r344652)
+++ head/sbin/nvmecontrol/nc_util.c Thu Feb 28 02:29:48 2019
(r344653)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2017 Netflix, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r344654 - head/sys/dev/cxgbe

2019-02-27 Thread Navdeep Parhar
Author: np
Date: Thu Feb 28 05:45:14 2019
New Revision: 344654
URL: https://svnweb.freebsd.org/changeset/base/344654

Log:
  cxgbe(4): Request high priority filter support explicitly, as required
  by recent firmwares.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Feb 28 02:29:48 2019
(r344653)
+++ head/sys/dev/cxgbe/t4_main.cThu Feb 28 05:45:14 2019
(r344654)
@@ -608,6 +608,7 @@ static int cfg_itype_and_nqueues(struct adapter *, str
 static int contact_firmware(struct adapter *);
 static int partition_resources(struct adapter *);
 static int get_params__pre_init(struct adapter *);
+static int set_params__pre_init(struct adapter *);
 static int get_params__post_init(struct adapter *);
 static int set_params__post_init(struct adapter *);
 static void t4_set_desc(struct adapter *);
@@ -3955,6 +3956,7 @@ apply_cfg_and_initialize(struct adapter *sc, char *cfg
}
 
t4_tweak_chip_settings(sc);
+   set_params__pre_init(sc);
 
/* get basic stuff going */
rc = -t4_fw_initialize(sc, sc->mbox);
@@ -4077,6 +4079,35 @@ get_params__pre_init(struct adapter *sc)
 }
 
 /*
+ * Any params that need to be set before FW_INITIALIZE.
+ */
+static int
+set_params__pre_init(struct adapter *sc)
+{
+   int rc = 0;
+   uint32_t param, val;
+
+   if (chip_id(sc) >= CHELSIO_T6) {
+   param = FW_PARAM_DEV(HPFILTER_REGION_SUPPORT);
+   val = 1;
+   rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val);
+   /* firmwares < 1.20.1.0 do not have this param. */
+   if (rc == FW_EINVAL && sc->params.fw_vers <
+   (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) |
+   V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) {
+   rc = 0;
+   }
+   if (rc != 0) {
+   device_printf(sc->dev,
+   "failed to enable high priority filters :%d.\n",
+   rc);
+   }
+   }
+
+   return (rc);
+}
+
+/*
  * Retrieve various parameters that are of interest to the driver.  The device
  * has been initialized by the firmware at this point.
  */
@@ -4118,20 +4149,6 @@ get_params__post_init(struct adapter *sc)
sc->params.core_vdd = val[6];
 
if (chip_id(sc) >= CHELSIO_T6) {
-
-#ifdef INVARIANTS
-   if (sc->params.fw_vers >=
-   (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) |
-   V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) {
-   /*
-* Note that the code to enable the region should run
-* before t4_fw_initialize and not here.  This is just a
-* reminder to add said code.
-*/
-   device_printf(sc->dev,
-   "hpfilter region not enabled.\n");
-   }
-#endif
 
sc->tids.tid_base = t4_read_reg(sc,
A_LE_DB_ACTIVE_TABLE_START_INDEX);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r344648 - in head: . sys/kern sys/sys

2019-02-27 Thread Alexey Dokuchaev
On Wed, Feb 27, 2019 at 10:56:55PM +, Mateusz Guzik wrote:
> New Revision: 344648
> URL: https://svnweb.freebsd.org/changeset/base/344648
> 
> Log:
>   Rename seq to seqc to avoid namespace clashes with Linux
>   
> ...
> Added:
>   head/sys/sys/seqc.h   (contents, props changed)
> Deleted:
>   head/sys/sys/seq.h

Why it was deleted and added as new file instead of being repocopied?

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