sync with OpenBSD -current
This commit is contained in:
parent
caabca1cee
commit
aaa686b79e
15 changed files with 537 additions and 267 deletions
|
@ -164,6 +164,8 @@ static void sumo_construct_vid_mapping_table(struct amdgpu_device *adev,
|
|||
|
||||
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
|
||||
if (table[i].ulSupportedSCLK != 0) {
|
||||
if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
|
||||
continue;
|
||||
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
|
||||
table[i].usVoltageID;
|
||||
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =
|
||||
|
|
|
@ -393,6 +393,10 @@ bool intel_dp_can_bigjoiner(struct intel_dp *intel_dp)
|
|||
struct intel_encoder *encoder = &intel_dig_port->base;
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
|
||||
/* eDP MSO is not compatible with joiner */
|
||||
if (intel_dp->mso_link_count)
|
||||
return false;
|
||||
|
||||
return DISPLAY_VER(dev_priv) >= 12 ||
|
||||
(DISPLAY_VER(dev_priv) == 11 &&
|
||||
encoder->port != PORT_A);
|
||||
|
|
|
@ -1621,6 +1621,8 @@ void sumo_construct_vid_mapping_table(struct radeon_device *rdev,
|
|||
|
||||
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
|
||||
if (table[i].ulSupportedSCLK != 0) {
|
||||
if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
|
||||
continue;
|
||||
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
|
||||
table[i].usVoltageID;
|
||||
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_vio.c,v 1.41 2024/06/26 01:40:49 jsg Exp $ */
|
||||
/* $OpenBSD: if_vio.c,v 1.42 2024/06/28 14:46:31 jan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
|
||||
|
@ -419,7 +419,7 @@ vio_alloc_mem(struct vio_softc *sc)
|
|||
*/
|
||||
allocsize = sizeof(struct virtio_net_hdr) * txqsize;
|
||||
|
||||
if (vsc->sc_nvqs == 3) {
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ)) {
|
||||
allocsize += sizeof(struct virtio_net_ctrl_cmd) * 1;
|
||||
allocsize += sizeof(struct virtio_net_ctrl_status) * 1;
|
||||
allocsize += sizeof(struct virtio_net_ctrl_rx) * 1;
|
||||
|
@ -436,7 +436,7 @@ vio_alloc_mem(struct vio_softc *sc)
|
|||
kva = sc->sc_dma_kva;
|
||||
sc->sc_tx_hdrs = (struct virtio_net_hdr*)(kva + offset);
|
||||
offset += sizeof(struct virtio_net_hdr) * txqsize;
|
||||
if (vsc->sc_nvqs == 3) {
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ)) {
|
||||
sc->sc_ctrl_cmd = (void*)(kva + offset);
|
||||
offset += sizeof(*sc->sc_ctrl_cmd);
|
||||
sc->sc_ctrl_status = (void*)(kva + offset);
|
||||
|
@ -529,7 +529,7 @@ vio_needs_reset(struct vio_softc *sc)
|
|||
{
|
||||
if (virtio_get_status(sc->sc_virtio) &
|
||||
VIRTIO_CONFIG_DEVICE_STATUS_DEVICE_NEEDS_RESET) {
|
||||
printf("%s: device needs reset", sc->sc_dev.dv_xname);
|
||||
printf("%s: device needs reset\n", sc->sc_dev.dv_xname);
|
||||
vio_ctrl_wakeup(sc, RESET);
|
||||
return 1;
|
||||
}
|
||||
|
@ -604,8 +604,7 @@ vio_attach(struct device *parent, struct device *self, void *aux)
|
|||
virtio_postpone_intr_far(&sc->sc_vq[VQTX]);
|
||||
else
|
||||
virtio_stop_vq_intr(vsc, &sc->sc_vq[VQTX]);
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ) &&
|
||||
virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_RX)) {
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ)) {
|
||||
if (virtio_alloc_vq(vsc, &sc->sc_vq[VQCTL], 2, NBPG, 1,
|
||||
"control") == 0) {
|
||||
sc->sc_vq[VQCTL].vq_done = vio_ctrleof;
|
||||
|
@ -760,7 +759,7 @@ vio_stop(struct ifnet *ifp, int disable)
|
|||
/* only way to stop I/O and DMA is resetting... */
|
||||
virtio_reset(vsc);
|
||||
vio_rxeof(sc);
|
||||
if (vsc->sc_nvqs >= 3)
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ))
|
||||
vio_ctrl_wakeup(sc, RESET);
|
||||
vio_tx_drain(sc);
|
||||
if (disable)
|
||||
|
@ -769,10 +768,10 @@ vio_stop(struct ifnet *ifp, int disable)
|
|||
virtio_reinit_start(vsc);
|
||||
virtio_start_vq_intr(vsc, &sc->sc_vq[VQRX]);
|
||||
virtio_stop_vq_intr(vsc, &sc->sc_vq[VQTX]);
|
||||
if (vsc->sc_nvqs >= 3)
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ))
|
||||
virtio_start_vq_intr(vsc, &sc->sc_vq[VQCTL]);
|
||||
virtio_reinit_end(vsc);
|
||||
if (vsc->sc_nvqs >= 3)
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ))
|
||||
vio_ctrl_wakeup(sc, FREE);
|
||||
}
|
||||
|
||||
|
@ -959,7 +958,7 @@ vio_dump(struct vio_softc *sc)
|
|||
printf("rx tick active: %d\n", !timeout_triggered(&sc->sc_rxtick));
|
||||
printf("RX virtqueue:\n");
|
||||
virtio_vq_dump(&vsc->sc_vqs[VQRX]);
|
||||
if (vsc->sc_nvqs == 3) {
|
||||
if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ)) {
|
||||
printf("CTL virtqueue:\n");
|
||||
virtio_vq_dump(&vsc->sc_vqs[VQCTL]);
|
||||
printf("ctrl_inuse: %d\n", sc->sc_ctrl_inuse);
|
||||
|
@ -1530,7 +1529,7 @@ vio_wait_ctrl_done(struct vio_softc *sc)
|
|||
r = tsleep_nsec(&sc->sc_ctrl_inuse, PRIBIO, "viodone",
|
||||
VIRTIO_NET_CTRL_TIMEOUT);
|
||||
if (r == EWOULDBLOCK) {
|
||||
printf("%s: ctrl queue timeout", sc->sc_dev.dv_xname);
|
||||
printf("%s: ctrl queue timeout\n", sc->sc_dev.dv_xname);
|
||||
vio_ctrl_wakeup(sc, RESET);
|
||||
return ENXIO;
|
||||
}
|
||||
|
@ -1648,7 +1647,7 @@ vio_iff(struct vio_softc *sc)
|
|||
|
||||
ifp->if_flags &= ~IFF_ALLMULTI;
|
||||
|
||||
if (vsc->sc_nvqs < 3) {
|
||||
if (!virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_RX)) {
|
||||
/* no ctrl vq; always promisc */
|
||||
ifp->if_flags |= IFF_ALLMULTI | IFF_PROMISC;
|
||||
return;
|
||||
|
@ -1682,9 +1681,6 @@ vio_iff(struct vio_softc *sc)
|
|||
|
||||
sc->sc_ctrl_mac_tbl_mc->nentries = rxfilter ? nentries : 0;
|
||||
|
||||
if (vsc->sc_nvqs < 3)
|
||||
return;
|
||||
|
||||
r = vio_set_rx_filter(sc);
|
||||
if (r == EIO)
|
||||
allmulti = 1; /* fallback */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: uipc_socket2.c,v 1.155 2024/05/17 19:11:14 mvs Exp $ */
|
||||
/* $OpenBSD: uipc_socket2.c,v 1.156 2024/06/28 21:30:24 mvs Exp $ */
|
||||
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -160,8 +160,6 @@ void
|
|||
soisdisconnected(struct socket *so)
|
||||
{
|
||||
soassertlocked(so);
|
||||
so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
|
||||
so->so_state |= SS_ISDISCONNECTED;
|
||||
|
||||
mtx_enter(&so->so_rcv.sb_mtx);
|
||||
so->so_rcv.sb_state |= SS_CANTRCVMORE;
|
||||
|
@ -171,6 +169,9 @@ soisdisconnected(struct socket *so)
|
|||
so->so_snd.sb_state |= SS_CANTSENDMORE;
|
||||
mtx_leave(&so->so_snd.sb_mtx);
|
||||
|
||||
so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
|
||||
so->so_state |= SS_ISDISCONNECTED;
|
||||
|
||||
wakeup(&so->so_timeo);
|
||||
sowwakeup(so);
|
||||
sorwakeup(so);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: uipc_usrreq.c,v 1.207 2024/06/26 12:23:36 mvs Exp $ */
|
||||
/* $OpenBSD: uipc_usrreq.c,v 1.208 2024/06/28 21:30:24 mvs Exp $ */
|
||||
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -513,6 +513,14 @@ uipc_send(struct socket *so, struct mbuf *m, struct mbuf *nam,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* We hold both solock() and `sb_mtx' mutex while modifying
|
||||
* SS_CANTSENDMORE flag. solock() is enough to check it.
|
||||
*/
|
||||
if (so->so_snd.sb_state & SS_CANTSENDMORE) {
|
||||
error = EPIPE;
|
||||
goto dispose;
|
||||
}
|
||||
if (unp->unp_conn == NULL) {
|
||||
error = ENOTCONN;
|
||||
goto dispose;
|
||||
|
@ -531,12 +539,6 @@ uipc_send(struct socket *so, struct mbuf *m, struct mbuf *nam,
|
|||
*/
|
||||
mtx_enter(&so2->so_rcv.sb_mtx);
|
||||
mtx_enter(&so->so_snd.sb_mtx);
|
||||
if (so->so_snd.sb_state & SS_CANTSENDMORE) {
|
||||
mtx_leave(&so->so_snd.sb_mtx);
|
||||
mtx_leave(&so2->so_rcv.sb_mtx);
|
||||
error = EPIPE;
|
||||
goto dispose;
|
||||
}
|
||||
if (control) {
|
||||
if (sbappendcontrol(so2, &so2->so_rcv, m, control)) {
|
||||
control = NULL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: fifo_vnops.c,v 1.105 2024/05/03 17:43:09 mvs Exp $ */
|
||||
/* $OpenBSD: fifo_vnops.c,v 1.106 2024/06/28 21:30:24 mvs Exp $ */
|
||||
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -174,10 +174,16 @@ fifo_open(void *v)
|
|||
return (error);
|
||||
}
|
||||
fip->fi_readers = fip->fi_writers = 0;
|
||||
/*
|
||||
* Should take both solock() and `sb_mtx' mutex for
|
||||
* SS_CANTSENDMORE flag modifications.
|
||||
*/
|
||||
solock(wso);
|
||||
mtx_enter(&wso->so_snd.sb_mtx);
|
||||
wso->so_snd.sb_state |= SS_CANTSENDMORE;
|
||||
wso->so_snd.sb_lowat = PIPE_BUF;
|
||||
mtx_leave(&wso->so_snd.sb_mtx);
|
||||
sounlock(wso);
|
||||
} else {
|
||||
rso = fip->fi_readsock;
|
||||
wso = fip->fi_writesock;
|
||||
|
@ -185,9 +191,11 @@ fifo_open(void *v)
|
|||
if (ap->a_mode & FREAD) {
|
||||
fip->fi_readers++;
|
||||
if (fip->fi_readers == 1) {
|
||||
solock(wso);
|
||||
mtx_enter(&wso->so_snd.sb_mtx);
|
||||
wso->so_snd.sb_state &= ~SS_CANTSENDMORE;
|
||||
mtx_leave(&wso->so_snd.sb_mtx);
|
||||
sounlock(wso);
|
||||
if (fip->fi_writers > 0)
|
||||
wakeup(&fip->fi_writers);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue