20 Dec, 2019

1 commit

  • Delete unused structure field tr in structure utp_upiu_req, since no person
    uses it for task management.

    Fixes: df032bf27a41 ("scsi: ufs: Add a bsg endpoint that supports UPIUs")
    Link: https://lore.kernel.org/r/20191205220912.5696-1-huobean@gmail.com
    Reviewed-by: Avri Altman
    Signed-off-by: Bean Huo
    Signed-off-by: Martin K. Petersen

    Bean Huo
     

13 Aug, 2019

1 commit

  • When CONFIG_UAPI_HEADER_TEST=y, exported headers are compile-tested to make
    sure they can be included from user-space.

    Currently, scsi_bsg_fc.h, scsi_netlink.h, and scsi_netlink_fc.h are
    excluded from the test coverage. To make them join the compile-test, we
    need to fix the build errors attached below.

    For a case like this, we decided to use __u{8,16,32,64} variable types in
    this discussion:

    https://lkml.org/lkml/2019/6/5/18

    Build log:

    CC usr/include/scsi/scsi_netlink_fc.h.s
    CC usr/include/scsi/scsi_netlink.h.s
    CC usr/include/scsi/scsi_bsg_fc.h.s
    In file included from ./usr/include/scsi/scsi_netlink_fc.h:10:0,
    from :32:
    ./usr/include/scsi/scsi_netlink.h:29:2: error: unknown type name uint8_t
    uint8_t version;
    ^~~~~~~
    ./usr/include/scsi/scsi_netlink.h:30:2: error: unknown type name uint8_t
    uint8_t transport;
    ^~~~~~~
    ./usr/include/scsi/scsi_netlink.h:31:2: error: unknown type name uint16_t
    uint16_t magic;
    ^~~~~~~~
    ./usr/include/scsi/scsi_netlink.h:32:2: error: unknown type name uint16_t
    uint16_t msgtype;
    ^~~~~~~~
    CC usr/include/rdma/vmw_pvrdma-abi.h.s
    ./usr/include/scsi/scsi_netlink.h:33:2: error: unknown type name uint16_t
    uint16_t msglen;
    ^~~~~~~~
    ./usr/include/scsi/scsi_netlink.h:34:33: error: uint64_t undeclared here (not in a function); did you mean __uint128_t ?
    } __attribute__((aligned(sizeof(uint64_t))));
    ^~~~~~~~
    __uint128_t
    ./usr/include/scsi/scsi_netlink.h:78:2: error: expected specifier-qualifier-list before uint64_t
    uint64_t vendor_id;
    ^~~~~~~~
    In file included from :32:0:
    ./usr/include/scsi/scsi_netlink_fc.h:46:2: error: expected specifier-qualifier-list before uint64_t
    uint64_t seconds;
    ^~~~~~~~
    make[2]: *** [scripts/Makefile.build;302: usr/include/scsi/scsi_netlink_fc.h.s] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from :32:0:
    ./usr/include/scsi/scsi_netlink.h:29:2: error: unknown type name uint8_t
    uint8_t version;
    ^~~~~~~
    ./usr/include/scsi/scsi_netlink.h:30:2: error: unknown type name uint8_t
    uint8_t transport;
    ^~~~~~~
    ./usr/include/scsi/scsi_netlink.h:31:2: error: unknown type name uint16_t
    uint16_t magic;
    ^~~~~~~~
    ./usr/include/scsi/scsi_netlink.h:32:2: error: unknown type name uint16_t
    uint16_t msgtype;
    ^~~~~~~~
    ./usr/include/scsi/scsi_netlink.h:33:2: error: unknown type name uint16_t
    uint16_t msglen;
    ^~~~~~~~
    ./usr/include/scsi/scsi_netlink.h:34:33: error: uint64_t undeclared here (not in a function); did you mean __uint128_t ?
    } __attribute__((aligned(sizeof(uint64_t))));
    ^~~~~~~~
    __uint128_t
    ./usr/include/scsi/scsi_netlink.h:78:2: error: expected specifier-qualifier-list before uint64_t
    uint64_t vendor_id;
    ^~~~~~~~
    make[2]: *** [scripts/Makefile.build;302: usr/include/scsi/scsi_netlink.h.s] Error 1
    In file included from :32:0:
    ./usr/include/scsi/scsi_bsg_fc.h:69:2: error: unknown type name uint8_t
    uint8_t reserved;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:72:2: error: unknown type name uint8_t
    uint8_t port_id[3];
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:90:2: error: unknown type name uint8_t
    uint8_t reserved;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:93:2: error: unknown type name uint8_t
    uint8_t port_id[3];
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:114:2: error: unknown type name uint8_t
    uint8_t command_code;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:117:2: error: unknown type name uint8_t
    uint8_t port_id[3];
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:154:2: error: unknown type name uint32_t
    uint32_t status; /* See FC_CTELS_STATUS_xxx */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:158:3: error: unknown type name uint8_t
    uint8_t action; /* fragment_id for CT REJECT */
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:159:3: error: unknown type name uint8_t
    uint8_t reason_code;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:160:3: error: unknown type name uint8_t
    uint8_t reason_explanation;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:161:3: error: unknown type name uint8_t
    uint8_t vendor_unique;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:177:2: error: unknown type name uint8_t
    uint8_t reserved;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:180:2: error: unknown type name uint8_t
    uint8_t port_id[3];
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:185:2: error: unknown type name uint32_t
    uint32_t preamble_word0; /* revision & IN_ID */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:186:2: error: unknown type name uint32_t
    uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:187:2: error: unknown type name uint32_t
    uint32_t preamble_word2; /* Cmd Code, Max Size */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:207:2: error: unknown type name uint64_t
    uint64_t vendor_id;
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:210:2: error: unknown type name uint32_t
    uint32_t vendor_cmd[0];
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:217:2: error: unknown type name uint32_t
    uint32_t vendor_rsp[0];
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:236:2: error: unknown type name uint8_t
    uint8_t els_code;
    ^~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:254:2: error: unknown type name uint32_t
    uint32_t preamble_word0; /* revision & IN_ID */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:255:2: error: unknown type name uint32_t
    uint32_t preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:256:2: error: unknown type name uint32_t
    uint32_t preamble_word2; /* Cmd Code, Max Size */
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:268:2: error: unknown type name uint32_t
    uint32_t msgcode;
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:292:2: error: unknown type name uint32_t
    uint32_t result;
    ^~~~~~~~
    ./usr/include/scsi/scsi_bsg_fc.h:295:2: error: unknown type name uint32_t
    uint32_t reply_payload_rcv_len;
    ^~~~~~~~

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Martin K. Petersen

    Masahiro Yamada
     

