Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

This commit is contained in:
David S. Miller 2014-09-24 16:48:32 -04:00
commit 4daaab4f0c
98 changed files with 667 additions and 447 deletions

View File

@ -2545,6 +2545,30 @@ fields changed from _s32 to _u32.
</orderedlist> </orderedlist>
</section> </section>
<section>
<title>V4L2 in Linux 3.16</title>
<orderedlist>
<listitem>
<para>Added event V4L2_EVENT_SOURCE_CHANGE.
</para>
</listitem>
</orderedlist>
</section>
<section>
<title>V4L2 in Linux 3.17</title>
<orderedlist>
<listitem>
<para>Extended &v4l2-pix-format;. Added format flags.
</para>
</listitem>
<listitem>
<para>Added compound control types and &VIDIOC-QUERY-EXT-CTRL;.
</para>
</listitem>
</orderedlist>
</section>
<section id="other"> <section id="other">
<title>Relation of V4L2 to other Linux multimedia APIs</title> <title>Relation of V4L2 to other Linux multimedia APIs</title>

View File

@ -29,9 +29,12 @@ can suspend execution until the driver has captured data or is ready
to accept data for output.</para> to accept data for output.</para>
<para>When streaming I/O has been negotiated this function waits <para>When streaming I/O has been negotiated this function waits
until a buffer has been filled or displayed and can be dequeued with until a buffer has been filled by the capture device and can be dequeued
the &VIDIOC-DQBUF; ioctl. When buffers are already in the outgoing with the &VIDIOC-DQBUF; ioctl. For output devices this function waits
queue of the driver the function returns immediately.</para> until the device is ready to accept a new buffer to be queued up with
the &VIDIOC-QBUF; ioctl for display. When buffers are already in the outgoing
queue of the driver (capture) or the incoming queue isn't full (display)
the function returns immediately.</para>
<para>On success <function>poll()</function> returns the number of <para>On success <function>poll()</function> returns the number of
file descriptors that have been selected (that is, file descriptors file descriptors that have been selected (that is, file descriptors
@ -44,10 +47,22 @@ Capture devices set the <constant>POLLIN</constant> and
flags. When the function timed out it returns a value of zero, on flags. When the function timed out it returns a value of zero, on
failure it returns <returnvalue>-1</returnvalue> and the failure it returns <returnvalue>-1</returnvalue> and the
<varname>errno</varname> variable is set appropriately. When the <varname>errno</varname> variable is set appropriately. When the
application did not call &VIDIOC-QBUF; or &VIDIOC-STREAMON; yet the application did not call &VIDIOC-STREAMON; the
<function>poll()</function> function succeeds, but sets the <function>poll()</function> function succeeds, but sets the
<constant>POLLERR</constant> flag in the <constant>POLLERR</constant> flag in the
<structfield>revents</structfield> field.</para> <structfield>revents</structfield> field. When the
application has called &VIDIOC-STREAMON; for a capture device but hasn't
yet called &VIDIOC-QBUF;, the <function>poll()</function> function
succeeds and sets the <constant>POLLERR</constant> flag in the
<structfield>revents</structfield> field. For output devices this
same situation will cause <function>poll()</function> to succeed
as well, but it sets the <constant>POLLOUT</constant> and
<constant>POLLWRNORM</constant> flags in the <structfield>revents</structfield>
field.</para>
<para>If an event occurred (see &VIDIOC-DQEVENT;) then
<constant>POLLPRI</constant> will be set in the <structfield>revents</structfield>
field and <function>poll()</function> will return.</para>
<para>When use of the <function>read()</function> function has <para>When use of the <function>read()</function> function has
been negotiated and the driver does not capture yet, the been negotiated and the driver does not capture yet, the
@ -58,10 +73,18 @@ continuously (as opposed to, for example, still images) the function
may return immediately.</para> may return immediately.</para>
<para>When use of the <function>write()</function> function has <para>When use of the <function>write()</function> function has
been negotiated the <function>poll</function> function just waits been negotiated and the driver does not stream yet, the
<function>poll</function> function starts streaming. When that fails
it returns a <constant>POLLERR</constant> as above. Otherwise it waits
until the driver is ready for a non-blocking until the driver is ready for a non-blocking
<function>write()</function> call.</para> <function>write()</function> call.</para>
<para>If the caller is only interested in events (just
<constant>POLLPRI</constant> is set in the <structfield>events</structfield>
field), then <function>poll()</function> will <emphasis>not</emphasis>
start streaming if the driver does not stream yet. This makes it
possible to just poll for events and not for buffers.</para>
<para>All drivers implementing the <function>read()</function> or <para>All drivers implementing the <function>read()</function> or
<function>write()</function> function or streaming I/O must also <function>write()</function> function or streaming I/O must also
support the <function>poll()</function> function.</para> support the <function>poll()</function> function.</para>

View File

@ -152,10 +152,11 @@ structs, ioctls) must be noted in more detail in the history chapter
applications. --> applications. -->
<revision> <revision>
<revnumber>3.16</revnumber> <revnumber>3.17</revnumber>
<date>2014-05-27</date> <date>2014-08-04</date>
<authorinitials>lp</authorinitials> <authorinitials>lp, hv</authorinitials>
<revremark>Extended &v4l2-pix-format;. Added format flags. <revremark>Extended &v4l2-pix-format;. Added format flags. Added compound control types
and VIDIOC_QUERY_EXT_CTRL.
</revremark> </revremark>
</revision> </revision>
@ -538,7 +539,7 @@ and discussions on the V4L mailing list.</revremark>
</partinfo> </partinfo>
<title>Video for Linux Two API Specification</title> <title>Video for Linux Two API Specification</title>
<subtitle>Revision 3.14</subtitle> <subtitle>Revision 3.17</subtitle>
<chapter id="common"> <chapter id="common">
&sub-common; &sub-common;

View File

@ -119,7 +119,7 @@
</row> </row>
<row> <row>
<entry>&v4l2-rect;</entry> <entry>&v4l2-rect;</entry>
<entry><structfield>rect</structfield></entry> <entry><structfield>r</structfield></entry>
<entry>Selection rectangle, in pixels.</entry> <entry>Selection rectangle, in pixels.</entry>
</row> </row>
<row> <row>

View File

@ -1,4 +1,3 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_LOG_BUF_SHIFT=16 CONFIG_LOG_BUF_SHIFT=16
@ -6,6 +5,8 @@ CONFIG_PROFILING=y
CONFIG_OPROFILE=y CONFIG_OPROFILE=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_UNLOAD=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_IA64_DIG=y CONFIG_IA64_DIG=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_NR_CPUS=2 CONFIG_NR_CPUS=2
@ -51,9 +52,6 @@ CONFIG_DM_MIRROR=m
CONFIG_DM_ZERO=m CONFIG_DM_ZERO=m
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_DUMMY=y CONFIG_DUMMY=y
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_NET_PCI=y
CONFIG_INPUT_EVDEV=y CONFIG_INPUT_EVDEV=y
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
@ -85,7 +83,6 @@ CONFIG_EXT3_FS=y
CONFIG_XFS_FS=y CONFIG_XFS_FS=y
CONFIG_XFS_QUOTA=y CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y CONFIG_XFS_POSIX_ACL=y
CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m CONFIG_AUTOFS4_FS=m
CONFIG_ISO9660_FS=m CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y CONFIG_JOLIET=y
@ -95,17 +92,13 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=m CONFIG_NFS_FS=m
CONFIG_NFS_V3=y CONFIG_NFS_V4=m
CONFIG_NFS_V4=y
CONFIG_NFSD=m CONFIG_NFSD=m
CONFIG_NFSD_V4=y CONFIG_NFSD_V4=y
CONFIG_CIFS=m CONFIG_CIFS=m
CONFIG_CIFS_STATS=y CONFIG_CIFS_STATS=y
CONFIG_CIFS_XATTR=y CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y CONFIG_CIFS_POSIX=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_UTF8=m CONFIG_NLS_UTF8=m

View File

@ -1,4 +1,3 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
@ -6,13 +5,13 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=20 CONFIG_LOG_BUF_SHIFT=20
CONFIG_CGROUPS=y CONFIG_CGROUPS=y
CONFIG_CPUSETS=y CONFIG_CPUSETS=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ALL=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
# CONFIG_BLK_DEV_BSG is not set CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_MCKINLEY=y CONFIG_MCKINLEY=y
CONFIG_IA64_PAGE_SIZE_64KB=y CONFIG_IA64_PAGE_SIZE_64KB=y
CONFIG_IA64_CYCLONE=y CONFIG_IA64_CYCLONE=y
@ -29,14 +28,13 @@ CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=y CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=m CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_INET=y CONFIG_INET=y
CONFIG_IP_MULTICAST=y CONFIG_IP_MULTICAST=y
CONFIG_ARPD=y
CONFIG_SYN_COOKIES=y CONFIG_SYN_COOKIES=y
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@ -82,16 +80,13 @@ CONFIG_FUSION_FC=m
CONFIG_FUSION_SAS=y CONFIG_FUSION_SAS=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_DUMMY=m CONFIG_DUMMY=m
CONFIG_NET_ETHERNET=y CONFIG_NETCONSOLE=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y CONFIG_NET_TULIP=y
CONFIG_TULIP=m CONFIG_TULIP=m
CONFIG_NET_PCI=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=m CONFIG_E100=m
CONFIG_E1000=y CONFIG_E1000=y
CONFIG_IGB=y CONFIG_IGB=y
CONFIG_TIGON3=y
CONFIG_NETCONSOLE=y
# CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_SERPORT is not set
CONFIG_GAMEPORT=m CONFIG_GAMEPORT=m
CONFIG_SERIAL_NONSTANDARD=y CONFIG_SERIAL_NONSTANDARD=y
@ -151,6 +146,7 @@ CONFIG_USB_STORAGE=m
CONFIG_INFINIBAND=m CONFIG_INFINIBAND=m
CONFIG_INFINIBAND_MTHCA=m CONFIG_INFINIBAND_MTHCA=m
CONFIG_INFINIBAND_IPOIB=m CONFIG_INFINIBAND_IPOIB=m
CONFIG_INTEL_IOMMU=y
CONFIG_MSPEC=m CONFIG_MSPEC=m
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_XATTR=y
@ -164,7 +160,6 @@ CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_SECURITY=y CONFIG_REISERFS_FS_SECURITY=y
CONFIG_XFS_FS=y CONFIG_XFS_FS=y
CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m CONFIG_AUTOFS4_FS=m
CONFIG_ISO9660_FS=m CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y CONFIG_JOLIET=y
@ -175,16 +170,10 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=m CONFIG_NFS_FS=m
CONFIG_NFS_V3=y CONFIG_NFS_V4=m
CONFIG_NFS_V4=y
CONFIG_NFSD=m CONFIG_NFSD=m
CONFIG_NFSD_V4=y CONFIG_NFSD_V4=y
CONFIG_SMB_FS=m
CONFIG_SMB_NLS_DEFAULT=y
CONFIG_CIFS=m CONFIG_CIFS=m
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_775=m
@ -225,11 +214,7 @@ CONFIG_NLS_UTF8=m
CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MUTEXES=y CONFIG_DEBUG_MUTEXES=y
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_PCBC=m CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set # CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRC_T10DIF=y CONFIG_CRC_T10DIF=y
CONFIG_INTEL_IOMMU=y

View File

@ -1,4 +1,3 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
@ -9,6 +8,8 @@ CONFIG_KALLSYMS_ALL=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_MCKINLEY=y CONFIG_MCKINLEY=y
CONFIG_IA64_CYCLONE=y CONFIG_IA64_CYCLONE=y
CONFIG_SMP=y CONFIG_SMP=y
@ -24,14 +25,12 @@ CONFIG_BINFMT_MISC=m
CONFIG_ACPI_BUTTON=m CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=m
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_INET=y CONFIG_INET=y
CONFIG_IP_MULTICAST=y CONFIG_IP_MULTICAST=y
CONFIG_ARPD=y
CONFIG_SYN_COOKIES=y CONFIG_SYN_COOKIES=y
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_LOOP=m
@ -71,15 +70,12 @@ CONFIG_FUSION_SPI=y
CONFIG_FUSION_FC=m CONFIG_FUSION_FC=m
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_DUMMY=m CONFIG_DUMMY=m
CONFIG_NET_ETHERNET=y CONFIG_NETCONSOLE=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y CONFIG_NET_TULIP=y
CONFIG_TULIP=m CONFIG_TULIP=m
CONFIG_NET_PCI=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=m CONFIG_E100=m
CONFIG_E1000=y CONFIG_E1000=y
CONFIG_TIGON3=y
CONFIG_NETCONSOLE=y
# CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_SERPORT is not set
CONFIG_GAMEPORT=m CONFIG_GAMEPORT=m
CONFIG_SERIAL_NONSTANDARD=y CONFIG_SERIAL_NONSTANDARD=y
@ -146,7 +142,6 @@ CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_SECURITY=y CONFIG_REISERFS_FS_SECURITY=y
CONFIG_XFS_FS=y CONFIG_XFS_FS=y
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y CONFIG_AUTOFS4_FS=y
CONFIG_ISO9660_FS=m CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y CONFIG_JOLIET=y
@ -157,16 +152,10 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=m CONFIG_NFS_FS=m
CONFIG_NFS_V3=y CONFIG_NFS_V4=m
CONFIG_NFS_V4=y
CONFIG_NFSD=m CONFIG_NFSD=m
CONFIG_NFSD_V4=y CONFIG_NFSD_V4=y
CONFIG_SMB_FS=m
CONFIG_SMB_NLS_DEFAULT=y
CONFIG_CIFS=m CONFIG_CIFS=m
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_775=m

View File

@ -1,13 +1,12 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16 CONFIG_LOG_BUF_SHIFT=16
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_IA64_HP_SIM=y CONFIG_IA64_HP_SIM=y
CONFIG_MCKINLEY=y CONFIG_MCKINLEY=y
CONFIG_IA64_PAGE_SIZE_64KB=y CONFIG_IA64_PAGE_SIZE_64KB=y
@ -27,7 +26,6 @@ CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM=y
CONFIG_SCSI=y CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_SPI_ATTRS=y
@ -49,8 +47,6 @@ CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFSD=y CONFIG_NFSD=y
CONFIG_NFSD_V3=y CONFIG_NFSD_V3=y
CONFIG_PARTITION_ADVANCED=y CONFIG_DEBUG_INFO=y
CONFIG_EFI_PARTITION=y
CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MUTEXES=y CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_INFO=y

View File

@ -1,4 +1,3 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
@ -11,6 +10,8 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set # CONFIG_BLK_DEV_BSG is not set
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_IA64_DIG=y CONFIG_IA64_DIG=y
CONFIG_MCKINLEY=y CONFIG_MCKINLEY=y
CONFIG_IA64_PAGE_SIZE_64KB=y CONFIG_IA64_PAGE_SIZE_64KB=y
@ -29,14 +30,12 @@ CONFIG_BINFMT_MISC=m
CONFIG_ACPI_BUTTON=m CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=m
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_INET=y CONFIG_INET=y
CONFIG_IP_MULTICAST=y CONFIG_IP_MULTICAST=y
CONFIG_ARPD=y
CONFIG_SYN_COOKIES=y CONFIG_SYN_COOKIES=y
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_LOOP=m
@ -53,6 +52,7 @@ CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=m CONFIG_CHR_DEV_ST=m
CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR=m
CONFIG_CHR_DEV_SG=m CONFIG_CHR_DEV_SG=m
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_2=y
CONFIG_SCSI_QLOGIC_1280=y CONFIG_SCSI_QLOGIC_1280=y
CONFIG_MD=y CONFIG_MD=y
@ -72,15 +72,12 @@ CONFIG_FUSION_FC=y
CONFIG_FUSION_CTL=y CONFIG_FUSION_CTL=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_DUMMY=m CONFIG_DUMMY=m
CONFIG_NET_ETHERNET=y CONFIG_NETCONSOLE=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y CONFIG_NET_TULIP=y
CONFIG_TULIP=m CONFIG_TULIP=m
CONFIG_NET_PCI=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=m CONFIG_E100=m
CONFIG_E1000=y CONFIG_E1000=y
CONFIG_TIGON3=y
CONFIG_NETCONSOLE=y
# CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_SERPORT is not set
CONFIG_GAMEPORT=m CONFIG_GAMEPORT=m
CONFIG_SERIAL_NONSTANDARD=y CONFIG_SERIAL_NONSTANDARD=y
@ -118,7 +115,6 @@ CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_SECURITY=y CONFIG_REISERFS_FS_SECURITY=y
CONFIG_XFS_FS=y CONFIG_XFS_FS=y
CONFIG_AUTOFS_FS=y
CONFIG_AUTOFS4_FS=y CONFIG_AUTOFS4_FS=y
CONFIG_ISO9660_FS=m CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y CONFIG_JOLIET=y
@ -129,16 +125,10 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=m CONFIG_NFS_FS=m
CONFIG_NFS_V3=y CONFIG_NFS_V4=m
CONFIG_NFS_V4=y
CONFIG_NFSD=m CONFIG_NFSD=m
CONFIG_NFSD_V4=y CONFIG_NFSD_V4=y
CONFIG_SMB_FS=m
CONFIG_SMB_NLS_DEFAULT=y
CONFIG_CIFS=m CONFIG_CIFS=m
CONFIG_PARTITION_ADVANCED=y
CONFIG_SGI_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_775=m
@ -180,6 +170,5 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MUTEXES=y CONFIG_DEBUG_MUTEXES=y
CONFIG_IA64_GRANULE_16MB=y CONFIG_IA64_GRANULE_16MB=y
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_PCBC=m CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_MD5=y

View File

@ -1,9 +1,9 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_KPROBES=y CONFIG_KPROBES=y
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_IA64_HP_ZX1=y CONFIG_IA64_HP_ZX1=y
CONFIG_MCKINLEY=y CONFIG_MCKINLEY=y
CONFIG_SMP=y CONFIG_SMP=y
@ -18,6 +18,7 @@ CONFIG_EFI_VARS=y
CONFIG_BINFMT_MISC=y CONFIG_BINFMT_MISC=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_INET=y CONFIG_INET=y
@ -37,9 +38,9 @@ CONFIG_CHR_DEV_OSST=y
CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=y CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_FC_ATTRS=y
CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_2=y
CONFIG_SCSI_QLOGIC_1280=y CONFIG_SCSI_QLOGIC_1280=y
CONFIG_FUSION=y CONFIG_FUSION=y
@ -48,18 +49,15 @@ CONFIG_FUSION_FC=y
CONFIG_FUSION_CTL=m CONFIG_FUSION_CTL=m
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_DUMMY=y CONFIG_DUMMY=y
CONFIG_NET_ETHERNET=y CONFIG_TIGON3=y
CONFIG_NET_TULIP=y CONFIG_NET_TULIP=y
CONFIG_TULIP=y CONFIG_TULIP=y
CONFIG_TULIP_MWI=y CONFIG_TULIP_MWI=y
CONFIG_TULIP_MMIO=y CONFIG_TULIP_MMIO=y
CONFIG_TULIP_NAPI=y CONFIG_TULIP_NAPI=y
CONFIG_TULIP_NAPI_HW_MITIGATION=y CONFIG_TULIP_NAPI_HW_MITIGATION=y
CONFIG_NET_PCI=y
CONFIG_NET_VENDOR_INTEL=y
CONFIG_E100=y CONFIG_E100=y
CONFIG_E1000=y CONFIG_E1000=y
CONFIG_TIGON3=y
CONFIG_INPUT_JOYDEV=y CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_KEYBOARD is not set # CONFIG_INPUT_KEYBOARD is not set
@ -100,7 +98,6 @@ CONFIG_USB_STORAGE=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT3_FS=y CONFIG_EXT3_FS=y
CONFIG_AUTOFS_FS=y
CONFIG_ISO9660_FS=y CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y CONFIG_JOLIET=y
CONFIG_UDF_FS=y CONFIG_UDF_FS=y
@ -110,12 +107,9 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y CONFIG_HUGETLBFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V4=y CONFIG_NFS_V4=y
CONFIG_NFSD=y CONFIG_NFSD=y
CONFIG_NFSD_V3=y CONFIG_NFSD_V3=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_EFI_PARTITION=y
CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y CONFIG_NLS_CODEPAGE_775=y

View File

@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set # CONFIG_BLK_DEV_BSG is not set
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_INET=y CONFIG_INET=y

View File

@ -28,6 +28,7 @@ CONFIG_MIPS32_COMPAT=y
CONFIG_MIPS32_O32=y CONFIG_MIPS32_O32=y
CONFIG_MIPS32_N32=y CONFIG_MIPS32_N32=y
CONFIG_PM=y CONFIG_PM=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -18,6 +18,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_PM=y CONFIG_PM=y
CONFIG_NET=y
CONFIG_PACKET=m CONFIG_PACKET=m
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_NET_KEY=m CONFIG_NET_KEY=m

View File

@ -59,6 +59,7 @@ CONFIG_MIPS32_COMPAT=y
CONFIG_MIPS32_O32=y CONFIG_MIPS32_O32=y
CONFIG_MIPS32_N32=y CONFIG_MIPS32_N32=y
CONFIG_PM_RUNTIME=y CONFIG_PM_RUNTIME=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=y CONFIG_XFRM_USER=y

View File

@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -20,6 +20,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -27,6 +27,7 @@ CONFIG_PD6729=m
CONFIG_I82092=m CONFIG_I82092=m
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_PM=y CONFIG_PM=y
CONFIG_NET=y
CONFIG_PACKET=m CONFIG_PACKET=m
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -63,6 +63,7 @@ CONFIG_MIPS32_O32=y
CONFIG_MIPS32_N32=y CONFIG_MIPS32_N32=y
CONFIG_PM_RUNTIME=y CONFIG_PM_RUNTIME=y
CONFIG_PM_DEBUG=y CONFIG_PM_DEBUG=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -43,6 +43,7 @@ CONFIG_PCI_DEBUG=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_PM_RUNTIME=y CONFIG_PM_RUNTIME=y
CONFIG_PM_DEBUG=y CONFIG_PM_DEBUG=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -20,6 +20,7 @@ CONFIG_MODVERSIONS=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_PM=y CONFIG_PM=y
CONFIG_NET=y
CONFIG_PACKET=m CONFIG_PACKET=m
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_NET_KEY=m CONFIG_NET_KEY=m

View File

@ -48,7 +48,12 @@ cflags-y := -pipe
# These flags should be implied by an hppa-linux configuration, but they # These flags should be implied by an hppa-linux configuration, but they
# are not in gcc 3.2. # are not in gcc 3.2.
cflags-y += -mno-space-regs -mfast-indirect-calls cflags-y += -mno-space-regs
# -mfast-indirect-calls is only relevant for 32-bit kernels.
ifndef CONFIG_64BIT
cflags-y += -mfast-indirect-calls
endif
# Currently we save and restore fpregs on all kernel entry/interruption paths. # Currently we save and restore fpregs on all kernel entry/interruption paths.
# If that gets optimized, we might need to disable the use of fpregs in the # If that gets optimized, we might need to disable the use of fpregs in the

View File

@ -31,6 +31,7 @@ CONFIG_PD6729=m
CONFIG_I82092=m CONFIG_I82092=m
# CONFIG_SUPERIO is not set # CONFIG_SUPERIO is not set
# CONFIG_CHASSIS_LCD_LED is not set # CONFIG_CHASSIS_LCD_LED is not set
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -33,6 +33,7 @@ CONFIG_PCI_LBA=y
# CONFIG_PDC_CHASSIS_WARN is not set # CONFIG_PDC_CHASSIS_WARN is not set
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -17,6 +17,7 @@
#include <linux/user.h> #include <linux/user.h>
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/security.h> #include <linux/security.h>
#include <linux/seccomp.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/audit.h> #include <linux/audit.h>
@ -271,10 +272,7 @@ long do_syscall_trace_enter(struct pt_regs *regs)
long ret = 0; long ret = 0;
/* Do the secure computing check first. */ /* Do the secure computing check first. */
if (secure_computing(regs->gr[20])) { secure_computing_strict(regs->gr[20]);
/* seccomp failures shouldn't expose any additional code. */
return -1;
}
if (test_thread_flag(TIF_SYSCALL_TRACE) && if (test_thread_flag(TIF_SYSCALL_TRACE) &&
tracehook_report_syscall_entry(regs)) tracehook_report_syscall_entry(regs))

View File

@ -29,6 +29,7 @@ CONFIG_PM=y
CONFIG_PCI_MSI=y CONFIG_PCI_MSI=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_SHPC=m CONFIG_HOTPLUG_PCI_SHPC=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=y CONFIG_XFRM_USER=y

View File

@ -31,6 +31,7 @@ CONFIG_HIBERNATION=y
CONFIG_APM_EMULATION=y CONFIG_APM_EMULATION=y
CONFIG_PCCARD=m CONFIG_PCCARD=m
CONFIG_YENTA=m CONFIG_YENTA=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=y CONFIG_XFRM_USER=y

View File

@ -58,6 +58,7 @@ CONFIG_ELECTRA_CF=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_RPA=m CONFIG_HOTPLUG_PCI_RPA=m
CONFIG_HOTPLUG_PCI_RPA_DLPAR=m CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -33,6 +33,7 @@ CONFIG_SPARSEMEM_MANUAL=y
CONFIG_PCI_MSI=y CONFIG_PCI_MSI=y
CONFIG_PCCARD=y CONFIG_PCCARD=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -53,6 +53,7 @@ CONFIG_SCHED_SMT=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_RPA=m CONFIG_HOTPLUG_PCI_RPA=m
CONFIG_HOTPLUG_PCI_RPA_DLPAR=m CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -55,6 +55,7 @@ CONFIG_SCHED_SMT=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_RPA=m CONFIG_HOTPLUG_PCI_RPA=m
CONFIG_HOTPLUG_PCI_RPA_DLPAR=m CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -63,6 +63,7 @@ CONFIG_CRASH_DUMP=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_PACKET_DIAG=m CONFIG_PACKET_DIAG=m
CONFIG_UNIX=y CONFIG_UNIX=y

View File

@ -61,6 +61,7 @@ CONFIG_CRASH_DUMP=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_PACKET_DIAG=m CONFIG_PACKET_DIAG=m
CONFIG_UNIX=y CONFIG_UNIX=y

View File

@ -59,6 +59,7 @@ CONFIG_CRASH_DUMP=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_PACKET_DIAG=m CONFIG_PACKET_DIAG=m
CONFIG_UNIX=y CONFIG_UNIX=y

View File

@ -23,6 +23,7 @@ CONFIG_CRASH_DUMP=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_SECCOMP is not set # CONFIG_SECCOMP is not set
# CONFIG_IUCV is not set # CONFIG_IUCV is not set
CONFIG_NET=y
CONFIG_ATM=y CONFIG_ATM=y
CONFIG_ATM_LANE=y CONFIG_ATM_LANE=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"

View File

@ -50,6 +50,7 @@ CONFIG_CMA=y
CONFIG_CRASH_DUMP=y CONFIG_CRASH_DUMP=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_NET_KEY=y CONFIG_NET_KEY=y

View File

@ -30,6 +30,7 @@ CONFIG_PCI_DEBUG=y
CONFIG_PCCARD=y CONFIG_PCCARD=y
CONFIG_YENTA=y CONFIG_YENTA=y
CONFIG_HOTPLUG_PCI=y CONFIG_HOTPLUG_PCI=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_INET=y CONFIG_INET=y

View File

@ -25,6 +25,7 @@ CONFIG_CMDLINE_OVERWRITE=y
CONFIG_CMDLINE="console=ttySC1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/rootfs,rsize=1024,wsize=1024 earlyprintk=sh-sci.1" CONFIG_CMDLINE="console=ttySC1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/rootfs,rsize=1024,wsize=1024 earlyprintk=sh-sci.1"
CONFIG_PCCARD=y CONFIG_PCCARD=y
CONFIG_BINFMT_MISC=y CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=y CONFIG_XFRM_USER=y

View File

@ -29,6 +29,7 @@ CONFIG_PCI=y
CONFIG_PCI_MSI=y CONFIG_PCI_MSI=y
CONFIG_SUN_OPENPROMFS=m CONFIG_SUN_OPENPROMFS=m
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_NET=y
CONFIG_PACKET=y CONFIG_PACKET=y
CONFIG_UNIX=y CONFIG_UNIX=y
CONFIG_XFRM_USER=m CONFIG_XFRM_USER=m

View File

@ -6,10 +6,12 @@
#define SAVE_SZ 176 #define SAVE_SZ 176
#define SCRATCH_OFF STACK_BIAS + 128 #define SCRATCH_OFF STACK_BIAS + 128
#define BE_PTR(label) be,pn %xcc, label #define BE_PTR(label) be,pn %xcc, label
#define SIGN_EXTEND(reg) sra reg, 0, reg
#else #else
#define SAVE_SZ 96 #define SAVE_SZ 96
#define SCRATCH_OFF 72 #define SCRATCH_OFF 72
#define BE_PTR(label) be label #define BE_PTR(label) be label
#define SIGN_EXTEND(reg)
#endif #endif
#define SKF_MAX_NEG_OFF (-0x200000) /* SKF_LL_OFF from filter.h */ #define SKF_MAX_NEG_OFF (-0x200000) /* SKF_LL_OFF from filter.h */
@ -135,6 +137,7 @@ bpf_slow_path_byte_msh:
save %sp, -SAVE_SZ, %sp; \ save %sp, -SAVE_SZ, %sp; \
mov %i0, %o0; \ mov %i0, %o0; \
mov r_OFF, %o1; \ mov r_OFF, %o1; \
SIGN_EXTEND(%o1); \
call bpf_internal_load_pointer_neg_helper; \ call bpf_internal_load_pointer_neg_helper; \
mov (LEN), %o2; \ mov (LEN), %o2; \
mov %o0, r_TMP; \ mov %o0, r_TMP; \

View File

@ -184,7 +184,7 @@ do { \
*/ */
#define emit_alu_K(OPCODE, K) \ #define emit_alu_K(OPCODE, K) \
do { \ do { \
if (K) { \ if (K || OPCODE == AND || OPCODE == MUL) { \
unsigned int _insn = OPCODE; \ unsigned int _insn = OPCODE; \
_insn |= RS1(r_A) | RD(r_A); \ _insn |= RS1(r_A) | RD(r_A); \
if (is_simm13(K)) { \ if (is_simm13(K)) { \

View File

@ -30,33 +30,6 @@
#include <asm/boot.h> #include <asm/boot.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
/*
* Adjust our own GOT
*
* The relocation base must be in %ebx
*
* It is safe to call this macro more than once, because in some of the
* code paths multiple invocations are inevitable, e.g. via the efi*
* entry points.
*
* Relocation is only performed the first time.
*/
.macro FIXUP_GOT
cmpb $1, got_fixed(%ebx)
je 2f
leal _got(%ebx), %edx
leal _egot(%ebx), %ecx
1:
cmpl %ecx, %edx
jae 2f
addl %ebx, (%edx)
addl $4, %edx
jmp 1b
2:
movb $1, got_fixed(%ebx)
.endm
__HEAD __HEAD
ENTRY(startup_32) ENTRY(startup_32)
#ifdef CONFIG_EFI_STUB #ifdef CONFIG_EFI_STUB
@ -83,9 +56,6 @@ ENTRY(efi_pe_entry)
add %esi, 88(%eax) add %esi, 88(%eax)
pushl %eax pushl %eax
movl %esi, %ebx
FIXUP_GOT
call make_boot_params call make_boot_params
cmpl $0, %eax cmpl $0, %eax
je fail je fail
@ -111,10 +81,6 @@ ENTRY(efi32_stub_entry)
leal efi32_config(%esi), %eax leal efi32_config(%esi), %eax
add %esi, 88(%eax) add %esi, 88(%eax)
pushl %eax pushl %eax
movl %esi, %ebx
FIXUP_GOT
2: 2:
call efi_main call efi_main
cmpl $0, %eax cmpl $0, %eax
@ -224,7 +190,19 @@ relocated:
shrl $2, %ecx shrl $2, %ecx
rep stosl rep stosl
FIXUP_GOT /*
* Adjust our own GOT
*/
leal _got(%ebx), %edx
leal _egot(%ebx), %ecx
1:
cmpl %ecx, %edx
jae 2f
addl %ebx, (%edx)
addl $4, %edx
jmp 1b
2:
/* /*
* Do the decompression, and jump to the new kernel.. * Do the decompression, and jump to the new kernel..
*/ */
@ -247,12 +225,8 @@ relocated:
xorl %ebx, %ebx xorl %ebx, %ebx
jmp *%eax jmp *%eax
.data
/* Have we relocated the GOT? */
got_fixed:
.byte 0
#ifdef CONFIG_EFI_STUB #ifdef CONFIG_EFI_STUB
.data
efi32_config: efi32_config:
.fill 11,8,0 .fill 11,8,0
.long efi_call_phys .long efi_call_phys

View File

@ -32,33 +32,6 @@
#include <asm/processor-flags.h> #include <asm/processor-flags.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
/*
* Adjust our own GOT
*
* The relocation base must be in %rbx
*
* It is safe to call this macro more than once, because in some of the
* code paths multiple invocations are inevitable, e.g. via the efi*
* entry points.
*
* Relocation is only performed the first time.
*/
.macro FIXUP_GOT
cmpb $1, got_fixed(%rip)
je 2f
leaq _got(%rip), %rdx
leaq _egot(%rip), %rcx
1:
cmpq %rcx, %rdx
jae 2f
addq %rbx, (%rdx)
addq $8, %rdx
jmp 1b
2:
movb $1, got_fixed(%rip)
.endm
__HEAD __HEAD
.code32 .code32
ENTRY(startup_32) ENTRY(startup_32)
@ -279,13 +252,10 @@ ENTRY(efi_pe_entry)
subq $1b, %rbp subq $1b, %rbp
/* /*
* Relocate efi_config->call() and the GOT entries. * Relocate efi_config->call().
*/ */
addq %rbp, efi64_config+88(%rip) addq %rbp, efi64_config+88(%rip)
movq %rbp, %rbx
FIXUP_GOT
movq %rax, %rdi movq %rax, %rdi
call make_boot_params call make_boot_params
cmpq $0,%rax cmpq $0,%rax
@ -301,13 +271,10 @@ handover_entry:
subq $1b, %rbp subq $1b, %rbp
/* /*
* Relocate efi_config->call() and the GOT entries. * Relocate efi_config->call().
*/ */
movq efi_config(%rip), %rax movq efi_config(%rip), %rax
addq %rbp, 88(%rax) addq %rbp, 88(%rax)
movq %rbp, %rbx
FIXUP_GOT
2: 2:
movq efi_config(%rip), %rdi movq efi_config(%rip), %rdi
call efi_main call efi_main
@ -418,7 +385,18 @@ relocated:
shrq $3, %rcx shrq $3, %rcx
rep stosq rep stosq
FIXUP_GOT /*
* Adjust our own GOT
*/
leaq _got(%rip), %rdx
leaq _egot(%rip), %rcx
1:
cmpq %rcx, %rdx
jae 2f
addq %rbx, (%rdx)
addq $8, %rdx
jmp 1b
2:
/* /*
* Do the decompression, and jump to the new kernel.. * Do the decompression, and jump to the new kernel..
@ -459,10 +437,6 @@ gdt:
.quad 0x0000000000000000 /* TS continued */ .quad 0x0000000000000000 /* TS continued */
gdt_end: gdt_end:
/* Have we relocated the GOT? */
got_fixed:
.byte 0
#ifdef CONFIG_EFI_STUB #ifdef CONFIG_EFI_STUB
efi_config: efi_config:
.quad 0 .quad 0

View File

@ -481,7 +481,7 @@ static void ctr_crypt_final(struct crypto_aes_ctx *ctx,
crypto_inc(ctrblk, AES_BLOCK_SIZE); crypto_inc(ctrblk, AES_BLOCK_SIZE);
} }
#ifdef CONFIG_AS_AVX #if 0 /* temporary disabled due to failing crypto tests */
static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out, static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len, u8 *iv) const u8 *in, unsigned int len, u8 *iv)
{ {
@ -1522,7 +1522,7 @@ static int __init aesni_init(void)
aesni_gcm_dec_tfm = aesni_gcm_dec; aesni_gcm_dec_tfm = aesni_gcm_dec;
} }
aesni_ctr_enc_tfm = aesni_ctr_enc; aesni_ctr_enc_tfm = aesni_ctr_enc;
#ifdef CONFIG_AS_AVX #if 0 /* temporary disabled due to failing crypto tests */
if (cpu_has_avx) { if (cpu_has_avx) {
/* optimize performance of ctr mode encryption transform */ /* optimize performance of ctr mode encryption transform */
aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm; aesni_ctr_enc_tfm = aesni_ctr_enc_avx_tfm;

View File

@ -56,6 +56,7 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
bool is_pm_resume; bool is_pm_resume;
WARN_ON(irqs_disabled()); WARN_ON(irqs_disabled());
WARN_ON(rq->cmd_type == REQ_TYPE_FS);
rq->rq_disk = bd_disk; rq->rq_disk = bd_disk;
rq->end_io = done; rq->end_io = done;

View File

@ -119,7 +119,16 @@ void blk_mq_freeze_queue(struct request_queue *q)
spin_unlock_irq(q->queue_lock); spin_unlock_irq(q->queue_lock);
if (freeze) { if (freeze) {
percpu_ref_kill(&q->mq_usage_counter); /*
* XXX: Temporary kludge to work around SCSI blk-mq stall.
* SCSI synchronously creates and destroys many queues
* back-to-back during probe leading to lengthy stalls.
* This will be fixed by keeping ->mq_usage_counter in
* atomic mode until genhd registration, but, for now,
* let's work around using expedited synchronization.
*/
__percpu_ref_kill_expedited(&q->mq_usage_counter);
blk_mq_run_queues(q, false); blk_mq_run_queues(q, false);
} }
wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->mq_usage_counter)); wait_event(q->mq_freeze_wq, percpu_ref_is_zero(&q->mq_usage_counter));
@ -203,7 +212,6 @@ __blk_mq_alloc_request(struct blk_mq_alloc_data *data, int rw)
if (tag != BLK_MQ_TAG_FAIL) { if (tag != BLK_MQ_TAG_FAIL) {
rq = data->hctx->tags->rqs[tag]; rq = data->hctx->tags->rqs[tag];
rq->cmd_flags = 0;
if (blk_mq_tag_busy(data->hctx)) { if (blk_mq_tag_busy(data->hctx)) {
rq->cmd_flags = REQ_MQ_INFLIGHT; rq->cmd_flags = REQ_MQ_INFLIGHT;
atomic_inc(&data->hctx->nr_active); atomic_inc(&data->hctx->nr_active);
@ -258,6 +266,7 @@ static void __blk_mq_free_request(struct blk_mq_hw_ctx *hctx,
if (rq->cmd_flags & REQ_MQ_INFLIGHT) if (rq->cmd_flags & REQ_MQ_INFLIGHT)
atomic_dec(&hctx->nr_active); atomic_dec(&hctx->nr_active);
rq->cmd_flags = 0;
clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags); clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags);
blk_mq_put_tag(hctx, tag, &ctx->last_tag); blk_mq_put_tag(hctx, tag, &ctx->last_tag);
@ -392,6 +401,12 @@ static void blk_mq_start_request(struct request *rq, bool last)
blk_add_timer(rq); blk_add_timer(rq);
/*
* Ensure that ->deadline is visible before set the started
* flag and clear the completed flag.
*/
smp_mb__before_atomic();
/* /*
* Mark us as started and clear complete. Complete might have been * Mark us as started and clear complete. Complete might have been
* set if requeue raced with timeout, which then marked it as * set if requeue raced with timeout, which then marked it as
@ -473,7 +488,11 @@ static void blk_mq_requeue_work(struct work_struct *work)
blk_mq_insert_request(rq, false, false, false); blk_mq_insert_request(rq, false, false, false);
} }
blk_mq_run_queues(q, false); /*
* Use the start variant of queue running here, so that running
* the requeue work will kick stopped queues.
*/
blk_mq_start_hw_queues(q);
} }
void blk_mq_add_to_requeue_list(struct request *rq, bool at_head) void blk_mq_add_to_requeue_list(struct request *rq, bool at_head)
@ -957,14 +976,9 @@ void blk_mq_insert_request(struct request *rq, bool at_head, bool run_queue,
hctx = q->mq_ops->map_queue(q, ctx->cpu); hctx = q->mq_ops->map_queue(q, ctx->cpu);
if (rq->cmd_flags & (REQ_FLUSH | REQ_FUA) &&
!(rq->cmd_flags & (REQ_FLUSH_SEQ))) {
blk_insert_flush(rq);
} else {
spin_lock(&ctx->lock); spin_lock(&ctx->lock);
__blk_mq_insert_request(hctx, rq, at_head); __blk_mq_insert_request(hctx, rq, at_head);
spin_unlock(&ctx->lock); spin_unlock(&ctx->lock);
}
if (run_queue) if (run_queue)
blk_mq_run_hw_queue(hctx, async); blk_mq_run_hw_queue(hctx, async);
@ -1404,6 +1418,8 @@ static struct blk_mq_tags *blk_mq_init_rq_map(struct blk_mq_tag_set *set,
left -= to_do * rq_size; left -= to_do * rq_size;
for (j = 0; j < to_do; j++) { for (j = 0; j < to_do; j++) {
tags->rqs[i] = p; tags->rqs[i] = p;
tags->rqs[i]->atomic_flags = 0;
tags->rqs[i]->cmd_flags = 0;
if (set->ops->init_request) { if (set->ops->init_request) {
if (set->ops->init_request(set->driver_data, if (set->ops->init_request(set->driver_data,
tags->rqs[i], hctx_idx, i, tags->rqs[i], hctx_idx, i,
@ -1956,7 +1972,6 @@ out_unwind:
while (--i >= 0) while (--i >= 0)
blk_mq_free_rq_map(set, set->tags[i], i); blk_mq_free_rq_map(set, set->tags[i], i);
set->tags = NULL;
return -ENOMEM; return -ENOMEM;
} }

View File

@ -445,8 +445,6 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
*/ */
void blk_free_devt(dev_t devt) void blk_free_devt(dev_t devt)
{ {
might_sleep();
if (devt == MKDEV(0, 0)) if (devt == MKDEV(0, 0))
return; return;

View File

@ -367,6 +367,10 @@ static int ccp_crypto_init(void)
{ {
int ret; int ret;
ret = ccp_present();
if (ret)
return ret;
spin_lock_init(&req_queue_lock); spin_lock_init(&req_queue_lock);
INIT_LIST_HEAD(&req_queue.cmds); INIT_LIST_HEAD(&req_queue.cmds);
req_queue.backlog = &req_queue.cmds; req_queue.backlog = &req_queue.cmds;

View File

@ -54,6 +54,20 @@ static inline void ccp_del_device(struct ccp_device *ccp)
ccp_dev = NULL; ccp_dev = NULL;
} }
/**
* ccp_present - check if a CCP device is present
*
* Returns zero if a CCP device is present, -ENODEV otherwise.
*/
int ccp_present(void)
{
if (ccp_get_device())
return 0;
return -ENODEV;
}
EXPORT_SYMBOL_GPL(ccp_present);
/** /**
* ccp_enqueue_cmd - queue an operation for processing by the CCP * ccp_enqueue_cmd - queue an operation for processing by the CCP
* *

View File

@ -66,7 +66,7 @@
#define ADF_DH895XCC_ETR_MAX_BANKS 32 #define ADF_DH895XCC_ETR_MAX_BANKS 32
#define ADF_DH895XCC_SMIAPF0_MASK_OFFSET (0x3A000 + 0x28) #define ADF_DH895XCC_SMIAPF0_MASK_OFFSET (0x3A000 + 0x28)
#define ADF_DH895XCC_SMIAPF1_MASK_OFFSET (0x3A000 + 0x30) #define ADF_DH895XCC_SMIAPF1_MASK_OFFSET (0x3A000 + 0x30)
#define ADF_DH895XCC_SMIA0_MASK 0xFFFF #define ADF_DH895XCC_SMIA0_MASK 0xFFFFFFFF
#define ADF_DH895XCC_SMIA1_MASK 0x1 #define ADF_DH895XCC_SMIA1_MASK 0x1
/* Error detection and correction */ /* Error detection and correction */
#define ADF_DH895XCC_AE_CTX_ENABLES(i) (i * 0x1000 + 0x20818) #define ADF_DH895XCC_AE_CTX_ENABLES(i) (i * 0x1000 + 0x20818)

View File

@ -93,13 +93,29 @@ static ssize_t show_power_crit(struct device *dev,
} }
static DEVICE_ATTR(power1_crit, S_IRUGO, show_power_crit, NULL); static DEVICE_ATTR(power1_crit, S_IRUGO, show_power_crit, NULL);
static umode_t fam15h_power_is_visible(struct kobject *kobj,
struct attribute *attr,
int index)
{
/* power1_input is only reported for Fam15h, Models 00h-0fh */
if (attr == &dev_attr_power1_input.attr &&
(boot_cpu_data.x86 != 0x15 || boot_cpu_data.x86_model > 0xf))
return 0;
return attr->mode;
}
static struct attribute *fam15h_power_attrs[] = { static struct attribute *fam15h_power_attrs[] = {
&dev_attr_power1_input.attr, &dev_attr_power1_input.attr,
&dev_attr_power1_crit.attr, &dev_attr_power1_crit.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(fam15h_power); static const struct attribute_group fam15h_power_group = {
.attrs = fam15h_power_attrs,
.is_visible = fam15h_power_is_visible,
};
__ATTRIBUTE_GROUPS(fam15h_power);
static bool fam15h_power_is_internal_node0(struct pci_dev *f4) static bool fam15h_power_is_internal_node0(struct pci_dev *f4)
{ {
@ -216,7 +232,9 @@ static int fam15h_power_probe(struct pci_dev *pdev,
static const struct pci_device_id fam15h_power_id_table[] = { static const struct pci_device_id fam15h_power_id_table[] = {
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
{} {}
}; };
MODULE_DEVICE_TABLE(pci, fam15h_power_id_table); MODULE_DEVICE_TABLE(pci, fam15h_power_id_table);

View File

@ -145,7 +145,7 @@ static int tmp103_probe(struct i2c_client *client,
} }
i2c_set_clientdata(client, regmap); i2c_set_clientdata(client, regmap);
hwmon_dev = hwmon_device_register_with_groups(dev, client->name, hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
regmap, tmp103_groups); regmap, tmp103_groups);
return PTR_ERR_OR_ZERO(hwmon_dev); return PTR_ERR_OR_ZERO(hwmon_dev);
} }

View File

@ -105,6 +105,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
umem->length = size; umem->length = size;
umem->offset = addr & ~PAGE_MASK; umem->offset = addr & ~PAGE_MASK;
umem->page_size = PAGE_SIZE; umem->page_size = PAGE_SIZE;
umem->pid = get_task_pid(current, PIDTYPE_PID);
/* /*
* We ask for writable memory if any access flags other than * We ask for writable memory if any access flags other than
* "remote read" are set. "Local write" and "remote write" * "remote read" are set. "Local write" and "remote write"
@ -198,6 +199,7 @@ out:
if (ret < 0) { if (ret < 0) {
if (need_release) if (need_release)
__ib_umem_release(context->device, umem, 0); __ib_umem_release(context->device, umem, 0);
put_pid(umem->pid);
kfree(umem); kfree(umem);
} else } else
current->mm->pinned_vm = locked; current->mm->pinned_vm = locked;
@ -230,15 +232,19 @@ void ib_umem_release(struct ib_umem *umem)
{ {
struct ib_ucontext *context = umem->context; struct ib_ucontext *context = umem->context;
struct mm_struct *mm; struct mm_struct *mm;
struct task_struct *task;
unsigned long diff; unsigned long diff;
__ib_umem_release(umem->context->device, umem, 1); __ib_umem_release(umem->context->device, umem, 1);
mm = get_task_mm(current); task = get_pid_task(umem->pid, PIDTYPE_PID);
if (!mm) { put_pid(umem->pid);
kfree(umem); if (!task)
return; goto out;
} mm = get_task_mm(task);
put_task_struct(task);
if (!mm)
goto out;
diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT; diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;
@ -262,9 +268,10 @@ void ib_umem_release(struct ib_umem *umem)
} else } else
down_write(&mm->mmap_sem); down_write(&mm->mmap_sem);
current->mm->pinned_vm -= diff; mm->pinned_vm -= diff;
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
mmput(mm); mmput(mm);
out:
kfree(umem); kfree(umem);
} }
EXPORT_SYMBOL(ib_umem_release); EXPORT_SYMBOL(ib_umem_release);

View File

@ -140,5 +140,9 @@ void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst,
dst->packet_life_time = src->packet_life_time; dst->packet_life_time = src->packet_life_time;
dst->preference = src->preference; dst->preference = src->preference;
dst->packet_life_time_selector = src->packet_life_time_selector; dst->packet_life_time_selector = src->packet_life_time_selector;
memset(dst->smac, 0, sizeof(dst->smac));
memset(dst->dmac, 0, sizeof(dst->dmac));
dst->vlan_id = 0xffff;
} }
EXPORT_SYMBOL(ib_copy_path_rec_from_user); EXPORT_SYMBOL(ib_copy_path_rec_from_user);

View File

@ -54,7 +54,7 @@ static void __ipath_release_user_pages(struct page **p, size_t num_pages,
/* call with current->mm->mmap_sem held */ /* call with current->mm->mmap_sem held */
static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages, static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages,
struct page **p, struct vm_area_struct **vma) struct page **p)
{ {
unsigned long lock_limit; unsigned long lock_limit;
size_t got; size_t got;
@ -74,7 +74,7 @@ static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages,
ret = get_user_pages(current, current->mm, ret = get_user_pages(current, current->mm,
start_page + got * PAGE_SIZE, start_page + got * PAGE_SIZE,
num_pages - got, 1, 1, num_pages - got, 1, 1,
p + got, vma); p + got, NULL);
if (ret < 0) if (ret < 0)
goto bail_release; goto bail_release;
} }
@ -165,7 +165,7 @@ int ipath_get_user_pages(unsigned long start_page, size_t num_pages,
down_write(&current->mm->mmap_sem); down_write(&current->mm->mmap_sem);
ret = __ipath_get_user_pages(start_page, num_pages, p, NULL); ret = __ipath_get_user_pages(start_page, num_pages, p);
up_write(&current->mm->mmap_sem); up_write(&current->mm->mmap_sem);

View File

@ -59,6 +59,7 @@
#define MLX4_IB_FLOW_MAX_PRIO 0xFFF #define MLX4_IB_FLOW_MAX_PRIO 0xFFF
#define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF #define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF
#define MLX4_IB_CARD_REV_A0 0xA0
MODULE_AUTHOR("Roland Dreier"); MODULE_AUTHOR("Roland Dreier");
MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver"); MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver");
@ -119,6 +120,17 @@ static int check_flow_steering_support(struct mlx4_dev *dev)
return dmfs; return dmfs;
} }
static int num_ib_ports(struct mlx4_dev *dev)
{
int ib_ports = 0;
int i;
mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
ib_ports++;
return ib_ports;
}
static int mlx4_ib_query_device(struct ib_device *ibdev, static int mlx4_ib_query_device(struct ib_device *ibdev,
struct ib_device_attr *props) struct ib_device_attr *props)
{ {
@ -126,6 +138,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
struct ib_smp *in_mad = NULL; struct ib_smp *in_mad = NULL;
struct ib_smp *out_mad = NULL; struct ib_smp *out_mad = NULL;
int err = -ENOMEM; int err = -ENOMEM;
int have_ib_ports;
in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL);
out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
@ -142,6 +155,8 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
memset(props, 0, sizeof *props); memset(props, 0, sizeof *props);
have_ib_ports = num_ib_ports(dev->dev);
props->fw_ver = dev->dev->caps.fw_ver; props->fw_ver = dev->dev->caps.fw_ver;
props->device_cap_flags = IB_DEVICE_CHANGE_PHY_PORT | props->device_cap_flags = IB_DEVICE_CHANGE_PHY_PORT |
IB_DEVICE_PORT_ACTIVE_EVENT | IB_DEVICE_PORT_ACTIVE_EVENT |
@ -152,13 +167,15 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
props->device_cap_flags |= IB_DEVICE_BAD_PKEY_CNTR; props->device_cap_flags |= IB_DEVICE_BAD_PKEY_CNTR;
if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR) if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR)
props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR; props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR;
if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_APM) if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_APM && have_ib_ports)
props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG; props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG;
if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UD_AV_PORT) if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UD_AV_PORT)
props->device_cap_flags |= IB_DEVICE_UD_AV_PORT_ENFORCE; props->device_cap_flags |= IB_DEVICE_UD_AV_PORT_ENFORCE;
if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IPOIB_CSUM) if (dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IPOIB_CSUM)
props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM; props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
if (dev->dev->caps.max_gso_sz && dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BLH) if (dev->dev->caps.max_gso_sz &&
(dev->dev->rev_id != MLX4_IB_CARD_REV_A0) &&
(dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_BLH))
props->device_cap_flags |= IB_DEVICE_UD_TSO; props->device_cap_flags |= IB_DEVICE_UD_TSO;
if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_RESERVED_LKEY) if (dev->dev->caps.bmme_flags & MLX4_BMME_FLAG_RESERVED_LKEY)
props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY; props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY;
@ -357,7 +374,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
props->state = IB_PORT_DOWN; props->state = IB_PORT_DOWN;
props->phys_state = state_to_phys_state(props->state); props->phys_state = state_to_phys_state(props->state);
props->active_mtu = IB_MTU_256; props->active_mtu = IB_MTU_256;
spin_lock(&iboe->lock); spin_lock_bh(&iboe->lock);
ndev = iboe->netdevs[port - 1]; ndev = iboe->netdevs[port - 1];
if (!ndev) if (!ndev)
goto out_unlock; goto out_unlock;
@ -369,7 +386,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
IB_PORT_ACTIVE : IB_PORT_DOWN; IB_PORT_ACTIVE : IB_PORT_DOWN;
props->phys_state = state_to_phys_state(props->state); props->phys_state = state_to_phys_state(props->state);
out_unlock: out_unlock:
spin_unlock(&iboe->lock); spin_unlock_bh(&iboe->lock);
out: out:
mlx4_free_cmd_mailbox(mdev->dev, mailbox); mlx4_free_cmd_mailbox(mdev->dev, mailbox);
return err; return err;
@ -811,11 +828,11 @@ int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp,
if (!mqp->port) if (!mqp->port)
return 0; return 0;
spin_lock(&mdev->iboe.lock); spin_lock_bh(&mdev->iboe.lock);
ndev = mdev->iboe.netdevs[mqp->port - 1]; ndev = mdev->iboe.netdevs[mqp->port - 1];
if (ndev) if (ndev)
dev_hold(ndev); dev_hold(ndev);
spin_unlock(&mdev->iboe.lock); spin_unlock_bh(&mdev->iboe.lock);
if (ndev) { if (ndev) {
ret = 1; ret = 1;
@ -1292,11 +1309,11 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
mutex_lock(&mqp->mutex); mutex_lock(&mqp->mutex);
ge = find_gid_entry(mqp, gid->raw); ge = find_gid_entry(mqp, gid->raw);
if (ge) { if (ge) {
spin_lock(&mdev->iboe.lock); spin_lock_bh(&mdev->iboe.lock);
ndev = ge->added ? mdev->iboe.netdevs[ge->port - 1] : NULL; ndev = ge->added ? mdev->iboe.netdevs[ge->port - 1] : NULL;
if (ndev) if (ndev)
dev_hold(ndev); dev_hold(ndev);
spin_unlock(&mdev->iboe.lock); spin_unlock_bh(&mdev->iboe.lock);
if (ndev) if (ndev)
dev_put(ndev); dev_put(ndev);
list_del(&ge->list); list_del(&ge->list);
@ -1417,6 +1434,9 @@ static void update_gids_task(struct work_struct *work)
int err; int err;
struct mlx4_dev *dev = gw->dev->dev; struct mlx4_dev *dev = gw->dev->dev;
if (!gw->dev->ib_active)
return;
mailbox = mlx4_alloc_cmd_mailbox(dev); mailbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(mailbox)) { if (IS_ERR(mailbox)) {
pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox)); pr_warn("update gid table failed %ld\n", PTR_ERR(mailbox));
@ -1447,6 +1467,9 @@ static void reset_gids_task(struct work_struct *work)
int err; int err;
struct mlx4_dev *dev = gw->dev->dev; struct mlx4_dev *dev = gw->dev->dev;
if (!gw->dev->ib_active)
return;
mailbox = mlx4_alloc_cmd_mailbox(dev); mailbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(mailbox)) { if (IS_ERR(mailbox)) {
pr_warn("reset gid table failed\n"); pr_warn("reset gid table failed\n");
@ -1581,7 +1604,7 @@ static int mlx4_ib_addr_event(int event, struct net_device *event_netdev,
return 0; return 0;
iboe = &ibdev->iboe; iboe = &ibdev->iboe;
spin_lock(&iboe->lock); spin_lock_bh(&iboe->lock);
for (port = 1; port <= ibdev->dev->caps.num_ports; ++port) for (port = 1; port <= ibdev->dev->caps.num_ports; ++port)
if ((netif_is_bond_master(real_dev) && if ((netif_is_bond_master(real_dev) &&
@ -1591,7 +1614,7 @@ static int mlx4_ib_addr_event(int event, struct net_device *event_netdev,
update_gid_table(ibdev, port, gid, update_gid_table(ibdev, port, gid,
event == NETDEV_DOWN, 0); event == NETDEV_DOWN, 0);
spin_unlock(&iboe->lock); spin_unlock_bh(&iboe->lock);
return 0; return 0;
} }
@ -1664,13 +1687,21 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
new_smac = mlx4_mac_to_u64(dev->dev_addr); new_smac = mlx4_mac_to_u64(dev->dev_addr);
read_unlock(&dev_base_lock); read_unlock(&dev_base_lock);
atomic64_set(&ibdev->iboe.mac[port - 1], new_smac);
/* no need for update QP1 and mac registration in non-SRIOV */
if (!mlx4_is_mfunc(ibdev->dev))
return;
mutex_lock(&ibdev->qp1_proxy_lock[port - 1]); mutex_lock(&ibdev->qp1_proxy_lock[port - 1]);
qp = ibdev->qp1_proxy[port - 1]; qp = ibdev->qp1_proxy[port - 1];
if (qp) { if (qp) {
int new_smac_index; int new_smac_index;
u64 old_smac = qp->pri.smac; u64 old_smac;
struct mlx4_update_qp_params update_params; struct mlx4_update_qp_params update_params;
mutex_lock(&qp->mutex);
old_smac = qp->pri.smac;
if (new_smac == old_smac) if (new_smac == old_smac)
goto unlock; goto unlock;
@ -1685,17 +1716,20 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
release_mac = new_smac; release_mac = new_smac;
goto unlock; goto unlock;
} }
/* if old port was zero, no mac was yet registered for this QP */
qp->pri.smac = new_smac; if (qp->pri.smac_port)
qp->pri.smac_index = new_smac_index;
release_mac = old_smac; release_mac = old_smac;
qp->pri.smac = new_smac;
qp->pri.smac_port = port;
qp->pri.smac_index = new_smac_index;
} }
unlock: unlock:
mutex_unlock(&ibdev->qp1_proxy_lock[port - 1]);
if (release_mac != MLX4_IB_INVALID_MAC) if (release_mac != MLX4_IB_INVALID_MAC)
mlx4_unregister_mac(ibdev->dev, port, release_mac); mlx4_unregister_mac(ibdev->dev, port, release_mac);
if (qp)
mutex_unlock(&qp->mutex);
mutex_unlock(&ibdev->qp1_proxy_lock[port - 1]);
} }
static void mlx4_ib_get_dev_addr(struct net_device *dev, static void mlx4_ib_get_dev_addr(struct net_device *dev,
@ -1706,6 +1740,7 @@ static void mlx4_ib_get_dev_addr(struct net_device *dev,
struct inet6_dev *in6_dev; struct inet6_dev *in6_dev;
union ib_gid *pgid; union ib_gid *pgid;
struct inet6_ifaddr *ifp; struct inet6_ifaddr *ifp;
union ib_gid default_gid;
#endif #endif
union ib_gid gid; union ib_gid gid;
@ -1726,12 +1761,15 @@ static void mlx4_ib_get_dev_addr(struct net_device *dev,
in_dev_put(in_dev); in_dev_put(in_dev);
} }
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
mlx4_make_default_gid(dev, &default_gid);
/* IPv6 gids */ /* IPv6 gids */
in6_dev = in6_dev_get(dev); in6_dev = in6_dev_get(dev);
if (in6_dev) { if (in6_dev) {
read_lock_bh(&in6_dev->lock); read_lock_bh(&in6_dev->lock);
list_for_each_entry(ifp, &in6_dev->addr_list, if_list) { list_for_each_entry(ifp, &in6_dev->addr_list, if_list) {
pgid = (union ib_gid *)&ifp->addr; pgid = (union ib_gid *)&ifp->addr;
if (!memcmp(pgid, &default_gid, sizeof(*pgid)))
continue;
update_gid_table(ibdev, port, pgid, 0, 0); update_gid_table(ibdev, port, pgid, 0, 0);
} }
read_unlock_bh(&in6_dev->lock); read_unlock_bh(&in6_dev->lock);
@ -1753,24 +1791,33 @@ static int mlx4_ib_init_gid_table(struct mlx4_ib_dev *ibdev)
struct net_device *dev; struct net_device *dev;
struct mlx4_ib_iboe *iboe = &ibdev->iboe; struct mlx4_ib_iboe *iboe = &ibdev->iboe;
int i; int i;
int err = 0;
for (i = 1; i <= ibdev->num_ports; ++i) for (i = 1; i <= ibdev->num_ports; ++i) {
if (reset_gid_table(ibdev, i)) if (rdma_port_get_link_layer(&ibdev->ib_dev, i) ==
return -1; IB_LINK_LAYER_ETHERNET) {
err = reset_gid_table(ibdev, i);
if (err)
goto out;
}
}
read_lock(&dev_base_lock); read_lock(&dev_base_lock);
spin_lock(&iboe->lock); spin_lock_bh(&iboe->lock);
for_each_netdev(&init_net, dev) { for_each_netdev(&init_net, dev) {
u8 port = mlx4_ib_get_dev_port(dev, ibdev); u8 port = mlx4_ib_get_dev_port(dev, ibdev);
if (port) /* port will be non-zero only for ETH ports */
if (port) {
mlx4_ib_set_default_gid(ibdev, dev, port);
mlx4_ib_get_dev_addr(dev, ibdev, port); mlx4_ib_get_dev_addr(dev, ibdev, port);
} }
}
spin_unlock(&iboe->lock); spin_unlock_bh(&iboe->lock);
read_unlock(&dev_base_lock); read_unlock(&dev_base_lock);
out:
return 0; return err;
} }
static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev, static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
@ -1784,7 +1831,7 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
iboe = &ibdev->iboe; iboe = &ibdev->iboe;
spin_lock(&iboe->lock); spin_lock_bh(&iboe->lock);
mlx4_foreach_ib_transport_port(port, ibdev->dev) { mlx4_foreach_ib_transport_port(port, ibdev->dev) {
enum ib_port_state port_state = IB_PORT_NOP; enum ib_port_state port_state = IB_PORT_NOP;
struct net_device *old_master = iboe->masters[port - 1]; struct net_device *old_master = iboe->masters[port - 1];
@ -1816,35 +1863,47 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
port_state = (netif_running(curr_netdev) && netif_carrier_ok(curr_netdev)) ? port_state = (netif_running(curr_netdev) && netif_carrier_ok(curr_netdev)) ?
IB_PORT_ACTIVE : IB_PORT_DOWN; IB_PORT_ACTIVE : IB_PORT_DOWN;
mlx4_ib_set_default_gid(ibdev, curr_netdev, port); mlx4_ib_set_default_gid(ibdev, curr_netdev, port);
} else { if (curr_master) {
reset_gid_table(ibdev, port); /* if using bonding/team and a slave port is down, we
} * don't want the bond IP based gids in the table since
/* if using bonding/team and a slave port is down, we don't the bond IP * flows that select port by gid may get the down port.
* based gids in the table since flows that select port by gid may get
* the down port.
*/ */
if (curr_master && (port_state == IB_PORT_DOWN)) { if (port_state == IB_PORT_DOWN) {
reset_gid_table(ibdev, port); reset_gid_table(ibdev, port);
mlx4_ib_set_default_gid(ibdev, curr_netdev, port); mlx4_ib_set_default_gid(ibdev,
curr_netdev,
port);
} else {
/* gids from the upper dev (bond/team)
* should appear in port's gid table
*/
mlx4_ib_get_dev_addr(curr_master,
ibdev, port);
} }
/* if bonding is used it is possible that we add it to masters }
* only after IP address is assigned to the net bonding /* if bonding is used it is possible that we add it to
* interface. * masters only after IP address is assigned to the
* net bonding interface.
*/ */
if (curr_master && (old_master != curr_master)) { if (curr_master && (old_master != curr_master)) {
reset_gid_table(ibdev, port); reset_gid_table(ibdev, port);
mlx4_ib_set_default_gid(ibdev, curr_netdev, port); mlx4_ib_set_default_gid(ibdev,
curr_netdev, port);
mlx4_ib_get_dev_addr(curr_master, ibdev, port); mlx4_ib_get_dev_addr(curr_master, ibdev, port);
} }
if (!curr_master && (old_master != curr_master)) { if (!curr_master && (old_master != curr_master)) {
reset_gid_table(ibdev, port); reset_gid_table(ibdev, port);
mlx4_ib_set_default_gid(ibdev, curr_netdev, port); mlx4_ib_set_default_gid(ibdev,
curr_netdev, port);
mlx4_ib_get_dev_addr(curr_netdev, ibdev, port); mlx4_ib_get_dev_addr(curr_netdev, ibdev, port);
} }
} else {
reset_gid_table(ibdev, port);
}
} }
spin_unlock(&iboe->lock); spin_unlock_bh(&iboe->lock);
if (update_qps_port > 0) if (update_qps_port > 0)
mlx4_ib_update_qps(ibdev, dev, update_qps_port); mlx4_ib_update_qps(ibdev, dev, update_qps_port);
@ -2186,6 +2245,9 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
goto err_steer_free_bitmap; goto err_steer_free_bitmap;
} }
for (j = 1; j <= ibdev->dev->caps.num_ports; j++)
atomic64_set(&iboe->mac[j - 1], ibdev->dev->caps.def_mac[j]);
if (ib_register_device(&ibdev->ib_dev, NULL)) if (ib_register_device(&ibdev->ib_dev, NULL))
goto err_steer_free_bitmap; goto err_steer_free_bitmap;
@ -2222,12 +2284,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
} }
} }
#endif #endif
for (i = 1 ; i <= ibdev->num_ports ; ++i) if (mlx4_ib_init_gid_table(ibdev))
reset_gid_table(ibdev, i); goto err_notif;
rtnl_lock();
mlx4_ib_scan_netdevs(ibdev, NULL, 0);
rtnl_unlock();
mlx4_ib_init_gid_table(ibdev);
} }
for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) { for (j = 0; j < ARRAY_SIZE(mlx4_class_attributes); ++j) {
@ -2375,6 +2433,9 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
struct mlx4_ib_dev *ibdev = ibdev_ptr; struct mlx4_ib_dev *ibdev = ibdev_ptr;
int p; int p;
ibdev->ib_active = false;
flush_workqueue(wq);
mlx4_ib_close_sriov(ibdev); mlx4_ib_close_sriov(ibdev);
mlx4_ib_mad_cleanup(ibdev); mlx4_ib_mad_cleanup(ibdev);
ib_unregister_device(&ibdev->ib_dev); ib_unregister_device(&ibdev->ib_dev);

View File

@ -451,6 +451,7 @@ struct mlx4_ib_iboe {
spinlock_t lock; spinlock_t lock;
struct net_device *netdevs[MLX4_MAX_PORTS]; struct net_device *netdevs[MLX4_MAX_PORTS];
struct net_device *masters[MLX4_MAX_PORTS]; struct net_device *masters[MLX4_MAX_PORTS];
atomic64_t mac[MLX4_MAX_PORTS];
struct notifier_block nb; struct notifier_block nb;
struct notifier_block nb_inet; struct notifier_block nb_inet;
struct notifier_block nb_inet6; struct notifier_block nb_inet6;

View File

@ -234,14 +234,13 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags,
0); 0);
if (IS_ERR(mmr->umem)) { if (IS_ERR(mmr->umem)) {
err = PTR_ERR(mmr->umem); err = PTR_ERR(mmr->umem);
/* Prevent mlx4_ib_dereg_mr from free'ing invalid pointer */
mmr->umem = NULL; mmr->umem = NULL;
goto release_mpt_entry; goto release_mpt_entry;
} }
n = ib_umem_page_count(mmr->umem); n = ib_umem_page_count(mmr->umem);
shift = ilog2(mmr->umem->page_size); shift = ilog2(mmr->umem->page_size);
mmr->mmr.iova = virt_addr;
mmr->mmr.size = length;
err = mlx4_mr_rereg_mem_write(dev->dev, &mmr->mmr, err = mlx4_mr_rereg_mem_write(dev->dev, &mmr->mmr,
virt_addr, length, n, shift, virt_addr, length, n, shift,
*pmpt_entry); *pmpt_entry);
@ -249,6 +248,8 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags,
ib_umem_release(mmr->umem); ib_umem_release(mmr->umem);
goto release_mpt_entry; goto release_mpt_entry;
} }
mmr->mmr.iova = virt_addr;
mmr->mmr.size = length;
err = mlx4_ib_umem_write_mtt(dev, &mmr->mmr.mtt, mmr->umem); err = mlx4_ib_umem_write_mtt(dev, &mmr->mmr.mtt, mmr->umem);
if (err) { if (err) {
@ -262,6 +263,8 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags,
* return a failure. But dereg_mr will free the resources. * return a failure. But dereg_mr will free the resources.
*/ */
err = mlx4_mr_hw_write_mpt(dev->dev, &mmr->mmr, pmpt_entry); err = mlx4_mr_hw_write_mpt(dev->dev, &mmr->mmr, pmpt_entry);
if (!err && flags & IB_MR_REREG_ACCESS)
mmr->mmr.access = mr_access_flags;
release_mpt_entry: release_mpt_entry:
mlx4_mr_hw_put_mpt(dev->dev, pmpt_entry); mlx4_mr_hw_put_mpt(dev->dev, pmpt_entry);

View File

@ -964,9 +964,10 @@ static void destroy_qp_common(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp,
MLX4_QP_STATE_RST, NULL, 0, 0, &qp->mqp)) MLX4_QP_STATE_RST, NULL, 0, 0, &qp->mqp))
pr_warn("modify QP %06x to RESET failed.\n", pr_warn("modify QP %06x to RESET failed.\n",
qp->mqp.qpn); qp->mqp.qpn);
if (qp->pri.smac) { if (qp->pri.smac || (!qp->pri.smac && qp->pri.smac_port)) {
mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac);
qp->pri.smac = 0; qp->pri.smac = 0;
qp->pri.smac_port = 0;
} }
if (qp->alt.smac) { if (qp->alt.smac) {
mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac); mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac);
@ -1325,7 +1326,8 @@ static int _mlx4_set_path(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah,
* If one was already assigned, but the new mac differs, * If one was already assigned, but the new mac differs,
* unregister the old one and register the new one. * unregister the old one and register the new one.
*/ */
if (!smac_info->smac || smac_info->smac != smac) { if ((!smac_info->smac && !smac_info->smac_port) ||
smac_info->smac != smac) {
/* register candidate now, unreg if needed, after success */ /* register candidate now, unreg if needed, after success */
smac_index = mlx4_register_mac(dev->dev, port, smac); smac_index = mlx4_register_mac(dev->dev, port, smac);
if (smac_index >= 0) { if (smac_index >= 0) {
@ -1390,21 +1392,13 @@ static void update_mcg_macs(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp)
static int handle_eth_ud_smac_index(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, u8 *smac, static int handle_eth_ud_smac_index(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, u8 *smac,
struct mlx4_qp_context *context) struct mlx4_qp_context *context)
{ {
struct net_device *ndev;
u64 u64_mac; u64 u64_mac;
int smac_index; int smac_index;
u64_mac = atomic64_read(&dev->iboe.mac[qp->port - 1]);
ndev = dev->iboe.netdevs[qp->port - 1];
if (ndev) {
smac = ndev->dev_addr;
u64_mac = mlx4_mac_to_u64(smac);
} else {
u64_mac = dev->dev->caps.def_mac[qp->port];
}
context->pri_path.sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE | ((qp->port - 1) << 6); context->pri_path.sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE | ((qp->port - 1) << 6);
if (!qp->pri.smac) { if (!qp->pri.smac && !qp->pri.smac_port) {
smac_index = mlx4_register_mac(dev->dev, qp->port, u64_mac); smac_index = mlx4_register_mac(dev->dev, qp->port, u64_mac);
if (smac_index >= 0) { if (smac_index >= 0) {
qp->pri.candidate_smac_index = smac_index; qp->pri.candidate_smac_index = smac_index;
@ -1432,6 +1426,12 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
int steer_qp = 0; int steer_qp = 0;
int err = -EINVAL; int err = -EINVAL;
/* APM is not supported under RoCE */
if (attr_mask & IB_QP_ALT_PATH &&
rdma_port_get_link_layer(&dev->ib_dev, qp->port) ==
IB_LINK_LAYER_ETHERNET)
return -ENOTSUPP;
context = kzalloc(sizeof *context, GFP_KERNEL); context = kzalloc(sizeof *context, GFP_KERNEL);
if (!context) if (!context)
return -ENOMEM; return -ENOMEM;
@ -1786,9 +1786,10 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
if (qp->flags & MLX4_IB_QP_NETIF) if (qp->flags & MLX4_IB_QP_NETIF)
mlx4_ib_steer_qp_reg(dev, qp, 0); mlx4_ib_steer_qp_reg(dev, qp, 0);
} }
if (qp->pri.smac) { if (qp->pri.smac || (!qp->pri.smac && qp->pri.smac_port)) {
mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac);
qp->pri.smac = 0; qp->pri.smac = 0;
qp->pri.smac_port = 0;
} }
if (qp->alt.smac) { if (qp->alt.smac) {
mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac); mlx4_unregister_mac(dev->dev, qp->alt.smac_port, qp->alt.smac);
@ -1812,11 +1813,12 @@ out:
if (err && steer_qp) if (err && steer_qp)
mlx4_ib_steer_qp_reg(dev, qp, 0); mlx4_ib_steer_qp_reg(dev, qp, 0);
kfree(context); kfree(context);
if (qp->pri.candidate_smac) { if (qp->pri.candidate_smac ||
(!qp->pri.candidate_smac && qp->pri.candidate_smac_port)) {
if (err) { if (err) {
mlx4_unregister_mac(dev->dev, qp->pri.candidate_smac_port, qp->pri.candidate_smac); mlx4_unregister_mac(dev->dev, qp->pri.candidate_smac_port, qp->pri.candidate_smac);
} else { } else {
if (qp->pri.smac) if (qp->pri.smac || (!qp->pri.smac && qp->pri.smac_port))
mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac); mlx4_unregister_mac(dev->dev, qp->pri.smac_port, qp->pri.smac);
qp->pri.smac = qp->pri.candidate_smac; qp->pri.smac = qp->pri.candidate_smac;
qp->pri.smac_index = qp->pri.candidate_smac_index; qp->pri.smac_index = qp->pri.candidate_smac_index;
@ -2089,6 +2091,16 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,
return 0; return 0;
} }
static void mlx4_u64_to_smac(u8 *dst_mac, u64 src_mac)
{
int i;
for (i = ETH_ALEN; i; i--) {
dst_mac[i - 1] = src_mac & 0xff;
src_mac >>= 8;
}
}
static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
void *wqe, unsigned *mlx_seg_len) void *wqe, unsigned *mlx_seg_len)
{ {
@ -2203,7 +2215,6 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
} }
if (is_eth) { if (is_eth) {
u8 *smac;
struct in6_addr in6; struct in6_addr in6;
u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13; u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13;
@ -2216,12 +2227,17 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
memcpy(&ctrl->imm, ah->av.eth.mac + 2, 4); memcpy(&ctrl->imm, ah->av.eth.mac + 2, 4);
memcpy(&in6, sgid.raw, sizeof(in6)); memcpy(&in6, sgid.raw, sizeof(in6));
if (!mlx4_is_mfunc(to_mdev(ib_dev)->dev)) if (!mlx4_is_mfunc(to_mdev(ib_dev)->dev)) {
smac = to_mdev(sqp->qp.ibqp.device)-> u64 mac = atomic64_read(&to_mdev(ib_dev)->iboe.mac[sqp->qp.port - 1]);
iboe.netdevs[sqp->qp.port - 1]->dev_addr; u8 smac[ETH_ALEN];
else /* use the src mac of the tunnel */
smac = ah->av.eth.s_mac; mlx4_u64_to_smac(smac, mac);
memcpy(sqp->ud_header.eth.smac_h, smac, 6); memcpy(sqp->ud_header.eth.smac_h, smac, ETH_ALEN);
} else {
/* use the src mac of the tunnel */
memcpy(sqp->ud_header.eth.smac_h, ah->av.eth.s_mac, ETH_ALEN);
}
if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6)) if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6))
mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK); mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);
if (!is_vlan) { if (!is_vlan) {

View File

@ -38,7 +38,7 @@
#define OCRDMA_VID_PCP_SHIFT 0xD #define OCRDMA_VID_PCP_SHIFT 0xD
static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
struct ib_ah_attr *attr, int pdid) struct ib_ah_attr *attr, union ib_gid *sgid, int pdid)
{ {
int status = 0; int status = 0;
u16 vlan_tag; bool vlan_enabled = false; u16 vlan_tag; bool vlan_enabled = false;
@ -49,8 +49,7 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
memset(&eth, 0, sizeof(eth)); memset(&eth, 0, sizeof(eth));
memset(&grh, 0, sizeof(grh)); memset(&grh, 0, sizeof(grh));
ah->sgid_index = attr->grh.sgid_index; /* VLAN */
vlan_tag = attr->vlan_id; vlan_tag = attr->vlan_id;
if (!vlan_tag || (vlan_tag > 0xFFF)) if (!vlan_tag || (vlan_tag > 0xFFF))
vlan_tag = dev->pvid; vlan_tag = dev->pvid;
@ -65,15 +64,14 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
eth.eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE); eth.eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE);
eth_sz = sizeof(struct ocrdma_eth_basic); eth_sz = sizeof(struct ocrdma_eth_basic);
} }
/* MAC */
memcpy(&eth.smac[0], &dev->nic_info.mac_addr[0], ETH_ALEN); memcpy(&eth.smac[0], &dev->nic_info.mac_addr[0], ETH_ALEN);
memcpy(&eth.dmac[0], attr->dmac, ETH_ALEN);
status = ocrdma_resolve_dmac(dev, attr, &eth.dmac[0]); status = ocrdma_resolve_dmac(dev, attr, &eth.dmac[0]);
if (status) if (status)
return status; return status;
status = ocrdma_query_gid(&dev->ibdev, 1, attr->grh.sgid_index, ah->sgid_index = attr->grh.sgid_index;
(union ib_gid *)&grh.sgid[0]); memcpy(&grh.sgid[0], sgid->raw, sizeof(union ib_gid));
if (status) memcpy(&grh.dgid[0], attr->grh.dgid.raw, sizeof(attr->grh.dgid.raw));
return status;
grh.tclass_flow = cpu_to_be32((6 << 28) | grh.tclass_flow = cpu_to_be32((6 << 28) |
(attr->grh.traffic_class << 24) | (attr->grh.traffic_class << 24) |
@ -81,8 +79,7 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
/* 0x1b is next header value in GRH */ /* 0x1b is next header value in GRH */
grh.pdid_hoplimit = cpu_to_be32((pdid << 16) | grh.pdid_hoplimit = cpu_to_be32((pdid << 16) |
(0x1b << 8) | attr->grh.hop_limit); (0x1b << 8) | attr->grh.hop_limit);
/* Eth HDR */
memcpy(&grh.dgid[0], attr->grh.dgid.raw, sizeof(attr->grh.dgid.raw));
memcpy(&ah->av->eth_hdr, &eth, eth_sz); memcpy(&ah->av->eth_hdr, &eth, eth_sz);
memcpy((u8 *)ah->av + eth_sz, &grh, sizeof(struct ocrdma_grh)); memcpy((u8 *)ah->av + eth_sz, &grh, sizeof(struct ocrdma_grh));
if (vlan_enabled) if (vlan_enabled)
@ -98,6 +95,8 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
struct ocrdma_ah *ah; struct ocrdma_ah *ah;
struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); struct ocrdma_pd *pd = get_ocrdma_pd(ibpd);
struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device); struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device);
union ib_gid sgid;
u8 zmac[ETH_ALEN];
if (!(attr->ah_flags & IB_AH_GRH)) if (!(attr->ah_flags & IB_AH_GRH))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
@ -111,7 +110,27 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
status = ocrdma_alloc_av(dev, ah); status = ocrdma_alloc_av(dev, ah);
if (status) if (status)
goto av_err; goto av_err;
status = set_av_attr(dev, ah, attr, pd->id);
status = ocrdma_query_gid(&dev->ibdev, 1, attr->grh.sgid_index, &sgid);
if (status) {
pr_err("%s(): Failed to query sgid, status = %d\n",
__func__, status);
goto av_conf_err;
}
memset(&zmac, 0, ETH_ALEN);
if (pd->uctx &&
memcmp(attr->dmac, &zmac, ETH_ALEN)) {
status = rdma_addr_find_dmac_by_grh(&sgid, &attr->grh.dgid,
attr->dmac, &attr->vlan_id);
if (status) {
pr_err("%s(): Failed to resolve dmac from gid."
"status = %d\n", __func__, status);
goto av_conf_err;
}
}
status = set_av_attr(dev, ah, attr, &sgid, pd->id);
if (status) if (status)
goto av_conf_err; goto av_conf_err;
@ -145,7 +164,7 @@ int ocrdma_query_ah(struct ib_ah *ibah, struct ib_ah_attr *attr)
struct ocrdma_av *av = ah->av; struct ocrdma_av *av = ah->av;
struct ocrdma_grh *grh; struct ocrdma_grh *grh;
attr->ah_flags |= IB_AH_GRH; attr->ah_flags |= IB_AH_GRH;
if (ah->av->valid & Bit(1)) { if (ah->av->valid & OCRDMA_AV_VALID) {
grh = (struct ocrdma_grh *)((u8 *)ah->av + grh = (struct ocrdma_grh *)((u8 *)ah->av +
sizeof(struct ocrdma_eth_vlan)); sizeof(struct ocrdma_eth_vlan));
attr->sl = be16_to_cpu(av->eth_hdr.vlan_tag) >> 13; attr->sl = be16_to_cpu(av->eth_hdr.vlan_tag) >> 13;

View File

@ -101,7 +101,7 @@ int ocrdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr)
attr->max_srq_sge = dev->attr.max_srq_sge; attr->max_srq_sge = dev->attr.max_srq_sge;
attr->max_srq_wr = dev->attr.max_rqe; attr->max_srq_wr = dev->attr.max_rqe;
attr->local_ca_ack_delay = dev->attr.local_ca_ack_delay; attr->local_ca_ack_delay = dev->attr.local_ca_ack_delay;
attr->max_fast_reg_page_list_len = 0; attr->max_fast_reg_page_list_len = dev->attr.max_pages_per_frmr;
attr->max_pkeys = 1; attr->max_pkeys = 1;
return 0; return 0;
} }
@ -2846,11 +2846,9 @@ int ocrdma_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags cq_flags)
if (cq->first_arm) { if (cq->first_arm) {
ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0); ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0);
cq->first_arm = false; cq->first_arm = false;
goto skip_defer;
} }
cq->deferred_arm = true;
skip_defer: cq->deferred_arm = true;
cq->deferred_sol = sol_needed; cq->deferred_sol = sol_needed;
spin_unlock_irqrestore(&cq->cq_lock, flags); spin_unlock_irqrestore(&cq->cq_lock, flags);

