From patchwork Sun Jul 29 13:33:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 10548249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1800A753 for ; Sun, 29 Jul 2018 13:34:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A98F2A4F9 for ; Sun, 29 Jul 2018 13:34:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E8522A4FD; Sun, 29 Jul 2018 13:34:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17AC02A4F9 for ; Sun, 29 Jul 2018 13:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbeG2PEp (ORCPT ); Sun, 29 Jul 2018 11:04:45 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:6043 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbeG2PEp (ORCPT ); Sun, 29 Jul 2018 11:04:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sandisk.com; i=@sandisk.com; q=dns/txt; s=dkim.sandisk.com; t=1532871256; x=1564407256; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GBkMPIXTe/DZ6emsTs3F0pbrMiZRG2dzgHODKU4Tm30=; b=Mn4rLuc/0yN6mV5/+axxb+w4kuucnBjjORnSa5ed6oGSjiIkyx3ERT7U HzS1hyga+TEXpHjAe3Ov1s6maqItgfb5nNb0iem+2+4ChAY4QGWQKWq6A qUWKWhD2uql3TAzdYDh+u9dA69tpq5jHfh9dSmh0YevauEzHpl/QiVBDo e+eRmvFntpwNeAl70v6rqK+4oTXqtR+Bh/q+8lJ1QD3rPEiRk4t8PjbcI 3oZO9sWtapWKNMZ/dNKsqXtnMNKpTYF3yJ0Y24QIHp/bzFkAMP1WbYsF6 zB5SrI6yrArh+6A/cLLwizQz91tIBhALfRJLFdS0uZZLCz3/6/v7+YvNH A==; X-IronPort-AV: E=Sophos;i="5.51,418,1526313600"; d="scan'208";a="85332412" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 29 Jul 2018 21:34:15 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 29 Jul 2018 06:22:45 -0700 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.231.37]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jul 2018 06:34:12 -0700 From: Avri Altman To: Christoph Hellwig , Johannes Thumshirn , Hannes Reinecke , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Cc: Stanislav Nijnikov , Avi Shchislowski , Alex Lemberg , Subhash Jadavani , Vinayak Holikatti , Avri Altman Subject: [RFC 0/6] scsi: scsi transport for ufs devices Date: Sun, 29 Jul 2018 16:33:20 +0300 Message-Id: <1532871206-6311-1-git-send-email-avri.altman@sandisk.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Here is a proposal to use the scsi transport subsystem to manage ufs devices. scsi transport is a framework that allow to send scsi commands to a non-scsi devices. Still, it is flexible enough to allow sending non-scsi commands as well. We will use this framework to manage ufs devices by sending UPIU transactions. We added a new scsi transport module, a ufs-bsg LLD companion, and some new API to the ufs driver. For the time being, we will not use it for data transfer, but just for device management per-se. We are planning to add this capability in the future. We tested it on a Hikey-960 platform with a V4.14 kernel, "modernized" by recent bsg and ufs patches. We also used a htc11 with a V4.4 kernel, but needed much more transport/bsg/ufs patches to make it relevant. Avri Altman (6): scsi: Add ufs transport class scsi: ufs: Add ufs-bsg module scsi: ufs: Instantiate a ufs transport if its available scsi: ufs: Add API to execute raw upiu commands scsi: ufs-bsg: Add support for raw upiu in ufs_bsg_request() scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request() drivers/scsi/Kconfig | 13 ++ drivers/scsi/Makefile | 1 + drivers/scsi/scsi_transport_ufs.c | 337 ++++++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs_bsg.c | 292 +++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs_bsg.h | 76 +++++++++ drivers/scsi/ufs/ufshcd.c | 232 ++++++++++++++++++++++++++ drivers/scsi/ufs/ufshcd.h | 4 + include/scsi/scsi_transport_ufs.h | 40 +++++ include/uapi/scsi/scsi_bsg_ufs.h | 56 +++++++ 10 files changed, 1052 insertions(+) create mode 100644 drivers/scsi/scsi_transport_ufs.c create mode 100644 drivers/scsi/ufs/ufs_bsg.c create mode 100644 drivers/scsi/ufs/ufs_bsg.h create mode 100644 include/scsi/scsi_transport_ufs.h create mode 100644 include/uapi/scsi/scsi_bsg_ufs.h