23 Jul, 2019

1 commit

  • Added 'WITH Linux-syscall-note' exception which is the officially assigned
    exception identifier for the kernel syscall exception. This exception
    makes it possible to include GPL headers into non GPL code without
    confusing license compliance tools.

    Fixes: a851b2bd3632 (scsi: uapi: ufs: Make utp_upiu_req visible to user space)
    Signed-off-by: Avri Altman
    Reviewed-by: Pedro Sousa
    Signed-off-by: Martin K. Petersen

    Avri Altman
     

21 May, 2019

3 commits


09 Apr, 2019

1 commit

  • T11 has introduced a new Fabric Notifications mechanism whereby the fabric
    can notify a port of events occurring in the fabric. The notifications are
    given by the FPIN ELS.

    Add the FPIN ELS definitions to the kernel.

    Signed-off-by: James Smart
    Reviewed-by: Ewan D. Milne
    Signed-off-by: Martin K. Petersen

    James Smart
     

16 Oct, 2018

1 commit

  • We get a warning from 'make headers_check' about a newly introduced usage
    of integer types in the scsi/scsi_bsg_ufs.h uapi header:

    usr/include/scsi/scsi_bsg_ufs.h:18: found __[us]{8,16,32,64} type without #include

    Aside from the missing linux/types.h inclusion, I also noticed that it
    uses the wrong types: 'u32' is not available at all in user space, and
    'uint32_t' depends on the inclusion of a standard header that we should
    not include from kernel headers.

    Change the all to __u32 and similar types here.

    I also note the usage of '__be32' and '__be16' that seems unfortunate for
    a user space API. I wonder if it would be better to define the interface
    in terms of a CPU-endian structure and convert it in kernel space.

    Fixes: e77044c5a842 ("scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()")
    Fixes: df032bf27a41 ("scsi: ufs: Add a bsg endpoint that supports UPIUs")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Avri Altman
    Signed-off-by: Martin K. Petersen

    Arnd Bergmann
     