View File

@ -193,6 +193,7 @@ static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos)
struct qib_qp_iter *iter; struct qib_qp_iter *iter;
loff_t n = *pos; loff_t n = *pos;
rcu_read_lock();
iter = qib_qp_iter_init(s->private); iter = qib_qp_iter_init(s->private);
if (!iter) if (!iter)
return NULL; return NULL;
@ -224,7 +225,7 @@ static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr) static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr)
{ {
/* nothing for now */ rcu_read_unlock();
} }
static int _qp_stats_seq_show(struct seq_file *s, void *iter_ptr) static int _qp_stats_seq_show(struct seq_file *s, void *iter_ptr)

View File

@ -1325,7 +1325,6 @@ int qib_qp_iter_next(struct qib_qp_iter *iter)
struct qib_qp *pqp = iter->qp; struct qib_qp *pqp = iter->qp;
struct qib_qp *qp; struct qib_qp *qp;
rcu_read_lock();
for (; n < dev->qp_table_size; n++) { for (; n < dev->qp_table_size; n++) {
if (pqp) if (pqp)
qp = rcu_dereference(pqp->next); qp = rcu_dereference(pqp->next);
@ -1333,18 +1332,11 @@ int qib_qp_iter_next(struct qib_qp_iter *iter)
qp = rcu_dereference(dev->qp_table[n]); qp = rcu_dereference(dev->qp_table[n]);
pqp = qp; pqp = qp;
if (qp) { if (qp) {
if (iter->qp)
atomic_dec(&iter->qp->refcount);
atomic_inc(&qp->refcount);
rcu_read_unlock();
iter->qp = qp; iter->qp = qp;
iter->n = n; iter->n = n;
return 0; return 0;
} }
} }
rcu_read_unlock();
if (iter->qp)
atomic_dec(&iter->qp->refcount);
return ret; return ret;
} }

