RE: [PATCH 11/11] pm80xx : gpio feature support for motherboard controllers

2013-11-14 Thread Viswas G
Hi James,

Can you please share your opinion on this ?

Regards
Viswas G


-Original Message-
From: Jack Wang [mailto:xjtu...@gmail.com] 
Sent: Monday, November 11, 2013 2:28 PM
To: Viswas G; James Bottomley
Cc: linux-scsi@vger.kernel.org; Sangeetha Gnanasekaran; Nikith Ganigarakoppal; 
Anand Kumar Santhanam; Suresh Thiagarajan
Subject: Re: [PATCH 11/11] pm80xx : gpio feature support for motherboard 
controllers

Hi James,

About this gpio feature, do you think it's OK to implement with IOCTL or we can 
use exist bsg interface in libsas and add another function call?

Regards,
Jack

On 11/11/2013 06:57 AM, Viswas G wrote:
> Hi Jack,
> 
> The GPIO feature we implemented here is for controlling and configuring the 
> GPIO pins present in the HBA and it is not related to the GPIO registers 
> present in the SGPIO. Following is one of the GPIO operations we do from 
> application.
> 
> When application wants to know the insertion/removal of a SAS cable in any of 
> the port, it configures the GPIO for corresponding port to generate event for 
> SAS cable insertion or removal using the IOCTL to the HBA driver and waits by 
> calling poll function. When driver receives the GPIO event for the SAS cable 
> insertion or removal then it intimates the application.
> 
> We are using IOCTL instead of sysfs interface since we have to pass 
> structures between user space and kernel space. Again, in the kernel space, 
> we have to parse user buffer from application and convert it to the 
> corresponding data structure. We wanted to avoid the parsing complexity by 
> using ioctl interface.
> 
> Regards,
> Viswas G
> 
> 
> -Original Message-
> From: Jack Wang [mailto:xjtu...@gmail.com]
> Sent: Monday, November 04, 2013 4:00 PM
> To: Viswas G
> Cc: linux-scsi@vger.kernel.org; Sangeetha Gnanasekaran; Nikith 
> Ganigarakoppal; Anand Kumar Santhanam; Suresh Thiagarajan
> Subject: Re: [PATCH 11/11] pm80xx : gpio feature support for 
> motherboard controllers
> 
> On 11/04/2013 11:13 AM, Viswas G wrote:
>> Hi Jack,
>>
>> We wanted to control the GPIO in the HBA only. Bsg interface gets created 
>> only for enclosure or expander. 
>>
>> For our HBA, bsg interface will not be created since it does not have an 
>> enclosure target inside. That's why we wanted to use IOCTL. Please advise.
>>
>> Best Regards,
>> Viswas G
>>
> Hi Viswas,
> 
> No, bsg interface also support HBA.
> Here is two example output from LSI mpt2sas:
> 
> smp_rep_manufacturer /dev/bsg/sas_host0 Report manufacturer response:
>   SAS-1.1 format: 0
>   vendor identification: LSI
>   product identification: Virtual SMP Port
>   product revision level:
> smp_read_gpio /dev/bsg/sas_host0
> Read GPIO register response:
>   GPIO_CFG[0]:
> version: 0
> GPIO enable: 1
> cfg register count: 2
> gp register count: 1
> supported drive count: 16
> 
> Regards,
> Jack
> 
>> -Original Message-
>> From: Jack Wang [mailto:xjtu...@gmail.com]
>> Sent: Tuesday, October 29, 2013 3:49 PM
>> To: Viswas G
>> Cc: linux-scsi@vger.kernel.org; Sangeetha Gnanasekaran; Nikith 
>> Ganigarakoppal; Anand Kumar Santhanam
>> Subject: Re: [PATCH 11/11] pm80xx : gpio feature support for 
>> motherboard controllers
>>
>> Hi Viswas,
>>
>> As ioctl interface is not welcome for new feature, that's why we removed 
>> ioctl interface when pm8001 accepted into mainline.
>>
>> I suggest you use bsg interface for this, see sas_host_smp.c for details.
>>
>> Regards,
>> Jack
>>
>> On 10/22/2013 02:20 PM, Viswas G wrote:
>>>
>>> Signed-off-by: Viswas G 
>>> ---
>>>  drivers/scsi/pm8001/pm8001_ctl.c  |  248
>>> -
>>>  drivers/scsi/pm8001/pm8001_ctl.h  |   55 
>>>  drivers/scsi/pm8001/pm8001_init.c |   37 ++
>>>  drivers/scsi/pm8001/pm8001_sas.h  |   30 +
>>>  drivers/scsi/pm8001/pm80xx_hwi.c  |  106 
>>>  drivers/scsi/pm8001/pm80xx_hwi.h  |   49 +++
>>>  6 files changed, 524 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c
>>> b/drivers/scsi/pm8001/pm8001_ctl.c
>>> index 247cb1c..3c9ca21 100644
>>> --- a/drivers/scsi/pm8001/pm8001_ctl.c
>>> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
>>> @@ -40,7 +40,8 @@
>>>  #include 
>>>  #include 
>>>  #include "pm8001_sas.h"
>>> -#include "pm8001_ctl.h"
>>> +
>>> +int pm8001_major = -1;
>>>
>>>  /* scsi host attributes */
>>>
>>> @@ -759,3 +760,248 @@ struct device_attribute *pm8001_host_attrs[] = {
>>> NULL,
>>>  };
>>>
>>> +/**
>>> + * pm8001_open - open the configuration file
>>> + * @inode: inode being opened
>>> + * @file: file handle attached
>>> + *
>>> + * Called when the configuration device is opened. Does the needed
>>> + * set up on the handle and then returns
>>> + *
>>> + */
>>> +static int pm8001_open(struct inode *inode, struct file *file) {
>>> +   struct pm8001_hba_info *pm8001_ha;
>>> +   unsigned minor_number = iminor(inode);
>>> +   int err = -ENODEV;
>>> +
>>> +   list_for_each_entry(p

Re: PATCH: st.c: Fix blk_get_queue usage

2013-11-14 Thread Joe Lawrence
On Thu, 14 Nov 2013 20:22:40 +0100
Bodo Stroesser  wrote:

> On 14.11.2013, at 20.05, Kai M??kisara (Kolumbus)  
> wrote:
> 
> > 
> > On 14.11.2013, at 16.48, Bodo Stroesser  wrote:
> > 
> > > Hi,
> > > 
> > > in st_probe(), st.c I stumbled across what I'd call a minor problem.
> > > 
> > > So I'd like to suggest the following patch.
> > > 
> > > Best Regards,
> > > Bodo
> > > 
> > > P.S.: Please CC me, I'm not on the list.
> > > 
> > > -
> > > 
> > > 
> > > From: Bodo Stroesser 
> > > Date: Thu, 14 Nov 2013 14:35:00 +0100
> > > Subject: [PATCH] sg: fix blk_get_queue usage
> > > 
> > > If blk_queue_get() in st_probe fails, disk->queue must not
> > > be set to SDp->request_queue, as that would result in
> > > put_disk() dropping a not taken reference.
> > > 
> > > Thus, disk->queue should be set only after a successful
> > > blk_queue_get().
> > > 
> > > Signed-off-by: Bodo Stroesser 
> > > 
> > > ---
> > > 
> > > --- a/drivers/scsi/st.c   2013-11-14 14:10:40.0 +0100
> > > +++ b/drivers/scsi/st.c   2013-11-14 14:10:57.0 +0100
> > > @@ -4107,11 +4107,11 @@
> > >   kref_init(&tpnt->kref);
> > >   tpnt->disk = disk;
> > >   disk->private_data = &tpnt->driver;
> > > - disk->queue = SDp->request_queue;
> > >   /* SCSI tape doesn't register this gendisk via add_disk().  Manually
> > >* take queue reference that release_disk() expects. */
> > 
> > With this patch, blk_get_queue() is not called with the correct argument.
> > Maybe change the call to blk_get_queue(SDp->request_queue) ?
> > 
> > >   if (blk_get_queue(disk->queue))
> 
> Yes, thank you. You are obviously right. Below is the revised patch.
> Sorry for the mistake.
> 
> Bodo
> 
> > >   goto out_put_disk;
> > > + disk->queue = SDp->request_queue;
> > >   tpnt->driver = &st_template;
> > > 
> > >   tpnt->device = SDp--
> > > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> > > the body of a message to majord...@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > ;
> > 
> > Thanks,
> > Kai
> > 
> 
> From: Bodo Stroesser 
> Date: Thu, 14 Nov 2013 14:35:00 +0100
> Subject: [PATCH] sg: fix blk_get_queue usage
> 
> If blk_queue_get() in st_probe fails, disk->queue must not
> be set to SDp->request_queue, as that would result in
> put_disk() dropping a not taken reference.
> 
> Thus, disk->queue should be set only after a successful
> blk_queue_get().
> Revised patch due to a hint from Kai Makisara.
> 
> Signed-off-by: Bodo Stroesser 
> 
> ---
> 
> --- a/drivers/scsi/st.c   2013-11-14 14:10:40.0 +0100
> +++ b/drivers/scsi/st.c   2013-11-14 14:10:57.0 +0100
> @@ -4107,11 +4107,11 @@
>   kref_init(&tpnt->kref);
>   tpnt->disk = disk;
>   disk->private_data = &tpnt->driver;
> - disk->queue = SDp->request_queue;
>   /* SCSI tape doesn't register this gendisk via add_disk().  Manually
>* take queue reference that release_disk() expects. */
> - if (blk_get_queue(disk->queue))
> + if (blk_get_queue(SDp->request_queue))
>   goto out_put_disk;
> + disk->queue = SDp->request_queue;
>   tpnt->driver = &st_template;
>  
>   tpnt->device = SDp;
> ??{.n?+???+%??lzwm??b??r??zX???(??}?z?&j:+v???zZ+??+zf???h???~i???z??w?&?)??f

Hi Bodo,

Minor nit, wasn't blk_get_queue modified to return false on failure?

09ac46c42946 "block: misc updates to blk_get_queue()"

Just curious what tree this patch was tested against.

Thanks,

-- Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/4] ata: Add APM X-Gene SoC SATA host controller driver

2013-11-14 Thread Loc Ho
ata: Add APM X-Gene SoC SATA host controller driver

This patch adds support for the APM X-Gene SoC SATA host controller driver.

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson 
---
 drivers/ata/Kconfig  |8 +
 drivers/ata/Makefile |1 +
 drivers/ata/sata_xgene.c | 1271 ++
 drivers/ata/sata_xgene.h |   96 
 4 files changed, 1376 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ata/sata_xgene.c
 create mode 100644 drivers/ata/sata_xgene.h

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index d467e06..60da4a2 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -112,6 +112,14 @@ config SATA_XGENE_PHY
help
  This option enables support for APM X-Gene SoC SATA PHY.
 
+config SATA_XGENE
+   tristate "APM X-Gene 6.0Gbps SATA host controller support"
+   depends on SATA_AHCI_PLATFORM
+   default y if ARM64
+   select SATA_XGENE_PHY
+   help
+ This option enables support for APM X-Gene SoC SATA host controller.
+
 config SATA_FSL
tristate "Freescale 3.0Gbps SATA support"
depends on FSL_SOC
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index be53890..f141566 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_SATA_DWC)+= sata_dwc_460ex.o
 obj-$(CONFIG_SATA_HIGHBANK)+= sata_highbank.o libahci.o
 obj-$(CONFIG_AHCI_IMX) += ahci_imx.o
 obj-$(CONFIG_SATA_XGENE_PHY)   += sata_xgene_phy.o
