History log of /freebsd-10-stable/sys/dev/mvs/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
315813 23-Mar-2017 mav

MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039


/freebsd-10-stable/sys/cam/cam_xpt.c
/freebsd-10-stable/sys/cam/ctl/ctl_frontend_cam_sim.c
/freebsd-10-stable/sys/cam/scsi/scsi_low.c
/freebsd-10-stable/sys/dev/aac/aac_cam.c
/freebsd-10-stable/sys/dev/aacraid/aacraid_cam.c
/freebsd-10-stable/sys/dev/advansys/advansys.c
/freebsd-10-stable/sys/dev/advansys/adwcam.c
/freebsd-10-stable/sys/dev/aha/aha.c
/freebsd-10-stable/sys/dev/ahb/ahb.c
/freebsd-10-stable/sys/dev/ahci/ahci.c
/freebsd-10-stable/sys/dev/ahci/ahciem.c
/freebsd-10-stable/sys/dev/aic/aic.c
/freebsd-10-stable/sys/dev/aic7xxx/aic79xx_osm.c
/freebsd-10-stable/sys/dev/aic7xxx/aic7xxx_osm.c
/freebsd-10-stable/sys/dev/amr/amr_cam.c
/freebsd-10-stable/sys/dev/arcmsr/arcmsr.c
/freebsd-10-stable/sys/dev/ata/ata-all.c
/freebsd-10-stable/sys/dev/buslogic/bt.c
/freebsd-10-stable/sys/dev/ciss/ciss.c
/freebsd-10-stable/sys/dev/dpt/dpt_scsi.c
/freebsd-10-stable/sys/dev/esp/ncr53c9x.c
/freebsd-10-stable/sys/dev/firewire/sbp.c
/freebsd-10-stable/sys/dev/firewire/sbp_targ.c
/freebsd-10-stable/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
/freebsd-10-stable/sys/dev/hptiop/hptiop.c
/freebsd-10-stable/sys/dev/hptmv/entry.c
/freebsd-10-stable/sys/dev/hptnr/hptnr_osm_bsd.c
/freebsd-10-stable/sys/dev/hptrr/hptrr_osm_bsd.c
/freebsd-10-stable/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
/freebsd-10-stable/sys/dev/iir/iir.c
/freebsd-10-stable/sys/dev/isci/isci_controller.c
/freebsd-10-stable/sys/dev/iscsi_initiator/isc_cam.c
/freebsd-10-stable/sys/dev/isp/isp_freebsd.c
/freebsd-10-stable/sys/dev/mfi/mfi_cam.c
/freebsd-10-stable/sys/dev/mly/mly.c
/freebsd-10-stable/sys/dev/mpr/mpr_sas.c
/freebsd-10-stable/sys/dev/mps/mps_sas.c
/freebsd-10-stable/sys/dev/mpt/mpt_cam.c
/freebsd-10-stable/sys/dev/mrsas/mrsas_cam.c
mvs.c
/freebsd-10-stable/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
/freebsd-10-stable/sys/dev/ppbus/vpo.c
/freebsd-10-stable/sys/dev/siis/siis.c
/freebsd-10-stable/sys/dev/sym/sym_hipd.c
/freebsd-10-stable/sys/dev/trm/trm.c
/freebsd-10-stable/sys/dev/twa/tw_osl_cam.c
/freebsd-10-stable/sys/dev/tws/tws_cam.c
/freebsd-10-stable/sys/dev/virtio/scsi/virtio_scsi.c
/freebsd-10-stable/sys/powerpc/ps3/ps3cdrom.c
/freebsd-10-stable/sys/powerpc/pseries/phyp_vscsi.c
281140 06-Apr-2015 mav

MFC r280393: Reduce priority of ATA/SATA drivers.

Legacy ata(4) -> BUS_PROBE_LOW_PRIORITY; more functional ahci(4), siis(4),
mvs(4) -> BUS_PROBE_DEFAULT; BUS_PROBE_VENDOR leave for vendor drivers.

280276 20-Mar-2015 mav

MFC r279963: Fix SATA Gen3 speed constants.

275982 21-Dec-2014 smh