View File

@ -52,7 +52,7 @@ static void __qib_release_user_pages(struct page **p, size_t num_pages,
* Call with current->mm->mmap_sem held. * Call with current->mm->mmap_sem held.
*/ */
static int __qib_get_user_pages(unsigned long start_page, size_t num_pages, static int __qib_get_user_pages(unsigned long start_page, size_t num_pages,
struct page **p, struct vm_area_struct **vma) struct page **p)
{ {
unsigned long lock_limit; unsigned long lock_limit;
size_t got; size_t got;
@ -69,7 +69,7 @@ static int __qib_get_user_pages(unsigned long start_page, size_t num_pages,
ret = get_user_pages(current, current->mm, ret = get_user_pages(current, current->mm,
start_page + got * PAGE_SIZE, start_page + got * PAGE_SIZE,
num_pages - got, 1, 1, num_pages - got, 1, 1,
p + got, vma); p + got, NULL);
if (ret < 0) if (ret < 0)
goto bail_release; goto bail_release;
} }
@ -136,7 +136,7 @@ int qib_get_user_pages(unsigned long start_page, size_t num_pages,
down_write(&current->mm->mmap_sem); down_write(&current->mm->mmap_sem);
ret = __qib_get_user_pages(start_page, num_pages, p, NULL); ret = __qib_get_user_pages(start_page, num_pages, p);
up_write(&current->mm->mmap_sem); up_write(&current->mm->mmap_sem);

View File

@ -529,21 +529,13 @@ void ipoib_mcast_join_task(struct work_struct *work)
port_attr.state); port_attr.state);
return; return;
} }
priv->local_lid = port_attr.lid;
if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid)) if (ib_query_gid(priv->ca, priv->port, 0, &priv->local_gid))
ipoib_warn(priv, "ib_query_gid() failed\n"); ipoib_warn(priv, "ib_query_gid() failed\n");
else else
memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid)); memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid));
{
struct ib_port_attr attr;
if (!ib_query_port(priv->ca, priv->port, &attr))
priv->local_lid = attr.lid;
else
ipoib_warn(priv, "ib_query_port failed\n");
}
if (!priv->broadcast) { if (!priv->broadcast) {
struct ipoib_mcast *broadcast; struct ipoib_mcast *broadcast;

View File

@ -344,7 +344,6 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
int is_leading) int is_leading)
{ {
struct iscsi_conn *conn = cls_conn->dd_data; struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_session *session;
struct iser_conn *ib_conn; struct iser_conn *ib_conn;
struct iscsi_endpoint *ep; struct iscsi_endpoint *ep;
int error; int error;
@ -363,9 +362,17 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
} }
ib_conn = ep->dd_data; ib_conn = ep->dd_data;
session = conn->session; mutex_lock(&ib_conn->state_mutex);
if (iser_alloc_rx_descriptors(ib_conn, session)) if (ib_conn->state != ISER_CONN_UP) {
return -ENOMEM; error = -EINVAL;
iser_err("iser_conn %p state is %d, teardown started\n",
ib_conn, ib_conn->state);
goto out;
}
error = iser_alloc_rx_descriptors(ib_conn, conn->session);
if (error)
goto out;
/* binds the iSER connection retrieved from the previously /* binds the iSER connection retrieved from the previously
* connected ep_handle to the iSCSI layer connection. exchanges * connected ep_handle to the iSCSI layer connection. exchanges
@ -375,7 +382,9 @@ iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,
conn->dd_data = ib_conn; conn->dd_data = ib_conn;
ib_conn->iscsi_conn = conn; ib_conn->iscsi_conn = conn;
return 0; out:
mutex_unlock(&ib_conn->state_mutex);
return error;
} }
static int static int

View File

@ -69,7 +69,7 @@
#define DRV_NAME "iser" #define DRV_NAME "iser"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
#define DRV_VER "1.4" #define DRV_VER "1.4.1"
#define iser_dbg(fmt, arg...) \ #define iser_dbg(fmt, arg...) \
do { \ do { \

View File

@ -73,7 +73,7 @@ static int iser_create_device_ib_res(struct iser_device *device)
{ {
struct iser_cq_desc *cq_desc; struct iser_cq_desc *cq_desc;
struct ib_device_attr *dev_attr = &device->dev_attr; struct ib_device_attr *dev_attr = &device->dev_attr;
int ret, i, j; int ret, i;
ret = ib_query_device(device->ib_device, dev_attr); ret = ib_query_device(device->ib_device, dev_attr);
if (ret) { if (ret) {
@ -125,16 +125,20 @@ static int iser_create_device_ib_res(struct iser_device *device)
iser_cq_event_callback, iser_cq_event_callback,
(void *)&cq_desc[i], (void *)&cq_desc[i],
ISER_MAX_RX_CQ_LEN, i); ISER_MAX_RX_CQ_LEN, i);
if (IS_ERR(device->rx_cq[i])) if (IS_ERR(device->rx_cq[i])) {
device->rx_cq[i] = NULL;
goto cq_err; goto cq_err;
}
device->tx_cq[i] = ib_create_cq(device->ib_device, device->tx_cq[i] = ib_create_cq(device->ib_device,
NULL, iser_cq_event_callback, NULL, iser_cq_event_callback,
(void *)&cq_desc[i], (void *)&cq_desc[i],
ISER_MAX_TX_CQ_LEN, i); ISER_MAX_TX_CQ_LEN, i);
if (IS_ERR(device->tx_cq[i])) if (IS_ERR(device->tx_cq[i])) {
device->tx_cq[i] = NULL;
goto cq_err; goto cq_err;
}
if (ib_req_notify_cq(device->rx_cq[i], IB_CQ_NEXT_COMP)) if (ib_req_notify_cq(device->rx_cq[i], IB_CQ_NEXT_COMP))
goto cq_err; goto cq_err;
@ -160,14 +164,14 @@ static int iser_create_device_ib_res(struct iser_device *device)
handler_err: handler_err:
ib_dereg_mr(device->mr); ib_dereg_mr(device->mr);
dma_mr_err: dma_mr_err:
for (j = 0; j < device->cqs_used; j++) for (i = 0; i < device->cqs_used; i++)
tasklet_kill(&device->cq_tasklet[j]); tasklet_kill(&device->cq_tasklet[i]);
cq_err: cq_err:
for (j = 0; j < i; j++) { for (i = 0; i < device->cqs_used; i++) {
if (device->tx_cq[j]) if (device->tx_cq[i])
ib_destroy_cq(device->tx_cq[j]); ib_destroy_cq(device->tx_cq[i]);
if (device->rx_cq[j]) if (device->rx_cq[i])
ib_destroy_cq(device->rx_cq[j]); ib_destroy_cq(device->rx_cq[i]);
} }
ib_dealloc_pd(device->pd); ib_dealloc_pd(device->pd);
pd_err: pd_err:

View File

@ -540,11 +540,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
has_nonrot_disk = 0; has_nonrot_disk = 0;
choose_next_idle = 0; choose_next_idle = 0;
if (conf->mddev->recovery_cp < MaxSector && choose_first = (conf->mddev->recovery_cp < this_sector + sectors);
(this_sector + sectors >= conf->next_resync))
choose_first = 1;
else
choose_first = 0;
for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) { for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) {
sector_t dist; sector_t dist;
@ -831,7 +827,7 @@ static void flush_pending_writes(struct r1conf *conf)
* there is no normal IO happeing. It must arrange to call * there is no normal IO happeing. It must arrange to call
* lower_barrier when the particular background IO completes. * lower_barrier when the particular background IO completes.
*/ */
static void raise_barrier(struct r1conf *conf) static void raise_barrier(struct r1conf *conf, sector_t sector_nr)
{ {
spin_lock_irq(&conf->resync_lock); spin_lock_irq(&conf->resync_lock);
@ -841,6 +837,7 @@ static void raise_barrier(struct r1conf *conf)
/* block any new IO from starting */ /* block any new IO from starting */
conf->barrier++; conf->barrier++;
conf->next_resync = sector_nr;
/* For these conditions we must wait: /* For these conditions we must wait:
* A: while the array is in frozen state * A: while the array is in frozen state
@ -849,14 +846,17 @@ static void raise_barrier(struct r1conf *conf)
* C: next_resync + RESYNC_SECTORS > start_next_window, meaning * C: next_resync + RESYNC_SECTORS > start_next_window, meaning
* next resync will reach to the window which normal bios are * next resync will reach to the window which normal bios are
* handling. * handling.
* D: while there are any active requests in the current window.
*/ */
wait_event_lock_irq(conf->wait_barrier, wait_event_lock_irq(conf->wait_barrier,
!conf->array_frozen && !conf->array_frozen &&
conf->barrier < RESYNC_DEPTH && conf->barrier < RESYNC_DEPTH &&
conf->current_window_requests == 0 &&
(conf->start_next_window >= (conf->start_next_window >=
conf->next_resync + RESYNC_SECTORS), conf->next_resync + RESYNC_SECTORS),
conf->resync_lock); conf->resync_lock);
conf->nr_pending++;
spin_unlock_irq(&conf->resync_lock); spin_unlock_irq(&conf->resync_lock);
} }
@ -866,6 +866,7 @@ static void lower_barrier(struct r1conf *conf)
BUG_ON(conf->barrier <= 0); BUG_ON(conf->barrier <= 0);
spin_lock_irqsave(&conf->resync_lock, flags); spin_lock_irqsave(&conf->resync_lock, flags);
conf->barrier--; conf->barrier--;
conf->nr_pending--;
spin_unlock_irqrestore(&conf->resync_lock, flags); spin_unlock_irqrestore(&conf->resync_lock, flags);
wake_up(&conf->wait_barrier); wake_up(&conf->wait_barrier);
} }
@ -877,9 +878,7 @@ static bool need_to_wait_for_sync(struct r1conf *conf, struct bio *bio)
if (conf->array_frozen || !bio) if (conf->array_frozen || !bio)
wait = true; wait = true;
else if (conf->barrier && bio_data_dir(bio) == WRITE) { else if (conf->barrier && bio_data_dir(bio) == WRITE) {
if (conf->next_resync < RESYNC_WINDOW_SECTORS) if ((conf->mddev->curr_resync_completed
wait = true;
else if ((conf->next_resync - RESYNC_WINDOW_SECTORS
>= bio_end_sector(bio)) || >= bio_end_sector(bio)) ||
(conf->next_resync + NEXT_NORMALIO_DISTANCE (conf->next_resync + NEXT_NORMALIO_DISTANCE
<= bio->bi_iter.bi_sector)) <= bio->bi_iter.bi_sector))
@ -919,8 +918,8 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
} }
if (bio && bio_data_dir(bio) == WRITE) { if (bio && bio_data_dir(bio) == WRITE) {
if (conf->next_resync + NEXT_NORMALIO_DISTANCE if (bio->bi_iter.bi_sector >=
<= bio->bi_iter.bi_sector) { conf->mddev->curr_resync_completed) {
if (conf->start_next_window == MaxSector) if (conf->start_next_window == MaxSector)
conf->start_next_window = conf->start_next_window =
conf->next_resync + conf->next_resync +
@ -1186,6 +1185,7 @@ read_again:
atomic_read(&bitmap->behind_writes) == 0); atomic_read(&bitmap->behind_writes) == 0);
} }
r1_bio->read_disk = rdisk; r1_bio->read_disk = rdisk;
r1_bio->start_next_window = 0;
read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev); read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev);
bio_trim(read_bio, r1_bio->sector - bio->bi_iter.bi_sector, bio_trim(read_bio, r1_bio->sector - bio->bi_iter.bi_sector,
@ -1548,8 +1548,13 @@ static void close_sync(struct r1conf *conf)
mempool_destroy(conf->r1buf_pool); mempool_destroy(conf->r1buf_pool);
conf->r1buf_pool = NULL; conf->r1buf_pool = NULL;
spin_lock_irq(&conf->resync_lock);
conf->next_resync = 0; conf->next_resync = 0;
conf->start_next_window = MaxSector; conf->start_next_window = MaxSector;
conf->current_window_requests +=
conf->next_window_requests;
conf->next_window_requests = 0;
spin_unlock_irq(&conf->resync_lock);
} }
static int raid1_spare_active(struct mddev *mddev) static int raid1_spare_active(struct mddev *mddev)
@ -2150,7 +2155,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
d--; d--;
rdev = conf->mirrors[d].rdev; rdev = conf->mirrors[d].rdev;
if (rdev && if (rdev &&
test_bit(In_sync, &rdev->flags)) !test_bit(Faulty, &rdev->flags))
r1_sync_page_io(rdev, sect, s, r1_sync_page_io(rdev, sect, s,
conf->tmppage, WRITE); conf->tmppage, WRITE);
} }
@ -2162,7 +2167,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
d--; d--;
rdev = conf->mirrors[d].rdev; rdev = conf->mirrors[d].rdev;
if (rdev && if (rdev &&
test_bit(In_sync, &rdev->flags)) { !test_bit(Faulty, &rdev->flags)) {
if (r1_sync_page_io(rdev, sect, s, if (r1_sync_page_io(rdev, sect, s,
conf->tmppage, READ)) { conf->tmppage, READ)) {
atomic_add(s, &rdev->corrected_errors); atomic_add(s, &rdev->corrected_errors);
@ -2541,9 +2546,8 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
bitmap_cond_end_sync(mddev->bitmap, sector_nr); bitmap_cond_end_sync(mddev->bitmap, sector_nr);
r1_bio = mempool_alloc(conf->r1buf_pool, GFP_NOIO); r1_bio = mempool_alloc(conf->r1buf_pool, GFP_NOIO);
raise_barrier(conf);
conf->next_resync = sector_nr; raise_barrier(conf, sector_nr);
rcu_read_lock(); rcu_read_lock();
/* /*

View File

@ -1490,6 +1490,7 @@ static struct v4l2_ctrl *cx2341x_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
{ {
struct v4l2_ctrl_config cfg; struct v4l2_ctrl_config cfg;
memset(&cfg, 0, sizeof(cfg));
cx2341x_ctrl_fill(id, &cfg.name, &cfg.type, &min, &max, &step, &def, &cfg.flags); cx2341x_ctrl_fill(id, &cfg.name, &cfg.type, &min, &max, &step, &def, &cfg.flags);
cfg.ops = &cx2341x_ops; cfg.ops = &cx2341x_ops;
cfg.id = id; cfg.id = id;

View File

@ -1095,6 +1095,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
sizeof(state->tuner_i2c_adapter.name)); sizeof(state->tuner_i2c_adapter.name));
state->tuner_i2c_adapter.algo = &cx24123_tuner_i2c_algo; state->tuner_i2c_adapter.algo = &cx24123_tuner_i2c_algo;
state->tuner_i2c_adapter.algo_data = NULL; state->tuner_i2c_adapter.algo_data = NULL;
state->tuner_i2c_adapter.dev.parent = i2c->dev.parent;
i2c_set_adapdata(&state->tuner_i2c_adapter, state); i2c_set_adapdata(&state->tuner_i2c_adapter, state);
if (i2c_add_adapter(&state->tuner_i2c_adapter) < 0) { if (i2c_add_adapter(&state->tuner_i2c_adapter) < 0) {
err("tuner i2c bus could not be initialized\n"); err("tuner i2c bus could not be initialized\n");

View File

@ -2325,7 +2325,7 @@ static int adv7604_log_status(struct v4l2_subdev *sd)
v4l2_info(sd, "HDCP keys read: %s%s\n", v4l2_info(sd, "HDCP keys read: %s%s\n",
(hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no", (hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no",
(hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : ""); (hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : "");
if (!is_hdmi(sd)) { if (is_hdmi(sd)) {
bool audio_pll_locked = hdmi_read(sd, 0x04) & 0x01; bool audio_pll_locked = hdmi_read(sd, 0x04) & 0x01;
bool audio_sample_packet_detect = hdmi_read(sd, 0x18) & 0x01; bool audio_sample_packet_detect = hdmi_read(sd, 0x18) & 0x01;
bool audio_mute = io_read(sd, 0x65) & 0x40; bool audio_mute = io_read(sd, 0x65) & 0x40;

View File

@ -27,6 +27,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/kthread.h> #include <linux/kthread.h>

View File

@ -1342,7 +1342,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct em28xx *dev = video_drvdata(file); struct em28xx *dev = video_drvdata(file);
struct em28xx_v4l2 *v4l2 = dev->v4l2; struct em28xx_v4l2 *v4l2 = dev->v4l2;
if (v4l2->streaming_users > 0) if (vb2_is_busy(&v4l2->vb_vidq))
return -EBUSY; return -EBUSY;
vidioc_try_fmt_vid_cap(file, priv, f); vidioc_try_fmt_vid_cap(file, priv, f);
@ -1883,8 +1883,9 @@ static int em28xx_v4l2_open(struct file *filp)
return -EINVAL; return -EINVAL;
} }
em28xx_videodbg("open dev=%s type=%s\n", em28xx_videodbg("open dev=%s type=%s users=%d\n",
video_device_node_name(vdev), v4l2_type_names[fh_type]); video_device_node_name(vdev), v4l2_type_names[fh_type],
v4l2->users);
if (mutex_lock_interruptible(&dev->lock)) if (mutex_lock_interruptible(&dev->lock))
return -ERESTARTSYS; return -ERESTARTSYS;
@ -1897,9 +1898,7 @@ static int em28xx_v4l2_open(struct file *filp)
return ret; return ret;
} }
if (v4l2_fh_is_singular_file(filp)) { if (v4l2->users == 0) {
em28xx_videodbg("first opened filehandle, initializing device\n");
em28xx_set_mode(dev, EM28XX_ANALOG_MODE); em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
if (vdev->vfl_type != VFL_TYPE_RADIO) if (vdev->vfl_type != VFL_TYPE_RADIO)
@ -1910,8 +1909,6 @@ static int em28xx_v4l2_open(struct file *filp)
* of some i2c devices * of some i2c devices
*/ */
em28xx_wake_i2c(dev); em28xx_wake_i2c(dev);
} else {
em28xx_videodbg("further filehandles are already opened\n");
} }
if (vdev->vfl_type == VFL_TYPE_RADIO) { if (vdev->vfl_type == VFL_TYPE_RADIO) {
@ -1921,6 +1918,7 @@ static int em28xx_v4l2_open(struct file *filp)
kref_get(&dev->ref); kref_get(&dev->ref);
kref_get(&v4l2->ref); kref_get(&v4l2->ref);
v4l2->users++;
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
@ -2027,11 +2025,12 @@ static int em28xx_v4l2_close(struct file *filp)
struct em28xx_v4l2 *v4l2 = dev->v4l2; struct em28xx_v4l2 *v4l2 = dev->v4l2;
int errCode; int errCode;
em28xx_videodbg("users=%d\n", v4l2->users);
vb2_fop_release(filp);
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
if (v4l2_fh_is_singular_file(filp)) { if (v4l2->users == 1) {
em28xx_videodbg("last opened filehandle, shutting down device\n");
/* No sense to try to write to the device */ /* No sense to try to write to the device */
if (dev->disconnected) if (dev->disconnected)
goto exit; goto exit;
@ -2050,12 +2049,10 @@ static int em28xx_v4l2_close(struct file *filp)
em28xx_errdev("cannot change alternate number to " em28xx_errdev("cannot change alternate number to "
"0 (error=%i)\n", errCode); "0 (error=%i)\n", errCode);
} }
} else {
em28xx_videodbg("further opened filehandles left\n");
} }
exit: exit:
vb2_fop_release(filp); v4l2->users--;
kref_put(&v4l2->ref, em28xx_free_v4l2); kref_put(&v4l2->ref, em28xx_free_v4l2);
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
kref_put(&dev->ref, em28xx_free_device); kref_put(&dev->ref, em28xx_free_device);

View File

@ -524,6 +524,7 @@ struct em28xx_v4l2 {
int sensor_yres; int sensor_yres;
int sensor_xtal; int sensor_xtal;
int users; /* user count for exclusive use */
int streaming_users; /* number of actively streaming users */ int streaming_users; /* number of actively streaming users */
u32 frequency; /* selected tuner frequency */ u32 frequency; /* selected tuner frequency */

View File

@ -971,6 +971,7 @@ static int __reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
* to the userspace. * to the userspace.
*/ */
req->count = allocated_buffers; req->count = allocated_buffers;
q->waiting_for_buffers = !V4L2_TYPE_IS_OUTPUT(q->type);
return 0; return 0;
} }
@ -1018,6 +1019,7 @@ static int __create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create
memset(q->plane_sizes, 0, sizeof(q->plane_sizes)); memset(q->plane_sizes, 0, sizeof(q->plane_sizes));
memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
q->memory = create->memory; q->memory = create->memory;
q->waiting_for_buffers = !V4L2_TYPE_IS_OUTPUT(q->type);
} }
num_buffers = min(create->count, VIDEO_MAX_FRAME - q->num_buffers); num_buffers = min(create->count, VIDEO_MAX_FRAME - q->num_buffers);
@ -1130,7 +1132,7 @@ EXPORT_SYMBOL_GPL(vb2_plane_vaddr);
*/ */
void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no) void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no)
{ {
if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv) if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
return NULL; return NULL;
return call_ptr_memop(vb, cookie, vb->planes[plane_no].mem_priv); return call_ptr_memop(vb, cookie, vb->planes[plane_no].mem_priv);
@ -1165,13 +1167,10 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
if (WARN_ON(vb->state != VB2_BUF_STATE_ACTIVE)) if (WARN_ON(vb->state != VB2_BUF_STATE_ACTIVE))
return; return;
if (!q->start_streaming_called) { if (WARN_ON(state != VB2_BUF_STATE_DONE &&
if (WARN_ON(state != VB2_BUF_STATE_QUEUED)) state != VB2_BUF_STATE_ERROR &&
state = VB2_BUF_STATE_QUEUED; state != VB2_BUF_STATE_QUEUED))
} else if (WARN_ON(state != VB2_BUF_STATE_DONE &&
state != VB2_BUF_STATE_ERROR)) {
state = VB2_BUF_STATE_ERROR; state = VB2_BUF_STATE_ERROR;
}
#ifdef CONFIG_VIDEO_ADV_DEBUG #ifdef CONFIG_VIDEO_ADV_DEBUG
/* /*
@ -1762,6 +1761,12 @@ static int vb2_start_streaming(struct vb2_queue *q)
q->start_streaming_called = 0; q->start_streaming_called = 0;
dprintk(1, "driver refused to start streaming\n"); dprintk(1, "driver refused to start streaming\n");
/*
* If you see this warning, then the driver isn't cleaning up properly
* after a failed start_streaming(). See the start_streaming()
* documentation in videobuf2-core.h for more information how buffers
* should be returned to vb2 in start_streaming().
*/
if (WARN_ON(atomic_read(&q->owned_by_drv_count))) { if (WARN_ON(atomic_read(&q->owned_by_drv_count))) {
unsigned i; unsigned i;
@ -1777,6 +1782,12 @@ static int vb2_start_streaming(struct vb2_queue *q)
/* Must be zero now */ /* Must be zero now */
WARN_ON(atomic_read(&q->owned_by_drv_count)); WARN_ON(atomic_read(&q->owned_by_drv_count));
} }
/*
* If done_list is not empty, then start_streaming() didn't call
* vb2_buffer_done(vb, VB2_BUF_STATE_QUEUED) but STATE_ERROR or
* STATE_DONE.
*/
WARN_ON(!list_empty(&q->done_list));
return ret; return ret;
} }
@ -1812,6 +1823,7 @@ static int vb2_internal_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
*/ */
list_add_tail(&vb->queued_entry, &q->queued_list); list_add_tail(&vb->queued_entry, &q->queued_list);
q->queued_count++; q->queued_count++;
q->waiting_for_buffers = false;
vb->state = VB2_BUF_STATE_QUEUED; vb->state = VB2_BUF_STATE_QUEUED;
if (V4L2_TYPE_IS_OUTPUT(q->type)) { if (V4L2_TYPE_IS_OUTPUT(q->type)) {
/* /*
@ -2123,6 +2135,12 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
if (q->start_streaming_called) if (q->start_streaming_called)
call_void_qop(q, stop_streaming, q); call_void_qop(q, stop_streaming, q);
/*
* If you see this warning, then the driver isn't cleaning up properly
* in stop_streaming(). See the stop_streaming() documentation in
* videobuf2-core.h for more information how buffers should be returned
* to vb2 in stop_streaming().
*/
if (WARN_ON(atomic_read(&q->owned_by_drv_count))) { if (WARN_ON(atomic_read(&q->owned_by_drv_count))) {
for (i = 0; i < q->num_buffers; ++i) for (i = 0; i < q->num_buffers; ++i)
if (q->bufs[i]->state == VB2_BUF_STATE_ACTIVE) if (q->bufs[i]->state == VB2_BUF_STATE_ACTIVE)
@ -2272,6 +2290,7 @@ static int vb2_internal_streamoff(struct vb2_queue *q, enum v4l2_buf_type type)
* their normal dequeued state. * their normal dequeued state.
*/ */
__vb2_queue_cancel(q); __vb2_queue_cancel(q);
q->waiting_for_buffers = !V4L2_TYPE_IS_OUTPUT(q->type);
dprintk(3, "successful\n"); dprintk(3, "successful\n");
return 0; return 0;
@ -2590,10 +2609,17 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
} }
/* /*
* There is nothing to wait for if no buffer has been queued and the * There is nothing to wait for if the queue isn't streaming, or if the
* queue isn't streaming, or if the error flag is set. * error flag is set.
*/ */
if ((list_empty(&q->queued_list) && !vb2_is_streaming(q)) || q->error) if (!vb2_is_streaming(q) || q->error)
return res | POLLERR;
/*
* For compatibility with vb1: if QBUF hasn't been called yet, then
* return POLLERR as well. This only affects capture queues, output
* queues will always initialize waiting_for_buffers to false.
*/
if (q->waiting_for_buffers)
return res | POLLERR; return res | POLLERR;
/* /*

View File

@ -113,7 +113,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_fla
goto fail_pages_alloc; goto fail_pages_alloc;
ret = sg_alloc_table_from_pages(&buf->sg_table, buf->pages, ret = sg_alloc_table_from_pages(&buf->sg_table, buf->pages,
buf->num_pages, 0, size, gfp_flags); buf->num_pages, 0, size, GFP_KERNEL);
if (ret) if (ret)
goto fail_table_alloc; goto fail_table_alloc;

View File

@ -298,6 +298,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED);
} }
/* Must protect against concurrent access */
int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
struct mlx4_mpt_entry ***mpt_entry) struct mlx4_mpt_entry ***mpt_entry)
{ {
@ -305,13 +306,10 @@ int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
int key = key_to_hw_index(mmr->key) & (dev->caps.num_mpts - 1); int key = key_to_hw_index(mmr->key) & (dev->caps.num_mpts - 1);
struct mlx4_cmd_mailbox *mailbox = NULL; struct mlx4_cmd_mailbox *mailbox = NULL;
/* Make sure that at this point we have single-threaded access only */
if (mmr->enabled != MLX4_MPT_EN_HW) if (mmr->enabled != MLX4_MPT_EN_HW)
return -EINVAL; return -EINVAL;
err = mlx4_HW2SW_MPT(dev, NULL, key); err = mlx4_HW2SW_MPT(dev, NULL, key);
if (err) { if (err) {
mlx4_warn(dev, "HW2SW_MPT failed (%d).", err); mlx4_warn(dev, "HW2SW_MPT failed (%d).", err);
mlx4_warn(dev, "Most likely the MR has MWs bound to it.\n"); mlx4_warn(dev, "Most likely the MR has MWs bound to it.\n");
@ -333,7 +331,6 @@ int mlx4_mr_hw_get_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
0, MLX4_CMD_QUERY_MPT, 0, MLX4_CMD_QUERY_MPT,
MLX4_CMD_TIME_CLASS_B, MLX4_CMD_TIME_CLASS_B,
MLX4_CMD_WRAPPED); MLX4_CMD_WRAPPED);
if (err) if (err)
goto free_mailbox; goto free_mailbox;
@ -378,9 +375,10 @@ int mlx4_mr_hw_write_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr,
err = mlx4_SW2HW_MPT(dev, mailbox, key); err = mlx4_SW2HW_MPT(dev, mailbox, key);
} }
if (!err) {
mmr->pd = be32_to_cpu((*mpt_entry)->pd_flags) & MLX4_MPT_PD_MASK; mmr->pd = be32_to_cpu((*mpt_entry)->pd_flags) & MLX4_MPT_PD_MASK;
if (!err)
mmr->enabled = MLX4_MPT_EN_HW; mmr->enabled = MLX4_MPT_EN_HW;
}
return err; return err;
} }
EXPORT_SYMBOL_GPL(mlx4_mr_hw_write_mpt); EXPORT_SYMBOL_GPL(mlx4_mr_hw_write_mpt);
@ -400,11 +398,12 @@ EXPORT_SYMBOL_GPL(mlx4_mr_hw_put_mpt);
int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry, int mlx4_mr_hw_change_pd(struct mlx4_dev *dev, struct mlx4_mpt_entry *mpt_entry,
u32 pdn) u32 pdn)
{ {
u32 pd_flags = be32_to_cpu(mpt_entry->pd_flags); u32 pd_flags = be32_to_cpu(mpt_entry->pd_flags) & ~MLX4_MPT_PD_MASK;
/* The wrapper function will put the slave's id here */ /* The wrapper function will put the slave's id here */
if (mlx4_is_mfunc(dev)) if (mlx4_is_mfunc(dev))
pd_flags &= ~MLX4_MPT_PD_VF_MASK; pd_flags &= ~MLX4_MPT_PD_VF_MASK;
mpt_entry->pd_flags = cpu_to_be32((pd_flags & ~MLX4_MPT_PD_MASK) |
mpt_entry->pd_flags = cpu_to_be32(pd_flags |
(pdn & MLX4_MPT_PD_MASK) (pdn & MLX4_MPT_PD_MASK)
| MLX4_MPT_PD_FLAG_EN_INV); | MLX4_MPT_PD_FLAG_EN_INV);
return 0; return 0;
@ -600,14 +599,18 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
{ {
int err; int err;
mpt_entry->start = cpu_to_be64(mr->iova); mpt_entry->start = cpu_to_be64(iova);
mpt_entry->length = cpu_to_be64(mr->size); mpt_entry->length = cpu_to_be64(size);
mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); mpt_entry->entity_size = cpu_to_be32(page_shift);
err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt);
if (err) if (err)
return err; return err;
mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK |
MLX4_MPT_PD_FLAG_EN_INV);
mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE |
MLX4_MPT_FLAG_SW_OWNS);
if (mr->mtt.order < 0) { if (mr->mtt.order < 0) {
mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL); mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_PHYSICAL);
mpt_entry->mtt_addr = 0; mpt_entry->mtt_addr = 0;
@ -617,6 +620,14 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
if (mr->mtt.page_shift == 0) if (mr->mtt.page_shift == 0)
mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order); mpt_entry->mtt_sz = cpu_to_be32(1 << mr->mtt.order);
} }
if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) {
/* fast register MR in free state */
mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE);
mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG |
MLX4_MPT_PD_FLAG_RAE);
} else {
mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS);
}
mr->enabled = MLX4_MPT_EN_SW; mr->enabled = MLX4_MPT_EN_SW;
return 0; return 0;

