1. 05 Jul, 2022 17 commits
  2. 04 Jul, 2022 19 commits
    • Dmitry Chagin's avatar
      linux(4): Use saved cpu feature bits · 03473e8e
      Dmitry Chagin authored
      MFC after:		3 days
      03473e8e
    • Dmitry Chagin's avatar
      linux(4): Implement __vdso_time · 42317e64
      Dmitry Chagin authored
      PR:		240769
      MFC after:	3 days
      42317e64
    • Gleb Smirnoff's avatar
      sockets: use only soref()/sorele() as socket reference count · d8596171
      Gleb Smirnoff authored
      o Retire SS_FDREF as it is basically a debug flag on top of already
        existing soref()/sorele().
      o Convert SS_PROTOREF into soref()/sorele().
      o Change reference model for the listen queues, see below.
      o Make sofree() private.  The correct KPI to use is only sorele().
      o Make soabort() respect the model and sorele() instead of sofree().
      
      Note on listening queues.  Until now the sockets on a queue had zero
      reference count.  And the reference were given only upon accept(2).  The
      assumption was that there is no way to see the queued socket from anywhere
      except its head.  This is not true, since queued sockets already have pcbs,
      which are linked at least into the global pcb lists.  With this change we
      put the reference right in the sonewconn() and on accept(2) path we just
      hand the existing reference to the file descriptor.
      
      Differential revision:	https://reviews.freebsd.org/D35679
      d8596171
    • Gleb Smirnoff's avatar
      sockets: use positive flag for file descriptor socket reference · bc760564
      Gleb Smirnoff authored
      Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
      Mark sockets created by socreate() with SS_FDREF.
      
      This change is mostly illustrative. With it we see that SS_FDREF
      is a debugging flag, since:
      * socreate() takes a reference with soref().
      * on accept path solisten_dequeue() takes a reference
        with soref() and then soaccept() sets SS_FDREF.
      * soclose() checks SS_FDREF, removes it and does sorele().
      
      Reviewed by:		tuexen
      Differential revision:	https://reviews.freebsd.org/D35678
      bc760564
    • Gleb Smirnoff's avatar
      tcp: use a TCP flag to check if connection has been close(2)d · 74703901
      Gleb Smirnoff authored
      The flag SS_NOFDREF is a private flag of the socket layer.  It also
      is supposed to be read with SOCK_LOCK(), which we don't own here.
      
      Reviewed by:		rrs, tuexen
      Differential revision:	https://reviews.freebsd.org/D35663
      74703901
    • Bjoern A. Zeeb's avatar
      pca954x: harmonize pca9547 and pca954x and add pca9540 support · 97dbd377
      Bjoern A. Zeeb authored
      The two implementations for the pca9548 switch and the pca9547 mux
      seemed close enough so we can put them together and with a bit more
      abstraction add pca9540 support.
      
      While here apply a bit of consistency in variable and driver naming and
      use device_has_property instead of the FDT-only OF_ variant.
      
      This disconnects pca9547 from the build but does not yet delete it.
      
      MFC after:	2 weeks
      Reviewed by:	mmel (earlier version), avg
      Differential Revision: https://reviews.freebsd.org/D35701
      97dbd377
    • Doug Moore's avatar
      rb_tree: fine-tune rebalancing code · 2120d7f5
      Doug Moore authored
      Change parts of RB_INSERT_COLOR and RB_REMOVE_COLOR to reduce the
      number of operations, by, in some cases, flipping two color bits at a
      time instead of flipping each individually, in separate operations,
      and by using a switch statement to replace a sequence of if-elses.
      Rewrite RB_SET_PARENT to generate fewer instructions.  These changes
      reduce the code size by over 100 bytes on some architectures.
      
      Also, allow RB users to define a preprocessor symbol to generate
      RB_REMOVE_COLOR code that matches the implementation described in the
      original weak-AVL paper in one particular case, instead of the still
      correct, but slightly more efficient implementation of that case
      currently implemented.
      
      Reviewed by:	alc
      MFC after:	3 weeks
      Differential Revision:	https://reviews.freebsd.org/D35524
      2120d7f5
    • Andrew Gallatin's avatar
      pmcstat: fix log analysis · 0aa15077
      Andrew Gallatin authored
      pmcstat has been broken for analyzing logs since D35342 / b6e28991.
      
      This is because the pmc for the first CPU is not added when reading logs
      because unlike its clones, its event id is not invalid. That causes us
      to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
      when encountering samples from cpu0.
      
      Fix this by removing the check that the PMC is invalid
      
      Reviewed by: tsoome
      Sponsored by: Netflix
      Differential Revision: https://reviews.freebsd.org/D35709
      0aa15077
    • Andrew Turner's avatar
      Add Rockchip PCIe cleanup on attach faulure · ee2324aa
      Andrew Turner authored
      We should clean up on failure as it may panic the kernel later, e.g.
      if we crate the rman, but fail to destroy it on attach faulure.
      
      Reviewed by:	imp
      Sponsored by:	The FreeBSD Foundation
      Differential Revision: https://reviews.freebsd.org/D35682
      ee2324aa
    • Andrew Turner's avatar
      Fix ofw pcib when it rman_init fails · b1e93132
      Andrew Turner authored
      rman_fini assumes rman_init has been called successfully. Clean up
      init faulure by only calling rman_fini when rman_init has succeeded.
      
      While here add ofw_pcib_fini that can be used by a sub-class to clean
      up.
      
      Reviewed by:	bz, imp
      Sponsored by:	The FreeBSD Foundation
      Differential Revision: https://reviews.freebsd.org/D35681
      b1e93132
    • Andrew Turner's avatar
      Support decoding mem32 memory in the rk pcie driver · 1c799a6f
      Andrew Turner authored
      This is needed with some dtb files.
      
      While here use a switch statement as the two options are mutually
      exclusive in any iteration of the loop.
      
      Reviewed by:	imp
      Sponsored by:	The FreeBSD Foundation
      Differential Revision: https://reviews.freebsd.org/D35680
      1c799a6f
    • Kornel Dulęba's avatar
      e6000sw: Fix direct register write logic · 66548259
      Kornel Dulęba authored
      When accessing a register directly from etherswitchcfg one must specify
      a register group(e.g. registers of portN) and the register offset within
      the group. The latter is passed as the 5 least significant bits.
      Extract the former by dividing the register address by 32, not by 5.
      
      Approved by:	mw(mentor)
      Obtained from:	Semihalf
      Sponsored by:	Stormshield
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D35672
      66548259
    • Kornel Dulęba's avatar
      lockstat: Fix construction of comparision predicates · 9dbacce2
      Kornel Dulęba authored
      Passing "0x%p" to sprintf results in double "0x" being printed.
      This causes a dtrace script compilation failure when "-d" flag
      is specified.
      Fix that by removing the extraneous "0x".
      
      Reviewed by:	markj
      Approved by:	mw(mentor)
      Obtained from:	Semihalf
      Sponsored by:	Alstom
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D35690
      9dbacce2
    • Mike Karels's avatar
      mountd startup: enable NFSv4 if needed on restart · 1cf8e633
      Mike Karels authored
      The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly
      when it is run at system startup, relying on the kernel default.
      However, if NFSv4 was enabled in /etc/rc.conf later, and the script
      was re-run to restart mountd, the sysctl was still set to 3.
      Set the sysctl to the right value in all cases.
      
      Reviewed by:	rmacklem
      MFC after:	1 week
      1cf8e633
    • Mateusz Guzik's avatar
      routing: hide notify_add and notify_del behind ROUTE_MPATH · db4b4021
      Mateusz Guzik authored
      Fixes a warn about unused routines without the option.
      
      Sponsored by:	Rubicon Communications, LLC ("Netgate")
      db4b4021
    • Yuri's avatar
      ipmi: do not omit lun in BMC addresses · 177f8b32
      Yuri authored
      Some systems put sensors on non-0 lun, so we should not omit it.  This
      was the only difference with the Linux driver, where DIMM sensors could
      be queried, but not on FreeBSD.
      
      See this report[1] on the FreeBSD forums:
      https://forums.freebsd.org/threads/freebsd-cannot-get-dimm-temperature-sensor-value.85166/
      
      Reviewed by:	philip
      Tested by:	Andrey Lanin[1]
      MFC after:	1 week
      Differential Revision: https://reviews.freebsd.org/D35612
      177f8b32
    • Yuri's avatar
      ipmi: correctly handle ipmb requests · 18db96db
      Yuri authored
      Handle IPMB requests using SEND_MSG (sent as driver request as we do not
      need to return anything back to userland for this) and GET_MSG (sent as
      usual request so we can return the data for RECEIVE_MSG ioctl) pair.
      
      This fixes fetching complete sensor data from boards (e.g. HP ProLiant
      DL380 Gen10).
      
      Reviewed by:	philip
      MFC after:	1 week
      Differential Revision: https://reviews.freebsd.org/D35605
      18db96db
    • Xin LI's avatar
      file: upgrade to 5.42. · a4d6d3b8
      Xin LI authored
      MFC after:	2 weeks
      a4d6d3b8
    • Xin LI's avatar
      Vendor import of file 5.42. · ba49e637
      Xin LI authored
      ba49e637
  3. 03 Jul, 2022 4 commits
    • Bjoern A. Zeeb's avatar
      dwc3: improve debugging · 11a7d5e5
      Bjoern A. Zeeb authored
      Rather than hiding behind #if 0, hide the debugging behind DWC3_DEBUG
      so it can be turned on with a single define.  Require bootverbose
      to print anything so we can still avoid spamming the console if DWC3_DEBUG
      is on.
      Harmonize the format string in snsp_dwc3_dump_regs() to always print the
      full register and also print the XHCI quirks.
      Call snsp_dwc3_dump_regs() twice, before and after generic XHCI attachment
      and initialisation as this may have an effect on the confirgumation state.
      
      Obtained from:	an old debug patch
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35700
      11a7d5e5
    • Bjoern A. Zeeb's avatar
      dwc3: add more quirks and checks · 09cdf487
      Bjoern A. Zeeb authored
      Rather than just printing the Global SNPS ID Register store it as well
      so we can do a version check later.
      In addition, for debugging purposes, read the Global Hardware Parameters
      Registers and print them.
      
      Based on the snpsid disable an XHCI feature using a quirk prepared
      in 447c418d.
      Add the "snps,dis_u3_susphy_quirk" quirk and handle Suspend USB3.0 SS PHY
      after power-on-reset/during core initialization (suggested to be cleared)
      based on the DWC3_GHWPARAMS0 register.
      
      MFC after:	2 weeks
      Obtained from:	an old debugging patch
      Reviewed by:	mw (earlier version), mmel
      Differential Revision: https://reviews.freebsd.org/D35699
      09cdf487
    • Bjoern A. Zeeb's avatar
      dwc3: uncondinationally enable Host IN Auto Retry · cec0a5ec
      Bjoern A. Zeeb authored
      Enable dwc3's auto retry feature. For IN transfers with crc errors
      or internal overruns this will make the host reply with a
      non-terminating retry ACK.  I believe the hope was to improve
      reliability after seeing occasional hiccups.
      
      Obtained from:	an old debugging patch
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35698
      cec0a5ec
    • Bjoern A. Zeeb's avatar
      dwc3: fix snps,dis-del-phy-power-chg-quirk · 0084212b
      Bjoern A. Zeeb authored
      If snps,dis-del-phy-power-chg-quirk is set, the register bit should be
      cleared not ored on (it's the "dis" version).
      
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35697
      0084212b