11 Oct, 2018

3 commits

  • Make ufshcd_send_uic_cmd() public for that.

    Signed-off-by: Avri Altman
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Avri Altman
     
  • For now, just provide an API to allocate and remove ufs-bsg node. We
    will use this framework to manage ufs devices by sending UPIU
    transactions.

    For the time being, implements an empty bsg_request() - will add some
    more functionality in coming patches.

    Nonetheless, we reveal here the protocol we are planning to use: UFS
    Transport Protocol Transactions. UFS transactions consist of packets
    called UFS Protocol Information Units (UPIU).

    There are UPIU’s defined for UFS SCSI commands, responses, data in and
    data out, task management, utility functions, vendor functions,
    transaction synchronization and control, and more.

    By using UPIUs, we get access to the most fine-grained internals of this
    protocol, and able to communicate with the device in ways, that are
    sometimes beyond the capacity of the ufs driver.

    Moreover and as a result, our core structure - ufs_bsg_node has a pretty
    lean structure: using upiu transactions that contains the outmost
    detailed info, so we don't really need complex constructs to support it.

    Signed-off-by: Avri Altman
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Avri Altman
     
  • in preparation to send UPIU requests via bsg.

    Signed-off-by: Avri Altman
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Avri Altman
     

02 Nov, 2017

1 commit

  • Many user space API headers have licensing information, which is either
    incomplete, badly formatted or just a shorthand for referring to the
    license under which the file is supposed to be. This makes it hard for
    compliance tools to determine the correct license.

    Update these files with an SPDX license identifier. The identifier was
    chosen based on the license information in the file.

    GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
    identifier with the added 'WITH Linux-syscall-note' exception, which is
    the officially assigned exception identifier for the kernel syscall
    exception:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    This exception makes it possible to include GPL headers into non GPL
    code, without confusing license compliance tools.

    Headers which have either explicit dual licensing or are just licensed
    under a non GPL license are updated with the corresponding SPDX
    identifier and the GPLv2 with syscall exception identifier. The format
    is:
    ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

    SPDX license identifiers are a legally binding shorthand, which can be
    used instead of the full boiler plate text. The update does not remove
    existing license information as this has to be done on a case by case
    basis and the copyright holders might have to be consulted. This will
    happen in a separate step.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

27 Jun, 2017

3 commits

  • Adopt the SISLite AFU debug capability to allow future CXL Flash
    adapters the ability to better debug AFU issues. Update the SISLite
    header with the changes necessary to support AFU debug operations
    and create a host ioctl interface for user debug software. Also
    update the cxlflash documentation to describe this new host ioctl.

    Signed-off-by: Matthew R. Ochs
    Signed-off-by: Uma Krishnan
    Signed-off-by: Martin K. Petersen

    Matthew R. Ochs
     
  • Adopt the SISLite AFU LUN provisioning capability to allow future CXL
    Flash adapters the ability to better manage storage. Update the SISLite
    header with the changes necessary to support LUN provision operations
    and create a host ioctl interface for user LUN management software. Also
    update the cxlflash documentation to describe this new host ioctl.

    Signed-off-by: Matthew R. Ochs
    Signed-off-by: Uma Krishnan
    Signed-off-by: Martin K. Petersen

    Matthew R. Ochs
     
  • As staging for supporting various host management functions, add a host
    ioctl infrastructure to filter ioctl commands and perform operations that
    are common for all host ioctls. Also update the cxlflash documentation to
    create a new section for documenting host ioctls.

    Signed-off-by: Matthew R. Ochs
    Signed-off-by: Uma Krishnan
    Signed-off-by: Martin K. Petersen

    Matthew R. Ochs
     