View File

@ -103,7 +103,8 @@ static int find_index(struct mlx4_dev *dev,
int i; int i;
for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { for (i = 0; i < MLX4_MAX_MAC_NUM; i++) {
if ((mac & MLX4_MAC_MASK) == if (table->refs[i] &&
(MLX4_MAC_MASK & mac) ==
(MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) (MLX4_MAC_MASK & be64_to_cpu(table->entries[i])))
return i; return i;
} }
@ -165,12 +166,14 @@ int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac)
mutex_lock(&table->mutex); mutex_lock(&table->mutex);
for (i = 0; i < MLX4_MAX_MAC_NUM; i++) { for (i = 0; i < MLX4_MAX_MAC_NUM; i++) {
if (free < 0 && !table->entries[i]) { if (!table->refs[i]) {
if (free < 0)
free = i; free = i;
continue; continue;
} }
if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { if ((MLX4_MAC_MASK & mac) ==
(MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) {
/* MAC already registered, increment ref count */ /* MAC already registered, increment ref count */
err = i; err = i;
++table->refs[i]; ++table->refs[i];

View File

@ -505,7 +505,7 @@ irqreturn_t ath_isr(int irq, void *dev)
* touch anything. Note this can happen early * touch anything. Note this can happen early
* on if the IRQ is shared. * on if the IRQ is shared.
*/ */
if (test_bit(ATH_OP_INVALID, &common->op_flags)) if (!ah || test_bit(ATH_OP_INVALID, &common->op_flags))
return IRQ_NONE; return IRQ_NONE;
/* shared irq, not for us */ /* shared irq, not for us */

View File

@ -4927,7 +4927,7 @@ static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg,
struct brcmu_chan ch; struct brcmu_chan ch;
int i; int i;
for (i = 0; i <= total; i++) { for (i = 0; i < total; i++) {
ch.chspec = (u16)le32_to_cpu(chlist->element[i]); ch.chspec = (u16)le32_to_cpu(chlist->element[i]);
cfg->d11inf.decchspec(&ch); cfg->d11inf.decchspec(&ch);

View File

@ -501,9 +501,13 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate,
targets->sens_res = targets->sens_res =
be16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_A_ATQA]); be16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_A_ATQA]);
targets->sel_res = skb->data[MICROREAD_EMCF_A_SAK]; targets->sel_res = skb->data[MICROREAD_EMCF_A_SAK];
memcpy(targets->nfcid1, &skb->data[MICROREAD_EMCF_A_UID],
skb->data[MICROREAD_EMCF_A_LEN]);
targets->nfcid1_len = skb->data[MICROREAD_EMCF_A_LEN]; targets->nfcid1_len = skb->data[MICROREAD_EMCF_A_LEN];
if (targets->nfcid1_len > sizeof(targets->nfcid1)) {
r = -EINVAL;
goto exit_free;
}
memcpy(targets->nfcid1, &skb->data[MICROREAD_EMCF_A_UID],
targets->nfcid1_len);
break; break;
case MICROREAD_GATE_ID_MREAD_ISO_A_3: case MICROREAD_GATE_ID_MREAD_ISO_A_3:
targets->supported_protocols = targets->supported_protocols =
@ -511,9 +515,13 @@ static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate,
targets->sens_res = targets->sens_res =
be16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_A3_ATQA]); be16_to_cpu(*(u16 *)&skb->data[MICROREAD_EMCF_A3_ATQA]);
targets->sel_res = skb->data[MICROREAD_EMCF_A3_SAK]; targets->sel_res = skb->data[MICROREAD_EMCF_A3_SAK];
memcpy(targets->nfcid1, &skb->data[MICROREAD_EMCF_A3_UID],
skb->data[MICROREAD_EMCF_A3_LEN]);
targets->nfcid1_len = skb->data[MICROREAD_EMCF_A3_LEN]; targets->nfcid1_len = skb->data[MICROREAD_EMCF_A3_LEN];
if (targets->nfcid1_len > sizeof(targets->nfcid1)) {
r = -EINVAL;
goto exit_free;
}
memcpy(targets->nfcid1, &skb->data[MICROREAD_EMCF_A3_UID],
targets->nfcid1_len);
break; break;
case MICROREAD_GATE_ID_MREAD_ISO_B: case MICROREAD_GATE_ID_MREAD_ISO_B:
targets->supported_protocols = NFC_PROTO_ISO14443_B_MASK; targets->supported_protocols = NFC_PROTO_ISO14443_B_MASK;

View File

@ -2,7 +2,8 @@
# Makefile for ST21NFCA HCI based NFC driver # Makefile for ST21NFCA HCI based NFC driver
# #
st21nfca_i2c-objs = i2c.o st21nfca_hci-objs = st21nfca.o st21nfca_dep.o
obj-$(CONFIG_NFC_ST21NFCA) += st21nfca_hci.o
obj-$(CONFIG_NFC_ST21NFCA) += st21nfca.o st21nfca_dep.o st21nfca_i2c-objs = i2c.o
obj-$(CONFIG_NFC_ST21NFCA_I2C) += st21nfca_i2c.o obj-$(CONFIG_NFC_ST21NFCA_I2C) += st21nfca_i2c.o

View File

@ -2,7 +2,8 @@
# Makefile for ST21NFCB NCI based NFC driver # Makefile for ST21NFCB NCI based NFC driver
# #
st21nfcb_i2c-objs = i2c.o st21nfcb_nci-objs = ndlc.o st21nfcb.o
obj-$(CONFIG_NFC_ST21NFCB) += st21nfcb_nci.o
obj-$(CONFIG_NFC_ST21NFCB) += st21nfcb.o ndlc.o st21nfcb_i2c-objs = i2c.o
obj-$(CONFIG_NFC_ST21NFCB_I2C) += st21nfcb_i2c.o obj-$(CONFIG_NFC_ST21NFCB_I2C) += st21nfcb_i2c.o

View File

@ -278,7 +278,7 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
{ {
struct hardware_path hwpath; struct hardware_path hwpath;
unsigned short i; unsigned short i;
char in[count+1], *temp; char in[64], *temp;
struct device *dev; struct device *dev;
int ret; int ret;
@ -286,8 +286,9 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
return -EINVAL; return -EINVAL;
/* We'll use a local copy of buf */ /* We'll use a local copy of buf */
memset(in, 0, count+1); count = min_t(size_t, count, sizeof(in)-1);
strncpy(in, buf, count); strncpy(in, buf, count);
in[count] = '\0';
/* Let's clean up the target. 0xff is a blank pattern */ /* Let's clean up the target. 0xff is a blank pattern */
memset(&hwpath, 0xff, sizeof(hwpath)); memset(&hwpath, 0xff, sizeof(hwpath));
@ -393,14 +394,15 @@ pdcspath_layer_write(struct pdcspath_entry *entry, const char *buf, size_t count
{ {
unsigned int layers[6]; /* device-specific info (ctlr#, unit#, ...) */ unsigned int layers[6]; /* device-specific info (ctlr#, unit#, ...) */
unsigned short i; unsigned short i;
char in[count+1], *temp; char in[64], *temp;
if (!entry || !buf || !count) if (!entry || !buf || !count)
return -EINVAL; return -EINVAL;
/* We'll use a local copy of buf */ /* We'll use a local copy of buf */
memset(in, 0, count+1); count = min_t(size_t, count, sizeof(in)-1);
strncpy(in, buf, count); strncpy(in, buf, count);
in[count] = '\0';
/* Let's clean up the target. 0 is a blank pattern */ /* Let's clean up the target. 0 is a blank pattern */
memset(&layers, 0, sizeof(layers)); memset(&layers, 0, sizeof(layers));
@ -755,7 +757,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
{ {
struct pdcspath_entry *pathentry; struct pdcspath_entry *pathentry;
unsigned char flags; unsigned char flags;
char in[count+1], *temp; char in[8], *temp;
char c; char c;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
@ -765,8 +767,9 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
return -EINVAL; return -EINVAL;
/* We'll use a local copy of buf */ /* We'll use a local copy of buf */
memset(in, 0, count+1); count = min_t(size_t, count, sizeof(in)-1);
strncpy(in, buf, count); strncpy(in, buf, count);
in[count] = '\0';
/* Current flags are stored in primary boot path entry */ /* Current flags are stored in primary boot path entry */
pathentry = &pdcspath_entry_primary; pathentry = &pdcspath_entry_primary;

View File

@ -160,7 +160,7 @@ static void pcie_wait_cmd(struct controller *ctrl)
ctrl->slot_ctrl & PCI_EXP_SLTCTL_CCIE) ctrl->slot_ctrl & PCI_EXP_SLTCTL_CCIE)
rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout); rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout);
else else
rc = pcie_poll_cmd(ctrl, timeout); rc = pcie_poll_cmd(ctrl, jiffies_to_msecs(timeout));
/* /*
* Controllers with errata like Intel CF118 don't generate * Controllers with errata like Intel CF118 don't generate

View File

@ -775,7 +775,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
/* Check if setup is sensible at all */ /* Check if setup is sensible at all */
if (!pass && if (!pass &&
(primary != bus->number || secondary <= bus->number || (primary != bus->number || secondary <= bus->number ||
secondary > subordinate || subordinate > bus->busn_res.end)) { secondary > subordinate)) {
dev_info(&dev->dev, "bridge configuration invalid ([bus %02x-%02x]), reconfiguring\n", dev_info(&dev->dev, "bridge configuration invalid ([bus %02x-%02x]), reconfiguring\n",
secondary, subordinate); secondary, subordinate);
broken = 1; broken = 1;
@ -838,23 +838,18 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
goto out; goto out;
} }
if (max >= bus->busn_res.end) {
dev_warn(&dev->dev, "can't allocate child bus %02x from %pR\n",
max, &bus->busn_res);
goto out;
}
/* Clear errors */ /* Clear errors */
pci_write_config_word(dev, PCI_STATUS, 0xffff); pci_write_config_word(dev, PCI_STATUS, 0xffff);
/* The bus will already exist if we are rescanning */ /* Prevent assigning a bus number that already exists.
* This can happen when a bridge is hot-plugged, so in
* this case we only re-scan this bus. */
child = pci_find_bus(pci_domain_nr(bus), max+1); child = pci_find_bus(pci_domain_nr(bus), max+1);
if (!child) { if (!child) {
child = pci_add_new_bus(bus, dev, max+1); child = pci_add_new_bus(bus, dev, max+1);
if (!child) if (!child)
goto out; goto out;
pci_bus_insert_busn_res(child, max+1, pci_bus_insert_busn_res(child, max+1, 0xff);
bus->busn_res.end);
} }
max++; max++;
buses = (buses & 0xff000000) buses = (buses & 0xff000000)
@ -913,11 +908,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
/* /*
* Set the subordinate bus number to its real value. * Set the subordinate bus number to its real value.
*/ */
if (max > bus->busn_res.end) {
dev_warn(&dev->dev, "max busn %02x is outside %pR\n",
max, &bus->busn_res);
max = bus->busn_res.end;
}
pci_bus_update_busn_res_end(child, max); pci_bus_update_busn_res_end(child, max);
pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max); pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
} }

View File

@ -26,6 +26,13 @@ struct ccp_cmd;
#if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \ #if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \
defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE) defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE)
/**
* ccp_present - check if a CCP device is present
*
* Returns zero if a CCP device is present, -ENODEV otherwise.
*/
int ccp_present(void);
/** /**
* ccp_enqueue_cmd - queue an operation for processing by the CCP * ccp_enqueue_cmd - queue an operation for processing by the CCP
* *
@ -53,6 +60,11 @@ int ccp_enqueue_cmd(struct ccp_cmd *cmd);
#else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */ #else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */
static inline int ccp_present(void)
{
return -ENODEV;
}
static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd) static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd)
{ {
return -ENODEV; return -ENODEV;

View File

@ -71,6 +71,7 @@ void percpu_ref_reinit(struct percpu_ref *ref);
void percpu_ref_exit(struct percpu_ref *ref); void percpu_ref_exit(struct percpu_ref *ref);
void percpu_ref_kill_and_confirm(struct percpu_ref *ref, void percpu_ref_kill_and_confirm(struct percpu_ref *ref,
percpu_ref_func_t *confirm_kill); percpu_ref_func_t *confirm_kill);
void __percpu_ref_kill_expedited(struct percpu_ref *ref);
/** /**
* percpu_ref_kill - drop the initial ref * percpu_ref_kill - drop the initial ref

View File

@ -295,7 +295,7 @@ struct vb2_buffer {
* can return an error if hardware fails, in that case all * can return an error if hardware fails, in that case all
* buffers that have been already given by the @buf_queue * buffers that have been already given by the @buf_queue
* callback are to be returned by the driver by calling * callback are to be returned by the driver by calling
* @vb2_buffer_done(VB2_BUF_STATE_DEQUEUED). * @vb2_buffer_done(VB2_BUF_STATE_QUEUED).
* If you need a minimum number of buffers before you can * If you need a minimum number of buffers before you can
* start streaming, then set @min_buffers_needed in the * start streaming, then set @min_buffers_needed in the
* vb2_queue structure. If that is non-zero then * vb2_queue structure. If that is non-zero then
@ -380,6 +380,9 @@ struct v4l2_fh;
* @start_streaming_called: start_streaming() was called successfully and we * @start_streaming_called: start_streaming() was called successfully and we
* started streaming. * started streaming.
* @error: a fatal error occurred on the queue * @error: a fatal error occurred on the queue
* @waiting_for_buffers: used in poll() to check if vb2 is still waiting for
* buffers. Only set for capture queues if qbuf has not yet been
* called since poll() needs to return POLLERR in that situation.
* @fileio: file io emulator internal data, used only if emulator is active * @fileio: file io emulator internal data, used only if emulator is active
* @threadio: thread io internal data, used only if thread is active * @threadio: thread io internal data, used only if thread is active
*/ */
@ -417,6 +420,7 @@ struct vb2_queue {
unsigned int streaming:1; unsigned int streaming:1;
unsigned int start_streaming_called:1; unsigned int start_streaming_called:1;
unsigned int error:1; unsigned int error:1;
unsigned int waiting_for_buffers:1;
struct vb2_fileio_data *fileio; struct vb2_fileio_data *fileio;
struct vb2_threadio_data *threadio; struct vb2_threadio_data *threadio;

View File

@ -47,6 +47,7 @@ struct ib_umem {
int writable; int writable;
int hugetlb; int hugetlb;
struct work_struct work; struct work_struct work;
struct pid *pid;
struct mm_struct *mm; struct mm_struct *mm;
unsigned long diff; unsigned long diff;
struct sg_table sg_head; struct sg_table sg_head;

View File

@ -3985,7 +3985,6 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type,
l = cgroup_pidlist_find_create(cgrp, type); l = cgroup_pidlist_find_create(cgrp, type);
if (!l) { if (!l) {
mutex_unlock(&cgrp->pidlist_mutex);
pidlist_free(array); pidlist_free(array);
return -ENOMEM; return -ENOMEM;
} }

View File

@ -184,3 +184,19 @@ void percpu_ref_kill_and_confirm(struct percpu_ref *ref,
call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu); call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu);
} }
EXPORT_SYMBOL_GPL(percpu_ref_kill_and_confirm); EXPORT_SYMBOL_GPL(percpu_ref_kill_and_confirm);
/*
* XXX: Temporary kludge to work around SCSI blk-mq stall. Used only by
* block/blk-mq.c::blk_mq_freeze_queue(). Will be removed during v3.18
* devel cycle. Do not use anywhere else.
*/
void __percpu_ref_kill_expedited(struct percpu_ref *ref)
{
WARN_ONCE(ref->pcpu_count_ptr & PCPU_REF_DEAD,
"percpu_ref_kill() called more than once on %pf!",
ref->release);
ref->pcpu_count_ptr |= PCPU_REF_DEAD;
synchronize_sched_expedited();
percpu_ref_kill_rcu(&ref->rcu);
}

View File

@ -54,7 +54,7 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
if (blocked && !IS_ERR(rfkill->clk) && rfkill->clk_enabled) if (blocked && !IS_ERR(rfkill->clk) && rfkill->clk_enabled)
clk_disable(rfkill->clk); clk_disable(rfkill->clk);
rfkill->clk_enabled = blocked; rfkill->clk_enabled = !blocked;
return 0; return 0;
} }