+obj-$(CONFIG_SATA_XGENE)   += sata_xgene.o
 
 # SFF w/ custom DMA
 obj-$(CONFIG_PDC_ADMA) += pdc_adma.o
diff --git a/drivers/ata/sata_xgene.c b/drivers/ata/sata_xgene.c
new file mode 100644
index 000..88bcc34
--- /dev/null
+++ b/drivers/ata/sata_xgene.c
@@ -0,0 +1,1271 @@
+/*
+ * AppliedMicro X-Gene SoC SATA Driver
+ *
+ * Copyright (c) 2013, Applied Micro Circuits Corporation
+ * Author: Loc Ho 
+ * Tuan Phan 
+ * Suman Tripathi 
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "sata_xgene.h"
+
+/* Enable for dumping CSR read/write access */
+#undef XGENE_DBG_CSR
+
+/* Max # of disk per a controller */
+#define MAX_AHCI_CHN_PERCTR2
+
+#define SATA_DIAG_OFFSET   0xD000
+#define SATA_GLB_OFFSET0xD850
+#define SATA_SHIM_OFFSET   0xE000
+#define SATA_MASTER_OFFSET 0xF000
+#define SATA_PORT0_OFFSET  0x0100
+#define SATA_PORT1_OFFSET  0x0180
+
+/* SATA host controller CSR */
+#define SLVRDERRATTRIBUTES_ADDR0x
+#define SLVWRERRATTRIBUTES_ADDR0x0004
+#define MSTRDERRATTRIBUTES_ADDR0x0008
+#define MSTWRERRATTRIBUTES_ADDR0x000c
+#define BUSCTLREG_ADDR 0x0014
+#define  MSTAWAUX_COHERENT_BYPASS_SET(dst, src) \
+   (((dst) & ~0x0002) | (((u32)(src)<<1) & 0x0002))
+#define  MSTARAUX_COHERENT_BYPASS_SET(dst, src) \
+   (((dst) & ~0x0001) | (((u32)(src)) & 0x0001))
+#define IOFMSTRWAUX_ADDR   0x0018
+#define INTSTATUSMASK_ADDR 0x002c
+#define ERRINTSTATUS_ADDR  0x0030
+#define ERRINTSTATUSMASK_ADDR  0x0034
+
+/* SATA host AHCI CSR */
+#define PORTCFG_ADDR   0x00a4
+#define  PORTADDR_SET(dst, src) \
+   (((dst) & ~0x003f) | (((u32)(src)) & 0x003f))
+#define PORTPHY1CFG_ADDR   0x00a8
+#define PORTPHY1CFG_FRCPHYRDY_SET(dst, src) \
+   (((dst) & ~0x0010) | (((u32)(src) << 0x14) & 0x0010))
+#define PORTPHY2CFG_ADDR   0x00ac
+#define PORTPHY3CFG_ADDR   0x00b0
+#define PORTPHY4CFG_ADDR   0x00b4
+#define PORTPHY5CFG_ADDR   0x00b8
+#define SCTL0_ADDR 0x012C
+#define PORTPHY5CFG_RTCHG_SET(dst, src) \
+   (((dst) & ~0xfff0) | (((u32)(src) << 0x14) & 0xfff0))
+#define PORTAXICFG_EN_CONTEXT_SET(dst, src) \
+   (((dst) & ~0x0100) | (((u32)(src) << 0x18) & 0x0100))
+#define PORTAXICFG_ADDR 

[PATCH v4 4/4] arm64: Add APM X-Gene SoC SATA DTS entries

2013-11-14 Thread Loc Ho
arm64: Add APM X-Gene SoC SATA host controller and clock DTS entries

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson 
---
 arch/arm64/boot/dts/apm-storm.dtsi |   70 
 1 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/apm-storm.dtsi 
b/arch/arm64/boot/dts/apm-storm.dtsi
index b29b465..14f3d5b 100644
--- a/arch/arm64/boot/dts/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm-storm.dtsi
@@ -176,6 +176,36 @@
reg-names = "csr-reg";
clock-output-names = "eth8clk";
};
+
+   eth01clk: eth01clk@1f21c000 {
+   compatible = "apm,xgene-device-clock";
+   #clock-cells = <1>;
+   clocks = <&socplldiv2 0>;
+   clock-names = "eth01clk";
+   reg = <0x0 0x1f21c000 0x0 0x1000>;
+   reg-names = "csr-reg";
+   clock-output-names = "eth01clk";
+   };
+
+   eth23clk: eth23clk@1f22c000 {
+   compatible = "apm,xgene-device-clock";
+   #clock-cells = <1>;
+   clocks = <&socplldiv2 0>;
+   clock-names = "eth23clk";
+   reg = <0x0 0x1f22c000 0x0 0x1000>;
+   reg-names = "csr-reg";
+   clock-output-names = "eth23clk";
+   };
+
+   sata45clk: sata45clk@1f23c000 {
+   compatible = "apm,xgene-device-clock";
+   #clock-cells = <1>;
+   clocks = <&socplldiv2 0>;
+   clock-names = "sata45clk";
+   reg = <0x0 0x1f23c000 0x0 0x1000>;
+   reg-names = "csr-reg";
+   clock-output-names = "sata45clk";
+   };
};
 
serial0: serial@1c02 {
@@ -218,5 +248,45 @@
#phy-cells = <0>;
status = "ok";
};
+
+   sata0: sata@1a00 {
+   compatible = "apm,xgene-ahci";
+   id = <0>;
+   reg =  <0x0 0x1a00 0x0 0x10
+   0x0 0x1f21 0x0 0x1>;
+   interrupt-parent = <&gic>;
+   interrupts = <0x0 0x86 0x4>;
+   clocks = <ð01clk 0>;
+   status = "na";
+   phys = <&sataphy0>;
+   phy-names = "sataphy0";
+   };
+
+   sata1: sata@1a40 {
+   compatible = "apm,xgene-ahci";
+   id = <1>;
+   reg =  <0x0 0x1a40 0x0 0x10
+   0x0 0x1f22 0x0 0x1>;
+   interrupt-parent = <&gic>;
+   interrupts = <0x0 0x87 0x4>;
+   clocks = <ð23clk 0>;
+   status = "ok";
+   phys = <&sataphy1>;
+   phy-names = "sataphy1";
+   };
+
+   sata2: sata@1a80 {
+   compatible = "apm,xgene-ahci";
+   id = <2>;
+   reg =  <0x0 0x1a80 0x0 0x10
+   0x0 0x1f23 0x0 0x1
+   0x0 0x1f2d 0x0 0x1 >;
+   interrupt-parent = <&gic>;
+   interrupts = <0x0 0x88 0x4>;
+   clocks = <&sata45clk 0>;
+   status = "ok";
+   phys = <&sataphy2>;
+   phy-names = "sataphy2";
+   };
};
 };
-- 
1.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/4] Documentation: Add documentation for APM X-Gene SATA controllor DTS binding

2013-11-14 Thread Loc Ho
Documentation:: Add documentation for APM X-Gene SoC SATA host controller DTS 
binding

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson 
---
 .../devicetree/bindings/ata/apm-xgene.txt  |   62 +++-
 1 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/Documentation/devicetree/bindings/ata/apm-xgene.txt 
b/Documentation/devicetree/bindings/ata/apm-xgene.txt
index d18db67..0d16bfe 100644
--- a/Documentation/devicetree/bindings/ata/apm-xgene.txt
+++ b/Documentation/devicetree/bindings/ata/apm-xgene.txt
@@ -1,4 +1,4 @@
-* APM X-Gene 6.0 Gb/s SATA PHY nodes
+* APM X-Gene 6.0 Gb/s SATA PHY and controller nodes
 
 SATA PHY nodes are defined to describe on-chip Serial ATA PHY. Each SATA PHY
 (pair of PHY) has its own node.
@@ -67,3 +67,63 @@ Example:
status = "ok";
};
 
+SATA host controller nodes are defined to describe on-chip Serial ATA
+controllers. Each SATA controller (pair of ports) have its own node.
+
+Required properties:
+- compatible   : Shall be "apm,xgene-ahci"
+- reg  : First memory resource shall be the AHCI memory
+ resource.
+ Second memory resource shall be the host controller
+ memory resource.
+- id   : Controller ID (0 = first, 1 = second, 2 = third)
+- interrupt-parent : Interrupt controller
+- interrupts   : Interrupt mapping for SATA host controller IRQ
+- clocks   : Reference to the clock entry
+- phys : PHY reference
+- phy-names: Name of the PHY reference
+
+Optional properties:
+- status   : Shall be "ok" if enabled or "na" if disabled.
+ Default is "ok".
+
+Example:
+   sata0: sata@1a00 {
+   compatible = "apm,xgene-ahci";
+   id = <0>;
+   reg =  <0x0 0x1a00 0x0 0x10
+   0x0 0x1f21 0x0 0x1>;
+   interrupt-parent = <&gic>;
+   interrupts = <0x0 0x86 0x4>;
+   clocks = <ð01clk 0>;
+   status = "na";
+   phys = <&sataphy0>;
+   phy-names = "sataphy0";
+   };
+
+   sata1: sata@1a40 {
+   compatible = "apm,xgene-ahci";
+   id = <1>;
+   reg =  <0x0 0x1a40 0x0 0x10
+   0x0 0x1f22 0x0 0x1>;
+   interrupt-parent = <&gic>;
+   interrupts = <0x0 0x87 0x4>;
+   clocks = <ð23clk 0>;
+   status = "ok";
+   phys = <&sataphy1>;
+   phy-names = "sataphy1";
+   };
+
+   sata2: sata@1a80 {
+   compatible = "apm,xgene-ahci";
+   id = <2>;
+   reg =  <0x0 0x1a80 0x0 0x10
+   0x0 0x1f23 0x0 0x1
+   0x0 0x1f2d 0x0 0x1 >;
+   interrupt-parent = <&gic>;
+   interrupts = <0x0 0x88 0x4>;
+   clocks = <&sata45clk 0>;
+   status = "ok";
+   phys = <&sataphy2>;
+   phy-names = "sataphy2";
+   };
-- 
1.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/4] ata: Export required functions by APM X-Gene SATA driver

2013-11-14 Thread Loc Ho
ata: Export required functions by APM X-Gene SATA driver

This patch exports functions required by APM X-Gene SoC SATA host
controller driver to avoid duplication of code.

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson 
---
 drivers/ata/ahci.h|6 ++
 drivers/ata/libahci.c |   13 -
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 1145637..cf881e0 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -368,6 +368,12 @@ irqreturn_t ahci_hw_interrupt(int irq, void *dev_instance);
 irqreturn_t ahci_thread_fn(int irq, void *dev_instance);
 void ahci_print_info(struct ata_host *host, const char *scc_s);
 int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis);
+void ahci_sw_activity(struct ata_link *link);
+int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
+void ahci_error_intr(struct ata_port *ap, u32 irq_stat);
+int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
+   struct ata_taskfile *tf, int is_cmd, u16 flags,
+   unsigned long timeout_msec);
 
 static inline void __iomem *__ahci_port_base(struct ata_host *host,
 unsigned int port_no)
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index aaac4fb..de7e074 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -68,7 +68,6 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, 
u32 state,
 
 
 static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
-static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
 static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
 static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
 static int ahci_port_start(struct ata_port *ap);
@@ -553,7 +552,7 @@ static int ahci_scr_read(struct ata_link *link, unsigned 
int sc_reg, u32 *val)
return -EINVAL;
 }
 
-static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
+int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
 {
void __iomem *port_mmio = ahci_port_base(link->ap);
int offset = ahci_scr_offset(link->ap, sc_reg);
@@ -564,6 +563,7 @@ static int ahci_scr_write(struct ata_link *link, unsigned 
int sc_reg, u32 val)
}
return -EINVAL;
 }
+EXPORT_SYMBOL_GPL(ahci_scr_write);
 
 void ahci_start_engine(struct ata_port *ap)
 {
@@ -869,7 +869,7 @@ int ahci_reset_controller(struct ata_host *host)
 }
 EXPORT_SYMBOL_GPL(ahci_reset_controller);
 
-static void ahci_sw_activity(struct ata_link *link)
+void ahci_sw_activity(struct ata_link *link)
 {
struct ata_port *ap = link->ap;
struct ahci_port_priv *pp = ap->private_data;
@@ -882,6 +882,7 @@ static void ahci_sw_activity(struct ata_link *link)
if (!timer_pending(&emp->timer))
mod_timer(&emp->timer, jiffies + msecs_to_jiffies(10));
 }
+EXPORT_SYMBOL_GPL(ahci_sw_activity);
 
 static void ahci_sw_activity_blink(unsigned long arg)
 {
@@ -1239,7 +1240,7 @@ int ahci_kick_engine(struct ata_port *ap)
 }
 EXPORT_SYMBOL_GPL(ahci_kick_engine);
 
-static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
+int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
struct ata_taskfile *tf, int is_cmd, u16 flags,
unsigned long timeout_msec)
 {
@@ -1268,6 +1269,7 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int 
pmp,
 
return 0;
 }
+EXPORT_SYMBOL_GPL(ahci_exec_polled_cmd);
 
 int ahci_do_softreset(struct ata_link *link, unsigned int *class,
  int pmp, unsigned long deadline,
@@ -1552,7 +1554,7 @@ static void ahci_fbs_dec_intr(struct ata_port *ap)
dev_err(ap->host->dev, "failed to clear device error\n");
 }
 
-static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
+void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
 {
struct ahci_host_priv *hpriv = ap->host->private_data;
struct ahci_port_priv *pp = ap->private_data;
@@ -1662,6 +1664,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 
irq_stat)
} else
ata_port_abort(ap);
 }
+EXPORT_SYMBOL_GPL(ahci_error_intr);
 
 static void ahci_handle_port_interrupt(struct ata_port *ap,
   void __iomem *port_mmio, u32 status)
-- 
1.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/4] ata: Add APM X-Gene SoC SATA host controller support

2013-11-14 Thread Loc Ho
ata: Add APM X-Gene SoC SATA host controller support

This patch adds support for the APM X-Gene SoC SATA host controller. In 
order for the host controller to work, the corresponding SATA PHY driver
musts also be available.

v3:
 * Move out the SATA PHY to another driver
 * Remove the clock-cells entry from DTS
 * Remove debug wrapper
 * Remove delay functions wrapper
 * Clean up resource and IRQ query
 * Remove query clock name
 * Switch to use dma_set_mask/dma_coherent_mask
 * Remove un-necessary devm_kfree
 * Update GPL license header to v2
 * Spilt up function xgene_ahci_hardreset
 * Spilt up function xgene_ahci_probe
 * Remove all reference of CONFIG_ARCH_MSLIM
 * Clean up chip revision code

v2:
 * Clean up file sata_xgene.c with Lindent and etc
 * Clean up file sata_xgene_serdes.c with Lindent and etc
 * Add description to each patch

v1:
 * inital version

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson 
---
Loc Ho (4):
  ata: Export required functions by APM X-Gene SATA driver
  Documentation: Add documentation for APM X-Gene SATA controllor DTS
binding
  ata: Add APM X-Gene SoC SATA host controller driver
  arm64: Add APM X-Gene SoC SATA host controller DTS entries

 .../devicetree/bindings/ata/apm-xgene.txt  |   62 +-
 arch/arm64/boot/dts/apm-storm.dtsi |   70 ++
 drivers/ata/Kconfig|8 +
 drivers/ata/Makefile   |1 +
 drivers/ata/ahci.h |6 +
 drivers/ata/libahci.c  |   13 +-
 drivers/ata/sata_xgene.c   | 1271 
 drivers/ata/sata_xgene.h   |   96 ++
 8 files changed, 1521 insertions(+), 6 deletions(-)
 create mode 100644 drivers/ata/sata_xgene.c
 create mode 100644 drivers/ata/sata_xgene.h

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PATCH: st.c: Fix blk_get_queue usage

2013-11-14 Thread Kai Makisara
On Thu, 14 Nov 2013, Bodo Stroesser wrote:

...
> From: Bodo Stroesser 
> Date: Thu, 14 Nov 2013 14:35:00 +0100
> Subject: [PATCH] sg: fix blk_get_queue usage
> 
> If blk_queue_get() in st_probe fails, disk->queue must not
> be set to SDp->request_queue, as that would result in
> put_disk() dropping a not taken reference.
> 
> Thus, disk->queue should be set only after a successful
> blk_queue_get().
> Revised patch due to a hint from Kai Makisara.
> 
> Signed-off-by: Bodo Stroesser 

Acked-by: Kai Mäkisara 

> 
> ---
> 
> --- a/drivers/scsi/st.c   2013-11-14 14:10:40.0 +0100
> +++ b/drivers/scsi/st.c   2013-11-14 14:10:57.0 +0100
> @@ -4107,11 +4107,11 @@
>   kref_init(&tpnt->kref);
>   tpnt->disk = disk;
>   disk->private_data = &tpnt->driver;
> - disk->queue = SDp->request_queue;
>   /* SCSI tape doesn't register this gendisk via add_disk().  Manually
>* take queue reference that release_disk() expects. */
> - if (blk_get_queue(disk->queue))
> + if (blk_get_queue(SDp->request_queue))
>   goto out_put_disk;
> + disk->queue = SDp->request_queue;
>   tpnt->driver = &st_template;
>  
>   tpnt->device = SDp;

Thanks for the fix,
Kai


Re: Guaranteed Top 10 Google Placements mail-archive.com In 100 Days

2013-11-14 Thread bianca72775
Hello Sir / Mam,

We would like to have a chance to work on your website and get it positioned 
top 10 on major search engines around the world ( Google & Bing ). We are 
presently working with 500+ clients world wide and we have made sure all our 
clients rank top 10 for their best keywords. None of our clients have been 
caught in any of the recent google updates. We only use ethical white hat 
methods to deliver rankings. Our search engine packages include both onsite & 
off optimization, we provide complete SEO solution to our clients and not just 
link building packages.

We understand there are many SEO Scam companies mailing you each day over and 
over again and I am also sure you have been robbed off a few times in past with 
no results at all. To make sure you we show you our WORTH, we have launched 15 
DAY FREE SEO TRIAL service. We want to build your faith in our service and make 
sure you see results before paying for our service.

Is 15 days Enough time to deliver results ?

15 days is good enough a time to show you huge movements in rankings for all 
your keywords. We start with A) choosing the best keywords for your website, B) 
 Approve a final list of keywords, C) Make onsite changes D) Build links for 
your website. If in these 15 days you are not happy with our performance, you 
can cancel or decide to opt-out. You will not be billed a single dime for these 
15 days.

Post Trial Pricing & Package

In the 15 days trial, we only work for 10 keywords so that we can show best 
possible results in the time span. Once the trial is over you pick one of the 
packages listed below :

Package A ) $99 / month (10 keywords optimized ) Package B ) $149 / month ( 20 
keywords optimized ) Package C ) $199 / month ( 30 keywords optimized )

To Sign up for our free trial email us back with the information below so we 
can send you our sign up link.

1) " Website You Want To Optimize "
2) Keywords ( Optional )
3) SEO Done Before ( Yes / No )

Looking forward working with you, let us know if you would like to have more 
information about our company and procedures.
Regards

Vince G
SEO Manager : T.O.B
7 B Green Avenue, Amritsar Punjab




Our email above is not intended to waste your time or fill your inbox with 
spam. If you would not like to hear from us, email us back with NOT INTERESTED. 
We will never email you again.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] arm64: Add APM X-Gene SoC 6.0Gbps SATA PHY DTS entries

2013-11-14 Thread Loc Ho
arm64: Add APM X-Gene SoC 6.0Gbps SATA PHY DTS entries.

This patch adds the DTS entries for the APM X-Gene SoC 6.0Gbps SATA PHY 
driver. The PHY for controller 0 and 1 are enabled by default.
---
 arch/arm64/boot/dts/apm-storm.dtsi |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/apm-storm.dtsi 
b/arch/arm64/boot/dts/apm-storm.dtsi
index 359d7b6..b29b465 100644
--- a/arch/arm64/boot/dts/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm-storm.dtsi
@@ -193,5 +193,30 @@
reg = <0x0 0x1714 0x0 0x100>;
mask = <0x1>;
};
+
+   sataphy0: sataphy@1f21 {
+   compatible = "apm,xgene-ahci-phy";
+   id = <0>;
+   reg = <0x0 0x1f21 0x0 0x1>;
+   #phy-cells = <0>;
+   status = "na";
+   };
+
+   sataphy1: sataphy@1f22 {
+   compatible = "apm,xgene-ahci-phy";
+   id = <1>;
+   reg = <0x0 0x1f22 0x0 0x1>;
+   #phy-cells = <0>;
+   status = "ok";
+   };
+
+   sataphy2: sataphy@1f23 {
+   compatible = "apm,xgene-ahci-phy";
+   id = <2>;
+   reg = <0x0 0x1f23 0x0 0x1
+  0x0 0x1f2d 0x0 0x1 >;
+   #phy-cells = <0>;
+   status = "ok";
+   };
};
 };
-- 
1.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] ata: Add APM X-Gene SoC 6.0Gbps SATA PHY support

2013-11-14 Thread Loc Ho
ata: Add APM X-Gene SoC 6.0Gbps SATA PHY support

This patch adds support for APM X-Gene SoC 6.0Gbps SATA PHY. This is the
physical layer interface for the corresponding SATA host controller. This
driver uses the new PHY generic framework posted by Kishon Vijay Abrahm.

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson  
---
Loc Ho (3):
  Documentation: Add APM X-Gene SATA PHY driver binding documentation
  ata: Add APM X-Gene SoC 6.0Gbps SATA PHY driver
  arm64: Add APM X-Gene SoC 6.0Gbps SATA PHY DTS entries.

 .../devicetree/bindings/ata/apm-xgene.txt  |   69 +
 arch/arm64/boot/dts/apm-storm.dtsi |   25 +
 drivers/ata/Kconfig|6 +
 drivers/ata/Makefile   |1 +
 drivers/ata/sata_xgene_phy.c   | 2142 
 5 files changed, 2243 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/apm-xgene.txt
 create mode 100644 drivers/ata/sata_xgene_phy.c

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] Documentation: Add APM X-Gene SoC 6.0Gbps SATA PHY driver binding documentation

2013-11-14 Thread Loc Ho
Documentation: Add APM X-Gene SoC 6.0Gbps SATA PHY driver binding documentation

Document the DTS binding for the X-Gene SoC SATA PHY driver.

Signed-off-by: Loc Ho 
Signed-off-by: Tuan Phan 
Signed-off-by: Suman Tripathi 
Reviewed-by: Arnd Bergmann 
Reviewed-by: Olof Johansson  
---
 .../devicetree/bindings/ata/apm-xgene.txt  |   69 
 1 files changed, 69 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/apm-xgene.txt

diff --git a/Documentation/devicetree/bindings/ata/apm-xgene.txt 
b/Documentation/devicetree/bindings/ata/apm-xgene.txt
new file mode 100644
index 000..d18db67
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/apm-xgene.txt
@@ -0,0 +1,69 @@
+* APM X-Gene 6.0 Gb/s SATA PHY nodes
+
+SATA PHY nodes are defined to describe on-chip Serial ATA PHY. Each SATA PHY
+(pair of PHY) has its own node.
+
+Required properties:
+- compatible   : Shall be "apm,xgene-ahci-phy"
+- reg  : First memory resource shall be the PHY memory resource
+ Second memory resource shall be the optional PHY
+ memory resource if mux'ed with another IP
+- id   : PHY ID (0 = first, 1 = second, 2 = third)
+- #phy-cells   : Shall be 0
+
+Optional properties:
+- status   : Shall be "ok" if enabled or "na" if disabled. Default
+ is "ok".
+- CTLE0: PHY override parameters for channel 0 
register REG1
+ field CTLE_EQ. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0x2.
+- CTLE1: PHY override parameters for channel 1 
register REG1
+ field CTLE_EQ. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0x2.
+- PQ0  : PHY override parameters for channel 0 register REG125
+ field PQ_REG. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0xA.
+- PQ1  : PHY override parameters for channel 1 register REG125
+ field PQ_REG. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0xA.
+- PQS0 : PHY override parameters for channel 0 register REG125
+ field PQ_SIGN. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0x1.
+- PQS1 : PHY override parameters for channel 1 register REG125
+ field PQ_SIGN. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0x1.
+- SPD0 : PHY override parameters for channel 0 register REG61
+ field PQ_SIGN. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0x5.
+- SPD1 : PHY override parameters for channel 1 register REG61
+ field PQ_SIGN. First value for Gen1, second value
+ for Gen2, and third value for Gen3. Default is 0x5.
+
+NOTE: PHY override parameters are board specific setting.
+
+Example:
+   sataphy0: sataphy@1f21 {
+   compatible = "apm,xgene-ahci-phy";
+   id = <0>;
+   reg = <0x0 0x1f21 0x0 0x1>;
+   #phy-cells = <0>;
+   status = "na";
+   };
+
+   sataphy1: sataphy@1f22 {
+   compatible = "apm,xgene-ahci-phy";
+   id = <1>;
+   reg = <0x0 0x1f22 0x0 0x1>;
+   #phy-cells = <0>;
+   status = "ok";
+   };
+
+   sataphy2: sataphy@1f23 {
+   compatible = "apm,xgene-ahci-phy";
+   id = <2>;
+   reg = <0x0 0x1f23 0x0 0x1
+  0x0 0x1f2d 0x0 0x1 >;
+   #phy-cells = <0>;
+   status = "ok";
+   };
+
-- 
1.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PATCH: st.c: Fix blk_get_queue usage

2013-11-14 Thread Bodo Stroesser
On 14.11.2013, at 20.05, Kai Mäkisara (Kolumbus)  
wrote:

> 
> On 14.11.2013, at 16.48, Bodo Stroesser  wrote:
> 
> > Hi,
> > 
> > in st_probe(), st.c I stumbled across what I'd call a minor problem.
> > 
> > So I'd like to suggest the following patch.
> > 
> > Best Regards,
> > Bodo
> > 
> > P.S.: Please CC me, I'm not on the list.
> > 
> > -
> > 
> > 
> > From: Bodo Stroesser 
> > Date: Thu, 14 Nov 2013 14:35:00 +0100
> > Subject: [PATCH] sg: fix blk_get_queue usage
> > 
> > If blk_queue_get() in st_probe fails, disk->queue must not
> > be set to SDp->request_queue, as that would result in
> > put_disk() dropping a not taken reference.
> > 
> > Thus, disk->queue should be set only after a successful
> > blk_queue_get().
> > 
> > Signed-off-by: Bodo Stroesser 
> > 
> > ---
> > 
> > --- a/drivers/scsi/st.c 2013-11-14 14:10:40.0 +0100
> > +++ b/drivers/scsi/st.c 2013-11-14 14:10:57.0 +0100
> > @@ -4107,11 +4107,11 @@
> > kref_init(&tpnt->kref);
> > tpnt->disk = disk;
> > disk->private_data = &tpnt->driver;
> > -   disk->queue = SDp->request_queue;
> > /* SCSI tape doesn't register this gendisk via add_disk().  Manually
> >  * take queue reference that release_disk() expects. */
> 
> With this patch, blk_get_queue() is not called with the correct argument.
> Maybe change the call to blk_get_queue(SDp->request_queue) ?
> 
> > if (blk_get_queue(disk->queue))

Yes, thank you. You are obviously right. Below is the revised patch.
Sorry for the mistake.

Bodo

> > goto out_put_disk;
> > +   disk->queue = SDp->request_queue;
> > tpnt->driver = &st_template;
> > 
> > tpnt->device = SDp--
> > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > ;
> 
> Thanks,
> Kai
> 

From: Bodo Stroesser 
Date: Thu, 14 Nov 2013 14:35:00 +0100
Subject: [PATCH] sg: fix blk_get_queue usage

If blk_queue_get() in st_probe fails, disk->queue must not
be set to SDp->request_queue, as that would result in
put_disk() dropping a not taken reference.

Thus, disk->queue should be set only after a successful
blk_queue_get().
Revised patch due to a hint from Kai Makisara.

Signed-off-by: Bodo Stroesser 

---

--- a/drivers/scsi/st.c 2013-11-14 14:10:40.0 +0100
+++ b/drivers/scsi/st.c 2013-11-14 14:10:57.0 +0100
@@ -4107,11 +4107,11 @@
kref_init(&tpnt->kref);
tpnt->disk = disk;
disk->private_data = &tpnt->driver;
-   disk->queue = SDp->request_queue;
/* SCSI tape doesn't register this gendisk via add_disk().  Manually
 * take queue reference that release_disk() expects. */
-   if (blk_get_queue(disk->queue))
+   if (blk_get_queue(SDp->request_queue))
goto out_put_disk;
+   disk->queue = SDp->request_queue;
tpnt->driver = &st_template;
 
tpnt->device = SDp;


Re: PATCH: st.c: Fix blk_get_queue usage

2013-11-14 Thread Kai Mäkisara (Kolumbus)

On 14.11.2013, at 16.48, Bodo Stroesser  wrote:

> Hi,
> 
> in st_probe(), st.c I stumbled across what I'd call a minor problem.
> 
> So I'd like to suggest the following patch.
> 
> Best Regards,
> Bodo
> 
> P.S.: Please CC me, I'm not on the list.
> 
> -
> 
> 
> From: Bodo Stroesser 
> Date: Thu, 14 Nov 2013 14:35:00 +0100
> Subject: [PATCH] sg: fix blk_get_queue usage
> 
> If blk_queue_get() in st_probe fails, disk->queue must not
> be set to SDp->request_queue, as that would result in
> put_disk() dropping a not taken reference.
> 
> Thus, disk->queue should be set only after a successful
> blk_queue_get().
> 
> Signed-off-by: Bodo Stroesser 
> 
> ---
> 
> --- a/drivers/scsi/st.c   2013-11-14 14:10:40.0 +0100
> +++ b/drivers/scsi/st.c   2013-11-14 14:10:57.0 +0100
> @@ -4107,11 +4107,11 @@
>   kref_init(&tpnt->kref);
>   tpnt->disk = disk;
>   disk->private_data = &tpnt->driver;
> - disk->queue = SDp->request_queue;
>   /* SCSI tape doesn't register this gendisk via add_disk().  Manually
>* take queue reference that release_disk() expects. */

With this patch, blk_get_queue() is not called with the correct argument.
Maybe change the call to blk_get_queue(SDp->request_queue) ?

>   if (blk_get_queue(disk->queue))
>   goto out_put_disk;
> + disk->queue = SDp->request_queue;
>   tpnt->driver = &st_template;
> 
>   tpnt->device = SDp--
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> ;

Thanks,
Kai

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] sg: O_EXCL and other lock handling

2013-11-14 Thread Douglas Gilbert

On 13-11-12 07:58 PM, Douglas Gilbert wrote:

After feedback on version 2 and a new report of a failure
in the vicinity of sg_remove() [remove device] during
a shutdown on a large machine, the locking has been
revised again.


The shutdown problem in the vicinity of sg_remove() has
been traced to the st driver and a patch to fix st has
been sent to this list. So there are now no reported
problems against this patch.

Doug Gilbert


ChangeLog v3:
   - change Sg_device::exclude and detached (renamed to
 detaching) to atomic_t
   - introduce atomic_t Sg_device::open_cnt and use for
 open(O_EXCL) logic. Hence stop using list_empty(sfds)
 which decouples the open/release logic from
 sg_remove_device() and other post-release cleanup
 functions
   - use a mutex to stop races between sg_open() and
 sg_release() on the same device
   - reduce the use of driver wide sg_index_lock so now
 it only protects sg_index_idr (the device array)
   - expand cleanups requested by checkpatch.pl to the
 remaining code in the driver

ChangeLog v2:
   - favour non O_EXCL open()s over open(dev, O_EXCL)s
   - wake all open(dev)s if dev is removed (detached)
   - wake all read(dev_fd)s that are waiting for a response
 if dev is removed (detached)
   - other cleanups requested by checkpatch.pl

ChangeLog v1:
   - introduce a finer grain (per device) lock to protect
 access and changes to the file descriptor objects
   - introduce a semaphore for mutual exclusion of co-incident
 open and release calls to the same device
   - improve the O_EXCL handling of sg_open() when multiple
 callers are waiting for an O_EXCL condition to clear
   - change some seq_printf()s to seq_puts()s as requested
 by checkpatch.pl
   - update copyright notice, version number and date


The patch is against lk 3.12.0 (and should work on lk 3.10
and lk 3.11 as the sg driver hasn't changed).

Testing is ongoing (see the v2 post) with focus on host
removal and shutdown. The driver survives bombarding 4 LUs
with queued requests spread across 6000 scsi_debug LUs.
Some log noise is generated, but it is not from the sg
driver:
   scsi 9:0:33:3: rejecting I/O to offline device
   scsi 9:0:33:3: [sg1000] killing request


This is not seen when there are only 600 LUs.


Signed-off-by: Douglas Gilbert 


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drivers: scsi: lpfc_debugfs: Fix wrong assignment

2013-11-14 Thread James Smart

Thanks!

Acked-by:   James Smart  

-- james s


On 10/18/2013 7:15 PM, Felipe Pena wrote:

On lpfc_debugfs_initialize function the dumpHostSlim member setup happens
when 'phba->sli_rev < LPFC_SLI_REV4' is true, however when it is false NULL
has been assigned to debug_dumpHBASlim instead of debug_dumpHostSlim.

Signed-off-by: Felipe Pena 
---
  drivers/scsi/lpfc/lpfc_debugfs.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index 60084e6..b800cc9 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -4001,7 +4001,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
goto debug_failed;
}
} else
-   phba->debug_dumpHBASlim = NULL;
+   phba->debug_dumpHostSlim = NULL;

/* Setup dumpData */
snprintf(name, sizeof(name), "dumpData");
--
1.7.10.4





--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


PATCH: st.c: Fix blk_get_queue usage

2013-11-14 Thread Bodo Stroesser
Hi,

in st_probe(), st.c I stumbled across what I'd call a minor problem.

So I'd like to suggest the following patch.

Best Regards,
Bodo

P.S.: Please CC me, I'm not on the list.

-


From: Bodo Stroesser 
Date: Thu, 14 Nov 2013 14:35:00 +0100
Subject: [PATCH] sg: fix blk_get_queue usage

If blk_queue_get() in st_probe fails, disk->queue must not
be set to SDp->request_queue, as that would result in
put_disk() dropping a not taken reference.

Thus, disk->queue should be set only after a successful
blk_queue_get().

Signed-off-by: Bodo Stroesser 

---

--- a/drivers/scsi/st.c 2013-11-14 14:10:40.0 +0100
+++ b/drivers/scsi/st.c 2013-11-14 14:10:57.0 +0100
@@ -4107,11 +4107,11 @@
kref_init(&tpnt->kref);
tpnt->disk = disk;
disk->private_data = &tpnt->driver;
-   disk->queue = SDp->request_queue;
/* SCSI tape doesn't register this gendisk via add_disk().  Manually
 * take queue reference that release_disk() expects. */
if (blk_get_queue(disk->queue))
goto out_put_disk;
+   disk->queue = SDp->request_queue;
tpnt->driver = &st_template;
 
tpnt->device = SDp;


[Bug 60758] module scsi_wait_scan not found kernel panic on boot

2013-11-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=60758

--- Comment #47 from zakrzews...@wp.pl ---
3.12 doesn't boot too. The same reason...

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


blk-tag.c: 89 BUG() triggering + initial analysis

2013-11-14 Thread Hans de Goede

Hi All,

I hope linux-scsi is the right list for this, if not let me know.

I've been working on getting the uas (Usb Attached Scsi) driver into
working shape for the last 3 weeks, so that it can be enabled in 3.14 .

My latest tests where performed on top of 3.11 + a bunch of xhci and
of course uas fixes.

I can reliable trigger the BUG() in blk-tag.c line 89:

void blk_free_tags(struct blk_queue_tag *bqt)
{
if (unlikely(!__blk_free_tags(bqt)))
BUG();
}

I believe this is not an uas driver bug, but rather a bug which
any scsi host which uses scsi_init_shared_tag_map() can trigger,
which is likely not seen before because almost no hosts actually
use scsi_init_shared_tag_map().

The above test triggering the BUG() assumes that blk_free_tags()
caller holds the last reference to the bqt. For scsi hosts using
scsi_init_shared_tag_map() this assumes that the release of the
block_queue through blk-sysfs.c: blk_release_queue() happens before
the release of the host through scsi/hosts.c: scsi_host_dev_release()

I've added some strategic debug printk-s to debug this problem
(and removed the BUG()) and in some cases this is not true.

Here is the output of my debug scripts on a normal unplug of
the uas usb-device:

[ 7678.202540] blk-sysfs.c: blk_release_queue queue_tags 88022d4d59e0
[ 7678.202551] blk-tag.c: __blk_queue_free_tags bqt 88022d4d59e0
[ 7678.202553] blk-tag.c: __blk_free_tags refcnt before dec: 2
[ 7678.202626] scsi/hosts.c: scsi_host_dev_release bqt 88022d4d59e0
[ 7678.202654] blk-tag.c: blk_free_tags bqt 88022d4d59e0
[ 7678.202655] blk-tag.c: __blk_free_tags refcnt before dec: 1
[ 7678.202657] blk-tag.c: __blk_free_tags free-ed: 88022d4d59e0

Which does not trigger the BUG().

If however I do the following:
1) plug in uas usb-device
2) let udisks auto-mount it under:
   /run/media/hans/4e82585c-3c40-48ac-81ad-11d2a7bad0fc
3) cd into that dir to keep it busy
4) unplug
5) cd out of the directory, at which points udisks will umount it


Then with an unpatched kernel I hit the BUG() at step 5, and with
a kernel with the BUG() removed I get the following debug trace:

[ 9089.808021] scsi/hosts.c: scsi_host_dev_release bqt 88022c02ae40
[ 9089.808040] blk-tag.c: blk_free_tags bqt 88022c02ae40
[ 9089.808041] blk-tag.c: __blk_free_tags refcnt before dec: 2
[ 9089.808046] blk-sysfs.c: blk_release_queue queue_tags 88022c02ae40
[ 9089.808057] blk-tag.c: __blk_queue_free_tags bqt 88022c02ae40
[ 9089.808058] blk-tag.c: __blk_free_tags refcnt before dec: 1
[ 9089.808059] blk-tag.c: __blk_free_tags free-ed: 88022c02ae40

Notice how in this case scsi_host_dev_release() runs before
blk_release_queue(), breaking the assumption the BUG() tests for.

I think this may be caused by userspace holding a reference to the
kobj which has blk_release_queue as release callback when doing the
umount. But I simply don't know the code in question well enough to do
a more detailed analysis of the problem.

A naive fix, which seems to work, would be to simply remove the BUG()
but I'm not sure if that is the right solution...

Regards,

Hans

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html