10 May, 2017

1 commit

  • Regularly, when a new header is created in include/uapi/, the developer
    forgets to add it in the corresponding Kbuild file. This error is usually
    detected after the release is out.

    In fact, all headers under uapi directories should be exported, thus it's
    useless to have an exhaustive list.

    After this patch, the following files, which were not exported, are now
    exported (with make headers_install_all):
    asm-arc/kvm_para.h
    asm-arc/ucontext.h
    asm-blackfin/shmparam.h
    asm-blackfin/ucontext.h
    asm-c6x/shmparam.h
    asm-c6x/ucontext.h
    asm-cris/kvm_para.h
    asm-h8300/shmparam.h
    asm-h8300/ucontext.h
    asm-hexagon/shmparam.h
    asm-m32r/kvm_para.h
    asm-m68k/kvm_para.h
    asm-m68k/shmparam.h
    asm-metag/kvm_para.h
    asm-metag/shmparam.h
    asm-metag/ucontext.h
    asm-mips/hwcap.h
    asm-mips/reg.h
    asm-mips/ucontext.h
    asm-nios2/kvm_para.h
    asm-nios2/ucontext.h
    asm-openrisc/shmparam.h
    asm-parisc/kvm_para.h
    asm-powerpc/perf_regs.h
    asm-sh/kvm_para.h
    asm-sh/ucontext.h
    asm-tile/shmparam.h
    asm-unicore32/shmparam.h
    asm-unicore32/ucontext.h
    asm-x86/hwcap2.h
    asm-xtensa/kvm_para.h
    drm/armada_drm.h
    drm/etnaviv_drm.h
    drm/vgem_drm.h
    linux/aspeed-lpc-ctrl.h
    linux/auto_dev-ioctl.h
    linux/bcache.h
    linux/btrfs_tree.h
    linux/can/vxcan.h
    linux/cifs/cifs_mount.h
    linux/coresight-stm.h
    linux/cryptouser.h
    linux/fsmap.h
    linux/genwqe/genwqe_card.h
    linux/hash_info.h
    linux/kcm.h
    linux/kcov.h
    linux/kfd_ioctl.h
    linux/lightnvm.h
    linux/module.h
    linux/nbd-netlink.h
    linux/nilfs2_api.h
    linux/nilfs2_ondisk.h
    linux/nsfs.h
    linux/pr.h
    linux/qrtr.h
    linux/rpmsg.h
    linux/sched/types.h
    linux/sed-opal.h
    linux/smc.h
    linux/smc_diag.h
    linux/stm.h
    linux/switchtec_ioctl.h
    linux/vfio_ccw.h
    linux/wil6210_uapi.h
    rdma/bnxt_re-abi.h

    Note that I have removed from this list the files which are generated in every
    exported directories (like .install or .install.cmd).

    Thanks to Julien Floret for the tip to get all
    subdirs with a pure makefile command.

    For the record, note that exported files for asm directories are a mix of
    files listed by:
    - include/uapi/asm-generic/Kbuild.asm;
    - arch//include/uapi/asm/Kbuild;
    - arch//include/asm/Kbuild.

    Signed-off-by: Nicolas Dichtel
    Acked-by: Daniel Vetter
    Acked-by: Russell King
    Acked-by: Mark Salter
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Masahiro Yamada

    Nicolas Dichtel
     

12 Jan, 2017

1 commit

  • The SISLite specification outlines a new queuing model to improve
    over the MMIO-based IOARRIN model that exists today. This new model
    uses a submission queue that exists in host memory and is shared with
    the device. Each entry in the queue is an IOARCB that describes a
    transfer request. When requests are submitted, IOARCBs ('current'
    position tracked in host software) are populated and the submission
    queue tail pointer is then updated via MMIO to make the device aware
    of the requests.

    Signed-off-by: Matthew R. Ochs
    Signed-off-by: Uma Krishnan
    Signed-off-by: Martin K. Petersen

    Matthew R. Ochs
     

06 Dec, 2016

1 commit


24 Aug, 2016

1 commit

  • Caching the adapter file descriptor and performing a close on behalf of
    an application is a poor design. This is due to the fact that once a
    file descriptor in installed, it is free to be altered without the
    knowledge of the cxlflash driver. This can lead to inconsistencies
    between the application and kernel. Furthermore, the nature of the
    former design is more exploitable and thus should be abandoned.

    To support applications performing a close on the adapter file that is
    associated with a context, a new flag is introduced to the user API to
    indicate to applications that they are responsible for the close
    following the cleanup (detach) of a context. The documentation is also
    updated to reflect this change in behavior.

    Inspired-by: Al Viro
    Signed-off-by: Matthew R. Ochs
    Acked-by: Manoj N. Kumar
    Signed-off-by: Martin K. Petersen

    Matthew R. Ochs
     

07 Jan, 2016

1 commit

  • Applications which use virtual LUN's that are backed by a physical LUN
    over both adapter ports may experience an I/O failure in the event of a
    link loss (e.g. cable pull).

    Virtual LUNs may be accessed through one or both ports of the adapter.
    This access is encoded in the translation entries that comprise the
    virtual LUN and used by the AFU for load-balancing I/O and handling
    failover scenarios. In a link loss scenario, even though the AFU is able
    to maintain connectivity to the LUN, it is up to the application to
    retry the failed I/O. When applications are unaware of the virtual LUN's
    underlying topology, they are unable to make a sound decision of when to
    retry an I/O and therefore are forced to make their reaction to a failed
    I/O absolute. The result is either a failure to retry I/O or increased
    latency for scenarios where a retry is pointless.

    To remedy this scenario, provide feedback back to the application on
    virtual LUN creation as to which ports the LUN may be accessed. LUN's
    spanning both ports are candidates for a retry in a presence of an I/O
    failure.

    Signed-off-by: Matthew R. Ochs
    Acked-by: Manoj Kumar
    Reviewed-by: Uma Krishnan
    Signed-off-by: Martin K. Petersen

    Matthew R. Ochs
     

27 Aug, 2015

2 commits

  • Add support for physical LUN segmentation (virtual LUNs) to device
    driver supporting the IBM CXL Flash adapter. This patch allows user
    space applications to virtually segment a physical LUN into N virtual
    LUNs, taking advantage of the translation features provided by this
    adapter.

    Signed-off-by: Matthew R. Ochs
    Signed-off-by: Manoj N. Kumar
    Reviewed-by: Michael Neuling
    Reviewed-by: Wen Xiong
    Signed-off-by: James Bottomley

    Matthew R. Ochs
     
  • Add superpipe supporting infrastructure to device driver for the IBM CXL
    Flash adapter. This patch allows userspace applications to take advantage
    of the accelerated I/O features that this adapter provides and bypass the
    traditional filesystem stack.

    Signed-off-by: Matthew R. Ochs
    Signed-off-by: Manoj N. Kumar
    Reviewed-by: Michael Neuling
    Reviewed-by: Wen Xiong
    Reviewed-by: Brian King
    Signed-off-by: James Bottomley

    Matthew R. Ochs
     

01 Mar, 2013

1 commit


08 Jan, 2013

1 commit


20 Dec, 2012

1 commit


03 Oct, 2012

1 commit