Skip to content

Commit

Permalink
Merge remote-tracking branch 'vendor/master' into tmpfs
Browse files Browse the repository at this point in the history
* vendor/master:
  Use calloc() instead of an explicit memset.
  Add a new option, -N to disable the default and recommended syslogd(8) behavior, which binds to the well known UDP port.
  Use prototype.  While I'm there, add a pair of parenthesis to mark an if statment's border.
  More Japan regulatory domain fixes:
  Japan regulatory domain update #1 - sync with CRDA entries.
  Remove trailing whitespace in the shutdown(8) manual.
  Improvements to the shutdown(8) manual.
  Fix for dump after shutdown with USB keyboard plugged in. It appears that the system timer is stopped during shutdown and that the pause() statement in ukbd causes infinite hang in this regard. The fix is to use mi_switch() instead of pause() to do the required task switch to ensure that the required USB processes get executed.
  While fixing the looping of a thread while devfs vnode is reclaimed, r179247 introduced a possibility of devfs_allocv() returning spurious ENOENT. If the vnode is selected by vnlru daemon for reclamation, then devfs_allocv() can get ENOENT from vget() due to devfs_close() dropping vnode lock around the call to cdevsw d_close method.
  - Expand the scope of the lock in the interrupt routine to close races with   checking IFF_DRV_RUNNING and simplify the code. This also involves holding   the driver lock in the rx_ch callout. - Just use ifp instead of sc->sc_ifp.
  - For SAS but neither FC nor SPI controllers default to using MSI (still   allowing their use to be disabled via device hints though). This matches   what the corresponding Linux driver provided by LSI does. Tested with   SAS1064. - There's no need to keep track of the RIDs used. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Remove a comment which no longer applies since r209599. - Assign NULL rather than 0 to pointers.
  PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI bridge is blacklisted. In that case just return from pci_alloc_msix_method(), otherwise we continue without a single MSI-X resource, causing subsequent attempts to use the seemingly available resource to fail or when booting verbose a NULL-pointer dereference of rle->start when trying to print the IRQ in pci_alloc_msix_method().
  Remove extra empty lines.
  Run newaliases at the end of the install process.
  • Loading branch information
glk committed Jul 14, 2011
2 parents 8bdf5c1 + 45e6686 commit 3391d5c
Show file tree
Hide file tree
Showing 17 changed files with 222 additions and 97 deletions.
68 changes: 68 additions & 0 deletions etc/regdomain.xml
Expand Up @@ -323,6 +323,14 @@
</band>
</netband>
<netband mode="11a">
<band>
<freqband ref="F1_4920_4980"/>
<maxpower>23</maxpower>
</band>
<band>
<freqband ref="F1_5040_5080"/>
<maxpower>23</maxpower>
</band>
<band>
<freqband ref="F1_5180_5240"/>
<maxpower>23</maxpower>
Expand All @@ -333,6 +341,12 @@
<flags>IEEE80211_CHAN_PASSIVE</flags>
<flags>IEEE80211_CHAN_DFS</flags>
</band>
<band>
<freqband ref="F1_5500_5700"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_PASSIVE</flags>
<flags>IEEE80211_CHAN_DFS</flags>
</band>
</netband>
<netband mode="11ng">
<band>
Expand All @@ -349,6 +363,26 @@
</band>
</netband>
<netband mode="11na">
<band>
<freqband ref="F1_4920_4980"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_HT20</flags>
</band>
<band>
<freqband ref="H4_4920_4980"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_HT40</flags>
</band>
<band>
<freqband ref="F1_5040_5080"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_HT20</flags>
</band>
<band>
<freqband ref="H4_5040_5080"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_HT40</flags>
</band>
<band>
<freqband ref="F1_5180_5240"/>
<maxpower>23</maxpower>
Expand All @@ -373,6 +407,20 @@
<flags>IEEE80211_CHAN_PASSIVE</flags>
<flags>IEEE80211_CHAN_DFS</flags>
</band>
<band>
<freqband ref="F1_5500_5700"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_HT20</flags>
<flags>IEEE80211_CHAN_PASSIVE</flags>
<flags>IEEE80211_CHAN_DFS</flags>
</band>
<band>
<freqband ref="H4_5500_5680"/>
<maxpower>23</maxpower>
<flags>IEEE80211_CHAN_HT40</flags>
<flags>IEEE80211_CHAN_PASSIVE</flags>
<flags>IEEE80211_CHAN_DFS</flags>
</band>
</netband>
</rd>

Expand Down Expand Up @@ -1624,11 +1672,31 @@
<flags>IEEE80211_CHAN_A</flags>
<flags>IEEE80211_CHAN_HALF</flags>
</freqband>
<freqband id="F1_4920_4980">
<freqstart>4920</freqstart> <freqend>4980</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<freqband id="H4_4920_4980">
<freqstart>4920</freqstart> <freqend>4980</freqend>
<chanwidth>40</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<freqband id="F1_4950_4980">
<freqstart>4950</freqstart> <freqend>4980</freqend>
<chanwidth>20</chanwidth> <chansep>5</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<freqband id="F1_5040_5080">
<freqstart>5040</freqstart> <freqend>5080</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<freqband id="H4_5040_5080">
<freqstart>5040</freqstart> <freqend>5080</freqend>
<chanwidth>40</chanwidth> <chansep>20</chansep>
<flags>IEEE80211_CHAN_A</flags>
</freqband>
<freqband id="F1_5120_5240">
<freqstart>5120</freqstart> <freqend>5240</freqend>
<chanwidth>20</chanwidth> <chansep>20</chansep>
Expand Down
30 changes: 16 additions & 14 deletions sbin/shutdown/shutdown.8
Expand Up @@ -28,7 +28,7 @@
.\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95
.\" $FreeBSD$
.\"
.Dd December 30, 2010
.Dd July 13, 2011
.Dt SHUTDOWN 8
.Os
.Sh NAME
Expand Down Expand Up @@ -83,20 +83,20 @@ If one of the
.Fl p
or
.Fl r
is specified,
options are specified,
.Nm
will execute
.Xr halt 8
or
.Xr reboot 8
instead of sending signal to
instead of sending a signal to
.Xr init 8 .
.It Fl n
If the
.Fl o
is specified, prevent the file system cache from being flushed by passing
option is specified, prevent the file system cache from being flushed by passing
.Fl n
option to
to
.Xr halt 8
or
.Xr reboot 8 .
Expand All @@ -106,10 +106,10 @@ This option should probably not be used.
is the time at which
.Nm
will bring the system down and
may be the word
may be the case-insensitive word
.Ar now
(indicating an immediate shutdown) or
specify a future time in one of two formats:
a future time in one of two formats:
.Ar +number ,
or
.Ar yymmddhhmm ,
Expand Down Expand Up @@ -148,7 +148,7 @@ exits.
.Pp
At shutdown time a message is written to the system log, containing the
time of shutdown, the person who initiated the shutdown and the reason.
Corresponding signal is then sent to
The corresponding signal is then sent to
.Xr init 8
to respectively halt, reboot or bring the system down to single-user state
(depending on the above options).
Expand All @@ -170,22 +170,24 @@ file that
.Nm
created will be removed automatically.
.Pp
When run without options, the
When run without options, the
.Nm
utility will place the system into single user mode at the
utility will place the system into single user mode at the
.Ar time
specified.
.Pp
Calling utility as
.Nm poweroff
is equivalent of calling:
Calling
.Dq Nm poweroff
is equivalent to running:
.Bd -literal -offset indent
shutdown -p now
.Ed
.Sh FILES
.Bl -tag -width /var/run/nologin -compact
.It Pa /var/run/nologin
tells login not to let anyone log in
tells
.Xr login 1
not to let anyone log in
.El
.Sh COMPATIBILITY
The hours and minutes in the second time format may be separated by
Expand Down
47 changes: 25 additions & 22 deletions sys/dev/cas/if_cas.c
Expand Up @@ -203,7 +203,7 @@ cas_attach(struct cas_softc *sc)
IFQ_SET_READY(&ifp->if_snd);

callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0);
callout_init(&sc->sc_rx_ch, 1);
callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0);
/* Create local taskq. */
TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc);
TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp);
Expand Down Expand Up @@ -1599,7 +1599,7 @@ cas_rint_timeout(void *arg)
{
struct cas_softc *sc = arg;

CAS_LOCK_ASSERT(sc, MA_NOTOWNED);
CAS_LOCK_ASSERT(sc, MA_OWNED);

cas_rint(sc);
}
Expand All @@ -1614,7 +1614,7 @@ cas_rint(struct cas_softc *sc)
uint32_t rxhead;
u_int idx, idx2, len, off, skip;

CAS_LOCK_ASSERT(sc, MA_NOTOWNED);
CAS_LOCK_ASSERT(sc, MA_OWNED);

callout_stop(&sc->sc_rx_ch);

Expand Down Expand Up @@ -1742,7 +1742,9 @@ cas_rint(struct cas_softc *sc)
cas_rxcksum(m, CAS_GET(word4,
CAS_RC4_TCP_CSUM));
/* Pass it on. */
CAS_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
CAS_LOCK(sc);
} else
ifp->if_iqdrops++;

Expand Down Expand Up @@ -1838,7 +1840,9 @@ cas_rint(struct cas_softc *sc)
cas_rxcksum(m, CAS_GET(word4,
CAS_RC4_TCP_CSUM));
/* Pass it on. */
CAS_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
CAS_LOCK(sc);
} else
ifp->if_iqdrops++;

Expand Down Expand Up @@ -1876,7 +1880,7 @@ cas_free(void *arg1, void *arg2)
{
struct cas_rxdsoft *rxds;
struct cas_softc *sc;
u_int idx;
u_int idx, locked;

#if __FreeBSD_version < 800016
rxds = arg2;
Expand All @@ -1894,17 +1898,18 @@ cas_free(void *arg1, void *arg2)
* NB: this function can be called via m_freem(9) within
* this driver!
*/

if ((locked = CAS_LOCK_OWNED(sc)) == 0)
CAS_LOCK(sc);
cas_add_rxdesc(sc, idx);
if (locked == 0)
CAS_UNLOCK(sc);
}

static inline void
cas_add_rxdesc(struct cas_softc *sc, u_int idx)
{
u_int locked;

if ((locked = CAS_LOCK_OWNED(sc)) == 0)
CAS_LOCK(sc);
CAS_LOCK_ASSERT(sc, MA_OWNED);

bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap,
BUS_DMASYNC_PREREAD);
Expand All @@ -1922,17 +1927,14 @@ cas_add_rxdesc(struct cas_softc *sc, u_int idx)
CAS_WRITE_4(sc, CAS_RX_KICK,
(sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK);
}

if (locked == 0)
CAS_UNLOCK(sc);
}

static void
cas_eint(struct cas_softc *sc, u_int status)
{
struct ifnet *ifp = sc->sc_ifp;

CAS_LOCK_ASSERT(sc, MA_NOTOWNED);
CAS_LOCK_ASSERT(sc, MA_OWNED);

ifp->if_ierrors++;

Expand All @@ -1949,7 +1951,7 @@ cas_eint(struct cas_softc *sc, u_int status)
printf("\n");

ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
cas_init(sc);
cas_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task);
}
Expand Down Expand Up @@ -1986,6 +1988,7 @@ cas_intr_task(void *arg, int pending __unused)
if (__predict_false((status & CAS_INTR_SUMMARY) == 0))
goto done;

CAS_LOCK(sc);
#ifdef CAS_DEBUG
CTR4(KTR_CAS, "%s: %s: cplt %x, status %x",
device_get_name(sc->sc_dev), __func__,
Expand Down Expand Up @@ -2025,14 +2028,15 @@ cas_intr_task(void *arg, int pending __unused)
(CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR |
CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) {
cas_eint(sc, status);
CAS_UNLOCK(sc);
return;
}

if (__predict_false(status & CAS_INTR_TX_MAC_INT)) {
status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS);
if ((status2 &
(CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0)
sc->sc_ifp->if_oerrors++;
ifp->if_oerrors++;
else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0)
device_printf(sc->sc_dev,
"MAC TX fault, status %x\n", status2);
Expand All @@ -2041,7 +2045,7 @@ cas_intr_task(void *arg, int pending __unused)
if (__predict_false(status & CAS_INTR_RX_MAC_INT)) {
status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS);
if ((status2 & CAS_MAC_RX_OVERFLOW) != 0)
sc->sc_ifp->if_ierrors++;
ifp->if_ierrors++;
else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0)
device_printf(sc->sc_dev,
"MAC RX fault, status %x\n", status2);
Expand All @@ -2061,16 +2065,15 @@ cas_intr_task(void *arg, int pending __unused)
}

if ((status &
(CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) {
CAS_LOCK(sc);
(CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0)
cas_tint(sc);
CAS_UNLOCK(sc);
}

if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
CAS_UNLOCK(sc);
return;
else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
} else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task);
CAS_UNLOCK(sc);

status = CAS_READ_4(sc, CAS_STATUS_ALIAS);
if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) {
Expand Down Expand Up @@ -2403,7 +2406,7 @@ cas_mii_statchg(device_t dev)
CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v);

sc->sc_mac_rxcfg = rxcfg;
if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
(sc->sc_flags & CAS_LINK) != 0) {
CAS_WRITE_4(sc, CAS_MAC_TX_CONF,
txcfg | CAS_MAC_TX_CONF_EN);
Expand Down
2 changes: 0 additions & 2 deletions sys/dev/mpt/mpt.h
Expand Up @@ -721,11 +721,9 @@ struct mpt_softc {
* DMA Mapping Stuff
*/
struct resource * pci_reg; /* Register map for chip */
int pci_mem_rid; /* Resource ID */
bus_space_tag_t pci_st; /* Bus tag for registers */
bus_space_handle_t pci_sh; /* Bus handle for registers */
/* PIO versions of above. */
int pci_pio_rid;
struct resource * pci_pio_reg;
bus_space_tag_t pci_pio_st;
bus_space_handle_t pci_pio_sh;
Expand Down

0 comments on commit 3391d5c

Please sign in to comment.