MFC r274819:
Prevent overflow issues in timeout processing

MFC r274852:
Fix build with asr driver

Sponsored by: Multiplay

266152 15-May-2014 ian

MFC r261410

Follow r261352 by updating all drivers which are children of simplebus
to check the status property in their probe routines.


/freebsd-10-stable/sys/arm/allwinner/a10_clk.c
/freebsd-10-stable/sys/arm/allwinner/a10_ehci.c
/freebsd-10-stable/sys/arm/allwinner/a10_gpio.c
/freebsd-10-stable/sys/arm/allwinner/a10_wdog.c
/freebsd-10-stable/sys/arm/allwinner/a20/a20_cpu_cfg.c
/freebsd-10-stable/sys/arm/allwinner/aintc.c
/freebsd-10-stable/sys/arm/arm/generic_timer.c
/freebsd-10-stable/sys/arm/arm/gic.c
/freebsd-10-stable/sys/arm/arm/mpcore_timer.c
/freebsd-10-stable/sys/arm/arm/pl190.c
/freebsd-10-stable/sys/arm/arm/pl310.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_bsc.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_dma.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_intr.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_spi.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_systimer.c
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_wdog.c
/freebsd-10-stable/sys/arm/freescale/imx/i2c.c
/freebsd-10-stable/sys/arm/freescale/imx/imx51_ccm.c
/freebsd-10-stable/sys/arm/freescale/imx/imx51_gpio.c
/freebsd-10-stable/sys/arm/freescale/imx/imx51_iomux.c
/freebsd-10-stable/sys/arm/freescale/imx/imx51_ipuv3.c
/freebsd-10-stable/sys/arm/freescale/imx/imx51_ipuv3_fbd.c
/freebsd-10-stable/sys/arm/freescale/imx/imx6_anatop.c
/freebsd-10-stable/sys/arm/freescale/imx/imx6_ccm.c
/freebsd-10-stable/sys/arm/freescale/imx/imx6_usbphy.c
/freebsd-10-stable/sys/arm/freescale/imx/imx_gpt.c
/freebsd-10-stable/sys/arm/freescale/imx/imx_nop_usbphy.c
/freebsd-10-stable/sys/arm/freescale/imx/imx_sdhci.c
/freebsd-10-stable/sys/arm/freescale/imx/imx_wdog.c
/freebsd-10-stable/sys/arm/freescale/imx/tzic.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_anadig.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_ccm.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_ehci.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_gpio.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_iomuxc.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_mscm.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_nfc.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_src.c
/freebsd-10-stable/sys/arm/lpc/if_lpe.c
/freebsd-10-stable/sys/arm/lpc/lpc_dmac.c
/freebsd-10-stable/sys/arm/lpc/lpc_fb.c
/freebsd-10-stable/sys/arm/lpc/lpc_gpio.c
/freebsd-10-stable/sys/arm/lpc/lpc_intc.c
/freebsd-10-stable/sys/arm/lpc/lpc_mmc.c
/freebsd-10-stable/sys/arm/lpc/lpc_ohci.c
/freebsd-10-stable/sys/arm/lpc/lpc_pwr.c
/freebsd-10-stable/sys/arm/lpc/lpc_rtc.c
/freebsd-10-stable/sys/arm/lpc/lpc_spi.c
/freebsd-10-stable/sys/arm/lpc/lpc_timer.c
/freebsd-10-stable/sys/arm/mv/gpio.c
/freebsd-10-stable/sys/arm/mv/ic.c
/freebsd-10-stable/sys/arm/mv/mpic.c
/freebsd-10-stable/sys/arm/mv/mv_sata.c
/freebsd-10-stable/sys/arm/mv/mv_ts.c
/freebsd-10-stable/sys/arm/mv/rtc.c
/freebsd-10-stable/sys/arm/mv/timer.c
/freebsd-10-stable/sys/arm/mv/twsi.c
/freebsd-10-stable/sys/arm/rockchip/rk30xx_gpio.c
/freebsd-10-stable/sys/arm/rockchip/rk30xx_grf.c
/freebsd-10-stable/sys/arm/rockchip/rk30xx_pmu.c
/freebsd-10-stable/sys/arm/rockchip/rk30xx_wdog.c
/freebsd-10-stable/sys/arm/samsung/exynos/arch_timer.c
/freebsd-10-stable/sys/arm/samsung/exynos/ehci_exynos5.c
/freebsd-10-stable/sys/arm/ti/aintc.c
/freebsd-10-stable/sys/arm/ti/am335x/am335x_dmtimer.c
/freebsd-10-stable/sys/arm/ti/am335x/am335x_lcd.c
/freebsd-10-stable/sys/arm/ti/am335x/am335x_prcm.c
/freebsd-10-stable/sys/arm/ti/am335x/am335x_pwm.c
/freebsd-10-stable/sys/arm/ti/am335x/am335x_usbss.c
/freebsd-10-stable/sys/arm/ti/cpsw/if_cpsw.c
/freebsd-10-stable/sys/arm/ti/omap4/omap4_prcm_clks.c
/freebsd-10-stable/sys/arm/ti/ti_edma3.c
/freebsd-10-stable/sys/arm/ti/ti_gpio.c
/freebsd-10-stable/sys/arm/ti/ti_i2c.c
/freebsd-10-stable/sys/arm/ti/ti_mbox.c
/freebsd-10-stable/sys/arm/ti/ti_mmchs.c
/freebsd-10-stable/sys/arm/ti/ti_pruss.c
/freebsd-10-stable/sys/arm/ti/ti_scm.c
/freebsd-10-stable/sys/arm/ti/ti_sdhci.c
/freebsd-10-stable/sys/arm/ti/ti_sdma.c
/freebsd-10-stable/sys/arm/ti/usb/omap_ehci.c
/freebsd-10-stable/sys/arm/versatile/if_smc_fdt.c
/freebsd-10-stable/sys/arm/versatile/pl050.c
/freebsd-10-stable/sys/arm/versatile/sp804.c
/freebsd-10-stable/sys/arm/versatile/versatile_clcd.c
/freebsd-10-stable/sys/arm/versatile/versatile_pci.c
/freebsd-10-stable/sys/arm/versatile/versatile_sic.c
/freebsd-10-stable/sys/arm/xilinx/zy7_devcfg.c
/freebsd-10-stable/sys/arm/xilinx/zy7_ehci.c
/freebsd-10-stable/sys/arm/xilinx/zy7_gpio.c
/freebsd-10-stable/sys/arm/xilinx/zy7_slcr.c
/freebsd-10-stable/sys/dev/altera/atse/if_atse_fdt.c
/freebsd-10-stable/sys/dev/altera/avgen/altera_avgen_fdt.c
/freebsd-10-stable/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c
/freebsd-10-stable/sys/dev/altera/sdcard/altera_sdcard_fdt.c
/freebsd-10-stable/sys/dev/ata/chipsets/ata-fsl.c
/freebsd-10-stable/sys/dev/cesa/cesa.c
/freebsd-10-stable/sys/dev/cfi/cfi_bus_fdt.c
/freebsd-10-stable/sys/dev/fdt/simplebus.c
/freebsd-10-stable/sys/dev/ffec/if_ffec.c
/freebsd-10-stable/sys/dev/mge/if_mge.c
mvs_soc.c
/freebsd-10-stable/sys/dev/quicc/quicc_bfe_fdt.c
/freebsd-10-stable/sys/dev/sdhci/sdhci_fdt.c
/freebsd-10-stable/sys/dev/sec/sec.c
/freebsd-10-stable/sys/dev/terasic/de4led/terasic_de4led_fdt.c
/freebsd-10-stable/sys/dev/terasic/mtl/terasic_mtl_fdt.c
/freebsd-10-stable/sys/dev/tsec/if_tsec_fdt.c
/freebsd-10-stable/sys/dev/uart/uart_bus_fdt.c
/freebsd-10-stable/sys/dev/usb/controller/dwc_otg_fdt.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_fsl.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_imx.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_mv.c
/freebsd-10-stable/sys/mips/beri/beri_pic.c
/freebsd-10-stable/sys/mips/beri/beri_simplebus.c
266046 14-May-2014 ian

MFC r257170, r257171, r257172, r257240, r257278, r257279, r257280, r257281,
r257282, r257332

Wait for DesignWare UART transfers completion before accessing line control

Enable UART busy detection handling for Armada XP - based board

Enable SATA interface on Armada XP
Run mvs SATA driver on Armada XP instead of old mv_sata

Retire arm_remap_nocache() and the data and constants associated with it.

Remove hard-coded mappings related to Armada XP support

Fix-up DTB for Armada XP registers' base according to the actual settings

Change Armada XP kernel load address to the u-boot's end address

Remove not working and deprecated PJ4Bv6 support

Switch off explicit broadcasting of the TLB flush operations for PJ4B CPU

Add missing ARMv6 CPU functions to ARM Makefile

261455 04-Feb-2014 eadler

MFC r258779,r258780,r258787,r258822:

Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit. Instead use (1U << 31) which gets the
expected result.

Similar to the (1 << 31) case it is not defined to do (2 << 30).

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.


/freebsd-10-stable/lib/libc/sparc64/fpu/fpu.c
/freebsd-10-stable/lib/libc/sparc64/fpu/fpu_sqrt.c
/freebsd-10-stable/lib/libc/xdr/xdr_rec.c
/freebsd-10-stable/sys/amd64/pci/pci_cfgreg.c
/freebsd-10-stable/sys/amd64/vmm/intel/vmcs.h
/freebsd-10-stable/sys/amd64/vmm/intel/vmx_controls.h
/freebsd-10-stable/sys/amd64/vmm/intel/vtd.c
/freebsd-10-stable/sys/arm/arm/cpufunc_asm_pj4b.S
/freebsd-10-stable/sys/arm/arm/db_trace.c
/freebsd-10-stable/sys/arm/arm/pl190.c
/freebsd-10-stable/sys/arm/at91/if_macbvar.h
/freebsd-10-stable/sys/arm/broadcom/bcm2835/bcm2835_dma.c
/freebsd-10-stable/sys/arm/econa/if_ece.c
/freebsd-10-stable/sys/arm/freescale/imx/imx6_anatopreg.h
/freebsd-10-stable/sys/arm/freescale/imx/imx6_usbphy.c
/freebsd-10-stable/sys/arm/freescale/imx/imx_gptreg.h
/freebsd-10-stable/sys/arm/include/armreg.h
/freebsd-10-stable/sys/arm/lpc/if_lpereg.h
/freebsd-10-stable/sys/arm/lpc/lpcreg.h
/freebsd-10-stable/sys/arm/mv/mv_pci.c
/freebsd-10-stable/sys/arm/samsung/exynos/ehci_exynos5.c
/freebsd-10-stable/sys/arm/xscale/i8134x/i81342reg.h
/freebsd-10-stable/sys/arm/xscale/ixp425/ixp425reg.h
/freebsd-10-stable/sys/boot/arm/at91/libat91/mci_device.h
/freebsd-10-stable/sys/boot/i386/libfirewire/fwohci.h
/freebsd-10-stable/sys/boot/i386/libfirewire/fwohcireg.h
/freebsd-10-stable/sys/dev/aac/aacvar.h
/freebsd-10-stable/sys/dev/acpica/acpi_video.c
/freebsd-10-stable/sys/dev/agp/agp_i810.c
/freebsd-10-stable/sys/dev/ahci/ahci.h
/freebsd-10-stable/sys/dev/bktr/bktr_core.c
/freebsd-10-stable/sys/dev/cesa/cesa.h
/freebsd-10-stable/sys/dev/drm/i915_reg.h
/freebsd-10-stable/sys/dev/drm/mach64_drv.h
/freebsd-10-stable/sys/dev/drm/mga_drv.h
/freebsd-10-stable/sys/dev/drm/r128_drv.h
/freebsd-10-stable/sys/dev/drm/r300_reg.h
/freebsd-10-stable/sys/dev/drm/r600_blit.c
/freebsd-10-stable/sys/dev/drm/radeon_cp.c
/freebsd-10-stable/sys/dev/drm/radeon_drv.h
/freebsd-10-stable/sys/dev/drm/via_irq.c
/freebsd-10-stable/sys/dev/drm2/i915/i915_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/evergreen_blit_kms.c
/freebsd-10-stable/sys/dev/drm2/radeon/evergreen_cs.c
/freebsd-10-stable/sys/dev/drm2/radeon/evergreend.h
/freebsd-10-stable/sys/dev/drm2/radeon/nid.h
/freebsd-10-stable/sys/dev/drm2/radeon/r200.c
/freebsd-10-stable/sys/dev/drm2/radeon/r300.c
/freebsd-10-stable/sys/dev/drm2/radeon/r300_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/r500_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/r600_blit.c
/freebsd-10-stable/sys/dev/drm2/radeon/r600_blit_kms.c
/freebsd-10-stable/sys/dev/drm2/radeon/r600_cs.c
/freebsd-10-stable/sys/dev/drm2/radeon/r600d.h
/freebsd-10-stable/sys/dev/drm2/radeon/radeon_cp.c
/freebsd-10-stable/sys/dev/drm2/radeon/radeon_drv.h
/freebsd-10-stable/sys/dev/drm2/radeon/radeon_reg.h
/freebsd-10-stable/sys/dev/drm2/radeon/rv770d.h
/freebsd-10-stable/sys/dev/drm2/radeon/sid.h
/freebsd-10-stable/sys/dev/drm2/ttm/ttm_bo.c
/freebsd-10-stable/sys/dev/e1000/e1000_82575.h
/freebsd-10-stable/sys/dev/e1000/e1000_ich8lan.c
/freebsd-10-stable/sys/dev/e1000/e1000_regs.h
/freebsd-10-stable/sys/dev/etherswitch/arswitch/arswitchreg.h
/freebsd-10-stable/sys/dev/ffec/if_ffecreg.h
/freebsd-10-stable/sys/dev/firewire/firewire.c
/freebsd-10-stable/sys/dev/firewire/fwohci.c
/freebsd-10-stable/sys/dev/firewire/fwohcireg.h
/freebsd-10-stable/sys/dev/firewire/sbp.c
/freebsd-10-stable/sys/dev/firewire/sbp.h
/freebsd-10-stable/sys/dev/firewire/sbp_targ.c
/freebsd-10-stable/sys/dev/hatm/if_hatmreg.h
/freebsd-10-stable/sys/dev/hwpmc/hwpmc_piv.h
/freebsd-10-stable/sys/dev/iwn/if_iwnreg.h
/freebsd-10-stable/sys/dev/mge/if_mgevar.h
/freebsd-10-stable/sys/dev/mpt/mpt_cam.c
/freebsd-10-stable/sys/dev/msk/if_mskreg.h
mvs.h
/freebsd-10-stable/sys/dev/mxge/mxge_mcp.h
/freebsd-10-stable/sys/dev/qlxge/qls_dump.c
/freebsd-10-stable/sys/dev/ral/rt2560reg.h
/freebsd-10-stable/sys/dev/ral/rt2661reg.h
/freebsd-10-stable/sys/dev/ral/rt2860reg.h
/freebsd-10-stable/sys/dev/sound/pci/hda/hdaa.h
/freebsd-10-stable/sys/dev/usb/controller/ehci.h
/freebsd-10-stable/sys/dev/usb/wlan/if_rumreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_runreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_uralreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_urtwreg.h
/freebsd-10-stable/sys/dev/usb/wlan/if_zydreg.h
/freebsd-10-stable/sys/dev/wpi/if_wpireg.h
/freebsd-10-stable/sys/geom/raid/tr_raid1e.c
/freebsd-10-stable/sys/i386/pci/pci_cfgreg.c
/freebsd-10-stable/sys/mips/atheros/ar71xxreg.h
/freebsd-10-stable/sys/mips/atheros/ar934xreg.h
/freebsd-10-stable/sys/mips/atheros/if_argevar.h
/freebsd-10-stable/sys/mips/malta/gt_pci.c
/freebsd-10-stable/sys/mips/nlm/dev/net/nae.c
/freebsd-10-stable/sys/mips/nlm/xlp_machdep.c
/freebsd-10-stable/sys/mips/rmi/pic.h
/freebsd-10-stable/sys/ofed/drivers/infiniband/hw/mlx4/qp.c
/freebsd-10-stable/sys/ofed/drivers/infiniband/hw/mthca/mthca_mcg.c
/freebsd-10-stable/sys/ofed/drivers/infiniband/hw/mthca/mthca_qp.c
/freebsd-10-stable/sys/ofed/drivers/net/mlx4/mcg.c
/freebsd-10-stable/sys/powerpc/fpu/fpu_emu.c
/freebsd-10-stable/sys/powerpc/fpu/fpu_sqrt.c
/freebsd-10-stable/sys/powerpc/powermac/nvbl.c
/freebsd-10-stable/sys/sys/consio.h
/freebsd-10-stable/sys/x86/iommu/intel_reg.h
/freebsd-10-stable/usr.sbin/bluetooth/bthidd/kbd.c
260387 07-Jan-2014 scottl

MFC Alexander Motin's direct dispatch, multi-queue, and finer-grained
locking support for CAM

r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs. Not all CCB flags there belong to them.

r256836:
Remove hard limit on number of BIOs handled with one ATA TRIM request.

r256843:
Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

r256888:
Unconditionally acquire periph reference on CCB allocation failure.

r256895:
Fix memory and references leak due to unfreed path.

r256960:
Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
This fixes race condition with cam_periph_ccbwait(), causing use-after-free.

r256975:
Minor (mostly cosmetical) addition to r256960.

r257054:
Some microoptimizations for da and ada drivers:
- Replace ordered_tag_count counter with single flag;
- From da remove outstanding_cmds counter, duplicating pending_ccbs list;
- From da_softc remove unused links field.

r257482:
Fix lock recursion, triggered by `smartctl -a /dev/adaX`.

r257501:
Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment. getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.

r257914:
Some CAM locks polishing:
- Fix LOR and possible lock recursion when handling high-power commands.
Introduce new lock to protect left power quota and list of frozen devices.
- Correct locking around xpt periph creation.
- Remove seems never used XPT_FLAG_OPEN xpt periph flag.

Again, Netflix assisted with testing the merge, but all of the credit goes
to Alexander and iX Systems.

Submitted by: mav
Sponsored by: iX Systems


/freebsd-10-stable/sys/cam/ata/ata_da.c
/freebsd-10-stable/sys/cam/ata/ata_pmp.c
/freebsd-10-stable/sys/cam/ata/ata_xpt.c
/freebsd-10-stable/sys/cam/cam_ccb.h
/freebsd-10-stable/sys/cam/cam_periph.c
/freebsd-10-stable/sys/cam/cam_periph.h
/freebsd-10-stable/sys/cam/cam_queue.c
/freebsd-10-stable/sys/cam/cam_queue.h
/freebsd-10-stable/sys/cam/cam_sim.c
/freebsd-10-stable/sys/cam/cam_sim.h
/freebsd-10-stable/sys/cam/cam_xpt.c
/freebsd-10-stable/sys/cam/cam_xpt.h
/freebsd-10-stable/sys/cam/cam_xpt_internal.h
/freebsd-10-stable/sys/cam/cam_xpt_sim.h
/freebsd-10-stable/sys/cam/ctl/ctl_frontend_cam_sim.c
/freebsd-10-stable/sys/cam/ctl/scsi_ctl.c
/freebsd-10-stable/sys/cam/scsi/scsi_cd.c
/freebsd-10-stable/sys/cam/scsi/scsi_ch.c
/freebsd-10-stable/sys/cam/scsi/scsi_da.c
/freebsd-10-stable/sys/cam/scsi/scsi_enc.c
/freebsd-10-stable/sys/cam/scsi/scsi_enc_internal.h
/freebsd-10-stable/sys/cam/scsi/scsi_enc_safte.c
/freebsd-10-stable/sys/cam/scsi/scsi_enc_ses.c
/freebsd-10-stable/sys/cam/scsi/scsi_pass.c
/freebsd-10-stable/sys/cam/scsi/scsi_pt.c
/freebsd-10-stable/sys/cam/scsi/scsi_sa.c
/freebsd-10-stable/sys/cam/scsi/scsi_sg.c
/freebsd-10-stable/sys/cam/scsi/scsi_targ_bh.c
/freebsd-10-stable/sys/cam/scsi/scsi_target.c
/freebsd-10-stable/sys/cam/scsi/scsi_xpt.c
/freebsd-10-stable/sys/dev/ahci/ahci.c
/freebsd-10-stable/sys/dev/ahci/ahci.h
/freebsd-10-stable/sys/dev/ata/ata-all.c
/freebsd-10-stable/sys/dev/isp/isp_freebsd.c
mvs.c
/freebsd-10-stable/sys/dev/siis/siis.c
/freebsd-10-stable/sys/kern/kern_environment.c
256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


