summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgbe/t4_main.c6
-rw-r--r--sys/dev/drm2/drm_drv.c4
-rw-r--r--sys/dev/mrsas/mrsas.c18
-rw-r--r--sys/dev/nvd/nvd.c2
-rw-r--r--sys/dev/nvme/nvme.h1
-rw-r--r--sys/dev/nvme/nvme_ns.c18
-rw-r--r--sys/dev/nvme/nvme_sysctl.c16
-rw-r--r--sys/dev/qlxgb/qla_hw.c3
8 files changed, 21 insertions, 47 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index de4a380..3dfb53f 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -3250,6 +3250,12 @@ cxgbe_uninit_synchronized(struct port_info *pi)
ASSERT_SYNCHRONIZED_OP(sc);
+ if (!(pi->flags & PORT_INIT_DONE)) {
+ KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING),
+ ("uninited port is running"));
+ return (0);
+ }
+
/*
* Disable the VI so that all its data in either direction is discarded
* by the MPS. Leave everything else (the queues, interrupts, and 1Hz
diff --git a/sys/dev/drm2/drm_drv.c b/sys/dev/drm2/drm_drv.c
index f4431a7..3b46253 100644
--- a/sys/dev/drm2/drm_drv.c
+++ b/sys/dev/drm2/drm_drv.c
@@ -386,17 +386,21 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags,
switch (cmd) {
case FIONBIO:
case FIOASYNC:
+ atomic_dec(&dev->ioctl_count);
return 0;
case FIOSETOWN:
+ atomic_dec(&dev->ioctl_count);
return fsetown(*(int *)data, &file_priv->minor->buf_sigio);
case FIOGETOWN:
+ atomic_dec(&dev->ioctl_count);
*(int *) data = fgetown(&file_priv->minor->buf_sigio);
return 0;
}
if (IOCGROUP(cmd) != DRM_IOCTL_BASE) {
+ atomic_dec(&dev->ioctl_count);
DRM_DEBUG("Bad ioctl group 0x%x\n", (int)IOCGROUP(cmd));
return EINVAL;
}
diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c
index 3e6dbe8..6fa4639 100644
--- a/sys/dev/mrsas/mrsas.c
+++ b/sys/dev/mrsas/mrsas.c
@@ -1272,14 +1272,12 @@ mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg)
* Application
*/
sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no];
- if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) {
- if (sc == NULL)
- mrsas_dprint(sc, MRSAS_FAULT,
- "There is no Controller number %d .\n", user_ioc->host_no);
- else
- mrsas_dprint(sc, MRSAS_FAULT,
- "Invalid Controller number %d .\n", user_ioc->host_no);
- }
+ if (sc == NULL)
+ printf("There is no Controller number %d\n",
+ user_ioc->host_no);
+ else if (user_ioc->host_no >= mrsas_mgmt_info.max_index)
+ mrsas_dprint(sc, MRSAS_FAULT,
+ "Invalid Controller number %d\n", user_ioc->host_no);
}
return sc;
@@ -4018,8 +4016,8 @@ mrsas_aen_handler(struct mrsas_softc *sc)
u_int32_t seq_num;
int error;
- if (!sc) {
- device_printf(sc->mrsas_dev, "invalid instance!\n");
+ if (sc == NULL) {
+ printf("invalid instance!\n");
return;
}
if (sc->evt_detail_mem) {
diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c
index e062f57..989ed92 100644
--- a/sys/dev/nvd/nvd.c
+++ b/sys/dev/nvd/nvd.c
@@ -311,7 +311,7 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns);
if (disk->d_delmaxsize > nvd_delete_max)
disk->d_delmaxsize = nvd_delete_max;
- disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns);
+ disk->d_stripesize = nvme_ns_get_stripesize(ns);
if (TAILQ_EMPTY(&disk_head))
disk->d_unit = 0;
diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index 227a89e..7e41e77 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -870,7 +870,6 @@ const char * nvme_ns_get_serial_number(struct nvme_namespace *ns);
const char * nvme_ns_get_model_number(struct nvme_namespace *ns);
const struct nvme_namespace_data *
nvme_ns_get_data(struct nvme_namespace *ns);
-uint32_t nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns);
uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns);
int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp,
diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c
index 4580e66..754d074 100644
--- a/sys/dev/nvme/nvme_ns.c
+++ b/sys/dev/nvme/nvme_ns.c
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
#include "nvme_private.h"
-extern int nvme_max_optimal_sectorsize;
-
static void nvme_bio_child_inbed(struct bio *parent, int bio_error);
static void nvme_bio_child_done(void *arg,
const struct nvme_completion *cpl);
@@ -219,22 +217,6 @@ nvme_ns_get_stripesize(struct nvme_namespace *ns)
return (ns->stripesize);
}
-uint32_t
-nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns)
-{
- uint32_t stripesize;
-
- stripesize = nvme_ns_get_stripesize(ns);
-
- if (stripesize == 0)
- return nvme_ns_get_sector_size(ns);
-
- if (nvme_max_optimal_sectorsize == 0)
- return (stripesize);
-
- return (MIN(stripesize, nvme_max_optimal_sectorsize));
-}
-
static void
nvme_ns_bio_done(void *arg, const struct nvme_completion *status)
{
diff --git a/sys/dev/nvme/nvme_sysctl.c b/sys/dev/nvme/nvme_sysctl.c
index 08cd15e..44b0ab7 100644
--- a/sys/dev/nvme/nvme_sysctl.c
+++ b/sys/dev/nvme/nvme_sysctl.c
@@ -33,22 +33,6 @@ __FBSDID("$FreeBSD$");
#include "nvme_private.h"
-SYSCTL_NODE(_kern, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVM Express");
-/*
- * Intel NVMe controllers have a slow path for I/Os that span a 128KB
- * stripe boundary but ZFS limits ashift, which is derived from
- * d_stripesize, to 13 (8KB) so we limit the stripesize reported to
- * geom(8) to 4KB by default.
- *
- * This may result in a small number of additional I/Os to require
- * splitting in nvme(4), however the NVMe I/O path is very efficient
- * so these additional I/Os will cause very minimal (if any) difference
- * in performance or CPU utilisation.
- */
-int nvme_max_optimal_sectorsize = 1<<12;
-SYSCTL_INT(_kern_nvme, OID_AUTO, max_optimal_sectorsize, CTLFLAG_RWTUN,
- &nvme_max_optimal_sectorsize, 0, "The maximum optimal sectorsize reported");
-
/*
* CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these
* explicitly here for older kernels that don't include the r217616
diff --git a/sys/dev/qlxgb/qla_hw.c b/sys/dev/qlxgb/qla_hw.c
index e9c635d..d71bb29 100644
--- a/sys/dev/qlxgb/qla_hw.c
+++ b/sys/dev/qlxgb/qla_hw.c
@@ -797,7 +797,8 @@ qla_tx_tso(qla_host_t *ha, struct mbuf *mp, q80_tx_cmd_t *tx_cmd, uint8_t *hdr)
}
if ((*tcp_opt != 0x01) || (*(tcp_opt + 1) != 0x01) ||
- (*(tcp_opt + 2) != 0x08) || (*(tcp_opt + 2) != 10)) {
+ (*(tcp_opt + 2) != 0x08) ||
+ (*(tcp_opt + 3) != 10)) {
return -1;
}
}
OpenPOWER on IntegriCloud