View File

@ -1782,14 +1782,16 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream,
{ {
struct snd_pcm_hw_params *params = arg; struct snd_pcm_hw_params *params = arg;
snd_pcm_format_t format; snd_pcm_format_t format;
int channels, width; int channels;
ssize_t frame_size;
params->fifo_size = substream->runtime->hw.fifo_size; params->fifo_size = substream->runtime->hw.fifo_size;
if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) {
format = params_format(params); format = params_format(params);
channels = params_channels(params); channels = params_channels(params);
width = snd_pcm_format_physical_width(format); frame_size = snd_pcm_format_size(format, channels);
params->fifo_size /= width * channels; if (frame_size > 0)
params->fifo_size /= (unsigned)frame_size;
} }
return 0; return 0;
} }

View File

@ -777,6 +777,7 @@ static const struct hda_model_fixup cxt5066_fixup_models[] = {
{ .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" }, { .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" },
{ .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" }, { .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" },
{ .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" }, { .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" },
{ .id = CXT_PINCFG_LEMOTE_A1205, .name = "lemote-a1205" },
{ .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" }, { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" },
{} {}
}; };

View File

@ -100,15 +100,19 @@ static int control_put(struct snd_kcontrol *kcontrol,
struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card);
int pos = kcontrol->private_value; int pos = kcontrol->private_value;
int v = ucontrol->value.integer.value[0]; int v = ucontrol->value.integer.value[0];
unsigned char cmd = EP1_CMD_WRITE_IO; unsigned char cmd;
if (cdev->chip.usb_id == switch (cdev->chip.usb_id) {
USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1)) case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER):
cmd = EP1_CMD_DIMM_LEDS; case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
if (cdev->chip.usb_id == case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER))
cmd = EP1_CMD_DIMM_LEDS; cmd = EP1_CMD_DIMM_LEDS;
break;
default:
cmd = EP1_CMD_WRITE_IO;
break;
}
if (pos & CNT_INTVAL) { if (pos & CNT_INTVAL) {
int i = pos & ~CNT_INTVAL; int i = pos & ~CNT_INTVAL;

View File

@ -71,7 +71,7 @@ static void vgic_v2_sync_lr_elrsr(struct kvm_vcpu *vcpu, int lr,
struct vgic_lr lr_desc) struct vgic_lr lr_desc)
{ {
if (!(lr_desc.state & LR_STATE_MASK)) if (!(lr_desc.state & LR_STATE_MASK))
set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr); __set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr);
} }
static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu) static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu)