Skip to contentSkip to conversation

drivers/scsi/ufs: Seggregate PCI Specific Code

PATCH Superseded [email protected] 2 participants 6 messages Feb 5, 2013 – Feb 24, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1360082857-3317-1-git-send-email-y

#1 lore raw

PATCH v6 1/4 drivers/scsi/ufs: Seggregate PCI Specific Code

From: Vinayak Holikatti <[email protected]>

This patch seggregates the PCI specific code in ufshcd.c to make it ready for splitting into core ufs driver and PCI glue driver. Also copyright header modification to remove extra warranty disclaim.

---
 drivers/scsi/ufs/Kconfig  |   50 +++----
 drivers/scsi/ufs/ufs.h    |   44 +++----
 drivers/scsi/ufs/ufshcd.c |  350 +++++++++++++++++++++++++++------------------
 drivers/scsi/ufs/ufshci.h |   44 +++----
 4 files changed, 268 insertions(+), 220 deletions(-)
drivers/scsi/ufs/Kconfig +20 -30
index 8f27f9d..8ee40df 100644
@@ -2,45 +2,35 @@
 # Kernel configuration file for the UFS Host Controller
 #
 # This code is based on drivers/scsi/ufs/Kconfig
-# Copyright (C) 2011  Samsung Samsung India Software Operations
+# Copyright (C) 2011-2013 Samsung India Software Operations
+#
+# Authors:
+#	Santosh Yaraganavi <[email protected]>
+#	Vinayak Holikatti <[email protected]>
 #
-# Santosh Yaraganavi <[email protected]>
-# Vinayak Holikatti <[email protected]>
-
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-
+# See the COPYING file in the top-level directory or visit
+# <http://www.gnu.org/licenses/gpl-2.0.html>
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
-# NO WARRANTY
-# THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
-# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
-# LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
-# solely responsible for determining the appropriateness of using and
-# distributing the Program and assumes all risks associated with its
-# exercise of rights under this Agreement, including but not limited to
-# the risks and costs of program errors, damage to or loss of data,
-# programs or equipment, and unavailability or interruption of operations.
-
-# DISCLAIMER OF LIABILITY
-# NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-# USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-# HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-# USA.
+#
+# This program is provided "AS IS" and "WITH ALL FAULTS" and
+# without warranty of any kind. You are solely responsible for
+# determining the appropriateness of using and distributing
+# the program and assume all risks associated with your exercise
+# of rights with respect to the program, including but not limited
+# to infringement of third party rights, the risks and costs of
+# program errors, damage to or loss of data, programs or equipment,
+# and unavailability or interruption of operations. Under no
+# circumstances will the contributor of this Program be liable for
+# any damages of any kind arising from your use or distribution of
+# this program.
 
 config SCSI_UFSHCD
 	tristate "Universal Flash Storage host controller driver"
drivers/scsi/ufs/ufs.h +17 -27

62 lines not on this page · raw message

drivers/scsi/ufs/ufshcd.c +214 -136

657 lines not on this page · raw message

drivers/scsi/ufs/ufshci.h +17 -27

62 lines not on this page · raw message

Signature · 1 line
1.7.5.4
maintainer
#2 lore raw
Quoted 11 lines · On Tue, 2013-02-05 at 22:17 +0530, [email protected] wrote:

From: Vinayak Holikatti <[email protected]>

This patch seggregates the PCI specific code in ufshcd.c to make it ready for splitting into core ufs driver and PCI glue driver. Also copyright header modification to remove extra warranty disclaim.

Quoted 6 lines
---
 drivers/scsi/ufs/Kconfig  |   50 +++----
 drivers/scsi/ufs/ufs.h    |   44 +++----
 drivers/scsi/ufs/ufshcd.c |  350 +++++++++++++++++++++++++++------------------
 drivers/scsi/ufs/ufshci.h |   44 +++----
 4 files changed, 268 insertions(+), 220 deletions(-)

This patch doesn't apply:

jejb@dabdike> patch -p1 < .git/rebase-apply/patch patching file drivers/scsi/ufs/Kconfig patching file drivers/scsi/ufs/ufs.h patching file drivers/scsi/ufs/ufshcd.c Hunk #26 FAILED at 1823.
Hunk #27 succeeded at 1898 (offset -1 lines). Hunk #28 succeeded at 1924 (offset -1 lines). Hunk #29 FAILED at 2039.
2 out of 29 hunks FAILED -- saving rejects to file drivers/scsi/ufs/ufshcd.c.rej
patching file drivers/scsi/ufs/ufshci.h

The rejects are pretty complex hunks; could you please rebase to the top of the scsi-misc tree? Thanks,

James

#3 lore raw
Quoted 33 lines · James Bottomley
Quoted 11 lines · On Tue, 2013-02-05 at 22:17 +0530, [email protected] wrote:

From: Vinayak Holikatti <[email protected]>

This patch seggregates the PCI specific code in ufshcd.c to make it ready for splitting into core ufs driver and PCI glue driver. Also copyright header modification to remove extra warranty disclaim.

Quoted 6 lines
---
 drivers/scsi/ufs/Kconfig  |   50 +++----
 drivers/scsi/ufs/ufs.h    |   44 +++----
 drivers/scsi/ufs/ufshcd.c |  350 +++++++++++++++++++++++++++------------------
 drivers/scsi/ufs/ufshci.h |   44 +++----
 4 files changed, 268 insertions(+), 220 deletions(-)

This patch doesn't apply:

jejb@dabdike> patch -p1 < .git/rebase-apply/patch patching file drivers/scsi/ufs/Kconfig patching file drivers/scsi/ufs/ufs.h patching file drivers/scsi/ufs/ufshcd.c Hunk #26 FAILED at 1823.
Hunk #27 succeeded at 1898 (offset -1 lines). Hunk #28 succeeded at 1924 (offset -1 lines). Hunk #29 FAILED at 2039.
2 out of 29 hunks FAILED -- saving rejects to file drivers/scsi/ufs/ufshcd.c.rej
patching file drivers/scsi/ufs/ufshci.h

Quoted 2 lines

The rejects are pretty complex hunks; could you please rebase to the top of the scsi-misc tree? Thanks,

Ok, I will do it.

Quoted 4 lines

James

#4 lore raw

PATCH v6 2/4 drivers/scsi/ufs: Separate PCI code into glue driver

In reply to a message not in the archive

From: Vinayak Holikatti <[email protected]>

This patch separates PCI code from ufshcd.c and makes it as a core driver module and adds a new file ufshcd-pci.c as PCI glue driver.

---
 drivers/scsi/ufs/Kconfig      |   26 +++-
 drivers/scsi/ufs/Makefile     |    1 +
 drivers/scsi/ufs/ufshcd-pci.c |  211 ++++++++++++++++++++++++++
 drivers/scsi/ufs/ufshcd.c     |  328 +----------------------------------------
 drivers/scsi/ufs/ufshcd.h     |  202 +++++++++++++++++++++++++
 5 files changed, 440 insertions(+), 328 deletions(-)
 create mode 100644 drivers/scsi/ufs/ufshcd-pci.c
 create mode 100644 drivers/scsi/ufs/ufshcd.h
drivers/scsi/ufs/Kconfig +23 -3
index 8ee40df..0371047 100644
@@ -33,7 +33,27 @@
 # this program.
 
 config SCSI_UFSHCD
-	tristate "Universal Flash Storage host controller driver"
-	depends on PCI && SCSI
+	tristate "Universal Flash Storage Controller Driver Core"
+	depends on SCSI
 	---help---
-	This is a generic driver which supports PCIe UFS Host controllers.
+	This selects the support for UFS devices in Linux, say Y and make
+	  sure that you know the name of your UFS host adapter (the card
+	  inside your computer that "speaks" the UFS protocol, also
+	  called UFS Host Controller), because you will be asked for it.
+	  The module will be called ufshcd.
+
+	  To compile this driver as a module, choose M here and read
+	  <file:Documentation/scsi/ufs.txt>.
+	  However, do not compile this as a module if your root file system
+	  (the one containing the directory /) is located on a UFS device.
+
+config SCSI_UFSHCD_PCI
+	tristate "PCI bus based UFS Controller support"
+	depends on SCSI_UFSHCD && PCI
+	---help---
+	This selects the PCI UFS Host Controller Interface. Select this if
+	you have UFS Host Controller with PCI Interface.
+
+	  If you have a controller with this interface, say Y or M here.
+
+	  If unsure, say N.
drivers/scsi/ufs/Makefile +1 -0
index adf7895..9eda0df 100644
@@ -1,2 +1,3 @@
 # UFSHCD makefile
 obj-$(CONFIG_SCSI_UFSHCD) += ufshcd.o
+obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
drivers/scsi/ufs/ufshcd-pci.c new file +211 -0

211 lines not on this page · raw message

drivers/scsi/ufs/ufshcd.c +3 -325

375 lines not on this page · raw message

drivers/scsi/ufs/ufshcd.h new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#5 lore raw

PATCH v6 3/4 ufs: Add Platform glue driver for ufshcd

In reply to a message not in the archive

From: Vinayak Holikatti <[email protected]>

This patch adds Platform glue driver for ufshcd.

---
 drivers/scsi/ufs/Kconfig         |   11 ++
 drivers/scsi/ufs/Makefile        |    1 +
 drivers/scsi/ufs/ufshcd-pltfrm.c |  217 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 229 insertions(+), 0 deletions(-)
 create mode 100644 drivers/scsi/ufs/ufshcd-pltfrm.c
drivers/scsi/ufs/Kconfig +11 -0
index 0371047..35faf24 100644
@@ -57,3 +57,14 @@ config SCSI_UFSHCD_PCI
 	  If you have a controller with this interface, say Y or M here.
 
 	  If unsure, say N.
+
+config SCSI_UFSHCD_PLATFORM
+	tristate "Platform bus based UFS Controller support"
+	depends on SCSI_UFSHCD
+	---help---
+	This selects the UFS host controller support. Select this if
+	you have an UFS controller on Platform bus.
+
+	If you have a controller with this interface, say Y or M here.
+
+	  If unsure, say N.
drivers/scsi/ufs/Makefile +1 -0
index 9eda0df..1e5bd48 100644
@@ -1,3 +1,4 @@
 # UFSHCD makefile
 obj-$(CONFIG_SCSI_UFSHCD) += ufshcd.o
 obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
+obj-$(CONFIG_SCSI_UFSHCD_PLATFORM) += ufshcd-pltfrm.o
drivers/scsi/ufs/ufshcd-pltfrm.c new file +217 -0

217 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#6 lore raw

PATCH v6 4/4 ufs: Correct the expected data transfersize

In reply to a message not in the archive

From: Vinayak Holikatti <[email protected]>

This patch corrects the expected data transfer size of the command UPIU. The current implementation of cmd->transfersize is wrong as it probably equal to sector size. With this implementation the transfer size is updated correctly

---
 drivers/scsi/ufs/ufshcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -1
index 60fd40c..c32a478 100644
@@ -478,7 +478,7 @@ static void ufshcd_compose_upiu(struct ufshcd_lrb *lrbp)
 		ucd_cmd_ptr->header.dword_2 = 0;
 
 		ucd_cmd_ptr->exp_data_transfer_len =
-			cpu_to_be32(lrbp->cmd->transfersize);
+			cpu_to_be32(lrbp->cmd->sdb.length);
 
 		memcpy(ucd_cmd_ptr->cdb,
 		       lrbp->cmd->cmnd,
Signature · 1 line
1.7.5.4