251661 12-Jun-2013 mav

Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt). All other ATA PIO commands transfer one sector or 512 bytes
at one time. Hardcode these exceptions in mvs(4) with ATA_CAM option.
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.


249622 18-Apr-2013 mav

Make siis(4) and mvs(4) send bus_get_dma_tag() requests to parent buses
passing real bus' child pointers instead of grandchilds.

Requested by: kib


246713 12-Feb-2013 kib

Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c. It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code. The MD busdma is then given a chance to do any final processing
in the complete() callback.

The cam changes unify the bus_dmamap_load* handling in cam drivers.

The arm and mips implementations are updated to track virtual
addresses for sync(). Previously this was done in a type specific
way. Now it is done in a generic way by recording the list of
virtuals in the map.

Submitted by: jeff (sponsored by EMC/Isilon)
Reviewed by: kan (previous version), scottl,
mjacob (isp(4), no objections for target mode changes)
Discussed with: ian (arm changes)
Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris),
amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)


238873 28-Jul-2012 hrs

Add support for Marvell 88F6282.

Sponsored by: Plat'Home, Co.,Ltd.


236952 12-Jun-2012 mav

- Limit r214102 workaround to only x86. On arm it causes more problems
then solves because of cache coherency issues. This fixes periodic error
messages on console and command timeouts.
- Patch SATA PHY configuration for 65nm SoCs to improve SNR same as
Linux does.

MFC after: 2 weeks


236847 10-Jun-2012 mav

Partially revert r236666:
Return PROTO_ATA protocol in response to XPT_PATH_INQ.

smartmontools uses it to identify ATA devices and I don't know any other
place now where it is important. It could probably use XPT_GDEV_TYPE
instead for more accurate protocol information, but let it live for now.

Reported by: matthew
MFC after: 3 days


236666 06-Jun-2012 mav

ATA/SATA controllers have no idea about protocol of the connected device
until transport will do some probe actions (at least soft reset).
Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol.
Make ATA/SATA transport to fill that gap by reporting protocol to SIM with
XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed.


235333 12-May-2012 mav

Add two functions xpt_batch_start() and xpt_batch_done() to the CAM SIM KPI
to allow drivers to handle request completion directly without passing
them to the CAM SWI thread removing extra context switch.
Modify all ATA/SATA drivers to use them.

Reviewed by: gibbs, ken
MFC after: 2 weeks


230865 01-Feb-2012 raj

Adjust mvs(4) to handle interrupt cause reg depending on the actual number of
channels available

- current code treats bits 4:7 in 'SATAHC interrupt mask' and 'SATAHC
interrupt cause' as flags for SATA channels 2 and 3

- for embedded SATA controllers (SoC) these bits have been marked as reserved
in datasheets so far, but for some new and upcoming chips they are used for
purposes other than SATA

Submitted by: Lukasz Plachno
Reviewed by: mav
Obtained from: Semihalf
MFC after: 2 weeks


227849 22-Nov-2011 hselasky

Rename device_delete_all_children() into device_delete_children().

Suggested by: jhb @ and marius @
MFC after: 1 week


227701 19-Nov-2011 hselasky

Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Identify a few other places where
it makes sense to use device_delete_all_children().

MFC after: 1 week


227293 07-Nov-2011 ed

Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.

This means that their use is restricted to a single C file.


222285 25-May-2011 mav

According to SATA specification, when Serial ATA Enclosure Management Bridge
(SEMB) is unable to communicate to Storage Enclosure Processor (SEP), in
response to hard and soft resets it should among other things return value
0x7F in Status register. The weird side is that it means DRQ bit set, which
tells that reset request is not completed. It would be fine if SEMB was the
only device on port. But if SEMB connected to PMP or built into it, it may
block access to other devices sharing same SATA port.

Make some tunings/fixes to soft-reset handling to workaround the issue:
- ahci(4): request CLO on the port after soft reset to ignore DRQ bit;
- siis(4): gracefully reinitialize port after soft reset timeout (hardware
doesn't detect reset request completion in this case);
- mvs(4): if PMP is used, send dummy soft-reset to the PMP port to make it
clear DRQ bit for us.

For now this makes quirks in ata_pmp.c, hiding SEMB ports of SiI3726/SiI4726
PMPs, less important. Further, if hardware permit, I hope to implement real
SEMB support.


220830 19-Apr-2011 mav

Fix some English grammar.


220829 19-Apr-2011 mav

According to specification. device should respond to COMRESET with COMINIT
in no more then 10ms. If we detected no device presence within that time,
there is no reason to wait longer.


220822 19-Apr-2011 mav

Properly handle memory allocation errors during error recovery.


220615 14-Apr-2011 mav

Refactor hard-reset implementation in mvs(4).

Instead of spinning in a tight loop for up to 15 seconds, polling for device
readiness while it spins up, return reset completion just after PHY reports
"connect well" or 100ms connection timeout. If device was found, use callout
for checking device readiness with 100ms period up to full 31 second timeout.

This fixes system freeze for 5-10 seconds on drives hot plug-in.


220602 13-Apr-2011 mav

Improve SATA Asynchronous Notification feature support in CAM:
- make SATA SIMs announce capabilities to handle SDB with Notification bit;
- make PMP driver honor this SIMs capability;
- make SATA XPT to negotiate and enable this feature for ATAPI devices.

This feature allows supporting SATA ATAPI devices to inform system about
some events happened, that may require attention. In my case this allows
LG GH22LS50 SATA DVR-RW drive to report tray open/close events. Events
reported to CAM in form of AC_SCSI_AEN async. Further they could be used
as a hints for checking device status and reporting media change to upper
layers, for example, via spoiling mechanism of GEOM.


220569 12-Apr-2011 mav

Implement automatic SCSI sense fetching for mvs(4).

Make few improvements/changes to ATAPI PIO support to pass most of scgcheck
(cdrtools) tests.


220097 28-Mar-2011 mav

Update mvs(4) driver to work over FDT's simplebus(4) bus.


214102 20-Oct-2010 mav

Workaround strange situation when EDMA_RESQIP register returns zero instead
of proper value. It caused bunch of "EMPTY CRPB" messages and potentially
may cause premature requests completion, which could cause data corruption.
For most cases it seems enough to just reread register to get proper value.
To protect against worse cases - erase processed queue entries with
impossible values and ignore them if problem still happen.


214099 20-Oct-2010 mav

Some style cleanup:
- remove commented debugging code;
- wrap long lines.


212732 16-Sep-2010 mav

Fix panic, when due to some kind of congestion on FIS-based switching
port multiplier some command triggers false positive timeout, but then
completes normally.

MFC after: 2 weeks


210471 25-Jul-2010 mav

Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers to
GEOM. This information needed for proper soft-RAID's on-disk metadata
reading and writing.


208818 05-Jun-2010 mav

Plug memory leak to silent Coverity. Error is still not really handled.

Found with: Coverity Prevent(tm)
CID: 4137


208414 22-May-2010 mav

Fill rman range start/end values. It makes devinfo output more readable.


208410 22-May-2010 mav

Report ATA/SATA channel number to NewBus at location string.


208393 21-May-2010 mav

Improve suspend/resume support. Make sure controller is idle on suspend
and reset it on resume.


207696 06-May-2010 mav

Fix polled operation. Now it is possible to dump kernel via mvs(4).


207536 02-May-2010 mav

Import mvs(4) - Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA controllers
driver for CAM ATA subsystem. This driver supports same hardware as
atamarvell, ataadaptec and atamvsata drivers from ata(4), but provides
many additional features, such as NCQ, PMP, etc.