Re: [PATCH] scsi: myrs: fix build failure on 32 bit

2018-10-19 Thread Randy Dunlap
On 10/18/18 4:50 PM, James Bottomley wrote:
> For 32 bit versions we have to be careful about divisions of 64 bit
> quantities so use do_div() instead of a direct division.  This fixes a
> warning about _uldivmod being undefined in certain configurations

on i386 it was:
ERROR: "__udivdi3" [drivers/scsi/myrs.ko] undefined!

and this patch fixes that build error.

Tested-by: Randy Dunlap  # build-tested

thanks.

> 
> Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller")
> Reported-by: kbuild test robot 
> Signed-off-by: James Bottomley 
> ---
>  drivers/scsi/myrs.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
> index b02ee0b0dd55..a9f9c77e889f 100644
> --- a/drivers/scsi/myrs.c
> +++ b/drivers/scsi/myrs.c
> @@ -1978,7 +1978,8 @@ myrs_get_resync(struct device *dev)
>   struct scsi_device *sdev = to_scsi_device(dev);
>   struct myrs_hba *cs = shost_priv(sdev->host);
>   struct myrs_ldev_info *ldev_info = sdev->hostdata;
> - u8 percent_complete = 0, status;
> + u64 percent_complete = 0;
> + u8 status;
>  
>   if (sdev->channel < cs->ctlr_info->physchan_present || !ldev_info)
>   return;
> @@ -1986,8 +1987,8 @@ myrs_get_resync(struct device *dev)
>   unsigned short ldev_num = ldev_info->ldev_num;
>  
>   status = myrs_get_ldev_info(cs, ldev_num, ldev_info);
> - percent_complete = ldev_info->rbld_lba * 100 /
> - ldev_info->cfg_devsize;
> + percent_complete = ldev_info->rbld_lba * 100;
> + do_div(percent_complete, ldev_info->cfg_devsize);
>   }
>   raid_set_resync(myrs_raid_template, dev, percent_complete);
>  }
> 


-- 
~Randy


Re: [PATCH v2] target: fix tcm_loop build errors when SCSI=m

2018-08-06 Thread Randy Dunlap
On 08/06/2018 04:29 PM, Randy Dunlap wrote:
> On 08/06/2018 04:26 PM, Bart Van Assche wrote:
>> On Mon, 2018-08-06 at 16:20 -0700, Randy Dunlap wrote:
>>> Fixes: 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD
>>>fabric module")
>>
>> From drivers/target/Kconfig on Linus' master branch:
>>
>> menuconfig TARGET_CORE
>>  tristate "Generic Target Core Mod (TCM) and ConfigFS Infrastructure"
>>  depends on SCSI && BLOCK
>>
>> if TARGET_CORE
>> [ ... ]
>> source "drivers/target/loopback/Kconfig"
>> endif
>>
>> In other words, the loopback driver already depends on SCSI. So I doubt that
>> this is a longstanding issue. Did you encounter this with Linus' master 
>> branch
>> or rather with linux-next?
> 
> Darn.  Thanks for the info.
> 
> I encountered it in linux-next.  I'll dig deeper.

For TARGET_CORE, the depends on SCSI has been removed in linux-next.
That allows the kconfig to go sideways.


-- 
~Randy


Re: [PATCH v2] target: fix tcm_loop build errors when SCSI=m

2018-08-06 Thread Randy Dunlap
On 08/06/2018 04:26 PM, Bart Van Assche wrote:
> On Mon, 2018-08-06 at 16:20 -0700, Randy Dunlap wrote:
>> Fixes: 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD
>>fabric module")
> 
> From drivers/target/Kconfig on Linus' master branch:
> 
> menuconfig TARGET_CORE
>   tristate "Generic Target Core Mod (TCM) and ConfigFS Infrastructure"
>   depends on SCSI && BLOCK
> 
> if TARGET_CORE
> [ ... ]
> source "drivers/target/loopback/Kconfig"
> endif
> 
> In other words, the loopback driver already depends on SCSI. So I doubt that
> this is a longstanding issue. Did you encounter this with Linus' master branch
> or rather with linux-next?

Darn.  Thanks for the info.

I encountered it in linux-next.  I'll dig deeper.

-- 
~Randy


[PATCH v2] target: fix tcm_loop build errors when SCSI=m

2018-08-06 Thread Randy Dunlap
From: Randy Dunlap 

Fix build errors when CONFIG_SCSI=m and CONFIG_LOOPBACK_TARGET=y
by making LOOPBACK_TARGET depend on SCSI.

drivers/target/loopback/tcm_loop.o: In function `tcm_loop_port_link':
tcm_loop.c:(.text+0x445): undefined reference to `scsi_add_device'
drivers/target/loopback/tcm_loop.o: In function `tcm_loop_driver_remove':
tcm_loop.c:(.text+0x55c): undefined reference to `scsi_remove_host'
tcm_loop.c:(.text+0x564): undefined reference to `scsi_host_put'
drivers/target/loopback/tcm_loop.o: In function `tcm_loop_submission_work':
tcm_loop.c:(.text+0x7c4): undefined reference to `scmd_printk'
drivers/target/loopback/tcm_loop.o: In function `tcm_loop_driver_probe':
tcm_loop.c:(.text+0x7fb): undefined reference to `scsi_host_alloc'
tcm_loop.c:(.text+0x85b): undefined reference to `scsi_add_host_with_dma'
tcm_loop.c:(.text+0x896): undefined reference to `scsi_host_put'
drivers/target/loopback/tcm_loop.o: In function `tcm_loop_port_unlink':
tcm_loop.c:(.text+0x962): undefined reference to `scsi_device_lookup'
tcm_loop.c:(.text+0x972): undefined reference to `scsi_remove_device'
tcm_loop.c:(.text+0x97a): undefined reference to `scsi_device_put'
drivers/target/loopback/tcm_loop.o:(.data+0x210): undefined reference to 
`scsi_change_queue_depth'

Fixes: 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD
   fabric module")

Signed-off-by: Randy Dunlap 
Cc: "Nicholas A. Bellinger" 
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: Bart Van Assche 
Cc: sta...@vger.kernel.org # 2.6.39++
---
v2: add Fixes: and Cc:stable

 drivers/target/loopback/Kconfig |1 +
 1 file changed, 1 insertion(+)

--- linux-next-20180806.orig/drivers/target/loopback/Kconfig
+++ linux-next-20180806/drivers/target/loopback/Kconfig
@@ -1,5 +1,6 @@
 config LOOPBACK_TARGET
tristate "TCM Virtual SAS target and Linux/SCSI LDD fabric loopback 
module"
+   depends on SCSI
help
  Say Y here to enable the TCM Virtual SAS target and Linux/SCSI LLD
  fabric loopback module.




Re: [PATCH 4/8] mpt3sas: Fix kernel-doc warnings

2018-06-14 Thread Randy Dunlap
On 06/14/2018 09:49 AM, Bart Van Assche wrote:
> This patch avoids that warnings about the kernel headers appear when
> building with W=1.
> 
> Signed-off-by: Bart Van Assche 
> Cc: Sathya Prakash 
> Cc: Chaitra P B 
> Cc: Suganath Prabu Subramani 
> ---
>  drivers/scsi/mpt3sas/mpt3sas_base.c |  16 +-
>  drivers/scsi/mpt3sas/mpt3sas_ctl.c  | 251 +++-
>  drivers/scsi/mpt3sas/mpt3sas_scsih.c|  36 +--
>  drivers/scsi/mpt3sas/mpt3sas_transport.c|  10 +-
>  drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c |  18 +-
>  drivers/scsi/mpt3sas/mpt3sas_warpdrive.c|   3 -
>  6 files changed, 186 insertions(+), 148 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
> b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 9c233ddc5b2b..67e1b603f287 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -103,7 +103,8 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc);
>  
>  /**
>   * _scsih_set_fwfault_debug - global setting of ioc->fwfault_debug.
> - *
> + * @val: ?
> + * @kp: ?
>   */
>  static int
>  _scsih_set_fwfault_debug(const char *val, const struct kernel_param *kp)
> @@ -197,7 +198,7 @@ _base_clone_to_sys_mem(void __iomem *dst_iomem, void 
> *src, u32 size)
>   * @smid: system request message index
>   * @sge_chain_count: Scatter gather chain count.
>   *
> - * @Return: chain address.
> + * Returns the chain address.
>   */

Hi Bart,

Documentation/doc-guide/kernel-doc.rst says that Return info "should be" 
described
in a Return: section:


The return value, if any, should be described in a dedicated section
named ``Return``.


This applies to many instances in this patch.

thanks,
-- 
~Randy


Re: [PATCH v2 3/5] scsi: ufs: Add Kconfig for UFS HC driver crypto support

2018-05-29 Thread Randy Dunlap
On 05/28/2018 11:35 PM, Ladvine D Almeida wrote:
> 
> changes in v2: Indented the help text
> 
> This patch adds the Kconfig for enabling crypto support for
> UFS Host Controller driver. It also adds Makefile changes
> for building crypto support based on crypto Kconfig selection.
> 
> Signed-off-by: Ladvine D Almeida 
> ---
>  drivers/scsi/ufs/Kconfig  | 15 +++
>  drivers/scsi/ufs/Makefile |  6 +-
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
> index e27b4d4..6778c83 100644
> --- a/drivers/scsi/ufs/Kconfig
> +++ b/drivers/scsi/ufs/Kconfig
> @@ -50,6 +50,21 @@ config SCSI_UFSHCD
> 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_INLINE_ENCRYPTION
> + bool "Universal Flash Storage Controller Driver crypto support"
> + depends on SCSI_UFSHCD
> + default n
> + select BLK_DEV_INLINE_ENCRYPTION if SCSI_UFSHCD_INLINE_ENCRYPTION
> + help
> + This enables the Inline Encryption feature of the UFS Host

The line above also needs to be indented like the lines below.  :(

> +   Controller driver. Once the capability is detected in hardware,
> +   it will be made available for the user through Linux Kernel
> +   Cryptography Framework(LKCF).
> +
> +   If you have a controller with this capability, say Y.
> +
> +   If unsure, say N.
> +
>  config SCSI_UFSHCD_PCI
>   tristate "PCI bus based UFS Controller support"
>   depends on SCSI_UFSHCD && PCI


-- 
~Randy


Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-23 Thread Randy Dunlap
On 05/23/2018 02:22 PM, Jens Axboe wrote:
> On 5/23/18 3:20 PM, Randy Dunlap wrote:
>> On 05/23/2018 02:14 PM, Jens Axboe wrote:
>>> On 5/23/18 2:52 PM, Kees Cook wrote:
>>>> On Wed, May 23, 2018 at 7:31 AM, Jens Axboe <ax...@kernel.dk> wrote:
>>>>> On 5/23/18 8:25 AM, Christoph Hellwig wrote:
>>>>>> On Wed, May 23, 2018 at 08:13:56AM -0600, Jens Axboe wrote:
>>>>>>>> Should I move to code to a new drivers/scsi/scsi_sense.c and add it to
>>>>>>>> drivers/scsi/Makefile as:
>>>>>>>>
>>>>>>>> obj-$(CONFIG_BLK_SCSI_REQUEST)+= scsi_sense.o
>>>>>>>>
>>>>>>>> Every place I want to use the code is already covered by
>>>>>>>> CONFIG_BLK_SCSI_REQUEST, so it seems like I just need to know where to
>>>>>>>> put the .c file. :P
>>>>>>>
>>>>>>> I think this is so much saner than a SCSI select or dependency, so I'll
>>>>>>> have to disagree with Martin and Christoph. Just put it in drivers/scsi,
>>>>>>> if it's the location they care about.
>>>>>>
>>>>>> I actually plan to remove CONFIG_BLK_SCSI_REQUEST in a merge window
>>>>>> or two.  The only users are scsi and the ide layer, (virtio_blk
>>>>>> support has already been accidentally disabled for a while), and getting
>>>>>> rid of it allows to to shrink and simply the scsi data structures.
>>>>>>
>>>>>> But if you want this for now lets keep scsi_sense.c in drivers/scsi
>>>>>> but depend on CONFIG_BLK_SCSI_REQUEST, that is easy enough to fix up.
>>>>>
>>>>> It could be a stand-alone dependency, doesn't have to be BLK_SCSI_REQUEST.
>>>>> BLA_SCSI_SENSE or something would do. I don't care too much about that,
>>>>> mostly getting rid of the entire stack dependency.
>>>>
>>>> Aaand, I can't do this and leave it in drivers/scsi because of 
>>>> drivers/Makefile:
>>>>
>>>> obj-$(CONFIG_SCSI)  += scsi/
>>>>
>>>> So: this needs to live in block/ just like CONFIG_BLK_SCSI_REQUEST's
>>>> scsi_ioctl.c. I will split it into CONFIG_BLK_SCSI_SENSE, but I'll
>>>> still need to move the code from drivers/scsi/ to block/. Is this
>>>> okay?
>>>
>>> Ugh, so that would necessitate a change there too. As I said before,
>>> I don't really care where it lives. I know the SCSI folks seem bothered
>>> by moving it, but in reality, it's not like this stuff will likely ever
>>> really change. Of the two choices (select entire SCSI stack, or just move
>>> this little bit), I know what I would consider the saner option...
>>>
>>
>> or option 3:
>>
>> obj-y   += scsi/
>>
>> so that make descends into drivers/scsi/ and then builds whatever is needed,
>> depending on individual kconfig options.
> 
> Right, that was the initial option, the later two are the other options.
> 

Sorry, I'm late to the party.

-- 
~Randy


Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-23 Thread Randy Dunlap
On 05/23/2018 02:14 PM, Jens Axboe wrote:
> On 5/23/18 2:52 PM, Kees Cook wrote:
>> On Wed, May 23, 2018 at 7:31 AM, Jens Axboe  wrote:
>>> On 5/23/18 8:25 AM, Christoph Hellwig wrote:
 On Wed, May 23, 2018 at 08:13:56AM -0600, Jens Axboe wrote:
>> Should I move to code to a new drivers/scsi/scsi_sense.c and add it to
>> drivers/scsi/Makefile as:
>>
>> obj-$(CONFIG_BLK_SCSI_REQUEST)+= scsi_sense.o
>>
>> Every place I want to use the code is already covered by
>> CONFIG_BLK_SCSI_REQUEST, so it seems like I just need to know where to
>> put the .c file. :P
>
> I think this is so much saner than a SCSI select or dependency, so I'll
> have to disagree with Martin and Christoph. Just put it in drivers/scsi,
> if it's the location they care about.

 I actually plan to remove CONFIG_BLK_SCSI_REQUEST in a merge window
 or two.  The only users are scsi and the ide layer, (virtio_blk
 support has already been accidentally disabled for a while), and getting
 rid of it allows to to shrink and simply the scsi data structures.

 But if you want this for now lets keep scsi_sense.c in drivers/scsi
 but depend on CONFIG_BLK_SCSI_REQUEST, that is easy enough to fix up.
>>>
>>> It could be a stand-alone dependency, doesn't have to be BLK_SCSI_REQUEST.
>>> BLA_SCSI_SENSE or something would do. I don't care too much about that,
>>> mostly getting rid of the entire stack dependency.
>>
>> Aaand, I can't do this and leave it in drivers/scsi because of 
>> drivers/Makefile:
>>
>> obj-$(CONFIG_SCSI)  += scsi/
>>
>> So: this needs to live in block/ just like CONFIG_BLK_SCSI_REQUEST's
>> scsi_ioctl.c. I will split it into CONFIG_BLK_SCSI_SENSE, but I'll
>> still need to move the code from drivers/scsi/ to block/. Is this
>> okay?
> 
> Ugh, so that would necessitate a change there too. As I said before,
> I don't really care where it lives. I know the SCSI folks seem bothered
> by moving it, but in reality, it's not like this stuff will likely ever
> really change. Of the two choices (select entire SCSI stack, or just move
> this little bit), I know what I would consider the saner option...
> 

or option 3:

obj-y   += scsi/

so that make descends into drivers/scsi/ and then builds whatever is needed,
depending on individual kconfig options.

-- 
~Randy


Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-22 Thread Randy Dunlap
On 05/22/2018 04:39 PM, Kees Cook wrote:
> On Tue, May 22, 2018 at 4:34 PM, Randy Dunlap <rdun...@infradead.org> wrote:
>> On 05/22/2018 04:31 PM, Kees Cook wrote:
>>> On Tue, May 22, 2018 at 12:16 PM, Jens Axboe <ax...@kernel.dk> wrote:
>>>> On 5/22/18 1:13 PM, Christoph Hellwig wrote:
>>>>> On Tue, May 22, 2018 at 01:09:41PM -0600, Jens Axboe wrote:
>>>>>> I think Martin and Christoph are objecting to moving the code to
>>>>>> block/scsi_ioctl.h. I don't care too much about where the code is, but
>>>>>> think it would be nice to have the definitions in a separate header. But
>>>>>> if they prefer just pulling in all of SCSI for it, well then I guess
>>>>>> it's pointless to move the header bits. Seems very heavy handed to me,
>>>>>> though.
>>>>>
>>>>> It might be heavy handed for the 3 remaining users of drivers/ide,
>>>>
>>>> Brutal :-)
>>>
>>> Heh. I noticed a similar sense buffer use in drivers/cdrom/cdrom.c
>>> too. Is this okay under the same considerations?
>>
>> No.  Do not select an entire subsystem.  Use depends on it instead.
> 
> I looked at that first, but it seems it's designed for that. For
> example, "config ATA" already has a "select SCSI".
> 
> It does look fishy, though, since "config SCSI" has a "depends" which
> would be ignored by "select". Luckily, all these uses already do a
> "depends on BLOCK" (directly or indirectly).

Linus has railed against selecting subsystems.  We shouldn't be adding
more IMHO, although it is difficult to get rid of ones that we already have.


-- 
~Randy


Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI

2018-05-22 Thread Randy Dunlap
On 05/22/2018 04:31 PM, Kees Cook wrote:
> On Tue, May 22, 2018 at 12:16 PM, Jens Axboe  wrote:
>> On 5/22/18 1:13 PM, Christoph Hellwig wrote:
>>> On Tue, May 22, 2018 at 01:09:41PM -0600, Jens Axboe wrote:
 I think Martin and Christoph are objecting to moving the code to
 block/scsi_ioctl.h. I don't care too much about where the code is, but
 think it would be nice to have the definitions in a separate header. But
 if they prefer just pulling in all of SCSI for it, well then I guess
 it's pointless to move the header bits. Seems very heavy handed to me,
 though.
>>>
>>> It might be heavy handed for the 3 remaining users of drivers/ide,
>>
>> Brutal :-)
> 
> Heh. I noticed a similar sense buffer use in drivers/cdrom/cdrom.c
> too. Is this okay under the same considerations?

No.  Do not select an entire subsystem.  Use depends on it instead.


> diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
> index ad9b687a236a..220ff321c102 100644
> --- a/drivers/block/Kconfig
> +++ b/drivers/block/Kconfig
> @@ -79,7 +79,7 @@ config GDROM
> tristate "SEGA Dreamcast GD-ROM drive"
> depends on SH_DREAMCAST
> select CDROM
> -   select BLK_SCSI_REQUEST # only for the generic cdrom code
> +   select SCSI
> help
>   A standard SEGA Dreamcast comes with a modified CD ROM drive called 
> a
>   "GD-ROM" by SEGA to signify it is capable of reading special disks
> @@ -345,7 +345,7 @@ config CDROM_PKTCDVD
> tristate "Packet writing on CD/DVD media (DEPRECATED)"
> depends on !UML
> select CDROM
> -   select BLK_SCSI_REQUEST
> +   select SCSI
> help
>   Note: This driver is deprecated and will be removed from the
>   kernel in the near future!
> diff --git a/drivers/block/paride/Kconfig b/drivers/block/paride/Kconfig
> index f8bd6ef3605a..7fdfcc5eaca5 100644
> --- a/drivers/block/paride/Kconfig
> +++ b/drivers/block/paride/Kconfig
> @@ -27,7 +27,7 @@ config PARIDE_PCD
> tristate "Parallel port ATAPI CD-ROMs"
> depends on PARIDE
> select CDROM
> -   select BLK_SCSI_REQUEST # only for the generic cdrom code
> +   select SCSI
> ---help---
>   This option enables the high-level driver for ATAPI CD-ROM devices
>   connected through a parallel port. If you chose to build PARIDE
> 
>>> but as long as that stuff just keeps working I'd rather worry about
>>> everyone else, and keep the scsi code where it belongs.
>>
>> Fine with me then, hopefully we can some day kill it off.
> 
> I'll send a v2. I found a few other things to fix up (including the
> cdrom.c one).


-- 
~Randy


[PATCH] scsi: clean up generated file scsi_devinfo_tbl.c

2018-05-13 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

"make clean" should remove the generated file "scsi_devinfo_tbl.c",
so list it in the clean-files variable so that the file gets
cleaned up.

Fixes: 345e29608b4b ("scsi: scsi: Export blacklist flags to sysfs")

Cc: Hannes Reinecke <h...@suse.de>
Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
 drivers/scsi/Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-4.17-rc4.orig/drivers/scsi/Makefile
+++ linux-4.17-rc4/drivers/scsi/Makefile
@@ -182,7 +182,7 @@ zalon7xx-objs   := zalon.o ncr53c8xx.o
 NCR_Q720_mod-objs  := NCR_Q720.o ncr53c8xx.o
 
 # Files generated that shall be removed upon make clean
-clean-files := 53c700_d.h 53c700_u.h
+clean-files := 53c700_d.h 53c700_u.h scsi_devinfo_tbl.c
 
 $(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h
 




[PATCH v3 3/4] target: target_core_user.[ch]: convert comments into DOC:

2018-04-14 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Make documentation on target-supported userspace-I/O design be
usable by kernel-doc by using "DOC:". This is used in the driver-api
Documentation chapter.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
To: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
Cc: Jonathan Corbet <cor...@lwn.net>
---
 drivers/target/target_core_user.c |8 ++--
 include/uapi/linux/target_core_user.h |   11 ++-
 2 files changed, 12 insertions(+), 7 deletions(-)

--- linux-next-20180413.orig/drivers/target/target_core_user.c
+++ linux-next-20180413/drivers/target/target_core_user.c
@@ -42,7 +42,11 @@
 
 #include 
 
-/*
+/**
+ * DOC: Userspace I/O
+ * Userspace I/O
+ * -
+ *
  * Define a shared-memory interface for LIO to pass SCSI commands and
  * data to userspace for processing. This is to allow backends that
  * are too complex for in-kernel support to be possible.
@@ -53,7 +57,7 @@
  * See the .h file for how the ring is laid out. Note that while the
  * command ring is defined, the particulars of the data area are
  * not. Offset values in the command entry point to other locations
- * internal to the mmap()ed area. There is separate space outside the
+ * internal to the mmap-ed area. There is separate space outside the
  * command ring for data buffers. This leaves maximum flexibility for
  * moving buffer allocations, or even page flipping or other
  * allocation techniques, without altering the command ring layout.
--- linux-next-20180413.orig/include/uapi/linux/target_core_user.h
+++ linux-next-20180413/include/uapi/linux/target_core_user.h
@@ -9,21 +9,22 @@
 
 #define TCMU_VERSION "2.0"
 
-/*
+/**
+ * DOC: Ring Design
  * Ring Design
  * ---
  *
  * The mmaped area is divided into three parts:
- * 1) The mailbox (struct tcmu_mailbox, below)
- * 2) The command ring
- * 3) Everything beyond the command ring (data)
+ * 1) The mailbox (struct tcmu_mailbox, below);
+ * 2) The command ring;
+ * 3) Everything beyond the command ring (data).
  *
  * The mailbox tells userspace the offset of the command ring from the
  * start of the shared memory region, and how big the command ring is.
  *
  * The kernel passes SCSI commands to userspace by putting a struct
  * tcmu_cmd_entry in the ring, updating mailbox->cmd_head, and poking
- * userspace via uio's interrupt mechanism.
+ * userspace via UIO's interrupt mechanism.
  *
  * tcmu_cmd_entry contains a header. If the header type is PAD,
  * userspace should skip hdr->length bytes (mod cmdr_size) to find the


[PATCH v3 4/4] target: add driver-api document

2018-04-14 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Add a driver-api document for target/iSCSI interfaces.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
To: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
Cc: Jonathan Corbet <cor...@lwn.net>
---
 Documentation/driver-api/index.rst  |1 
 Documentation/driver-api/scsi.rst   |2 
 Documentation/driver-api/target.rst |   64 ++
 3 files changed, 66 insertions(+), 1 deletion(-)

--- linux-next-20180413.orig/Documentation/driver-api/index.rst
+++ linux-next-20180413/Documentation/driver-api/index.rst
@@ -34,6 +34,7 @@ available subsections can be seen below.
edac
scsi
libata
+   target
mtdnand
miscellaneous
w1
--- linux-next-20180413.orig/Documentation/driver-api/scsi.rst
+++ linux-next-20180413/Documentation/driver-api/scsi.rst
@@ -334,5 +334,5 @@ todo
 
 
 Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
-FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
+FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
 netlink...
--- /dev/null
+++ linux-next-20180413/Documentation/driver-api/target.rst
@@ -0,0 +1,64 @@
+=
+target and iSCSI Interfaces Guide
+=
+
+Introduction and Overview
+=
+
+TBD
+
+Target core device interfaces
+=
+
+.. kernel-doc:: drivers/target/target_core_device.c
+:export:
+
+Target core transport interfaces
+
+
+.. kernel-doc:: drivers/target/target_core_transport.c
+:export:
+
+Target-supported userspace I/O
+==
+
+.. kernel-doc:: drivers/target/target_core_user.c
+:doc: Userspace I/O
+
+.. kernel-doc:: include/uapi/linux/target_core_user.h
+:doc: Ring Design
+
+iSCSI helper functions
+==
+
+.. kernel-doc:: drivers/scsi/libiscsi.c
+   :export:
+
+
+iSCSI boot information
+==
+
+.. kernel-doc:: drivers/scsi/iscsi_boot_sysfs.c
+   :export:
+
+
+iSCSI transport class
+=
+
+The file drivers/scsi/scsi_transport_iscsi.c defines transport
+attributes for the iSCSI class, which sends SCSI packets over TCP/IP
+connections.
+
+.. kernel-doc:: drivers/scsi/scsi_transport_iscsi.c
+   :export:
+
+
+iSCSI TCP interfaces
+
+
+.. kernel-doc:: drivers/scsi/iscsi_tcp.c
+   :internal:
+
+.. kernel-doc:: drivers/scsi/libiscsi_tcp.c
+   :export:
+


target: clean up kernel-doc and add driver-api document

2018-04-14 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

This patch series fixes kernel-doc warnings in drivers/target/ and
its header files, then adds a Documentation driver-api chapter for
target driver interfaces.


[PATCH v3 1/4] target: target_core_transport.c: fix kernel-doc warnings
[PATCH v3 2/4] target: target_core_transport.c: enable+fix kernel-doc
[PATCH v3 3/4] target: target_core_user.[ch]: convert comments into DOC:
[PATCH v3 4/4] target: add driver-api document


 Documentation/driver-api/index.rst |1 
 Documentation/driver-api/scsi.rst  |2 
 Documentation/driver-api/target.rst|   64 +++
 drivers/target/target_core_transport.c |   19 +++---
 drivers/target/target_core_user.c  |8 ++
 include/uapi/linux/target_core_user.h  |   11 ++-
 6 files changed, 89 insertions(+), 16 deletions(-)


[PATCH v3 2/4] target: target_core_transport.c: enable+fix kernel-doc

2018-04-14 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

For exported functions that already have near-kernel-doc notation,
fix them to begin with "/**" and make a few corrections so that they
don't have any kernel-doc warnings.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
To: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
Cc: Jonathan Corbet <cor...@lwn.net>
---
 drivers/target/target_core_transport.c |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

--- linux-next-20180413.orig/drivers/target/target_core_transport.c
+++ linux-next-20180413/drivers/target/target_core_transport.c
@@ -1431,7 +1431,7 @@ transport_generic_map_mem_to_cmd(struct
return 0;
 }
 
-/*
+/**
  * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized
  *  se_cmd + use pre-allocated SGL memory.
  *
@@ -1441,7 +1441,7 @@ transport_generic_map_mem_to_cmd(struct
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
  * @data_length: fabric expected data transfer length
- * @task_addr: SAM task attribute
+ * @task_attr: SAM task attribute
  * @data_dir: DMA data direction
  * @flags: flags for command submission from target_sc_flags_tables
  * @sgl: struct scatterlist memory for unidirectional mapping
@@ -1578,7 +1578,7 @@ int target_submit_cmd_map_sgls(struct se
 }
 EXPORT_SYMBOL(target_submit_cmd_map_sgls);
 
-/*
+/**
  * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
  *
  * @se_cmd: command descriptor to submit
@@ -1587,7 +1587,7 @@ EXPORT_SYMBOL(target_submit_cmd_map_sgls
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
  * @data_length: fabric expected data transfer length
- * @task_addr: SAM task attribute
+ * @task_attr: SAM task attribute
  * @data_dir: DMA data direction
  * @flags: flags for command submission from target_sc_flags_tables
  *
@@ -2606,7 +2606,8 @@ int transport_generic_free_cmd(struct se
 }
 EXPORT_SYMBOL(transport_generic_free_cmd);
 
-/* target_get_sess_cmd - Add command to active ->sess_cmd_list
+/**
+ * target_get_sess_cmd - Add command to active ->sess_cmd_list
  * @se_cmd:command descriptor to add
  * @ack_kref:  Signal that fabric will perform an ack target_put_sess_cmd()
  */
@@ -2800,7 +2801,8 @@ void target_show_cmd(const char *pfx, st
 }
 EXPORT_SYMBOL(target_show_cmd);
 
-/* target_sess_cmd_list_set_waiting - Flag all commands in
+/**
+ * target_sess_cmd_list_set_waiting - Flag all commands in
  * sess_cmd_list to complete cmd_wait_comp.  Set
  * sess_tearing_down so no more commands are queued.
  * @se_sess:   session to flag
@@ -2835,7 +2837,8 @@ void target_sess_cmd_list_set_waiting(st
 }
 EXPORT_SYMBOL(target_sess_cmd_list_set_waiting);
 
-/* target_wait_for_sess_cmds - Wait for outstanding descriptors
+/**
+ * target_wait_for_sess_cmds - Wait for outstanding descriptors
  * @se_sess:session to wait for active I/O
  */
 void target_wait_for_sess_cmds(struct se_session *se_sess)


[PATCH v3 1/4] target: target_core_transport.c: fix kernel-doc warnings

2018-04-14 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Correct a function parameter's name to eliminate kernel-doc warnings
in drivers/target/target_core_transport.c.

Fixes these kernel-doc warnings: (tested by adding these files to a new
target.rst documentation file)

../drivers/target/target_core_transport.c:1671: warning: No description found 
for parameter 'fabric_tmr_ptr'
../drivers/target/target_core_transport.c:1671: warning: Excess function 
parameter 'fabric_context' description in 'target_submit_tmr'

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
To: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
Cc: Jonathan Corbet <cor...@lwn.net>
---
 drivers/target/target_core_transport.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20180413.orig/drivers/target/target_core_transport.c
+++ linux-next-20180413/drivers/target/target_core_transport.c
@@ -1654,7 +1654,7 @@ static bool target_lookup_lun_from_tag(s
  * @se_sess: associated se_sess for endpoint
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
- * @fabric_context: fabric context for TMR req
+ * @fabric_tmr_ptr: fabric context for TMR req
  * @tm_type: Type of TM request
  * @gfp: gfp type for caller
  * @tag: referenced task tag for TMR_ABORT_TASK


Re: target documentation patches?

2018-04-14 Thread Randy Dunlap
On 02/22/2018 04:38 PM, Randy Dunlap wrote:
> Hi Nicholas,
> 
> I posted several patches for target documentation cleanups and adding
> a chapter to the driver-api chapter back in December.
> 
> Do I need to repost those?  Do you want someone else to merge them, even
> though several of them are in drivers/target/ ?


[no response in 7 weeks]
[adding linux-doc list]


I have a new 4-patch series for target kernel-doc fixes and adding
Documentation/driver-api/target.rst.  However, I am wondering who will
merge the series.

I'll post the series to target-devel, linux-scsi, and linux-doc.
Hopefully one of the maintainers there will apply them.


thanks,
-- 
~Randy


target documentation patches?

2018-02-22 Thread Randy Dunlap
Hi Nicholas,

I posted several patches for target documentation cleanups and adding
a chapter to the driver-api chapter back in December.

Do I need to repost those?  Do you want someone else to merge them, even
though several of them are in drivers/target/ ?


[PATCH] target: fix kernel-doc warnings in 
drivers/target/target_core_transport.c
https://www.spinics.net/lists/target-devel/msg16378.html

[PATCH] target: cleanup target_core_transport.c for kernel-doc
https://www.spinics.net/lists/target-devel/msg16381.html

[PATCH] target: add kernel-doc overview in target_core_user.[hc]
https://www.spinics.net/lists/target-devel/msg16380.html

[PATCH v2] target: add a target/iscsi driver-api Documentation chapter
https://www.spinics.net/lists/target-devel/msg16383.html

This patch has already been merged:
[PATCH] scsi: fix iscsi-related kernel-doc warnings
  https://marc.info/?l=linux-scsi=151398051426923=2


thanks,
-- 
~Randy


Re: [PATCH] scsi: fix iscsi-related kernel-doc warnings

2018-01-03 Thread Randy Dunlap
On 01/03/2018 08:11 PM, Martin K. Petersen wrote:
> 
> Randy,
> 
>> Fix kernel-doc warnings in drivers/scsi/ that are related to iscsi
>> support interfaces.
>>
>> Fixes these kernel-doc warnings: (tested by adding these files to a new
>> target.rst documentation file: WIP)
> 
> Applied to 4.16/scsi-queue, thanks!
> 
>> Cc:  "Nicholas A. Bellinger" 
>> Cc:  linux-scsi@vger.kernel.org
>> Cc:  target-de...@vger.kernel.org
>> Cc:  Sagi Grimberg 
>> Cc:  linux-r...@vger.kernel.org
>> Cc:  "James E.J. Bottomley" 
>> Cc:  "Martin K. Petersen" 
> 
>  ^^^ checkpatch complains about these spaces.

Hah, those are tabs, not spaces.

scripts/checkpatch.pl (comment) says something about this being a style thing:
# Check signature styles

WARNING: Use a single space after Cc:
#29: 
Cc: "Martin K. Petersen" 



Email standards (RFCs) sure don't require a single space.

and I would like to be able to copy N lines from MAINTAINERS file and then
replace either the M: and/or L: (actually just the 'M' or 'L') with
"To" or "Cc" and be done with it, instead of having to replace TAB on each
line with a space also.

Does anyone know where this "signature style" check came from?
I don't see it in any style guide.

thanks,
-- 
~Randy


[PATCH v2] target: add a target/iscsi driver-api Documentation chapter

2017-12-27 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Add a driver-api document for target/iSCSI interfaces.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---

This patch depends on 4 previous patches to driver source files:

[PATCH] target: fix kernel-doc warnings in 
drivers/target/target_core_transport.c
  https://marc.info/?l=linux-scsi=151398041926906=2

[PATCH] scsi: fix iscsi-related kernel-doc warnings
  https://marc.info/?l=linux-scsi=151398051426923=2

[PATCH] target: add kernel-doc overview in target_core_user.[hc]
  [PATCH] target: add kernel-doc overview in target_core_user.[hc]

[PATCH] target: cleanup target_core_transport.c for kernel-doc
  https://marc.info/?l=linux-scsi=151409284812033=2

v2: fix missing ':' on one line (:export:)

 Documentation/driver-api/index.rst  |1 
 Documentation/driver-api/scsi.rst   |2 
 Documentation/driver-api/target.rst |   64 ++
 3 files changed, 66 insertions(+), 1 deletion(-)

--- linux-next-20171221.orig/Documentation/driver-api/index.rst
+++ linux-next-20171221/Documentation/driver-api/index.rst
@@ -34,6 +34,7 @@ available subsections can be seen below.
edac
scsi
libata
+   target
mtdnand
miscellaneous
w1
--- linux-next-20171221.orig/Documentation/driver-api/scsi.rst
+++ linux-next-20171221/Documentation/driver-api/scsi.rst
@@ -340,5 +340,5 @@ todo
 
 
 Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
-FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
+FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
 netlink...
--- /dev/null
+++ linux-next-20171221/Documentation/driver-api/target.rst
@@ -0,0 +1,64 @@
+=
+target and iSCSI Interfaces Guide
+=
+
+Introduction and Overview
+=
+
+TBD
+
+Target core device interfaces
+=
+
+.. kernel-doc:: drivers/target/target_core_device.c
+:export:
+
+Target core transport interfaces
+
+
+.. kernel-doc:: drivers/target/target_core_transport.c
+:export:
+
+Target-supported userspace I/O
+==
+
+.. kernel-doc:: drivers/target/target_core_user.c
+:doc: Userspace I/O
+
+.. kernel-doc:: include/uapi/linux/target_core_user.h
+:doc: Ring Design
+
+iSCSI helper functions
+==
+
+.. kernel-doc:: drivers/scsi/libiscsi.c
+   :export:
+
+
+iSCSI boot information
+==
+
+.. kernel-doc:: drivers/scsi/iscsi_boot_sysfs.c
+   :export:
+
+
+iSCSI transport class
+=
+
+The file drivers/scsi/scsi_transport_iscsi.c defines transport
+attributes for the iSCSI class, which sends SCSI packets over TCP/IP
+connections.
+
+.. kernel-doc:: drivers/scsi/scsi_transport_iscsi.c
+   :export:
+
+
+iSCSI TCP interfaces
+
+
+.. kernel-doc:: drivers/scsi/iscsi_tcp.c
+   :internal:
+
+.. kernel-doc:: drivers/scsi/libiscsi_tcp.c
+   :export:
+


[PATCH] documentation: add a target/iscsi driver document

2017-12-26 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Add a driver-api document for target/iSCSI interfaces.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
This patch depends on 4 previous patches to driver source files:

[PATCH] target: fix kernel-doc warnings in 
drivers/target/target_core_transport.c
  https://marc.info/?l=linux-scsi=151398041926906=2

[PATCH] scsi: fix iscsi-related kernel-doc warnings
  https://marc.info/?l=linux-scsi=151398051426923=2

[PATCH] target: add kernel-doc overview in target_core_user.[hc]
  [PATCH] target: add kernel-doc overview in target_core_user.[hc]

[PATCH] target: cleanup target_core_transport.c for kernel-doc
  https://marc.info/?l=linux-scsi=151409284812033=2

 Documentation/driver-api/index.rst  |1 
 Documentation/driver-api/scsi.rst   |2 
 Documentation/driver-api/target.rst |   64 ++
 3 files changed, 66 insertions(+), 1 deletion(-)

--- linux-next-20171221.orig/Documentation/driver-api/index.rst
+++ linux-next-20171221/Documentation/driver-api/index.rst
@@ -34,6 +34,7 @@ available subsections can be seen below.
edac
scsi
libata
+   target
mtdnand
miscellaneous
w1
--- linux-next-20171221.orig/Documentation/driver-api/scsi.rst
+++ linux-next-20171221/Documentation/driver-api/scsi.rst
@@ -340,5 +340,5 @@ todo
 
 
 Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
-FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
+FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
 netlink...
--- /dev/null
+++ linux-next-20171221/Documentation/driver-api/target.rst
@@ -0,0 +1,64 @@
+=
+target and iSCSI Interfaces Guide
+=
+
+Introduction and Overview
+=
+
+TBD
+
+Target core device interfaces
+=
+
+.. kernel-doc:: drivers/target/target_core_device.c
+:export:
+
+Target core transport interfaces
+
+
+.. kernel-doc:: drivers/target/target_core_transport.c
+:export:
+
+Target-supported userspace I/O
+==
+
+.. kernel-doc:: drivers/target/target_core_user.c
+:doc: Userspace I/O
+
+.. kernel-doc:: include/uapi/linux/target_core_user.h
+:doc: Ring Design
+
+iSCSI helper functions
+==
+
+.. kernel-doc:: drivers/scsi/libiscsi.c
+   :export:
+
+
+iSCSI boot information
+==
+
+.. kernel-doc:: drivers/scsi/iscsi_boot_sysfs.c
+   :export
+
+
+iSCSI transport class
+=
+
+The file drivers/scsi/scsi_transport_iscsi.c defines transport
+attributes for the iSCSI class, which sends SCSI packets over TCP/IP
+connections.
+
+.. kernel-doc:: drivers/scsi/scsi_transport_iscsi.c
+   :export:
+
+
+iSCSI TCP interfaces
+
+
+.. kernel-doc:: drivers/scsi/iscsi_tcp.c
+   :internal:
+
+.. kernel-doc:: drivers/scsi/libiscsi_tcp.c
+   :export:
+




[PATCH] target: cleanup target_core_transport.c for kernel-doc

2017-12-23 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

For exported functions that already have near-kernel-doc notation,
fix them to begin with "/**" and make a few corrections so that they
don't have any kernel-doc warnings.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: Sagi Grimberg <s...@grimberg.me>
Cc: linux-r...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
---
 drivers/target/target_core_transport.c |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

--- linux-next-20171221.orig/drivers/target/target_core_transport.c
+++ linux-next-20171221/drivers/target/target_core_transport.c
@@ -1431,7 +1431,7 @@ transport_generic_map_mem_to_cmd(struct
return 0;
 }
 
-/*
+/**
  * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized
  *  se_cmd + use pre-allocated SGL memory.
  *
@@ -1441,7 +1441,7 @@ transport_generic_map_mem_to_cmd(struct
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
  * @data_length: fabric expected data transfer length
- * @task_addr: SAM task attribute
+ * @task_attr: SAM task attribute
  * @data_dir: DMA data direction
  * @flags: flags for command submission from target_sc_flags_tables
  * @sgl: struct scatterlist memory for unidirectional mapping
@@ -1578,7 +1578,7 @@ int target_submit_cmd_map_sgls(struct se
 }
 EXPORT_SYMBOL(target_submit_cmd_map_sgls);
 
-/*
+/**
  * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
  *
  * @se_cmd: command descriptor to submit
@@ -1587,7 +1587,7 @@ EXPORT_SYMBOL(target_submit_cmd_map_sgls
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
  * @data_length: fabric expected data transfer length
- * @task_addr: SAM task attribute
+ * @task_attr: SAM task attribute
  * @data_dir: DMA data direction
  * @flags: flags for command submission from target_sc_flags_tables
  *
@@ -2641,7 +2641,8 @@ int transport_generic_free_cmd(struct se
 }
 EXPORT_SYMBOL(transport_generic_free_cmd);
 
-/* target_get_sess_cmd - Add command to active ->sess_cmd_list
+/**
+ * target_get_sess_cmd - Add command to active ->sess_cmd_list
  * @se_cmd:command descriptor to add
  * @ack_kref:  Signal that fabric will perform an ack target_put_sess_cmd()
  */
@@ -2835,7 +2836,8 @@ void target_show_cmd(const char *pfx, st
 }
 EXPORT_SYMBOL(target_show_cmd);
 
-/* target_sess_cmd_list_set_waiting - Flag all commands in
+/**
+ * target_sess_cmd_list_set_waiting - Flag all commands in
  * sess_cmd_list to complete cmd_wait_comp.  Set
  * sess_tearing_down so no more commands are queued.
  * @se_sess:   session to flag
@@ -2870,7 +2872,8 @@ void target_sess_cmd_list_set_waiting(st
 }
 EXPORT_SYMBOL(target_sess_cmd_list_set_waiting);
 
-/* target_wait_for_sess_cmds - Wait for outstanding descriptors
+/**
+ * target_wait_for_sess_cmds - Wait for outstanding descriptors
  * @se_sess:session to wait for active I/O
  */
 void target_wait_for_sess_cmds(struct se_session *se_sess)




[PATCH] target: add kernel-doc overview in target_core_user.[hc]

2017-12-22 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Make documentation on target-supported userspace-I/O design be
usable by kernel-doc by using "DOC:".

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: Sagi Grimberg <s...@grimberg.me>
Cc: linux-r...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
Cc: Shaohua Li <s...@kernel.org>
Cc: Andy Grover <agro...@redhat.com>
---
 drivers/target/target_core_user.c |6 +-
 include/uapi/linux/target_core_user.h |   11 ++-
 2 files changed, 11 insertions(+), 6 deletions(-)

--- linux-next-20171221.orig/drivers/target/target_core_user.c
+++ linux-next-20171221/drivers/target/target_core_user.c
@@ -42,7 +42,11 @@
 
 #include 
 
-/*
+/**
+ * DOC: Userspace I/O
+ * Userspace I/O
+ * -
+ *
  * Define a shared-memory interface for LIO to pass SCSI commands and
  * data to userspace for processing. This is to allow backends that
  * are too complex for in-kernel support to be possible.
--- linux-next-20171221.orig/include/uapi/linux/target_core_user.h
+++ linux-next-20171221/include/uapi/linux/target_core_user.h
@@ -9,21 +9,22 @@
 
 #define TCMU_VERSION "2.0"
 
-/*
+/**
+ * DOC: Ring Design
  * Ring Design
  * ---
  *
  * The mmaped area is divided into three parts:
- * 1) The mailbox (struct tcmu_mailbox, below)
- * 2) The command ring
- * 3) Everything beyond the command ring (data)
+ * 1) The mailbox (struct tcmu_mailbox, below);
+ * 2) The command ring;
+ * 3) Everything beyond the command ring (data).
  *
  * The mailbox tells userspace the offset of the command ring from the
  * start of the shared memory region, and how big the command ring is.
  *
  * The kernel passes SCSI commands to userspace by putting a struct
  * tcmu_cmd_entry in the ring, updating mailbox->cmd_head, and poking
- * userspace via uio's interrupt mechanism.
+ * userspace via UIO's interrupt mechanism.
  *
  * tcmu_cmd_entry contains a header. If the header type is PAD,
  * userspace should skip hdr->length bytes (mod cmdr_size) to find the




[PATCH] scsi: fix iscsi-related kernel-doc warnings

2017-12-22 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Fix kernel-doc warnings in drivers/scsi/ that are related to iscsi
support interfaces.

Fixes these kernel-doc warnings: (tested by adding these files to a new
target.rst documentation file: WIP)

../drivers/scsi/libiscsi.c:2740: warning: No description found for parameter 
'dd_size'
../drivers/scsi/libiscsi.c:2740: warning: No description found for parameter 
'id'
../drivers/scsi/libiscsi.c:2961: warning: No description found for parameter 
'cls_conn'
../drivers/scsi/iscsi_tcp.c:313: warning: No description found for parameter 
'conn'
../drivers/scsi/iscsi_tcp.c:363: warning: No description found for parameter 
'conn'
../drivers/scsi/libiscsi_tcp.c:810: warning: No description found for parameter 
'tcp_conn'
../drivers/scsi/libiscsi_tcp.c:810: warning: No description found for parameter 
'segment'
../drivers/scsi/libiscsi_tcp.c:887: warning: No description found for parameter 
'offloaded'
../drivers/scsi/libiscsi_tcp.c:887: warning: No description found for parameter 
'status'
../drivers/scsi/libiscsi_tcp.c:887: warning: Excess function parameter 
'offload' description in 'iscsi_tcp_recv_skb'
../drivers/scsi/libiscsi_tcp.c:964: warning: Excess function parameter 'conn' 
description in 'iscsi_tcp_task_init'
../drivers/scsi/libiscsi_tcp.c:964: warning: Excess function parameter 'sc' 
description in 'iscsi_tcp_task_init'

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: Sagi Grimberg <s...@grimberg.me>
Cc: linux-r...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
---
 drivers/scsi/iscsi_tcp.c|2 ++
 drivers/scsi/libiscsi.c |4 +++-
 drivers/scsi/libiscsi_tcp.c |9 +
 3 files changed, 10 insertions(+), 5 deletions(-)

--- linux-next-20171221.orig/drivers/scsi/libiscsi.c
+++ linux-next-20171221/drivers/scsi/libiscsi.c
@@ -2722,8 +2722,10 @@ static void iscsi_host_dec_session_cnt(s
  * @iscsit: iscsi transport template
  * @shost: scsi host
  * @cmds_max: session can queue
+ * @dd_size: private driver data size, added to session allocation size
  * @cmd_task_size: LLD task private data size
  * @initial_cmdsn: initial CmdSN
+ * @id: target ID to add to this session
  *
  * This can be used by software iscsi_transports that allocate
  * a session per scsi host.
@@ -2951,7 +2953,7 @@ EXPORT_SYMBOL_GPL(iscsi_conn_setup);
 
 /**
  * iscsi_conn_teardown - teardown iscsi connection
- * cls_conn: iscsi class connection
+ * @cls_conn: iscsi class connection
  *
  * TODO: we may need to make this into a two step process
  * like scsi-mls remove + put host
--- linux-next-20171221.orig/drivers/scsi/iscsi_tcp.c
+++ linux-next-20171221/drivers/scsi/iscsi_tcp.c
@@ -307,6 +307,7 @@ static int iscsi_sw_tcp_xmit_segment(str
 
 /**
  * iscsi_sw_tcp_xmit - TCP transmit
+ * @conn: iscsi connection
  **/
 static int iscsi_sw_tcp_xmit(struct iscsi_conn *conn)
 {
@@ -357,6 +358,7 @@ error:
 
 /**
  * iscsi_tcp_xmit_qlen - return the number of bytes queued for xmit
+ * @conn: iscsi connection
  */
 static inline int iscsi_sw_tcp_xmit_qlen(struct iscsi_conn *conn)
 {
--- linux-next-20171221.orig/drivers/scsi/libiscsi_tcp.c
+++ linux-next-20171221/drivers/scsi/libiscsi_tcp.c
@@ -798,6 +798,8 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn
 
 /**
  * iscsi_tcp_hdr_recv_done - process PDU header
+ * @tcp_conn: iSCSI TCP connection
+ * @segment: the buffer segment being processed
  *
  * This is the callback invoked when the PDU header has
  * been received. If the header is followed by additional
@@ -876,9 +878,10 @@ EXPORT_SYMBOL_GPL(iscsi_tcp_recv_segment
  * @conn: iscsi connection
  * @skb: network buffer with header and/or data segment
  * @offset: offset in skb
- * @offload: bool indicating if transfer was offloaded
+ * @offloaded: bool indicating if transfer was offloaded
+ * @status: iscsi TCP status result
  *
- * Will return status of transfer in status. And will return
+ * Will return status of transfer in @status. And will return
  * number of bytes copied.
  */
 int iscsi_tcp_recv_skb(struct iscsi_conn *conn, struct sk_buff *skb,
@@ -955,9 +958,7 @@ EXPORT_SYMBOL_GPL(iscsi_tcp_recv_skb);
 
 /**
  * iscsi_tcp_task_init - Initialize iSCSI SCSI_READ or SCSI_WRITE commands
- * @conn: iscsi connection
  * @task: scsi command task
- * @sc: scsi command
  */
 int iscsi_tcp_task_init(struct iscsi_task *task)
 {




[PATCH] target: fix kernel-doc warnings in drivers/target/target_core_transport.c

2017-12-22 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Correct a function parameter's name to eliminate kernel-doc warnings
in drivers/target/target_core_transport.c.

Fixes these kernel-doc warnings: (tested by adding these files to a new
target.rst documentation file: WIP)

../drivers/target/target_core_transport.c:1671: warning: No description found 
for parameter 'fabric_tmr_ptr'
../drivers/target/target_core_transport.c:1671: warning: Excess function 
parameter 'fabric_context' description in 'target_submit_tmr'

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: "Nicholas A. Bellinger" <n...@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org
Cc: target-de...@vger.kernel.org
Cc: Sagi Grimberg <s...@grimberg.me>
Cc: linux-r...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
---
 drivers/target/target_core_transport.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20171221.orig/drivers/target/target_core_transport.c
+++ linux-next-20171221/drivers/target/target_core_transport.c
@@ -1654,7 +1654,7 @@ static bool target_lookup_lun_from_tag(s
  * @se_sess: associated se_sess for endpoint
  * @sense: pointer to SCSI sense buffer
  * @unpacked_lun: unpacked LUN to reference for struct se_lun
- * @fabric_context: fabric context for TMR req
+ * @fabric_tmr_ptr: fabric context for TMR req
  * @tm_type: Type of TM request
  * @gfp: gfp type for caller
  * @tag: referenced task tag for TMR_ABORT_TASK



[PATCH] documentation: add scsi_common.c to SCSI driver-api

2017-12-10 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Add exported functions from scsi_common.c to the SCSI driver API
documentation.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: Nicholas Bellinger <n...@linux-iscsi.org>
---
 Documentation/driver-api/scsi.rst |8 
 1 file changed, 8 insertions(+)

--- lnx-415-rc2.orig/Documentation/driver-api/scsi.rst
+++ lnx-415-rc2/Documentation/driver-api/scsi.rst
@@ -224,6 +224,14 @@ mid to lowlevel SCSI driver interface
 .. kernel-doc:: drivers/scsi/hosts.c
:export:
 
+drivers/scsi/scsi_common.c
+~~
+
+general support functions
+
+.. kernel-doc:: drivers/scsi/scsi_common.c
+   :export:
+
 Transport classes
 -
 




[PATCH] scsi: doc. fixes to scsi_common.c

2017-12-10 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Clean up some comment typos and fix some errors in documentation.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: Nicholas Bellinger <n...@linux-iscsi.org>
Cc: Sagi Grimberg <sa...@mellanox.com>
Cc: Bart Van Assche <bart.vanass...@wdc.com>
---
 drivers/scsi/scsi_common.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

--- lnx-415-rc2.orig/drivers/scsi/scsi_common.c
+++ lnx-415-rc2/drivers/scsi/scsi_common.c
@@ -12,7 +12,7 @@
 
 /* NB: These are exposed through /proc/scsi/scsi and form part of the ABI.
  * You may not alter any existing entry (although adding new ones is
- * encouraged once assigned by ANSI/INCITS T10
+ * encouraged once assigned by ANSI/INCITS T10).
  */
 static const char *const scsi_device_types[] = {
"Direct-Access",
@@ -39,7 +39,7 @@ static const char *const scsi_device_typ
 };
 
 /**
- * scsi_device_type - Return 17 char string indicating device type.
+ * scsi_device_type - Return 17-char string indicating device type.
  * @type: type number to look up
  */
 const char *scsi_device_type(unsigned type)
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(scsi_device_type);
  * @scsilun:   struct scsi_lun to be converted.
  *
  * Description:
- * Convert @scsilun from a struct scsi_lun to a four byte host byte-ordered
+ * Convert @scsilun from a struct scsi_lun to a four-byte host byte-ordered
  * integer, and return the result. The caller must check for
  * truncation before using this function.
  *
@@ -98,7 +98,7 @@ EXPORT_SYMBOL(scsilun_to_int);
  * back into the lun value.
  *
  * Notes:
- * Given an integer : 0x0b03d204,  this function returns a
+ * Given an integer : 0x0b03d204, this function returns a
  * struct scsi_lun of: d2 04 0b 03 00 00 00 00
  *
  */
@@ -221,7 +221,7 @@ EXPORT_SYMBOL(scsi_sense_desc_find);
 
 /**
  * scsi_build_sense_buffer - build sense data in a buffer
- * @desc:  Sense format (non zero == descriptor format,
+ * @desc:  Sense format (non-zero == descriptor format,
  *  0 == fixed format)
  * @buf:   Where to build sense data
  * @key:   Sense key
@@ -255,7 +255,7 @@ EXPORT_SYMBOL(scsi_build_sense_buffer);
  * @info:  64-bit information value to be set
  *
  * Return value:
- * 0 on success or EINVAL for invalid sense buffer length
+ * 0 on success or -EINVAL for invalid sense buffer length
  **/
 int scsi_set_sense_information(u8 *buf, int buf_len, u64 info)
 {
@@ -305,7 +305,7 @@ EXPORT_SYMBOL(scsi_set_sense_information
  * @cd:command/data bit
  *
  * Return value:
- * 0 on success or EINVAL for invalid sense buffer length
+ * 0 on success or -EINVAL for invalid sense buffer length
  */
 int scsi_set_sense_field_pointer(u8 *buf, int buf_len, u16 fp, u8 bp, bool cd)
 {



[PATCH] scsi: st.c: fix kernel-doc mismatch

2017-11-20 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Fix kernel-doc function name and comments in st.c::read_ns_show():
change us to ns to match the function name.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
 drivers/scsi/st.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-414.orig/drivers/scsi/st.c
+++ lnx-414/drivers/scsi/st.c
@@ -4712,7 +4712,7 @@ static ssize_t read_byte_cnt_show(struct
 static DEVICE_ATTR_RO(read_byte_cnt);
 
 /**
- * read_us_show - return read us - overall time spent waiting on reads in ns.
+ * read_ns_show - return read ns - overall time spent waiting on reads in ns.
  * @dev: struct device
  * @attr: attribute structure
  * @buf: buffer to return formatted data in




[PATCH] scsi: fix another I2O typo

2017-11-18 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Correct another typo I20 to I2O.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
 Documentation/driver-api/scsi.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-414.orig/Documentation/driver-api/scsi.rst
+++ lnx-414/Documentation/driver-api/scsi.rst
@@ -332,5 +332,5 @@ todo
 
 
 Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
-FireWire, ATAPI devices, Infiniband, I20, iSCSI, Parallel ports,
+FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
 netlink...




Re: [PATCH v2] scsi: require CAP_SYS_ADMIN to write to procfs interface

2017-11-04 Thread Randy Dunlap
On 11/04/2017 01:26 PM, Aleksa Sarai wrote:
> Previously, the only capability effectively required to operate on the
> /proc/scsi interface was CAP_DAC_OVERRIDE (or for some other files,
> having an fsuid of GLOBAL_ROOT_UID was enough). This means that
> semi-privileged processes could interfere with core components of a
> system (such as causing a DoS by removing the underlying SCSI device of
> the host's / mount).
> 
> Cc: 
> Cc: "Eric W. Biederman" 
> Signed-off-by: Aleksa Sarai 

There should be an
#include 
somewhere... even if some other header file is dragging it in (which
it must be), the preferred style is to always explicitly #include
header files that are used.

> ---
>  drivers/scsi/scsi_proc.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
> index 480a597b3877..8c891ab16b11 100644
> --- a/drivers/scsi/scsi_proc.c
> +++ b/drivers/scsi/scsi_proc.c
> @@ -51,7 +51,10 @@ static ssize_t proc_scsi_host_write(struct file *file, 
> const char __user *buf,
>   struct Scsi_Host *shost = PDE_DATA(file_inode(file));
>   ssize_t ret = -ENOMEM;
>   char *page;
> -
> +
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
>   if (count > PROC_BLOCK_SIZE)
>   return -EOVERFLOW;
>  
> @@ -313,6 +316,9 @@ static ssize_t proc_scsi_write(struct file *file, const 
> char __user *buf,
>   char *buffer, *p;
>   int err;
>  
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
>   if (!buf || length > PAGE_SIZE)
>   return -EINVAL;
>  
> 


-- 
~Randy


Re: [PATCH] scsi: require CAP_SYS_ADMIN to write to procfs interface

2017-11-04 Thread Randy Dunlap
On 11/04/2017 11:59 AM, Aleksa Sarai wrote:
> Previously, the only capability effectively required to operate on the
> /proc/scsi interface was CAP_DAC_OVERRIDE (or for some other files,
> having an fsuid of GLOBAL_ROOT_UID was enough). This means that
> semi-privileged processes could interfere with core components of a
> system (such as causing a DoS by removing the underlying SCSI device of
> the host's / mount).
> 
> Cc: 
> Cc: "Eric W. Biederman" 
> Signed-off-by: Aleksa Sarai 
> ---
>  drivers/scsi/scsi_proc.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
> index 480a597b3877..486aedce2f05 100644
> --- a/drivers/scsi/scsi_proc.c
> +++ b/drivers/scsi/scsi_proc.c
> @@ -51,7 +51,10 @@ static ssize_t proc_scsi_host_write(struct file *file, 
> const char __user *buf,
>   struct Scsi_Host *shost = PDE_DATA(file_inode(file));
>   ssize_t ret = -ENOMEM;
>   char *page;
> -
> +
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM

did that build without a trailing ';' ?

> +
>   if (count > PROC_BLOCK_SIZE)
>   return -EOVERFLOW;
>  
> @@ -313,6 +316,9 @@ static ssize_t proc_scsi_write(struct file *file, const 
> char __user *buf,
>   char *buffer, *p;
>   int err;
>  
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
>   if (!buf || length > PAGE_SIZE)
>   return -EINVAL;
>  
> 


-- 
~Randy


Re: Patch: add to Documentation/scsi for scsi_dev_flags and command line passing

2017-10-18 Thread Randy Dunlap
On 10/18/17 10:28, Laurence Oberman wrote:
> I just noticed that
> Was taken straight out of git after changing the Doc file.
> Let me see why git did that
> 

It's more likely that Evolution did it.

> 
> On Wed, Oct 18, 2017 at 1:25 PM, Randy Dunlap <rdun...@infradead.org 
> <mailto:rdun...@infradead.org>> wrote:
> 
> On 10/18/17 10:13, Laurence Oberman wrote:
> > Tired of forgetting about this so documented it for others so they also
> > don't spend unnecessary time figuring this out.
> >
> > Signed-off-by: Laurence Oberman <lober...@redhat.com 
> <mailto:lober...@redhat.com>>
> >
> > diff --git a/Documentation/scsi/scsi-parameters.txt
> > b/Documentation/scsi/scsi-parameters.txt
> > index 8477655..c9e9ce8 100644
> > --- a/Documentation/scsi/scsi-parameters.txt
> > +++ b/Documentation/scsi/scsi-parameters.txt
> > @@ -116,3 +116,9 @@ parameters may be changed at runtime by the command
> >  
> >       wd33c93=        [HW,SCSI]
> >                       See header of drivers/scsi/wd33c93.c.
> > +
> > +Additional notes on passing parameters on the command line.
> 
>                                                          line:
> 
> > +Its not intuitively obvious how to pass certain parameters on the boot
> 
>    It's
> 
> > line.
> > +For parameters such as scsi_dev_flags, you need to pass to the
> > scsi_mod as follows
> 
>            as follows:
> 
> > +scsi_mod.dev_flags=LIO-ORG:thin2:0x8000
> > +
> > -- 
> > 1.8.3.1
> 
> 
> Also the patch has some weird line breaks.
> 
> 
> --
> ~Randy
> 
> 


-- 
~Randy


Re: Patch: add to Documentation/scsi for scsi_dev_flags and command line passing

2017-10-18 Thread Randy Dunlap
On 10/18/17 10:13, Laurence Oberman wrote:
> Tired of forgetting about this so documented it for others so they also
> don't spend unnecessary time figuring this out.
> 
> Signed-off-by: Laurence Oberman 
> 
> diff --git a/Documentation/scsi/scsi-parameters.txt
> b/Documentation/scsi/scsi-parameters.txt
> index 8477655..c9e9ce8 100644
> --- a/Documentation/scsi/scsi-parameters.txt
> +++ b/Documentation/scsi/scsi-parameters.txt
> @@ -116,3 +116,9 @@ parameters may be changed at runtime by the command
>  
>   wd33c93=[HW,SCSI]
>   See header of drivers/scsi/wd33c93.c.
> +
> +Additional notes on passing parameters on the command line.

 line:

> +Its not intuitively obvious how to pass certain parameters on the boot

   It's

> line.
> +For parameters such as scsi_dev_flags, you need to pass to the
> scsi_mod as follows

   as follows:

> +scsi_mod.dev_flags=LIO-ORG:thin2:0x8000
> +
> -- 
> 1.8.3.1


Also the patch has some weird line breaks.


-- 
~Randy


Re: [PATCH 1/8] lib: Introduce sgl_alloc() and sgl_free()

2017-10-13 Thread Randy Dunlap
On 10/12/17 15:45, Bart Van Assche wrote:

> diff --git a/lib/sgl_alloc.c b/lib/sgl_alloc.c
> new file mode 100644
> index ..d96b395dd5c8
> --- /dev/null
> +++ b/lib/sgl_alloc.c
> @@ -0,0 +1,102 @@

> +/**
> + * sgl_free_order - free a scatterlist and its pages
> + * @sg: Scatterlist with one or more elements

  @sgl:

> + * @order: Second argument for __free_pages()
> + */
> +void sgl_free_order(struct scatterlist *sgl, int order)
> +{
> + struct scatterlist *sg;
> + struct page *page;
> +
> + for (sg = sgl; sg; sg = sg_next(sg)) {
> + page = sg_page(sg);
> + if (page)
> + __free_pages(page, order);
> + }
> + kfree(sgl);
> +}
> +EXPORT_SYMBOL(sgl_free_order);
> +
> +/**
> + * sgl_free - free a scatterlist and its pages
> + * @sg: Scatterlist with one or more elements

  @sgl:

> + */
> +void sgl_free(struct scatterlist *sgl)
> +{
> + sgl_free_order(sgl, 0);
> +}
> +EXPORT_SYMBOL(sgl_free);
> 

ta.
-- 
~Randy


[PATCH v2] scsi: logging: update description of logging_level bits

2017-10-11 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Update the description of 'scsi_logging_level' from 8 4-bit nibbles
to the (pre-git) reality of 10 3-bit bitfields.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Reviewed-by: Kyle Fortin <kyle.for...@oracle.com>
Reviewed-by: Steffen Maier <ma...@linux.vnet.ibm.com>
---
 drivers/scsi/scsi_logging.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

v2: change 3-bit 'nibbles' to 3-bit bitfields.
add Reviewed-bys.

--- lnx-414-rc3.orig/drivers/scsi/scsi_logging.h
+++ lnx-414-rc3/drivers/scsi/scsi_logging.h
@@ -3,10 +3,10 @@
 
 
 /*
- * This defines the scsi logging feature.  It is a means by which the user
- * can select how much information they get about various goings on, and it
- * can be really useful for fault tracing.  The logging word is divided into
- * 8 nibbles, each of which describes a loglevel.  The division of things is
+ * This defines the scsi logging feature.  It is a means by which the user can
+ * select how much information they get about various goings on, and it can be
+ * really useful for fault tracing.  The logging word is divided into 10 3-bit
+ * bitfields, each of which describes a loglevel.  The division of things is
  * somewhat arbitrary, and the division of the word could be changed if it
  * were really needed for any reason.  The numbers below are the only place
  * where these are specified.  For a first go-around, 3 bits is more than



Re: [PATCH] scsi: logging_level: update bits description

2017-10-11 Thread Randy Dunlap
On 10/11/17 06:18, Steffen Maier wrote:
> 
> On 10/10/2017 09:32 PM, Kyle Fortin wrote:
>> On Oct 10, 2017, at 3:05 PM, Randy Dunlap <rdun...@infradead.org> wrote:
>>> From: Randy Dunlap <rdun...@infradead.org>
>>>
>>> Update the description of 'scsi_logging_level' from 8 4-bit nibbles
>>> to the (pre-git) reality of 10 3-bit 'nibbles'.
>>>
>>> Signed-off-by: Randy Dunlap <rdun...@infradead.org>
>>> ---
>>> drivers/scsi/scsi_logging.h |    8 
>>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> --- lnx-414-rc3.orig/drivers/scsi/scsi_logging.h
>>> +++ lnx-414-rc3/drivers/scsi/scsi_logging.h
>>> @@ -3,10 +3,10 @@
>>>
>>>
>>> /*
>>> - * This defines the scsi logging feature.  It is a means by which the user
>>> - * can select how much information they get about various goings on, and it
>>> - * can be really useful for fault tracing.  The logging word is divided 
>>> into
> 
> nit pick: Why reflow and thus "change" these 3 lines even though the content 
> is the same?

Just to fit into max. of 80 characters per line. Changing it to only one long 
line
was weird.

>>> - * 8 nibbles, each of which describes a loglevel.  The division of things 
>>> is
>>> + * This defines the scsi logging feature.  It is a means by which the user 
>>> can
>>> + * select how much information they get about various goings on, and it 
>>> can be
>>> + * really useful for fault tracing.  The logging word is divided into 10 
>>> 3-bit
>>> + * 'nibbles', each of which describes a loglevel.  The division of things 
>>> is
>>
>> I think ‘bitfields' is more appropriate than ‘nibbles’ (a 4-bit construct in 
>> compute).
> 
> +1

OK.

>>>   * somewhat arbitrary, and the division of the word could be changed if it
>>>   * were really needed for any reason.  The numbers below are the only place
>>>   * where these are specified.  For a first go-around, 3 bits is more than
>>
>> Reviewed-by: Kyle Fortin <kyle.for...@oracle.com>
> 
> Reviewed-by: Steffen Maier <ma...@linux.vnet.ibm.com>
> 


-- 
~Randy


[PATCH] scsi: fix doc. typo for I2O

2017-10-10 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Fix typo: I20 should be I2O.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
 Documentation/driver-api/scsi.rst |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-414-rc3.orig/Documentation/driver-api/scsi.rst
+++ lnx-414-rc3/Documentation/driver-api/scsi.rst
@@ -28,7 +28,7 @@ SCSI commands can be transported over ju
 are the default protocol for storage devices attached to USB, SATA, SAS,
 Fibre Channel, FireWire, and ATAPI devices. SCSI packets are also
 commonly exchanged over Infiniband,
-`I20 <http://i2o.shadowconnect.com/faq.php>`__, TCP/IP
+`I2O <http://i2o.shadowconnect.com/faq.php>`__, TCP/IP
 (`iSCSI <https://en.wikipedia.org/wiki/ISCSI>`__), even `Parallel
 ports <http://cyberelk.net/tim/parport/parscsi.html>`__.
 



[PATCH] scsi: logging_level: update bits description

2017-10-10 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Update the description of 'scsi_logging_level' from 8 4-bit nibbles
to the (pre-git) reality of 10 3-bit 'nibbles'.

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
 drivers/scsi/scsi_logging.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

--- lnx-414-rc3.orig/drivers/scsi/scsi_logging.h
+++ lnx-414-rc3/drivers/scsi/scsi_logging.h
@@ -3,10 +3,10 @@
 
 
 /*
- * This defines the scsi logging feature.  It is a means by which the user
- * can select how much information they get about various goings on, and it
- * can be really useful for fault tracing.  The logging word is divided into
- * 8 nibbles, each of which describes a loglevel.  The division of things is
+ * This defines the scsi logging feature.  It is a means by which the user can
+ * select how much information they get about various goings on, and it can be
+ * really useful for fault tracing.  The logging word is divided into 10 3-bit
+ * 'nibbles', each of which describes a loglevel.  The division of things is
  * somewhat arbitrary, and the division of the word could be changed if it
  * were really needed for any reason.  The numbers below are the only place
  * where these are specified.  For a first go-around, 3 bits is more than


Re: [scsi-qedf] question about parameter ordering

2017-05-03 Thread Randy Dunlap
On 05/03/17 11:29, Chad Dupuis wrote:
> 
> On Wed, 3 May 2017, 1:58pm, Gustavo A. R. Silva wrote:
> 
>>
>> Hello everybody,
>>
>> While looking into Coverity ID 1402011 I ran into the following piece of code
>> at drivers/scsi/qedf/qedf_io.c:2057:
>>
>> /* Fill FC header */
>> fc_hdr = &(tm_req->req_fc_hdr);
>> sid = fcport->sid;
>> did = fcport->rdata->ids.port_id;
>> __fc_fill_fc_hdr(fc_hdr, FC_RCTL_DD_UNSOL_CMD, sid, did,
>>   FC_TYPE_FCP, FC_FC_FIRST_SEQ | FC_FC_END_SEQ |
>>   FC_FC_SEQ_INIT, 0);
>>
>> The issue here is that the position of arguments in the call to
>> __fc_fill_fc_hdr() function do not match the ordering of the parameters:
>>
>> _sid_ is passed to _did_
>> _did_ is passed to _sid_
>>
>> this is the function prototype:
>>
>> static inline void __fc_fill_fc_hdr(struct fc_frame_header *fh,
>>enum fc_rctl r_ctl,
>>u32 did, u32 sid, enum fc_fh_type type,
>>u32 f_ctl, u32 parm_offset)
>>
>> My question here is if this is intentionala?
> 
> This may have been but this code has been superseded by commit
> be086e7c53f1fac51eed14523b28f2214b548dd2.B

what git tree is that in?

Thanks.

>> In case it is not, I will send a patch to fix it. But first it would be great
>> to hear any comment about it.
>>
>> By the way... the same is happening at drivers/scsi/qedf/qedf_els.c:109
> 
> May be a bug here so you could send a patch.


-- 
~Randy


Re: linux-next: Tree for Apr 3 (scsi/lpfc)

2017-04-03 Thread Randy Dunlap
On 04/03/17 01:13, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20170331:
> 

on i386:

when SCSI_LPFC=y and
CONFIG_NVME_CORE=m
CONFIG_BLK_DEV_NVME=m
CONFIG_BLK_DEV_NVME_SCSI=y
CONFIG_NVME_FABRICS=m
CONFIG_NVME_FC=m
CONFIG_NVME_TARGET=m

drivers/built-in.o: In function `lpfc_nvme_create_localport':
(.text+0x28ce6b): undefined reference to `nvme_fc_register_localport'
drivers/built-in.o: In function `lpfc_nvme_destroy_localport':
(.text+0x28d263): undefined reference to `nvme_fc_unregister_remoteport'
drivers/built-in.o: In function `lpfc_nvme_destroy_localport':
(.text+0x28d2d3): undefined reference to `nvme_fc_unregister_localport'
drivers/built-in.o: In function `lpfc_nvme_register_port':
(.text+0x28d576): undefined reference to `nvme_fc_register_remoteport'
drivers/built-in.o: In function `lpfc_nvme_unregister_port':
(.text+0x28d93c): undefined reference to `nvme_fc_unregister_remoteport'


so SCSI_LPFC depends on NVME_FC...



Reported-by: Randy Dunlap <rdun...@infradead.org>

-- 
~Randy


[PATCH -next] scsi: qedi: fix build, depends on UIO

2016-12-20 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Fix build of SCSI qedi driver. It uses uio interfaces so it
should depend on UIO.

ERROR: "uio_unregister_device" [drivers/scsi/qedi/qedi.ko] undefined!
ERROR: "uio_event_notify" [drivers/scsi/qedi/qedi.ko] undefined!
ERROR: "__uio_register_device" [drivers/scsi/qedi/qedi.ko] undefined!

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
Cc: qlogic-storage-upstr...@cavium.com
---
 drivers/scsi/qedi/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20161220.orig/drivers/scsi/qedi/Kconfig
+++ linux-next-20161220/drivers/scsi/qedi/Kconfig
@@ -1,6 +1,6 @@
 config QEDI
tristate "QLogic QEDI 25/40/100Gb iSCSI Initiator Driver Support"
-   depends on PCI && SCSI
+   depends on PCI && SCSI && UIO
depends on QED
select SCSI_ISCSI_ATTRS
select QED_LL2
--
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: version 3.18.44 to 3.18.45 introduced a bug in "drivers/scsi/megaraid/megaraid_sas_base.c"

2016-12-13 Thread Randy Dunlap
On 12/13/16 08:30, Greg Kroah-Hartman wrote:
> On Tue, Dec 13, 2016 at 08:08:27AM -0800, Randy Dunlap wrote:
>> [adding other lists + gregkh]
>>
>>
>> On 12/13/16 02:56, Dashi DS1 Cao wrote:
>>> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
>>> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>>> @@ -1614,16 +1614,13 @@ megasas_queue_command(struct Scsi_Host *shost, 
>>> struct scsi_cmnd *scmd)
>>> goto out_done;
>>> }
>>>
>>> -   switch (scmd->cmnd[0]) {
>>> -   case SYNCHRONIZE_CACHE:
>>> -   /*
>>> -* FW takes care of flush cache on its own
>>> -* No need to send it down
>>> -*/
>>> +   /*
>>> +* FW takes care of flush cache on its own for Virtual Disk.
>>> +* No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE 
>>> to FW.
>>> +*/
>>> +   if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && 
>>> MEGASAS_IS_LOGICAL(scmd)) {
>>> scmd->result = DID_OK << 16;
>>> goto out_done;
>>> -   default:
>>> -   break;
>>> }
>>>
>>> if (instance->instancet->build_and_issue_cmd(instance, scmd)) {
>>>
>>> MEGASAS_IS_LOGICAL is defined to be a macro with '?' operator, which has a 
>>> lower precedence than '&&'.
>>> The macro should have been defined as:
>>> --- a/drivers/scsi/megaraid/megaraid_sas.h
>>> +++ b/drivers/scsi/megaraid/megaraid_sas.h
>>> @@ -1823,7 +1823,7 @@ struct megasas_instance_template {
>>>  };
>>>
>>>  #define MEGASAS_IS_LOGICAL(scp)
>>> \
>>> -   (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1
>>> +   ((scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1)
>>>
>>>  #define MEGASAS_DEV_INDEX(inst, scp)   \
>>> ((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) +\
>>>
>>> Dashi Cao
>>>
> 
> I don't maintain 3.18-stable :)
> 
> thanks,
> 
> greg k-h
> 

Thanks. My bad.

adding Sasha.


-- 
~Randy
--
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: version 3.18.44 to 3.18.45 introduced a bug in "drivers/scsi/megaraid/megaraid_sas_base.c"

2016-12-13 Thread Randy Dunlap
[adding other lists + gregkh]


On 12/13/16 02:56, Dashi DS1 Cao wrote:
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -1614,16 +1614,13 @@ megasas_queue_command(struct Scsi_Host *shost, struct 
> scsi_cmnd *scmd)
> goto out_done;
> }
> 
> -   switch (scmd->cmnd[0]) {
> -   case SYNCHRONIZE_CACHE:
> -   /*
> -* FW takes care of flush cache on its own
> -* No need to send it down
> -*/
> +   /*
> +* FW takes care of flush cache on its own for Virtual Disk.
> +* No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE to 
> FW.
> +*/
> +   if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd)) 
> {
> scmd->result = DID_OK << 16;
> goto out_done;
> -   default:
> -   break;
> }
> 
> if (instance->instancet->build_and_issue_cmd(instance, scmd)) {
> 
> MEGASAS_IS_LOGICAL is defined to be a macro with '?' operator, which has a 
> lower precedence than '&&'.
> The macro should have been defined as:
> --- a/drivers/scsi/megaraid/megaraid_sas.h
> +++ b/drivers/scsi/megaraid/megaraid_sas.h
> @@ -1823,7 +1823,7 @@ struct megasas_instance_template {
>  };
> 
>  #define MEGASAS_IS_LOGICAL(scp)  
>   \
> -   (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1
> +   ((scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1)
> 
>  #define MEGASAS_DEV_INDEX(inst, scp)   \
> ((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) +\
> 
> Dashi Cao
> 


-- 
~Randy
--
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: linux-next: Tree for Jun 6 (scsi_debug.c)

2016-09-02 Thread Randy Dunlap
On 08/23/16 16:22, Masanari Iida wrote:
> This one still exist on linus's tree (as of  v4.8-rc3).
> 
> CALLscripts/checksyscalls.sh
>   CHK kernel/config_data.h
>   Building modules, stage 2.
>   MODPOST 720 modules
> ERROR: "ip_compute_csum" [drivers/scsi/scsi_debug.ko] undefined!
> scripts/Makefile.modpost:91: recipe for target '__modpost' failed
> make[1]: *** [__modpost] Error 1
> Makefile:1178: recipe for target 'modules' failed
> make: *** [modules] Error 2
> 
> Masanari

Hi,

Do you have the kernel .config file that causes this?
I can no longer reproduce it.

What $arch did you build on?

Thanks.

> On Tue, Jun 7, 2016 at 12:10 PM, Randy Dunlap <rdun...@infradead.org> wrote:
>> On 06/05/16 21:20, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> Changes since 20160603:
>>
>> on x86_64:
>>
>> ERROR: "ip_compute_csum" [drivers/scsi/scsi_debug.ko] undefined!
>>
>> CONFIG_GENERIC_CSUM doesn't seem to exist for x86, so lib/checksum.o is not 
>> built.
>>
>>
>> --
>> ~Randy


-- 
~Randy
--
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: linux-next: Tree for Jun 6 (scsi_debug.c)

2016-06-06 Thread Randy Dunlap
On 06/05/16 21:20, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20160603:

on x86_64:

ERROR: "ip_compute_csum" [drivers/scsi/scsi_debug.ko] undefined!

CONFIG_GENERIC_CSUM doesn't seem to exist for x86, so lib/checksum.o is not 
built.


-- 
~Randy
--
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] scsi: ultrastor.c depends on ISA_DMA_API

2016-05-19 Thread Randy Dunlap
From: Randy Dunlap <rdun...@infradead.org>

Fix build when CONFIG_ISA_DMA_API is not enabled. Fixes these
build errors (on x86_64):

../drivers/scsi/ultrastor.c: In function 'ultrastor_14f_detect':
../drivers/scsi/ultrastor.c:519:5: error: implicit declaration of function 
'request_dma' [-Werror=implicit-function-declaration]
 if (config.dma_channel && request_dma(config.dma_channel,"Ultrastor")) {
 ^
../drivers/scsi/ultrastor.c: In function 'ultrastor_release':
../drivers/scsi/ultrastor.c:658:3: error: implicit declaration of function 
'free_dma' [-Werror=implicit-function-declaration]
   free_dma(shost->dma_channel);
   ^

Signed-off-by: Randy Dunlap <rdun...@infradead.org>
---
 drivers/scsi/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Found in linux-next but also applies to mainline.

--- linux-next-20160519.orig/drivers/scsi/Kconfig
+++ linux-next-20160519/drivers/scsi/Kconfig
@@ -1433,7 +1433,7 @@ config SCSI_U14_34F_MAX_TAGS
 
 config SCSI_ULTRASTOR
tristate "UltraStor SCSI support"
-   depends on X86 && ISA && SCSI
+   depends on X86 && ISA && SCSI && ISA_DMA_API
---help---
  This is support for the UltraStor 14F, 24F and 34F SCSI-2 host
  adapter family.  This driver is explained in section 3.12 of the
--
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] scsi: kconfig: When possible, compile drivers with COMPILE_TEST

2015-10-14 Thread Randy Dunlap
On 10/14/15 14:13, Luis de Bethencourt wrote:
> These drivers only have runtime but no build time dependencies, so they can
> be built for testing purposes if the Kconfig COMPILE_TEST option is enabled.
> 
> This is useful to have more build coverage and make sure that drivers are
> not affected by changes that could cause build regressions.
> 
> Signed-off-by: Luis de Bethencourt 
> ---
>  drivers/scsi/Kconfig | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index d2f480b..0d8ee16 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig

> @@ -1238,7 +1238,7 @@ config SCSI_NCR53C8XX_NO_DISCONNECT
>  
>  config SCSI_PAS16
>   tristate "PAS16 SCSI support"
> - depends on ISA && SCSI
> + depends on (ISA || COMPILE) && SCSI

COMPILE_TEST

>   select SCSI_SPI_ATTRS
>   ---help---
> This is support for a SCSI host adapter.  It is explained in section


-- 
~Randy
--
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] scsi: fix scsi_error.c kernel-doc warning

2014-12-29 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix kernel-doc warning in scsi_error.c:

Warning(..//drivers/scsi/scsi_error.c:887): No description found for parameter 
'hostt'

Fixes: 883a030f989a17b81167f3a181cf93d741fa98b4
(scsi: document scsi_try_to_abort_cmd)

Signed-off-by: Randy Dunlap rdun...@infradead.org
Cc: Hannes Reinecke h...@suse.de
---
 drivers/scsi/scsi_error.c |1 +
 1 file changed, 1 insertion(+)

--- lnx-319-rc2.orig/drivers/scsi/scsi_error.c
+++ lnx-319-rc2/drivers/scsi/scsi_error.c
@@ -868,6 +868,7 @@ static int scsi_try_bus_device_reset(str
 
 /**
  * scsi_try_to_abort_cmd - Ask host to abort a SCSI command
+ * @hostt: SCSI driver host template
  * @scmd:  SCSI cmd used to send a target reset
  *
  * Return value:
--
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] scsi_debug: improve driver description in Kconfig

2014-11-28 Thread Randy Dunlap
On 11/26/14 11:55, Douglas Gilbert wrote:
 From: Douglas Gilbert dgilb...@interlog.com
 Date: Wed, 26 Nov 2014 14:41:55 -0500
 Subject: [PATCH] scsi_debug improve driver description in Kconfig
 
 Try to give a more accurate driver description and some extra
 useful information in less lines.
 ---
  drivers/scsi/Kconfig | 17 -
  1 file changed, 8 insertions(+), 9 deletions(-)
 
 Signed-off-by: Douglas Gilbert dgilb...@interlog.com
 

creating a small ram disk device.

I would say: RAM

Otherwise looks good to me.

-- 
~Randy
--
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] scsi: fix kconfig dependency warnings for SCSI_FC_ATTRS

2014-09-19 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix kconfig dependency warnings which can lead to build errors:

warning: (SCSI_BNX2X_FCOE  LIBFCOE  TCM_QLA2XXX) selects LIBFC which has 
unmet direct dependencies (SCSI_LOWLEVEL  SCSI  SCSI_FC_ATTRS)

warning: (FCOE  FCOE_FNIC) selects LIBFCOE which has unmet direct 
dependencies (SCSI_LOWLEVEL  SCSI  SCSI_FC_ATTRS)

Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/scsi/Kconfig |3 +++
 drivers/scsi/qla2xxx/Kconfig |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

--- linux-next-20140918.orig/drivers/scsi/Kconfig
+++ linux-next-20140918/drivers/scsi/Kconfig
@@ -601,6 +601,7 @@ config LIBFC
 
 config LIBFCOE
tristate LibFCoE module
+   depends on SCSI_FC_ATTRS
select LIBFC
---help---
  Library for Fibre Channel over Ethernet module
@@ -608,6 +609,7 @@ config LIBFCOE
 config FCOE
tristate FCoE module
depends on PCI
+   depends on SCSI_FC_ATTRS
select LIBFCOE
---help---
  Fibre Channel over Ethernet module
@@ -615,6 +617,7 @@ config FCOE
 config FCOE_FNIC
tristate Cisco FNIC Driver
depends on PCI  X86
+   depends on SCSI_FC_ATTRS
select LIBFCOE
help
  This is support for the Cisco PCI-Express FCoE HBA.
--- linux-next-20140918.orig/drivers/scsi/qla2xxx/Kconfig
+++ linux-next-20140918/drivers/scsi/qla2xxx/Kconfig
@@ -30,7 +30,7 @@ config SCSI_QLA_FC
 
 config TCM_QLA2XXX
tristate TCM_QLA2XXX fabric module for Qlogic 2xxx series target mode 
HBAs
-   depends on SCSI_QLA_FC  TARGET_CORE
+   depends on SCSI_QLA_FC  TARGET_CORE  SCSI_FC_ATTRS
select LIBFC
select BTREE
default n
--
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 -net] scsi: fix users of SCSI_FC_ATTRS to depend on NET

2014-09-16 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

There are other kconfig symbols which select SCSI_FC_ATTRS,
so they also need to depend on NET to fix kconfig warnings and
build errors:

warning: (LIBFC  SCSI_IBMVFC  SCSI_QLA_FC  SCSI_LPFC  ZFCP  
SCSI_BFA_FC  SCSI_CHELSIO_FCOE  FUSION_FC) selects SCSI_FC_ATTRS which has 
unmet direct dependencies (SCSI  NET)
drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_event':
drivers/scsi/scsi_transport_fc.c:543:7: error: 'scsi_nl_sock' undeclared (first 
use in this function)
drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_vendor_event':
drivers/scsi/scsi_transport_fc.c:611:7: error: 'scsi_nl_sock' undeclared (first 
use in this function)

Reported-by: Fengguang Wu fengguang...@intel.com [0-day test robot]
Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/message/fusion/Kconfig |2 +-
 drivers/scsi/Kconfig   |9 +
 drivers/scsi/csiostor/Kconfig  |2 +-
 drivers/scsi/qla2xxx/Kconfig   |2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

--- lnx-317-rc5.orig/drivers/message/fusion/Kconfig
+++ lnx-317-rc5/drivers/message/fusion/Kconfig
@@ -28,7 +28,7 @@ config FUSION_SPI
 
 config FUSION_FC
tristate Fusion MPT ScsiHost drivers for FC
-   depends on PCI  SCSI
+   depends on PCI  SCSI  NET
select SCSI_FC_ATTRS
---help---
  SCSI HOST support for a Fiber Channel host adapters.
--- lnx-317-rc5.orig/drivers/scsi/Kconfig
+++ lnx-317-rc5/drivers/scsi/Kconfig
@@ -585,6 +585,7 @@ config HYPERV_STORAGE
 
 config LIBFC
tristate LibFC module
+   depends on NET
select SCSI_FC_ATTRS
select CRC32
---help---
@@ -815,7 +816,7 @@ config SCSI_IBMVSCSI
 
 config SCSI_IBMVFC
tristate IBM Virtual FC support
-   depends on PPC_PSERIES  SCSI
+   depends on PPC_PSERIES  SCSI  NET
select SCSI_FC_ATTRS
help
  This is the IBM POWER Virtual FC Client
@@ -1265,7 +1266,7 @@ source drivers/scsi/qla4xxx/Kconfig
 
 config SCSI_LPFC
tristate Emulex LightPulse Fibre Channel Support
-   depends on PCI  SCSI
+   depends on PCI  SCSI  NET
select SCSI_FC_ATTRS
select CRC_T10DIF
help
@@ -1675,7 +1676,7 @@ config SCSI_SUNESP
 
 config ZFCP
tristate FCP host bus adapter driver for IBM eServer zSeries
-   depends on S390  QDIO  SCSI
+   depends on S390  QDIO  SCSI  NET
select SCSI_FC_ATTRS
help
   If you want to access SCSI devices attached to your IBM eServer
@@ -1703,7 +1704,7 @@ config SCSI_PM8001
 
 config SCSI_BFA_FC
tristate Brocade BFA Fibre Channel Support
-   depends on PCI  SCSI
+   depends on PCI  SCSI  NET
select SCSI_FC_ATTRS
help
  This bfa driver supports all Brocade PCIe FC/FCOE host adapters.
--- lnx-317-rc5.orig/drivers/scsi/csiostor/Kconfig
+++ lnx-317-rc5/drivers/scsi/csiostor/Kconfig
@@ -1,6 +1,6 @@
 config SCSI_CHELSIO_FCOE
tristate Chelsio Communications FCoE support
-   depends on PCI  SCSI
+   depends on PCI  SCSI  NET
select SCSI_FC_ATTRS
select FW_LOADER
help
--- lnx-317-rc5.orig/drivers/scsi/qla2xxx/Kconfig
+++ lnx-317-rc5/drivers/scsi/qla2xxx/Kconfig
@@ -1,6 +1,6 @@
 config SCSI_QLA_FC
tristate QLogic QLA2XXX Fibre Channel Support
-   depends on PCI  SCSI
+   depends on PCI  SCSI  NET
select SCSI_FC_ATTRS
select FW_LOADER
---help---
--
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 -net] scsi: fix users of SCSI_FC_ATTRS to depend on NET

2014-09-16 Thread Randy Dunlap
On 09/16/14 13:15, David Miller wrote:
 From: Randy Dunlap rdun...@infradead.org
 Date: Mon, 15 Sep 2014 23:35:21 -0700
 
 From: Randy Dunlap rdun...@infradead.org

 There are other kconfig symbols which select SCSI_FC_ATTRS,
 so they also need to depend on NET to fix kconfig warnings and
 build errors:

 warning: (LIBFC  SCSI_IBMVFC  SCSI_QLA_FC  SCSI_LPFC  ZFCP  
 SCSI_BFA_FC  SCSI_CHELSIO_FCOE  FUSION_FC) selects SCSI_FC_ATTRS which 
 has unmet direct dependencies (SCSI  NET)
 drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_event':
 drivers/scsi/scsi_transport_fc.c:543:7: error: 'scsi_nl_sock' undeclared 
 (first use in this function)
 drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_vendor_event':
 drivers/scsi/scsi_transport_fc.c:611:7: error: 'scsi_nl_sock' undeclared 
 (first use in this function)

 Reported-by: Fengguang Wu fengguang...@intel.com [0-day test robot]
 Signed-off-by: Randy Dunlap rdun...@infradead.org
 
 Randy, this is starting to get convoluted.

Yes, I'm not happy about it either.

 It's pretty much pointless for SCSI_FC_ATTRS to depend on NET itself
 if we have to explicitly place a NET dependency on every single user
 of SCSI_FC_ATTRS.
 
 We have expressed a proper dependency for SCSI_FC_ATTRS only to have
 it forcefully bypassed by every single user because we 'select' it
 instead of using 'depends'.
 
 Can we just change these 'select' operations on SCSI_FC_ATTRS to just
 be 'depends' instead?
 
 I really wouldn't mind if select had the effect of force enabling the
 dependencies of the select'd Kconfig symbol.  Then it really does what
 we use it for (keeping the user from having to know obscure
 dependencies just to enable the feature they want) without the ugly
 side effect of dependency bypassing.
 
 So a select would do a recursive select on all the dependencies
 needed to turn on the select'd object.
 
 I doubt it would even need to recurse often at all, the ways we use
 this is almost always to turn on some top level major piece of
 infrastructure.
 
 Anyways, that's a longer term thing and we need to fix this now, any
 opinions on just using 'depend SCSI_FX_ATTRS' to fix this?

typo: depends on SCSI_FC_ATTRS

No, I certainly have no objection and prefer depends over select anyway.

-- 
~Randy
--
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 v2] scsi: use 'depends' instead of 'select' for SCSI_FC_ATTRS

2014-09-16 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

There are other kconfig symbols which use SCSI_FC_ATTRS.
In order to maintain sanity and prevent kconfig warnings, change
all of these from using 'select' to using 'depends on' so that
proper symbol dependencies will be honored and circular depends
problems will be avoided.
This fixes kconfig warnings and build errors:

warning: (LIBFC  SCSI_IBMVFC  SCSI_QLA_FC  SCSI_LPFC  ZFCP  
SCSI_BFA_FC  SCSI_CHELSIO_FCOE  FUSION_FC) selects SCSI_FC_ATTRS which has 
unmet direct dependencies (SCSI  NET)
drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_event':
drivers/scsi/scsi_transport_fc.c:543:7: error: 'scsi_nl_sock' undeclared (first 
use in this function)
drivers/scsi/scsi_transport_fc.c: In function 'fc_host_post_vendor_event':
drivers/scsi/scsi_transport_fc.c:611:7: error: 'scsi_nl_sock' undeclared (first 
use in this function)

Reported-by: Fengguang Wu fengguang...@intel.com [0-day test robot]
Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/message/fusion/Kconfig |2 +-
 drivers/scsi/Kconfig   |   10 +-
 drivers/scsi/csiostor/Kconfig  |2 +-
 drivers/scsi/qla2xxx/Kconfig   |2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

--- lnx-317-rc5.orig/drivers/message/fusion/Kconfig
+++ lnx-317-rc5/drivers/message/fusion/Kconfig
@@ -29,7 +29,7 @@ config FUSION_SPI
 config FUSION_FC
tristate Fusion MPT ScsiHost drivers for FC
depends on PCI  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
---help---
  SCSI HOST support for a Fiber Channel host adapters.
 
--- lnx-317-rc5.orig/drivers/scsi/Kconfig
+++ lnx-317-rc5/drivers/scsi/Kconfig
@@ -585,7 +585,7 @@ config HYPERV_STORAGE
 
 config LIBFC
tristate LibFC module
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
select CRC32
---help---
  Fibre Channel library module
@@ -816,7 +816,7 @@ config SCSI_IBMVSCSI
 config SCSI_IBMVFC
tristate IBM Virtual FC support
depends on PPC_PSERIES  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
help
  This is the IBM POWER Virtual FC Client
 
@@ -1266,7 +1266,7 @@ source drivers/scsi/qla4xxx/Kconfig
 config SCSI_LPFC
tristate Emulex LightPulse Fibre Channel Support
depends on PCI  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
select CRC_T10DIF
help
   This lpfc driver supports the Emulex LightPulse
@@ -1676,7 +1676,7 @@ config SCSI_SUNESP
 config ZFCP
tristate FCP host bus adapter driver for IBM eServer zSeries
depends on S390  QDIO  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
help
   If you want to access SCSI devices attached to your IBM eServer
   zSeries by means of Fibre Channel interfaces say Y.
@@ -1704,7 +1704,7 @@ config SCSI_PM8001
 config SCSI_BFA_FC
tristate Brocade BFA Fibre Channel Support
depends on PCI  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
help
  This bfa driver supports all Brocade PCIe FC/FCOE host adapters.
 
--- lnx-317-rc5.orig/drivers/scsi/csiostor/Kconfig
+++ lnx-317-rc5/drivers/scsi/csiostor/Kconfig
@@ -1,7 +1,7 @@
 config SCSI_CHELSIO_FCOE
tristate Chelsio Communications FCoE support
depends on PCI  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
select FW_LOADER
help
  This driver supports FCoE Offload functionality over
--- lnx-317-rc5.orig/drivers/scsi/qla2xxx/Kconfig
+++ lnx-317-rc5/drivers/scsi/qla2xxx/Kconfig
@@ -1,7 +1,7 @@
 config SCSI_QLA_FC
tristate QLogic QLA2XXX Fibre Channel Support
depends on PCI  SCSI
-   select SCSI_FC_ATTRS
+   depends on SCSI_FC_ATTRS
select FW_LOADER
---help---
This qla2xxx driver supports all QLogic Fibre Channel
--
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] scsi: fix build errors, SCSI_FC_ATTRS needs to depend on SCSI NET

2014-09-15 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix build errors when CONFIG_SCSI_NETLINK is enabled but
CONFIG_NET is not enabled:

drivers/built-in.o: In function `scsi_nl_rcv_msg':
scsi_netlink.c:(.text+0x1850fa): undefined reference to `netlink_ack'
scsi_netlink.c:(.text+0x185105): undefined reference to `skb_pull'
scsi_netlink.c:(.text+0x18515d): undefined reference to `netlink_capable'
drivers/built-in.o: In function `scsi_netlink_init':
(.text+0x185244): undefined reference to `init_net'
drivers/built-in.o: In function `scsi_netlink_init':
(.text+0x185258): undefined reference to `__netlink_kernel_create'
drivers/built-in.o: In function `scsi_netlink_exit':
(.text+0x185291): undefined reference to `netlink_kernel_release'

Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/scsi/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Based on Anish's previous SCSI_NETLINK patch.
Sorry about missing this one.

--- lnx-317-rc5.orig/drivers/scsi/Kconfig
+++ lnx-317-rc5/drivers/scsi/Kconfig
@@ -257,7 +257,7 @@ config SCSI_SPI_ATTRS
 
 config SCSI_FC_ATTRS
tristate FiberChannel Transport Attributes
-   depends on SCSI
+   depends on SCSI  NET
select SCSI_NETLINK
help
  If you wish to export transport-specific information about
--
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 3] scsi: fix build errors, SCSI_FC_ATTRS needs to depend on SCSI NET

2014-09-15 Thread Randy Dunlap
On 09/15/14 20:00, Anish Bhatt wrote:
 
 Doesn't fix make warnings, but SCSI_FC_ATTRS can no longer be selected without
 NET. Though both ia64 and powerpc emit a lot of unmet dependency warnings as 
 is 
 on defconfig


You mean these kconfig warnings?

quote

After merging the net tree, today's linux-next build
(powerpc ppc64_defconfig) failed like this:

warning: (PPC_CELL_NATIVE  BLUESTONE  CANYONLANDS  GLACIER  EIGER  
440EPX  440GRX  440GX  460SX  405EX) selects IBM_EMAC_RGMII which has 
unmet direct dependencies (NETDEVICES  ETHERNET  NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  CANYONLANDS  GLACIER  440EP  440EPX  
440GRX  440GP  440GX  460SX  405GP) selects IBM_EMAC_ZMII which has 
unmet direct dependencies (NETDEVICES  ETHERNET  NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  440GX  460EX  460SX  APM821xx) selects 
IBM_EMAC_TAH which has unmet direct dependencies (NETDEVICES  ETHERNET  
NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  AKEBONO  440EPX  440GRX  440GX  440SPe  
460EX  460SX  APM821xx  405EX) selects IBM_EMAC_EMAC4 which has unmet 
direct dependencies (NETDEVICES  ETHERNET  NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  CANYONLANDS  GLACIER  440EP  440EPX  
440GRX  440GP  440GX  460SX  405GP) selects IBM_EMAC_ZMII which has 
unmet direct dependencies (NETDEVICES  ETHERNET  NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  BLUESTONE  CANYONLANDS  GLACIER  EIGER  
440EPX  440GRX  440GX  460SX  405EX) selects IBM_EMAC_RGMII which has 
unmet direct dependencies (NETDEVICES  ETHERNET  NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  440GX  460EX  460SX  APM821xx) selects 
IBM_EMAC_TAH which has unmet direct dependencies (NETDEVICES  ETHERNET  
NET_VENDOR_IBM)
warning: (PPC_CELL_NATIVE  AKEBONO  440EPX  440GRX  440GX  440SPe  
460EX  460SX  APM821xx  405EX) selects IBM_EMAC_EMAC4 which has unmet 
direct dependencies (NETDEVICES  ETHERNET  NET_VENDOR_IBM)

/quote

I'll look into those.
-- 
~Randy
--
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] fusion: fix excess parameter kernel-doc warning

2014-08-28 Thread Randy Dunlap
On 08/27/14 17:55, Christoph Hellwig wrote:
 On Wed, Aug 27, 2014 at 04:47:24PM -0700, Randy Dunlap wrote:
 Goes with commit c9834c70efbaaa1461ec04289d97a842244fb294.

 Reviewed-by: Ewan D. Milne emi...@redhat.com

 Christoph, did you pick up this patch or should I merge it
 with my documentation patches?
 
 I did as mentioned in my reply to your other patch.

Thanks.  Sorry I missed that...

-- 
~Randy
--
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] fusion: fix excess parameter kernel-doc warning

2014-08-27 Thread Randy Dunlap
On 08/18/14 10:07, Ewan Milne wrote:
 On Sat, 2014-08-16 at 14:15 -0700, Randy Dunlap wrote:
 From: Randy Dunlap rdun...@infradead.org

 Fix kernel-doc excess parameter warning:

 Warning(..//drivers/message/fusion/mptbase.c:1411): Excess function 
 parameter 'prod_name' description in 'mpt_get_product_name'

 Signed-off-by: Randy Dunlap rdun...@infradead.org
 Cc: dl-mptfusionli...@lsi.com
 Cc: mpt-fusionlinux@avagotech.com
 ---
  drivers/message/fusion/mptbase.c |1 -
  1 file changed, 1 deletion(-)

 Index: lnx-317-rc1/drivers/message/fusion/mptbase.c
 ===
 --- lnx-317-rc1.orig/drivers/message/fusion/mptbase.c
 +++ lnx-317-rc1/drivers/message/fusion/mptbase.c
 @@ -1400,7 +1400,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTE
   *  @vendor: pci vendor id
   *  @device: pci device id
   *  @revision: pci revision id
 - *  @prod_name: string returned
   *
   *  Returns product string displayed when driver loads,
   *  in /proc/mpt/summary and /sysfs/class/scsi_host/hostX/version_product
 --
 
 Goes with commit c9834c70efbaaa1461ec04289d97a842244fb294.
 
 Reviewed-by: Ewan D. Milne emi...@redhat.com

Christoph, did you pick up this patch or should I merge it
with my documentation patches?

Thanks.

-- 
~Randy
--
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] scsi: fix various kernel-doc problems in scsi_error.c

2014-08-16 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Convert spaces to tabs in kernel-doc notation.
Correct duplicated (copy-paste) kernel-doc comments that are incorrect.
Fix kernel-doc warning:

Warning(..//drivers/scsi/scsi_error.c:1647): No description found for parameter 
'shost'

Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/scsi/scsi_error.c |   23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

Index: lnx-317-rc1/drivers/scsi/scsi_error.c
===
--- lnx-317-rc1.orig/drivers/scsi/scsi_error.c
+++ lnx-317-rc1/drivers/scsi/scsi_error.c
@@ -1238,8 +1238,8 @@ retry_tur:
 /**
  * scsi_eh_test_devices - check if devices are responding from error recovery.
  * @cmd_list:  scsi commands in error recovery.
- * @work_q: queue for commands which still need more error recovery
- * @done_q: queue for commands which are finished
+ * @work_q:queue for commands which still need more error recovery
+ * @done_q:queue for commands which are finished
  * @try_stu:boolean on if a STU command should be tried in addition to TUR.
  *
  * Decription:
@@ -1373,7 +1373,7 @@ static int scsi_eh_try_stu(struct scsi_c
  /**
  * scsi_eh_stu - send START_UNIT if needed
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  *
  * Notes:
@@ -1436,7 +1436,7 @@ static int scsi_eh_stu(struct Scsi_Host
 /**
  * scsi_eh_bus_device_reset - send bdr if needed
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  *
  * Notes:
@@ -1502,7 +1502,7 @@ static int scsi_eh_bus_device_reset(stru
 /**
  * scsi_eh_target_reset - send target reset if needed
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  *
  * Notes:
@@ -1567,7 +1567,7 @@ static int scsi_eh_target_reset(struct S
 /**
  * scsi_eh_bus_reset - send a bus reset
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  */
 static int scsi_eh_bus_reset(struct Scsi_Host *shost,
@@ -1638,8 +1638,9 @@ static int scsi_eh_bus_reset(struct Scsi
 
 /**
  * scsi_eh_host_reset - send a host reset
- * @work_q:list_head for processed commands.
- * @done_q:list_head for processed commands.
+ * @shost: host to be reset.
+ * @work_q:list_head for pending commands.
+ * @done_q:list_head for processed commands.
  */
 static int scsi_eh_host_reset(struct Scsi_Host *shost,
  struct list_head *work_q,
@@ -1677,8 +1678,8 @@ static int scsi_eh_host_reset(struct Scs
 
 /**
  * scsi_eh_offline_sdevs - offline scsi devices that fail to recover
- * @work_q:list_head for processed commands.
- * @done_q:list_head for processed commands.
+ * @work_q:list_head for pending commands.
+ * @done_q:list_head for processed commands.
  */
 static void scsi_eh_offline_sdevs(struct list_head *work_q,
  struct list_head *done_q)
@@ -2044,7 +2045,7 @@ static void scsi_restart_operations(stru
 /**
  * scsi_eh_ready_devs - check device ready state and recover if not.
  * @shost: host to be recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  */
 void scsi_eh_ready_devs(struct Scsi_Host *shost,
--
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] fusion: fix excess parameter kernel-doc warning

2014-08-16 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix kernel-doc excess parameter warning:

Warning(..//drivers/message/fusion/mptbase.c:1411): Excess function parameter 
'prod_name' description in 'mpt_get_product_name'

Signed-off-by: Randy Dunlap rdun...@infradead.org
Cc: dl-mptfusionli...@lsi.com
Cc: mpt-fusionlinux@avagotech.com
---
 drivers/message/fusion/mptbase.c |1 -
 1 file changed, 1 deletion(-)

Index: lnx-317-rc1/drivers/message/fusion/mptbase.c
===
--- lnx-317-rc1.orig/drivers/message/fusion/mptbase.c
+++ lnx-317-rc1/drivers/message/fusion/mptbase.c
@@ -1400,7 +1400,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTE
  * @vendor: pci vendor id
  * @device: pci device id
  * @revision: pci revision id
- * @prod_name: string returned
  *
  * Returns product string displayed when driver loads,
  * in /proc/mpt/summary and /sysfs/class/scsi_host/hostX/version_product
--
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 -next] scsi: fix u14-34f printk format warnings

2014-07-31 Thread Randy Dunlap
any comments?

Thanks.

On 07/24/14 11:07, Randy Dunlap wrote:
 From: Randy Dunlap rdun...@infradead.org
 
 Fix printk format warnings (seen on i386 builds):
 
 ../drivers/scsi/u14-34f.c: In function 'port_detect':
 ../drivers/scsi/u14-34f.c:630:28: warning: format '%u' expects argument of 
 type 'unsigned int', but argument 4 has type 'u64' [-Wformat=]
 ../drivers/scsi/u14-34f.c: In function 'u14_34f_queuecommand_lck':
 ../drivers/scsi/u14-34f.c:1290:25: warning: format '%llu' expects argument of 
 type 'long long unsigned int', but argument 6 has type 'int' [-Wformat=]
 
 Signed-off-by: Randy Dunlap rdun...@infradead.org
 Cc: James E.J. Bottomley jbottom...@parallels.com
 Cc: Christoph Hellwig h...@infradead.org
 ---
  drivers/scsi/u14-34f.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 Index: linux-next-20140724/drivers/scsi/u14-34f.c
 ===
 --- linux-next-20140724.orig/drivers/scsi/u14-34f.c
 +++ linux-next-20140724/drivers/scsi/u14-34f.c
 @@ -1006,7 +1006,7 @@ static int port_detect \
sh[j]-irq, dma_name, sh[j]-sg_tablesize, sh[j]-can_queue);
  
 if (sh[j]-max_id  8 || sh[j]-max_lun  8)
 -  printk(%s: wide SCSI support enabled, max_id %u, max_lun %u.\n,
 +  printk(%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n,
   BN(j), sh[j]-max_id, sh[j]-max_lun);
  
 for (i = 0; i = sh[j]-max_channel; i++)
 @@ -1285,7 +1285,7 @@ static int u14_34f_queuecommand_lck(stru
 cpp-cpp_index = i;
 SCpnt-host_scribble = (unsigned char *) cpp-cpp_index;
  
 -   if (do_trace) printk(%s: qcomm, mbox %d, target %d.%d:%llu.\n,
 +   if (do_trace) printk(%s: qcomm, mbox %d, target %d.%d:%u.\n,
  BN(j), i, SCpnt-device-channel, SCpnt-device-id,
  (u8)SCpnt-device-lun);
  
 --


-- 
~Randy
--
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 -next] scsi: fix u14-34f printk format warnings

2014-07-24 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix printk format warnings (seen on i386 builds):

../drivers/scsi/u14-34f.c: In function 'port_detect':
../drivers/scsi/u14-34f.c:630:28: warning: format '%u' expects argument of type 
'unsigned int', but argument 4 has type 'u64' [-Wformat=]
../drivers/scsi/u14-34f.c: In function 'u14_34f_queuecommand_lck':
../drivers/scsi/u14-34f.c:1290:25: warning: format '%llu' expects argument of 
type 'long long unsigned int', but argument 6 has type 'int' [-Wformat=]

Signed-off-by: Randy Dunlap rdun...@infradead.org
Cc: James E.J. Bottomley jbottom...@parallels.com
Cc: Christoph Hellwig h...@infradead.org
---
 drivers/scsi/u14-34f.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-next-20140724/drivers/scsi/u14-34f.c
===
--- linux-next-20140724.orig/drivers/scsi/u14-34f.c
+++ linux-next-20140724/drivers/scsi/u14-34f.c
@@ -1006,7 +1006,7 @@ static int port_detect \
   sh[j]-irq, dma_name, sh[j]-sg_tablesize, sh[j]-can_queue);
 
if (sh[j]-max_id  8 || sh[j]-max_lun  8)
-  printk(%s: wide SCSI support enabled, max_id %u, max_lun %u.\n,
+  printk(%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n,
  BN(j), sh[j]-max_id, sh[j]-max_lun);
 
for (i = 0; i = sh[j]-max_channel; i++)
@@ -1285,7 +1285,7 @@ static int u14_34f_queuecommand_lck(stru
cpp-cpp_index = i;
SCpnt-host_scribble = (unsigned char *) cpp-cpp_index;
 
-   if (do_trace) printk(%s: qcomm, mbox %d, target %d.%d:%llu.\n,
+   if (do_trace) printk(%s: qcomm, mbox %d, target %d.%d:%u.\n,
 BN(j), i, SCpnt-device-channel, SCpnt-device-id,
 (u8)SCpnt-device-lun);
 
--
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 -next] libata.h: add stub for ata_sas_port_resume

2014-03-19 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix build error when CONFIG_PM is not enabled by adding a stub
function in linux/libata.h.

drivers/scsi/libsas/sas_ata.c: In function 'sas_resume_sata':
drivers/scsi/libsas/sas_ata.c:756:3: error: implicit declaration of function 
'ata_sas_port_resume' [-Werror=implicit-function-declaration]

Signed-off-by: Randy Dunlap rdun...@infradead.org
Reported-by: Jim Davis jim.ep...@gmail.com
---
 include/linux/libata.h |3 +++
 1 file changed, 3 insertions(+)

--- linux-next-20140319.orig/include/linux/libata.h
+++ linux-next-20140319/include/linux/libata.h
@@ -1148,6 +1148,9 @@ static inline void ata_sas_port_suspend(
 static inline void ata_sas_port_async_resume(struct ata_port *ap)
 {
 }
+static inline void ata_sas_port_resume(struct ata_port *ap)
+{
+}
 #endif
 extern int ata_ratelimit(void);
 extern void ata_msleep(struct ata_port *ap, unsigned int msecs);
--
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: mmotm 2014-03-12-16-04 uploaded (scsi/qla2xxx)

2014-03-13 Thread Randy Dunlap
On 03/12/2014 04:05 PM, a...@linux-foundation.org wrote:
 The mm-of-the-moment snapshot 2014-03-12-16-04 has been uploaded to
 
http://www.ozlabs.org/~akpm/mmotm/
 
 mmotm-readme.txt says
 
 README for mm-of-the-moment:
 
 http://www.ozlabs.org/~akpm/mmotm/
 
 This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
 more than once a week.
 
 You will need quilt to apply these patches to the latest Linus release (3.x
 or 3.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
 http://ozlabs.org/~akpm/mmotm/series
 
 The file broken-out.tar.gz contains two datestamp files: .DATE and
 .DATE--mm-dd-hh-mm-ss.  Both contain the string -mm-dd-hh-mm-ss,
 followed by the base kernel version against which this patch series is to
 be applied.
 

from linux-next:

on i386:

drivers/scsi/qla2xxx/qla_init.c:5295:7: warning: format '%lx' expects argument 
of type 'long unsigned int', but argument 5 has type 'uint32_t' [-Wformat]
drivers/scsi/qla2xxx/qla_init.c:5562:6: warning: format '%lx' expects argument 
of type 'long unsigned int', but argument 5 has type 'int' [-Wformat]
drivers/scsi/qla2xxx/qla_init.c:5597:7: warning: format '%lx' expects argument 
of type 'long unsigned int', but argument 5 has type 'uint32_t' [-Wformat]
drivers/scsi/qla2xxx/qla_attr.c:162:6: warning: format '%lx' expects argument 
of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat]
drivers/scsi/qla2xxx/qla_attr.c:203:7: warning: format '%lx' expects argument 
of type 'long unsigned int', but argument 5 has type 'size_t' [-Wformat]
drivers/scsi/qla2xxx/qla_attr.c:207:6: warning: format '%lx' expects argument 
of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat]



-- 
~Randy
--
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] scsi_transport_srp: Fix kernel-doc warnings

2014-01-06 Thread Randy Dunlap
On 01/05/14 22:39, Bart Van Assche wrote:
 On 01/05/14 21:39, Randy Dunlap wrote:
 On 01/05/14 01:13, Bart Van Assche wrote:
 The following command has been used to verify that the kernel-doc
 tool no longer complains about undocumented fields:

 scripts/kernel-doc -html drivers/scsi/scsi_transport_srp.c \
   include/scsi/scsi_transport_srp.h srp-transport-doc.html

 Thanks for the patch.
 I guess that your tree is different from mine.  Using 3.13-rc7, I still get
 3 warnings:

 Warning(drivers/scsi/scsi_transport_srp.c:620): No description found for 
 parameter 'scmd'
 Warning(drivers/scsi/scsi_transport_srp.c:688): No description found for 
 parameter 'rport'
 Warning(drivers/scsi/scsi_transport_srp.c:697): No description found for 
 parameter 'rport'

 I also had some trouble with the patch itself -- looks like some of its 
 longer
 lines were broken (split) by your mail app (I'm guessing).
 The first split line is marked below.
 
 Sorry but it seems like my e-mail client line-wrapped the patch. Does
 the attached patch work better ? The attached patch should be identical
 to what I posted except for the line wrapping. I do not see the warnings
 mentioned above - maybe these were introduced by the line wrapping ?

Yes, that patch works for me.  Thanks.

Acked-by: Randy Dunlap rdun...@infradead.org



-- 
~Randy
--
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] scsi_transport_srp: Fix kernel-doc warnings

2014-01-05 Thread Randy Dunlap
On 01/05/14 01:13, Bart Van Assche wrote:
 The following command has been used to verify that the kernel-doc
 tool no longer complains about undocumented fields:
 
 scripts/kernel-doc -html drivers/scsi/scsi_transport_srp.c \
   include/scsi/scsi_transport_srp.h srp-transport-doc.html

Thanks for the patch.
I guess that your tree is different from mine.  Using 3.13-rc7, I still get
3 warnings:

Warning(drivers/scsi/scsi_transport_srp.c:620): No description found for 
parameter 'scmd'
Warning(drivers/scsi/scsi_transport_srp.c:688): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:697): No description found for 
parameter 'rport'


I also had some trouble with the patch itself -- looks like some of its longer
lines were broken (split) by your mail app (I'm guessing).
The first split line is marked below.


 Signed-off-by: Bart Van Assche bvanass...@acm.org
 Cc: David Dillow dillo...@ornl.gov
 Cc: Vu Pham v...@mellanox.com
 Cc: Sebastian Riemer sebastian.rie...@profitbricks.com
 Cc: James Bottomley jbottom...@parallels.com
 Cc: Randy Dunlap rdun...@infradead.org
 ---
  drivers/scsi/scsi_transport_srp.c | 12 
  include/scsi/scsi_transport_srp.h | 32 
  2 files changed, 40 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/scsi/scsi_transport_srp.c
 b/drivers/scsi/scsi_transport_srp.c
 index 2700a5a..96ffc46 100644
 --- a/drivers/scsi/scsi_transport_srp.c
 +++ b/drivers/scsi/scsi_transport_srp.c
 @@ -64,6 +64,9 @@ static inline struct Scsi_Host *rport_to_shost(struct
 srp_rport *r)
  
  /**
   * srp_tmo_valid() - check timeout combination validity
 + * @reconnect_delay: Reconnect delay in seconds.
 + * @fast_io_fail_tmo: Fast I/O fail timeout in seconds.
 + * @dev_loss_tmo: Device loss timeout in seconds.
   *
   * The combination of the timeout parameters must be such that SCSI
 commands

^^^ commands should be at the end of the line above.
I corrected about 8 (or more) lines like this so that the patch would apply 
cleanly.

http://marc.info/?l=linux-scsim=138891322826100w=2 shows the same problem.

   * are finished in a reasonable time. Hence do not allow the fast I/O fail
 @@ -368,6 +371,7 @@ invalid:
  
  /**
   * srp_reconnect_work() - reconnect and schedule a new attempt if necessary
 + * @work: Work structure used for scheduling this operation.
   */
  static void srp_reconnect_work(struct work_struct *work)
  {
 @@ -408,6 +412,7 @@ static void __rport_fail_io_fast(struct srp_rport
 *rport)
  
  /**
   * rport_fast_io_fail_timedout() - fast I/O failure timeout handler
 + * @work: Work structure used for scheduling this operation.
   */
  static void rport_fast_io_fail_timedout(struct work_struct *work)
  {
 @@ -426,6 +431,7 @@ static void rport_fast_io_fail_timedout(struct
 work_struct *work)
  
  /**
   * rport_dev_loss_timedout() - device loss timeout handler
 + * @work: Work structure used for scheduling this operation.
   */
  static void rport_dev_loss_timedout(struct work_struct *work)
  {
 @@ -488,6 +494,7 @@ static void __srp_start_tl_fail_timers(struct
 srp_rport *rport)
  
  /**
   * srp_start_tl_fail_timers() - start the transport layer failure timers
 + * @rport: SRP target port.
   *
   * Start the transport layer fast I/O failure and device loss timers.
 Do not
   * modify a timer that was already started.
 @@ -502,6 +509,7 @@ EXPORT_SYMBOL(srp_start_tl_fail_timers);
  
  /**
   * scsi_request_fn_active() - number of kernel threads inside
 scsi_request_fn()
 + * @shost: SCSI host for which to count the number of scsi_request_fn()
 callers.
   */
  static int scsi_request_fn_active(struct Scsi_Host *shost)
  {
 @@ -522,6 +530,7 @@ static int scsi_request_fn_active(struct Scsi_Host
 *shost)
  
  /**
   * srp_reconnect_rport() - reconnect to an SRP target port
 + * @rport: SRP target port.
   *
   * Blocks SCSI command queueing before invoking reconnect() such that
   * queuecommand() won't be invoked concurrently with reconnect() from
 outside
 @@ -599,6 +608,7 @@ EXPORT_SYMBOL(srp_reconnect_rport);
  
  /**
   * srp_timed_out() - SRP transport intercept of the SCSI timeout EH
 + * @scmd: SCSI command.
   *
   * If a timeout occurs while an rport is in the blocked state, ask the SCSI
   * EH to continue waiting (BLK_EH_RESET_TIMER). Otherwise let the SCSI core
 @@ -674,6 +684,7 @@ static int srp_host_match(struct attribute_container
 *cont, struct device *dev)
  
  /**
   * srp_rport_get() - increment rport reference count
 + * @rport: SRP target port.
   */
  void srp_rport_get(struct srp_rport *rport)
  {
 @@ -683,6 +694,7 @@ EXPORT_SYMBOL(srp_rport_get);
  
  /**
   * srp_rport_put() - decrement rport reference count
 + * @rport: SRP target port.
   */
  void srp_rport_put(struct srp_rport *rport)
  {
 diff --git a/include/scsi/scsi_transport_srp.h
 b/include/scsi/scsi_transport_srp.h
 index 4ebf691..69eb021 100644
 --- a/include/scsi/scsi_transport_srp.h
 +++ b/include/scsi

[PATCH] scsi: eliminate scsi_transport_srp.c kernel-doc warnings

2014-01-04 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

drivers/scsi/scsi_transport_srp.c has incomplete kernel-doc notation
for some of the functions. This causes several kernel-doc warnings.

Fix these kernel-doc warnings by changing the beginning /** kernel-doc
marker to a plain /* comment.

Warning(drivers/scsi/scsi_transport_srp.c:75): No description found for 
parameter 'reconnect_delay'
Warning(drivers/scsi/scsi_transport_srp.c:75): No description found for 
parameter 'fast_io_fail_tmo'
Warning(drivers/scsi/scsi_transport_srp.c:75): No description found for 
parameter 'dev_loss_tmo'
Warning(drivers/scsi/scsi_transport_srp.c:373): No description found for 
parameter 'work'
Warning(drivers/scsi/scsi_transport_srp.c:413): No description found for 
parameter 'work'
Warning(drivers/scsi/scsi_transport_srp.c:431): No description found for 
parameter 'work'
Warning(drivers/scsi/scsi_transport_srp.c:496): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:507): No description found for 
parameter 'shost'
Warning(drivers/scsi/scsi_transport_srp.c:545): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:611): No description found for 
parameter 'scmd'
Warning(drivers/scsi/scsi_transport_srp.c:679): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:688): No description found for 
parameter 'rport'

Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/scsi/scsi_transport_srp.c |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

--- lnx-313-rc7.orig/drivers/scsi/scsi_transport_srp.c
+++ lnx-313-rc7/drivers/scsi/scsi_transport_srp.c
@@ -62,7 +62,7 @@ static inline struct Scsi_Host *rport_to
return dev_to_shost(r-dev.parent);
 }
 
-/**
+/*
  * srp_tmo_valid() - check timeout combination validity
  *
  * The combination of the timeout parameters must be such that SCSI commands
@@ -366,7 +366,7 @@ invalid:
return -EINVAL;
 }
 
-/**
+/*
  * srp_reconnect_work() - reconnect and schedule a new attempt if necessary
  */
 static void srp_reconnect_work(struct work_struct *work)
@@ -406,7 +406,7 @@ static void __rport_fail_io_fast(struct
i-f-terminate_rport_io(rport);
 }
 
-/**
+/*
  * rport_fast_io_fail_timedout() - fast I/O failure timeout handler
  */
 static void rport_fast_io_fail_timedout(struct work_struct *work)
@@ -424,7 +424,7 @@ static void rport_fast_io_fail_timedout(
mutex_unlock(rport-mutex);
 }
 
-/**
+/*
  * rport_dev_loss_timedout() - device loss timeout handler
  */
 static void rport_dev_loss_timedout(struct work_struct *work)
@@ -486,7 +486,7 @@ static void __srp_start_tl_fail_timers(s
}
 }
 
-/**
+/*
  * srp_start_tl_fail_timers() - start the transport layer failure timers
  *
  * Start the transport layer fast I/O failure and device loss timers. Do not
@@ -500,7 +500,7 @@ void srp_start_tl_fail_timers(struct srp
 }
 EXPORT_SYMBOL(srp_start_tl_fail_timers);
 
-/**
+/*
  * scsi_request_fn_active() - number of kernel threads inside scsi_request_fn()
  */
 static int scsi_request_fn_active(struct Scsi_Host *shost)
@@ -520,7 +520,7 @@ static int scsi_request_fn_active(struct
return request_fn_active;
 }
 
-/**
+/*
  * srp_reconnect_rport() - reconnect to an SRP target port
  *
  * Blocks SCSI command queueing before invoking reconnect() such that
@@ -597,7 +597,7 @@ out:
 }
 EXPORT_SYMBOL(srp_reconnect_rport);
 
-/**
+/*
  * srp_timed_out() - SRP transport intercept of the SCSI timeout EH
  *
  * If a timeout occurs while an rport is in the blocked state, ask the SCSI
@@ -672,7 +672,7 @@ static int srp_host_match(struct attribu
return i-t.host_attrs.ac == cont;
 }
 
-/**
+/*
  * srp_rport_get() - increment rport reference count
  */
 void srp_rport_get(struct srp_rport *rport)
@@ -681,7 +681,7 @@ void srp_rport_get(struct srp_rport *rpo
 }
 EXPORT_SYMBOL(srp_rport_get);
 
-/**
+/*
  * srp_rport_put() - decrement rport reference count
  */
 void srp_rport_put(struct srp_rport *rport)
--
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


scsi_transport_srp.c kernel-doc warnings

2013-12-29 Thread Randy Dunlap
Hi Bart,

Please complete the kernel-doc notation in scsi_transport_srp.c to eliminate
the following kernel-doc warnings or make them not use kernel-doc notation
at all. [This list is from v3.13-rc6.]


Warning(drivers/scsi/scsi_transport_srp.c:75): No description found for 
parameter 'reconnect_delay'
Warning(drivers/scsi/scsi_transport_srp.c:75): No description found for 
parameter 'fast_io_fail_tmo'
Warning(drivers/scsi/scsi_transport_srp.c:75): No description found for 
parameter 'dev_loss_tmo'
Warning(drivers/scsi/scsi_transport_srp.c:373): No description found for 
parameter 'work'
Warning(drivers/scsi/scsi_transport_srp.c:413): No description found for 
parameter 'work'
Warning(drivers/scsi/scsi_transport_srp.c:431): No description found for 
parameter 'work'
Warning(drivers/scsi/scsi_transport_srp.c:496): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:507): No description found for 
parameter 'shost'
Warning(drivers/scsi/scsi_transport_srp.c:545): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:611): No description found for 
parameter 'scmd'
Warning(drivers/scsi/scsi_transport_srp.c:679): No description found for 
parameter 'rport'
Warning(drivers/scsi/scsi_transport_srp.c:688): No description found for 
parameter 'rport'


thanks,
-- 
~Randy
--
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: Why does lpfc select GENERIC_CSUM?

2013-08-07 Thread Randy Dunlap
On 08/05/13 03:20, Anton Blanchard wrote:
 
 Hi Randy,
 
 commit 6a7252fd ([SCSI] lpfc: fix up Kconfig dependencies) added a
 select of GENERIC_CSUM. This seems strange to me - it's an architecture
 specific detail if the checksum routines are implemented in assembly or
 if they pull in lib/checksum.c.
 
 The networking code doesn't select GENERIC_CSUM, so I'm not sure why
 the lpfc driver needs to. Was there a real issue we hit here?
 
 Regards,
 Anton
 

Hi Anton,

I reported:

on i386:
# CONFIG_CRC_T10DIF is not set


drivers/built-in.o: In function `lpfc_bg_crc':
(.text+0x3cb3c9): undefined reference to `crc_t10dif'


and then James Bottomley provided the patch.
I don't know why he added GENERIC_CSUM to it.

-- 
~Randy
--
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: linux-next: Tree for May 6 (lpfc)

2013-05-06 Thread Randy Dunlap
On 05/05/13 21:42, Stephen Rothwell wrote:
 Hi all,
 
 Please do not add any v3.11 destined work to your linux-next included
 branches until after v3.10-rc1 is released.
 
 I am receiving a (un)reasonable number of conflicts from there being
 multiple copies of some commits in various trees.   Please clean this up
 and resist the temptataion to rebase your trees on the way to your
 upstream ...
 
 Changes since 20130506:
 

on i386:
# CONFIG_CRC_T10DIF is not set


drivers/built-in.o: In function `lpfc_bg_crc':
(.text+0x3cb3c9): undefined reference to `crc_t10dif'




-- 
~Randy
--
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: linux-next: Tree for May 6 (lpfc)

2013-05-06 Thread Randy Dunlap
On 05/06/13 09:49, James Bottomley wrote:
 On Mon, 2013-05-06 at 09:14 -0700, Randy Dunlap wrote:
 On 05/05/13 21:42, Stephen Rothwell wrote:
 Hi all,

 Please do not add any v3.11 destined work to your linux-next included
 branches until after v3.10-rc1 is released.

 I am receiving a (un)reasonable number of conflicts from there being
 multiple copies of some commits in various trees.   Please clean this up
 and resist the temptataion to rebase your trees on the way to your
 upstream ...

 Changes since 20130506:


 on i386:
 # CONFIG_CRC_T10DIF is not set


 drivers/built-in.o: In function `lpfc_bg_crc':
 (.text+0x3cb3c9): undefined reference to `crc_t10dif'
 
 That's the usual minor config cockup, isn't it?  lpfc apparently also
 needs the generic checksum, so the fix would seem to be this.
 
 James
 

Thanks, that works.

for your S-O-B patch:
Acked-by: Randy Dunlap rdun...@infradead.org


 ---
 diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
 index db95c54..86af29f 100644
 --- a/drivers/scsi/Kconfig
 +++ b/drivers/scsi/Kconfig
 @@ -1353,6 +1353,8 @@ config SCSI_LPFC
   tristate Emulex LightPulse Fibre Channel Support
   depends on PCI  SCSI
   select SCSI_FC_ATTRS
 + select GENERIC_CSUM
 + select CRC_T10DIF
   help
This lpfc driver supports the Emulex LightPulse
Family of Fibre Channel PCI host adapters.
 
 
 --


-- 
~Randy
--
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] scsi: fix lpfc build when wmb() is defined as mb()

2013-02-22 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

On architectures where wmb() is defined as mb(), a build error
happens since there is also a variable named 'mb' in lpfc_sli.c's
lpfc_sli_issue_mbox_s3() function.  Rename the variable to 'mbx'
to prevent the build error.

drivers/scsi/lpfc/lpfc_sli.c: error: called object 'mb' is not a function

Reported-by: Geert Uytterhoeven ge...@linux-m68k.org
Signed-off-by: Randy Dunlap rdun...@infradead.org
Cc: James Smart james.sm...@emulex.com
Cc: James E.J. Bottomley jbottom...@parallels.com
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/lpfc/lpfc_sli.c |   56 -
 1 file changed, 28 insertions(+), 28 deletions(-)

--- lnx-38.orig/drivers/scsi/lpfc/lpfc_sli.c
+++ lnx-38/drivers/scsi/lpfc/lpfc_sli.c
@@ -6599,7 +6599,7 @@ static int
 lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
   uint32_t flag)
 {
-   MAILBOX_t *mb;
+   MAILBOX_t *mbx;
struct lpfc_sli *psli = phba-sli;
uint32_t status, evtctr;
uint32_t ha_copy, hc_copy;
@@ -6653,7 +6653,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *
 
psli = phba-sli;
 
-   mb = pmbox-u.mb;
+   mbx = pmbox-u.mb;
status = MBX_SUCCESS;
 
if (phba-link_state == LPFC_HBA_ERROR) {
@@ -6668,7 +6668,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *
goto out_not_finished;
}
 
-   if (mb-mbxCommand != MBX_KILL_BOARD  flag  MBX_NOWAIT) {
+   if (mbx-mbxCommand != MBX_KILL_BOARD  flag  MBX_NOWAIT) {
if (lpfc_readl(phba-HCregaddr, hc_copy) ||
!(hc_copy  HC_MBINT_ENA)) {
spin_unlock_irqrestore(phba-hbalock, drvr_flag);
@@ -6722,7 +6722,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *
(%d):0308 Mbox cmd issue - BUSY Data: 
x%x x%x x%x x%x\n,
pmbox-vport ? pmbox-vport-vpi : 0xff,
-   mb-mbxCommand, phba-pport-port_state,
+   mbx-mbxCommand, phba-pport-port_state,
psli-sli_flag, flag);
 
psli-slistat.mbox_busy++;
@@ -6732,15 +6732,15 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *
lpfc_debugfs_disc_trc(pmbox-vport,
LPFC_DISC_TRC_MBOX_VPORT,
MBOX Bsy vport:  cmd:x%x mb:x%x x%x,
-   (uint32_t)mb-mbxCommand,
-   mb-un.varWords[0], mb-un.varWords[1]);
+   (uint32_t)mbx-mbxCommand,
+   mbx-un.varWords[0], mbx-un.varWords[1]);
}
else {
lpfc_debugfs_disc_trc(phba-pport,
LPFC_DISC_TRC_MBOX,
MBOX Bsy:cmd:x%x mb:x%x x%x,
-   (uint32_t)mb-mbxCommand,
-   mb-un.varWords[0], mb-un.varWords[1]);
+   (uint32_t)mbx-mbxCommand,
+   mbx-un.varWords[0], mbx-un.varWords[1]);
}
 
return MBX_BUSY;
@@ -6751,7 +6751,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *
/* If we are not polling, we MUST be in SLI2 mode */
if (flag != MBX_POLL) {
if (!(psli-sli_flag  LPFC_SLI_ACTIVE) 
-   (mb-mbxCommand != MBX_KILL_BOARD)) {
+   (mbx-mbxCommand != MBX_KILL_BOARD)) {
psli-sli_flag = ~LPFC_SLI_MBOX_ACTIVE;
spin_unlock_irqrestore(phba-hbalock, drvr_flag);
/* Mbox command mbxCommand cannot issue */
@@ -6773,23 +6773,23 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *
(%d):0309 Mailbox cmd x%x issue Data: x%x x%x 
x%x\n,
pmbox-vport ? pmbox-vport-vpi : 0,
-   mb-mbxCommand, phba-pport-port_state,
+   mbx-mbxCommand, phba-pport-port_state,
psli-sli_flag, flag);
 
-   if (mb-mbxCommand != MBX_HEARTBEAT) {
+   if (mbx-mbxCommand != MBX_HEARTBEAT) {
if (pmbox-vport) {
lpfc_debugfs_disc_trc(pmbox-vport,
LPFC_DISC_TRC_MBOX_VPORT,
MBOX Send vport: cmd:x%x mb:x%x x%x,
-   (uint32_t)mb-mbxCommand,
-   mb-un.varWords[0], mb-un.varWords[1]);
+   (uint32_t)mbx-mbxCommand,
+   mbx-un.varWords[0], mbx-un.varWords[1]);
}
else {
lpfc_debugfs_disc_trc(phba-pport,
LPFC_DISC_TRC_MBOX,
MBOX Send:   cmd:x%x mb:x%x x%x

Re: [PATCH 2/2] SCSI tape: show options currently set in sysfs

2008-02-24 Thread Randy Dunlap
On Sun, 24 Feb 2008 22:29:12 +0200 (EET) Kai Makisara wrote:

  Documentation/scsi/st.txt |7 ++-

 Index: linux-2.6.25-rc2-q/Documentation/scsi/st.txt
 ===
 --- linux-2.6.25-rc2-q.orig/Documentation/scsi/st.txt
 +++ linux-2.6.25-rc2-q/Documentation/scsi/st.txt
 @@ -133,6 +133,11 @@ the defaults set by the user. The value 
  file 'dev' contains the device numbers corresponding to this device. The 
 links
  'device' and 'driver' point to the SCSI device and driver entries.
  
 +Each directory acontains also the entry 'options' which shows the currently

  also contains the entry 'options'

 +enabled driver and mode options. The value in the file is a bit mask where 
 the
 +bit definitions are the same as those used with MTSETDRVBUFFER in setting the
 +options.
 +
  A link named 'tape' is made from the SCSI device directory to the class
  directory corresponding to the mode 0 auto-rewind device (e.g., st0). 


---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.25-rc2-mm1 (cciss build error)

2008-02-18 Thread Randy Dunlap
On Sat, 16 Feb 2008 00:25:22 -0800 Andrew Morton wrote:

 
 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.25-rc2/2.6.25-rc2-mm1/

cciss driver has a bad macro definition:

#else /* no CONFIG_CISS_SCSI_TAPE */

/* If no tape support, then these become defined out of existence */

#define cciss_scsi_setup(cntl_num)
#define cciss_unregister_scsi(ctlr)
#define cciss_register_scsi(ctlr)
#define cciss_seq_tape_report(struct seq_file *seq, int ctlr)

#endif /* CONFIG_CISS_SCSI_TAPE */

which causes this error:

In file included from 
/local/linsrc/linux-2.6.25-rc2-mm1/drivers/block/cciss.c:231:
/local/linsrc/linux-2.6.25-rc2-mm1/drivers/block/cciss_scsi.c:1498:38: error: 
macro parameters must be comma-separated
make[3]: *** [drivers/block/cciss.o] Error 1

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drivers/scsi/aic7xxx/aic7xxx_osm_pci.c - remove pointer comparison to 0

2008-02-11 Thread Randy Dunlap
On Mon, 11 Feb 2008 09:08:05 -0800 Joe Perches wrote:

 On Mon, 2008-02-11 at 09:30 -0600, James Bottomley wrote:
  On Sun, 2008-02-10 at 21:47 -0800, Joe Perches wrote:
   -   if (request_region(*base, 256, aic7xxx) == 0)
   +   if (!request_region(*base, 256, aic7xxx))
  
  This patch is completely pointless.
 
 It removes a sparse warning.

I try to say that in the patch description.  Andrew also tries
to enforce such errors/warnings in patch descriptions

  There's a marginal preference for if (!x) over if (x == NULL)
  for pointers, but it's still up to a driver writer if they wish to use
  the marginally unpreferred form.
 
 Use == NULL then if you care to.

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Update SCSI documentation for 512 byte sector requirement with max_sectors

2008-01-31 Thread Randy Dunlap
On Thu, 31 Jan 2008 17:58:30 -0800 Nicholas A. Bellinger wrote:

 On Thu, 2008-01-31 at 13:42 -0600, James Bottomley wrote:
  On Thu, 2008-01-31 at 10:44 -0800, Nicholas A. Bellinger wrote:
In short, and to repeat: almost every internal size counter to block is
in units of 512 byte sectors ... that includes capacity, maximum etc ...

   
   Ok, after reading your followup with Geert I see that this looks like a
   bug in ps3rom.c assuming 2048 byte sectors to calculate .max_sectors
   (which was originally set to 32 as I mentioned).  Using the setting
   BOUNCE_SIZE  9 where BOUNCE_SIZE is the request size in bytes looks
   like this will solve the issue.  My misunderstanding was
   that .max_sectors was allowed to be calcuated in non 512 byte sectors,
   so please disregard my patch.
   
   Geert, .max_sectors for ps3rom.c using 512 byte sectors ends up being
   128, yes.?
   
   James, could we put something in the SCSI docs stating that .max_sectors
   MUST be calculated against 512 byte sectors..?
  
  If that we is royal, then certainly you're welcome to submit a patch
  (just get Randy's ack).  However, do take a look at the existing docs
  first.  Certainly the block layer seems to make this very clear:
  
  /**
   * blk_queue_max_sectors - set max sectors for a request for this queue
   * @q:  the request queue for the device
   * @max_sectors:  max sectors in the usual 512b unit
^^
   *
   * Description:
   *Enables a low level driver to set an upper limit on the size of
   *received requests.
   **/
  
 
 Agreed, here is the patch to make this clear within SCSI.  Randy, does
 this look OK..?
 
 Thanks,
 
 --nab
 
 Signed-off-by: Nicholas A. Bellinger [EMAIL PROTECTED]
 
 diff --git a/Documentation/scsi/scsi_mid_low_api.txt 
 b/Documentation/scsi/scsi_mid_low_api.txt
 index 6f70f2b..570f271 100644
 --- a/Documentation/scsi/scsi_mid_low_api.txt
 +++ b/Documentation/scsi/scsi_mid_low_api.txt
 @@ -1244,13 +1244,12 @@ of interest:
  this_id  - scsi id of host (scsi initiator) or -1 if not known
  sg_tablesize - maximum scatter gather elements allowed by host.
 0 implies scatter gather not supported by host
 -max_sectors  - maximum number of sectors (usually 512 bytes) allowed
 -   in a single SCSI command. The default value of 0 leads
 -   to a setting of SCSI_DEFAULT_MAX_SECTORS (defined in
 -   scsi_host.h) which is currently set to 1024. So for a
 -   disk the maximum transfer size is 512 KB when max_sectors
 -   is not defined. Note that this size may not be sufficient
 -   for disk firmware uploads.
 +max_sectors  - maximum number of 512 bytes sectors allowed in a single
 +   SCSI command. The default value of 0 leads to a setting
 +   of SCSI_DEFAULT_MAX_SECTORS (defined in scsi_host.h) which
 +   is currently set to 1024. So for a disk the maximum 
 transfer
 +   size is 512 KB when max_sectors is not defined. Note that
 +   this size may not be sufficient for disk firmware uploads.
  cmd_per_lun  - maximum number of commands that can be queued on devices
 controlled by the host. Overridden by LLD calls to
 scsi_adjust_queue_depth().
 diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
 index 5c58d59..84098e3 100644
 --- a/include/scsi/scsi_host.h
 +++ b/include/scsi/scsi_host.h
 @@ -372,7 +372,10 @@ struct scsi_host_template {
 unsigned short sg_tablesize;
  
 /*
 -* If the host adapter has limitations beside segment count
 +* If the host adapter has limitations beside segment count.
 +* Note that this value MUST be calculated in 512 byte sectors,
 +* even if the attached struct scsi_device-sector_size is expected
 +* to use non 512 byte sectors.

How about:
   * to use a sector size other than 512 bytes.

and
Acked-by: Randy Dunlap [EMAIL PROTECTED]


  */
 unsigned short max_sectors;

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] advansys: section mismatch warning

2008-01-10 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

WARNING: vmlinux.o(.exit.text+0xc5b5): Section mismatch: reference to 
.init.data:_asc_def_iop_base (between 'advansys_isa_remove' and 
'advansys_eisa_remove')

_asc_def_iop_base is used in both init and exit code, so it cannot be
marked as __devinitdata.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/scsi/advansys.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.24-rc7-git1.orig/drivers/scsi/advansys.c
+++ linux-2.6.24-rc7-git1/drivers/scsi/advansys.c
@@ -13906,7 +13906,7 @@ static int advansys_release(struct Scsi_
 
 #define ASC_IOADR_TABLE_MAX_IX  11
 
-static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] __devinitdata = {
+static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] = {
0x100, 0x0110, 0x120, 0x0130, 0x140, 0x0150, 0x0190,
0x0210, 0x0230, 0x0250, 0x0330
 };
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] qla2xyz: fix section mismatch

2008-01-10 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Fix section mismatch:  qla2x00_remove_one() should not be __devexit.

WARNING: vmlinux.o(.text+0xb014f5): Section mismatch: reference to .exit.text: 
(between 'qla2xxx_pci_error_detected' and 'qla2xxx_pci_mmio_enabled')

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_os.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.24-rc7-git1.orig/drivers/scsi/qla2xxx/qla_os.c
+++ linux-2.6.24-rc7-git1/drivers/scsi/qla2xxx/qla_os.c
@@ -1831,7 +1831,7 @@ probe_out:
return ret;
 }
 
-static void __devexit
+static void
 qla2x00_remove_one(struct pci_dev *pdev)
 {
scsi_qla_host_t *ha;
@@ -2965,7 +2965,7 @@ static struct pci_driver qla2xxx_pci_dri
},
.id_table   = qla2xxx_pci_tbl,
.probe  = qla2x00_probe_one,
-   .remove = __devexit_p(qla2x00_remove_one),
+   .remove = qla2x00_remove_one,
.err_handler= qla2xxx_err_handler,
 };
 
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] cciss: section mismatch

2008-01-10 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Mark cciss_pci_init() as __devinit, to fix section mismatch warning.

WARNING: vmlinux.o(.text+0x601fc9): Section mismatch: reference to .init.text: 
(between 'cciss_pci_init' and 'cciss_getgeometry')

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/block/cciss.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.24-rc7-git1.orig/drivers/block/cciss.c
+++ linux-2.6.24-rc7-git1/drivers/block/cciss.c
@@ -2927,7 +2927,7 @@ default_int_mode:
return;
 }
 
-static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
+static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
 {
ushort subsystem_vendor_id, subsystem_device_id, command;
__u32 board_id, scratchpad = 0;
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] megaraid: fix section mismatch

2008-01-10 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Change megaraid_pci_driver_g variable name so that it matches the modpost
whitelist that allows pointers to init text/data.

WARNING: vmlinux.o(.data+0x1a8e30): Section mismatch: reference to 
.init.text:megaraid_probe_one (between 'megaraid_pci_driver_g' and 
'class_device_attr_megaraid_mbox_app_hndl')

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/scsi/megaraid/megaraid_mbox.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.24-rc7-git1.orig/drivers/scsi/megaraid/megaraid_mbox.c
+++ linux-2.6.24-rc7-git1/drivers/scsi/megaraid/megaraid_mbox.c
@@ -300,7 +300,7 @@ static struct pci_device_id pci_id_table
 MODULE_DEVICE_TABLE(pci, pci_id_table_g);
 
 
-static struct pci_driver megaraid_pci_driver_g = {
+static struct pci_driver megaraid_pci_driver = {
.name   = megaraid,
.id_table   = pci_id_table_g,
.probe  = megaraid_probe_one,
@@ -394,7 +394,7 @@ megaraid_init(void)
 
 
// register as a PCI hot-plug driver module
-   rval = pci_register_driver(megaraid_pci_driver_g);
+   rval = pci_register_driver(megaraid_pci_driver);
if (rval  0) {
con_log(CL_ANN, (KERN_WARNING
megaraid: could not register hotplug support.\n));
@@ -415,7 +415,7 @@ megaraid_exit(void)
con_log(CL_DLEVEL1, (KERN_NOTICE megaraid: unloading framework\n));
 
// unregister as PCI hotplug driver
-   pci_unregister_driver(megaraid_pci_driver_g);
+   pci_unregister_driver(megaraid_pci_driver);
 
return;
 }
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] megaraid: fix section mismatch

2008-01-10 Thread Randy Dunlap

James Bottomley wrote:

On Thu, 2008-01-10 at 16:10 -0800, Andrew Morton wrote:

On Thu, 10 Jan 2008 14:33:16 -0800
Randy Dunlap [EMAIL PROTECTED] wrote:


From: Randy Dunlap [EMAIL PROTECTED]

Change megaraid_pci_driver_g variable name so that it matches the modpost
whitelist that allows pointers to init text/data.

WARNING: vmlinux.o(.data+0x1a8e30): Section mismatch: reference to 
.init.text:megaraid_probe_one (between 'megaraid_pci_driver_g' and 
'class_device_attr_megaraid_mbox_app_hndl')


All these patches fix references to possibly-discarded sections and hence
fix possibly-serious bugs.  So all of them should go into 2.6.24.


Renaming a variable fixes a serious bug?  It quiets a spurious warning
from modpost, sure, but I hardly think that's -rc7 material.


Right.  The variable-renaming patches are for:

tpm_infineon
hostap
av7110
megaraid

The other 4 are more serious.

--
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: QUEUE_FLAG_CLUSTER: not working in 2.6.24 ?

2007-12-17 Thread Randy Dunlap
On Sun, 16 Dec 2007 21:55:20 + Mel Gorman wrote:

   Just using cp to read the file is enough to cause problems but I included
   a very basic program below that produces the BUG_ON checks. Is this a 
   known
   issue or am I using the interface incorrectly?
  
  I'd say you're using it correctly but you've found a hitherto unknown bug. 
  On i386 highmem machines with CONFIG_HIGHPTE (at least) pte_offset_map()
  takes kmap_atomic(), so pagemap_pte_range() can't do copy_to_user() as it
  presently does.
  
  Drat.
  
  Still, that shouldn't really disrupt the testing which you're doing.  You
  could disable CONFIG_HIGHPTE to shut it up.
  
 
 Yes, that did the trick. Using pagemap, it was trivial to show that the
 2.6.24-rc5-mm1 kernel was placing pages in reverse physical order like
 the following output shows
 
 b:  32763 v:   753091 p:65559 . 65558 contig: 1
 b:  32764 v:   753092 p:65558 . 65557 contig: 1
 b:  32765 v:   753093 p:65557 . 65556 contig: 1
 b:  32766 v:   753094 p:65556 . 6 contig: 1
 b:  32767 v:   753095 p:6 . 6 contig: 1
 
 p: is the PFN of the page v: is the page offset within an anonymous
 mapping and b: is the number of non-contiguous blocks in the anonymous
 mapping. With the patch applied, it looks more like;
 
 b:   1232 v:   752964 p:58944  87328 contig: 15
 b:   1233 v:   752980 p:87328  91200 contig: 15
 b:   1234 v:   752996 p:91200  40272 contig: 15
 b:   1235 v:   753012 p:40272  85664 contig: 15
 b:   1236 v:   753028 p:85664  87312 contig: 15
 
 so mappings are using contiguous pages again. This was the final test
 program I used in case it's of any interest.
 
 Thanks
 
 /*
  * showcontiguous.c
  *
  * Use the /proc/pid/pagemap interface to give an indication of how contiguous
  * physical memory is in an anonymous virtual memory mapping
  */

Matt,
Did you ever make your python pagemap scripts available?
If not, would you?

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6 patch] drivers/scsi/advansys.c section fix

2007-12-11 Thread Randy Dunlap
On Tue, 11 Dec 2007 23:23:53 +0100 Adrian Bunk wrote:

 This patch fixes the following section mismatch with CONFIG_HOTPLUG=n:
 
 --  snip  --
 
 ...
 WARNING: vmlinux.o(.exit.text+0xcf8a): Section mismatch: reference to 
 .init.data:_asc_def_iop_base (between 'advansys_isa_remove' and 
 'exit_this_scsi_driver')
 ...
 
 --  snip  --
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
 
 ---
 e81cac11f9efe882a89708c298fa6268375b0221 
 diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
 index 9dd3952..38a1ee2 100644
 --- a/drivers/scsi/advansys.c
 +++ b/drivers/scsi/advansys.c
 @@ -13906,7 +13906,7 @@ static int advansys_release(struct Scsi_Host *shost)
  
  #define ASC_IOADR_TABLE_MAX_IX  11
  
 -static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] __devinitdata = {
 +static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] = {
   0x100, 0x0110, 0x120, 0x0130, 0x140, 0x0150, 0x0190,
   0x0210, 0x0230, 0x0250, 0x0330
  };
 
 -

http://marc.info/?l=linux-scsim=119368247502255

Acked-by me.


---
~Randy
Features and documentation: http://lwn.net/Articles/260136/
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Recent sym53c8xx patches

2007-11-27 Thread Randy Dunlap
On Tue, 27 Nov 2007 09:51:56 -0500 Tony Battersby wrote:

 Hello,
 
 I am sending this message to check up on the merge status of my recent
 sym53c8xx patches to make sure they aren't forgotten.  Matthew Wilcox,
 could you give an ack/nak for these merge requests?  Also, please let me
 know if I need to do anything else (such as resending later) to make
 sure these patches get merged.

Is Matthew assisting James on SCSI merges now?


More broadly speaking, it would be a Good Thing if the SCSI
maintainer(s) would ack patches and/or merge them in a more timely
manner, like most other kernel subsystem maintainers.


---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ide-scsi: use print_hex_dump from linux/kernel.h

2007-11-26 Thread Randy Dunlap

Matthew Wilcox wrote:

On Mon, Nov 26, 2007 at 04:37:50PM +0800, rae l wrote:

I know this is different from the original hexdump in ide-scsi.c, I
just want to tell someone that there's a good implementation of
hexdump in kernel.h, and I think the default KERN_DEBUG and
print_hex_dump is more informative and has better output. However,
anyone want more precise control on debug message could make her/his
improvements with print_hex_dump.


using KERN_DEBUG is wrong -- this is part of a line, so you need to use
KERN_NONE or simply .


s/KERN_NONE/KERN_CONT/ for continuation lines.

--
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH resend] scsi boot options: correct option name and tell where to find docs for it

2007-11-14 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Minor corrections and additions to 'scsi_logging_level', as pointed out
by Chuck Ebbert.
Also point out the IBM S390-tools 'scsi_logging_level' script.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 Documentation/kernel-parameters.txt |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- linux-2.6.24-rc2-git4.orig/Documentation/kernel-parameters.txt
+++ linux-2.6.24-rc2-git4/Documentation/kernel-parameters.txt
@@ -1584,7 +1584,13 @@ and is between 256 and 4096 characters. 
Format: vendor:model:flags
(flags are integer value)
 
-   scsi_logging=   [SCSI]
+   scsi_logging_level= [SCSI] a bit mask of logging levels
+   See drivers/scsi/scsi_logging.h for bits.  Also
+   settable via sysctl at dev.scsi.logging_level
+   (/proc/sys/dev/scsi/logging_level).
+   There is also a nice 'scsi_logging_level' script in the
+   S390-tools package, available for download at
+   
http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html
 
scsi_mod.scan=  [SCSI] sync (default) scans SCSI busses as they are
discovered.  async scans them in kernel threads,

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


[PATCH] cciss: use upper_32_bits() macro to eliminate warnings

2007-11-11 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Use upper_32_bits(x) macro to handle shifts that may be = the width of
the data type.

drivers/block/cciss.c: In function 'do_cciss_request':
drivers/block/cciss.c:2655: warning: right shift count = width of type
drivers/block/cciss.c:2656: warning: right shift count = width of type
drivers/block/cciss.c:2657: warning: right shift count = width of type
drivers/block/cciss.c:2658: warning: right shift count = width of type

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/block/cciss.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

--- linux-2.6.24-rc2-git2.orig/drivers/block/cciss.c
+++ linux-2.6.24-rc2-git2/drivers/block/cciss.c
@@ -2650,12 +2650,14 @@ static void do_cciss_request(struct requ
c-Request.CDB[8] = creq-nr_sectors  0xff;
c-Request.CDB[9] = c-Request.CDB[11] = 
c-Request.CDB[12] = 0;
} else {
+   u32 upper32 = upper_32_bits(start_blk);
+
c-Request.CDBLen = 16;
c-Request.CDB[1]= 0;
-   c-Request.CDB[2]= (start_blk  56)  0xff;//MSB
-   c-Request.CDB[3]= (start_blk  48)  0xff;
-   c-Request.CDB[4]= (start_blk  40)  0xff;
-   c-Request.CDB[5]= (start_blk  32)  0xff;
+   c-Request.CDB[2]= (upper32  24)  0xff;  //MSB
+   c-Request.CDB[3]= (upper32  16)  0xff;
+   c-Request.CDB[4]= (upper32   8)  0xff;
+   c-Request.CDB[5]= upper32  0xff;
c-Request.CDB[6]= (start_blk  24)  0xff;
c-Request.CDB[7]= (start_blk  16)  0xff;
c-Request.CDB[8]= (start_blk   8)  0xff;
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH alternative] [SCSI] aic7xxx: Fix warnings with CONFIG_PM=n

2007-11-09 Thread Randy Dunlap
On Fri,  9 Nov 2007 08:55:44 +0100 Frank Lichtenheld wrote:

 Fixes the following warnings:
   CC [M]  drivers/scsi/aic7xxx/aic79xx_osm_pci.o
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c:101: warning: 
 ‘ahd_linux_pci_dev_suspend’ defined but not used
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c:121: warning: 
 ‘ahd_linux_pci_dev_resume’ defined but not used
 
   CC [M]  drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:148: warning: 
 ‘ahc_linux_pci_dev_suspend’ defined but not used
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:166: warning: 
 ‘ahc_linux_pci_dev_resume’ defined but not used
 
 Reorder code as suggested by Randy Dunlap to minimize
 needed #ifdefs
 
 Cc: Randy Dunlap [EMAIL PROTECTED]
 Signed-off-by: Frank Lichtenheld [EMAIL PROTECTED]

Thanks.

Acked-by: Randy Dunlap [EMAIL PROTECTED]

with one nit:

Warning: trailing whitespace in line 174 of 
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
Warning: trailing whitespace in lines 131,132 of 
drivers/scsi/aic7xxx/aic79xx_osm_pci.c

 ---
  drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   25 +
  drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   25 +
  2 files changed, 26 insertions(+), 24 deletions(-)
 
   But ideally the functions would be defined before the  
   struct pci_driver data, so the prototypes for them could be removed.
 
  Hmm, I'm a bit sceptical about the reordering, but here you go.
  Choose whatever you like.
 
 diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 
 b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
 index 66f0259..f6dbd3e 100644
 --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
 +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
 @@ -50,8 +50,6 @@ static int  ahd_linux_pci_reserve_io_regions(struct 
 ahd_softc *ahd,
  static int   ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd,
u_long *bus_addr,
uint8_t __iomem **maddr);
 -static int   ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t 
 mesg);
 -static int   ahd_linux_pci_dev_resume(struct pci_dev *pdev);
  static void  ahd_linux_pci_dev_remove(struct pci_dev *pdev);
  
  /* Define the macro locally since it's different for different class of 
 chips.
 @@ -85,17 +83,7 @@ static struct pci_device_id ahd_linux_pci_id_table[] = {
  
  MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table);
  
 -static struct pci_driver aic79xx_pci_driver = {
 - .name   = aic79xx,
 - .probe  = ahd_linux_pci_dev_probe,
  #ifdef CONFIG_PM
 - .suspend= ahd_linux_pci_dev_suspend,
 - .resume = ahd_linux_pci_dev_resume,
 -#endif
 - .remove = ahd_linux_pci_dev_remove,
 - .id_table   = ahd_linux_pci_id_table
 -};
 -
  static int
  ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
  {
 @@ -139,6 +127,19 @@ ahd_linux_pci_dev_resume(struct pci_dev *pdev)
  
   return rc;
  }
 +#else
 +#define ahd_linux_pci_dev_suspend NULL   
   
 +#define ahd_linux_pci_dev_resume  NULL 
 +#endif
 +
 +static struct pci_driver aic79xx_pci_driver = {
 + .name   = aic79xx,
 + .probe  = ahd_linux_pci_dev_probe,
 + .suspend= ahd_linux_pci_dev_suspend,
 + .resume = ahd_linux_pci_dev_resume,
 + .remove = ahd_linux_pci_dev_remove,
 + .id_table   = ahd_linux_pci_id_table
 +};
  
  static void
  ahd_linux_pci_dev_remove(struct pci_dev *pdev)
 diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 
 b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
 index 4488946..ab53189 100644
 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
 +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
 @@ -49,8 +49,6 @@ static int  ahc_linux_pci_reserve_io_region(struct 
 ahc_softc *ahc,
  static int   ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
u_long *bus_addr,
uint8_t __iomem **maddr);
 -static int   ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t 
 mesg);
 -static int   ahc_linux_pci_dev_resume(struct pci_dev *pdev);
  static void  ahc_linux_pci_dev_remove(struct pci_dev *pdev);
  
  /* Define the macro locally since it's different for different class of 
 chips.
 @@ -132,17 +130,7 @@ static struct pci_device_id ahc_linux_pci_id_table[] = {
  
  MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
  
 -static struct pci_driver aic7xxx_pci_driver = {
 - .name   = aic7xxx,
 - .probe  = ahc_linux_pci_dev_probe,
  #ifdef CONFIG_PM
 - .suspend= ahc_linux_pci_dev_suspend,
 - .resume = ahc_linux_pci_dev_resume,
 -#endif
 - .remove = ahc_linux_pci_dev_remove,
 - .id_table   = ahc_linux_pci_id_table
 -};
 -
  static int
  ahc_linux_pci_dev_suspend(struct pci_dev *pdev

Re: [PATCH 13/32] aha1542.c: convert to accessors and !use_sg cleanup

2007-11-09 Thread Randy Dunlap
On Wed, 17 Oct 2007 19:53:11 +0200 Boaz Harrosh wrote:

 
  - convert to accessors and !use_sg cleanup
 
 Signed-off-by: Boaz Harrosh [EMAIL PROTECTED]
 ---

Tested-by: Randy Dunlap [EMAIL PROTECTED] // aha152x_cs

  drivers/scsi/aha1542.c |   46 ++
  1 files changed, 10 insertions(+), 36 deletions(-)


---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi menu: move RAID transport class to Transports menu

2007-11-04 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Move RAID_ATTRS into the SCSI Transports sub-menu.
Fix some help text whitespace in Transports.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/scsi/Kconfig |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

--- linux-2.6.24-rc1-git13.orig/drivers/scsi/Kconfig
+++ linux-2.6.24-rc1-git13/drivers/scsi/Kconfig
@@ -1,12 +1,5 @@
 menu SCSI device support
 
-config RAID_ATTRS
-   tristate RAID Transport Class
-   default n
-   depends on BLOCK
-   ---help---
- Provides RAID
-
 config SCSI
tristate SCSI device support
depends on BLOCK
@@ -256,6 +249,13 @@ config SCSI_WAIT_SCAN
 menu SCSI Transports
depends on SCSI
 
+config RAID_ATTRS
+   tristate RAID Transport Class
+   default n
+   depends on BLOCK
+   ---help---
+ Provides RAID class information in sysfs.
+
 config SCSI_SPI_ATTRS
tristate Parallel SCSI (SPI) Transport Attributes
depends on SCSI
@@ -277,7 +277,7 @@ config SCSI_FC_TGT_ATTRS
depends on SCSI_FC_ATTRS
depends on SCSI_TGT = y || SCSI_TGT = SCSI_FC_ATTRS
help
-   If you want to use SCSI target mode drivers enable this option.
+ If you want to use SCSI target mode drivers enable this option.
 
 config SCSI_ISCSI_ATTRS
tristate iSCSI Transport Attributes
@@ -308,7 +308,7 @@ config SCSI_SRP_TGT_ATTRS
depends on SCSI_SRP_ATTRS
depends on SCSI_TGT = y || SCSI_TGT = SCSI_SRP_ATTRS
help
-   If you want to use SCSI target mode drivers enable this option.
+ If you want to use SCSI target mode drivers enable this option.
 
 endmenu
 
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] block: move RAID transport class to BLOCK menu

2007-11-04 Thread Randy Dunlap

From: Randy Dunlap [EMAIL PROTECTED]

Move RAID class configuration to the BLOCK menu since it is not
SCSI-specific.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
block/Kconfig|5 +
drivers/scsi/Kconfig |7 ---
2 files changed, 5 insertions(+), 7 deletions(-)

--- linux-2.6.24-rc1-git13.orig/block/Kconfig
+++ linux-2.6.24-rc1-git13/block/Kconfig
@@ -62,6 +62,11 @@ config BLK_DEV_BSG
protocols (e.g. Task Management Functions and SMP in Serial
Attached SCSI).

+config RAID_ATTRS
+   tristate RAID Transport Class
+   ---help---
+ Provides RAID class information in sysfs.
+
endif # BLOCK

config BLOCK_COMPAT
--- linux-2.6.24-rc1-git13.orig/drivers/scsi/Kconfig
+++ linux-2.6.24-rc1-git13/drivers/scsi/Kconfig
@@ -1,12 +1,5 @@
menu SCSI device support

-config RAID_ATTRS
-   tristate RAID Transport Class
-   default n
-   depends on BLOCK
-   ---help---
- Provides RAID
-
config SCSI
tristate SCSI device support
depends on BLOCK
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] block: move RAID transport class to BLOCK menu

2007-11-04 Thread Randy Dunlap

Jeff Garzik wrote:

Randy Dunlap wrote:

Jeff Garzik wrote:

Randy Dunlap wrote:

From: Randy Dunlap [EMAIL PROTECTED]

Move RAID class configuration to the BLOCK menu since it is not
SCSI-specific.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
block/Kconfig|5 +
drivers/scsi/Kconfig |7 ---
2 files changed, 5 insertions(+), 7 deletions(-)


ACK

Though IMO we should move the code, too.


OK, I'll do that and resend.


Well, I'm only one voice...  might wait to see if others agree first :)


I'll let the maintainer(s) haggle over which patch to merge.  ;)

--
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] block: move RAID transport class to BLOCK menu

2007-11-04 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Move RAID class configuration to the BLOCK menu since it is not
SCSI-specific.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 block/Kconfig |5 
 block/Makefile|2 
 block/raid_class.c|  313 +
 drivers/scsi/Kconfig  |7 -
 drivers/scsi/Makefile |2 
 drivers/scsi/raid_class.c |  314 --
 6 files changed, 320 insertions(+), 323 deletions(-)

--- linux-2.6.24-rc1-git13.orig/block/Kconfig
+++ linux-2.6.24-rc1-git13/block/Kconfig
@@ -62,6 +62,11 @@ config BLK_DEV_BSG
protocols (e.g. Task Management Functions and SMP in Serial
Attached SCSI).
 
+config RAID_ATTRS
+   tristate RAID Transport Class
+   ---help---
+ Provides RAID class information in sysfs.
+
 endif # BLOCK
 
 config BLOCK_COMPAT
--- linux-2.6.24-rc1-git13.orig/drivers/scsi/Kconfig
+++ linux-2.6.24-rc1-git13/drivers/scsi/Kconfig
@@ -1,12 +1,5 @@
 menu SCSI device support
 
-config RAID_ATTRS
-   tristate RAID Transport Class
-   default n
-   depends on BLOCK
-   ---help---
- Provides RAID
-
 config SCSI
tristate SCSI device support
depends on BLOCK
--- /dev/null
+++ linux-2.6.24-rc1-git13/block/raid_class.c
@@ -0,0 +1,313 @@
+/*
+ * raid_class.c - implementation of a simple raid visualisation class
+ *
+ * Copyright (c) 2005 - James Bottomley [EMAIL PROTECTED]
+ *
+ * This file is licensed under GPLv2
+ *
+ * This class is designed to allow raid attributes to be visualised and
+ * manipulated in a form independent of the underlying raid.  Ultimately this
+ * should work for both hardware and software raids.
+ */
+#include linux/init.h
+#include linux/module.h
+#include linux/list.h
+#include linux/slab.h
+#include linux/string.h
+#include linux/raid_class.h
+#include scsi/scsi_device.h
+#include scsi/scsi_host.h
+
+#define RAID_NUM_ATTRS 3
+
+struct raid_internal {
+   struct raid_template r;
+   struct raid_function_template *f;
+   /* The actual attributes */
+   struct class_device_attribute private_attrs[RAID_NUM_ATTRS];
+   /* The array of null terminated pointers to attributes
+* needed by scsi_sysfs.c */
+   struct class_device_attribute *attrs[RAID_NUM_ATTRS + 1];
+};
+
+struct raid_component {
+   struct list_head node;
+   struct class_device cdev;
+   int num;
+};
+
+#define to_raid_internal(tmpl) container_of(tmpl, struct raid_internal, r)
+
+#define tc_to_raid_internal(tcont) ({  \
+   struct raid_template *r =   \
+   container_of(tcont, struct raid_template, raid_attrs);  \
+   to_raid_internal(r);\
+})
+
+#define ac_to_raid_internal(acont) ({  \
+   struct transport_container *tc =\
+   container_of(acont, struct transport_container, ac);\
+   tc_to_raid_internal(tc);\
+})
+
+#define class_device_to_raid_internal(cdev) ({ \
+   struct attribute_container *ac =\
+   attribute_container_classdev_to_container(cdev);\
+   ac_to_raid_internal(ac);\
+})
+
+
+static int raid_match(struct attribute_container *cont, struct device *dev)
+{
+   /* We have to look for every subsystem that could house
+* emulated RAID devices, so start with SCSI */
+   struct raid_internal *i = ac_to_raid_internal(cont);
+
+   if (scsi_is_sdev_device(dev)) {
+   struct scsi_device *sdev = to_scsi_device(dev);
+
+   if (i-f-cookie != sdev-host-hostt)
+   return 0;
+
+   return i-f-is_raid(dev);
+   }
+   /* FIXME: look at other subsystems too */
+   return 0;
+}
+
+static int raid_setup(struct transport_container *tc, struct device *dev,
+  struct class_device *cdev)
+{
+   struct raid_data *rd;
+
+   BUG_ON(class_get_devdata(cdev));
+
+   rd = kzalloc(sizeof(*rd), GFP_KERNEL);
+   if (!rd)
+   return -ENOMEM;
+
+   INIT_LIST_HEAD(rd-component_list);
+   class_set_devdata(cdev, rd);
+
+   return 0;
+}
+
+static int raid_remove(struct transport_container *tc, struct device *dev,
+  struct class_device *cdev)
+{
+   struct raid_data *rd = class_get_devdata(cdev);
+   struct raid_component *rc, *next;
+   dev_printk(KERN_ERR, dev, RAID REMOVE\n);
+   class_set_devdata(cdev, NULL);
+   list_for_each_entry_safe(rc, next, rd-component_list, node) {
+   list_del(rc-node);
+   dev_printk(KERN_ERR, rc-cdev.dev, RAID COMPONENT REMOVE\n);
+   class_device_unregister(rc-cdev

[PATCH] advansys: fix section mismatch warning

2007-10-29 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Fix section mismatch warning:

WARNING: vmlinux.o(.exit.text+0x152a): Section mismatch: reference to 
.init.data:_asc_def_iop_base (between 'advansys_isa_remove' and 'advansys_exit')

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/scsi/advansys.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2624-rc1g4-v1.orig/drivers/scsi/advansys.c
+++ linux-2624-rc1g4-v1/drivers/scsi/advansys.c
@@ -13906,7 +13906,7 @@ static int advansys_release(struct Scsi_
 
 #define ASC_IOADR_TABLE_MAX_IX  11
 
-static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] __devinitdata = {
+static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] = {
0x100, 0x0110, 0x120, 0x0130, 0x140, 0x0150, 0x0190,
0x0210, 0x0230, 0x0250, 0x0330
 };
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] aic94: fix section mismatches

2007-10-29 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Fix section mismatch warning:

WARNING: vmlinux.o(.init.text+0x23be6): Section mismatch: reference to 
.exit.text:asd_unmap_ha (between 'asd_pci_probe' and 'qla4xxx_module_init')
+
WARNING: vmlinux.o(.text+0x1ec8a8): Section mismatch: reference to .exit.text:as
d_unmap_ioport (between 'asd_unmap_ha' and 'asd_remove_dev_attrs')
WARNING: vmlinux.o(.text+0x1ec8b1): Section mismatch: reference to .exit.text:as
d_unmap_memio (between 'asd_unmap_ha' and 'asd_remove_dev_attrs')

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 drivers/scsi/aic94xx/aic94xx_init.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2624-rc1g4-v1.orig/drivers/scsi/aic94xx/aic94xx_init.c
+++ linux-2624-rc1g4-v1/drivers/scsi/aic94xx/aic94xx_init.c
@@ -134,7 +134,7 @@ Err:
return err;
 }
 
-static void __devexit asd_unmap_memio(struct asd_ha_struct *asd_ha)
+static void asd_unmap_memio(struct asd_ha_struct *asd_ha)
 {
struct asd_ha_addrspace *io_handle;
 
@@ -171,7 +171,7 @@ static int __devinit asd_map_ioport(stru
return err;
 }
 
-static void __devexit asd_unmap_ioport(struct asd_ha_struct *asd_ha)
+static void asd_unmap_ioport(struct asd_ha_struct *asd_ha)
 {
pci_release_region(asd_ha-pcidev, PCI_IOBAR_OFFSET);
 }
@@ -208,7 +208,7 @@ Err:
return err;
 }
 
-static void __devexit asd_unmap_ha(struct asd_ha_struct *asd_ha)
+static void asd_unmap_ha(struct asd_ha_struct *asd_ha)
 {
if (asd_ha-iospace)
asd_unmap_ioport(asd_ha);
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 15/15] Add Documentation/DocBook/scsi_midlayer.tmpl and add to Makefile.

2007-10-27 Thread Randy Dunlap
On Fri, 26 Oct 2007 23:18:00 -0500 Rob Landley wrote:

 From: Rob Landley [EMAIL PROTECTED]
 
 Add Documentation/DocBook/scsi_midlayer.tmpl and add to Makefile.


I have comments for all 15 patches here.

a.  You should cc: the maintainer who you want/expect to apply the
patches.  Always.  Andrew Morton is the only person who
trolls for patches on a mailing list.  :)

b.  The function Description: section header is not strictly
required by scripts/kernel-doc.  It will assume that the
first text section after parameters is the Description:
section.  FYI.

c.  Extraneous whitespace.  Git or quilt check for this.
I don't know about hg...

patch 2:
Warning: trailing whitespace in line 60 of drivers/scsi/scsicam.c

patch 6:
Warning: trailing whitespace in line 185 of drivers/scsi/scsi_ioctl.c

patch 15:
Warning: trailing whitespace in lines 8,43 of 
Documentation/DocBook/scsi_midlayer.tmpl



The docbook builds cleanly and all of my following comments are just
for cleanups/fixes.


General:  SCSI, not scsi (in text descriptions, sentences, etc.)
General:  IRQ, not irq (in text)
General:  LLD, not lld (in text) (or LLDD, not lldd)


Chap. 1:
Can't SCSI commands also be 32 bytes long?

Chap. 3:  Mid-layer:

It would make more sense to me to put extra comments like
Main file for the scsi midlayer.
just after the source file name instead of after all of the documented
interfaces in that file.


scsi_finish_command - needs a short description on the first kernel-doc line.
scsi_track_queue_full - ditto

__scsi_device_lookup_by_target:  fix text:
The only reason why drivers would want to use this is because they're need to 
access the device list in irq context.

s/would want to/should/
s/they're/they/

scsi_eh_finish_cmd:

thus we really

s/thus/Thus/

scsi_eh_get_sense:
proccessed (sp)

This has the unfortunate side effect that if a shost adapter does not
automatically request sense information, that we end up shutting it down
before we request it.

Ugh.  Fix.

scsi_sense_desc_find:
short function description needs to be all on one line and no blank
line before parameters.

scsi_get_sense_info_fld:
same comments as above.

scsi_init_devinfo:
Don't end kernel-doc with **/  (this is just a convention, not a
syntax rule).

HTML output of the function description is there 2 times.
I'll look into this problem.

scsi_mode_sense:
function short description must be on one line only (can be a long line
if needed)
Description text is repeated in html output; this is usually due to
the function desc. being on multiple lines.

scsi_device_set_state:
short func desc on one line only.


scsi_internal_device_block:
short func desc on one line only.


scsi_kunmap_atomic_sg:
short func desc on one line only.

scsi_target_reap:
no blank line before parameter list

scsi_inq_str:
short func desc on one line only.


scsi_host_set_state:
short func desc on one line only.

scsi_host_lookup:
no blank line before parameter list

fc_host_post_event:
short func desc on one line only.

fc_host_post_vendor_event:
a fc_host

s/a/an/

fc_remove_host:
short func desc on one line only.

fc_remote_port_add:
short func desc on one line only.

fc_remote_port_delete:
short func desc on one line only.

fc_remote_port_rolechg:
short func desc on one line only.

iscsi_destroy_conn:
This can be called from a LLD or iscsi_transport.

s/a/an/

sas_remove_children:
sas_remove_host:
sas_phy_alloc:
sas_phy_add:
sas_phy_free:
sas_phy_delete:
scsi_is_sas_phy:
sas_port_delete:
scsi_is_sas_port:
sas_rphy_add:
sas_rphy_free:
sas_rphy_delete:
sas_rphy_remove:
scsi_is_sas_rphy:
sas_attach_transport:
sas_release_transport:
s/--/-/  in first line of kernel-doc

sas_port_add:
no blank line before parameter list


srp_rport_add:
no blank line before parameter list

srp_rport_del:
srp_remove_host:
srp_attach_transport:
srp_release_transport:
s/--/-/  in first line of kernel-doc


###
Thanks,
---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: single unused scsi-related CONFIG variable

2007-10-26 Thread Randy Dunlap
On Fri, 26 Oct 2007 14:18:05 -0400 (EDT) Robert P. J. Day wrote:

 
 drivers/scsi/Kconfig:1322:config SCSI_QLOGIC_FC_FIRMWARE

config SCSI_QLOGIC_FC_FIRMWARE
bool Include loadable firmware in driver
depends on SCSI_QLOGIC_FC


I don't find SCSI_QLOGIC_FC defined anywhere...

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: single unused scsi-related CONFIG variable

2007-10-26 Thread Randy Dunlap
On Sat, 27 Oct 2007 00:28:03 -0400 (EDT) Robert P. J. Day wrote:

 On Fri, 26 Oct 2007, Randy Dunlap wrote:
 
  On Fri, 26 Oct 2007 14:18:05 -0400 (EDT) Robert P. J. Day wrote:
 
  
   drivers/scsi/Kconfig:1322:config SCSI_QLOGIC_FC_FIRMWARE
 
  config SCSI_QLOGIC_FC_FIRMWARE
  bool Include loadable firmware in driver
  depends on SCSI_QLOGIC_FC
 
 
  I don't find SCSI_QLOGIC_FC defined anywhere...
 
 i'm just *guessing* that some SCSI_QLOGIC_FC-related logic existed
 once upon a time, it was removed, but the controlling Kconfig entry
 was overlooked.
 
 so it would seem safe to just blast that single config entry above,
 no?  i can whip up a patch for that shortly.

Agreed.  Go for it.

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Questions about scsi.c

2007-10-25 Thread Randy Dunlap
On Thu, 25 Oct 2007 06:06:03 -0500 Rob Landley wrote:

 The rest sort of seems to make sense, although the kerneldoc comments in 
 include/scsi/scsi_device.h are before #defines instead of before function 
 definitions so the make xmldocs infrastructure (something in either 
 scripts/basic/docproc.c or scripts/kernel-doc) skips right over it
 because it can't figure out the argument types.  Separate issue, todo item 
 for 
 later...

scripts/kernel-doc is supposed to (and usually does) handle
kernel-doc notation of a #define macro.  Are these 2 not working?


---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Questions about scsi.c

2007-10-25 Thread Randy Dunlap
On Thu, 25 Oct 2007 13:25:37 -0500 Rob Landley wrote:

 On Thursday 25 October 2007 10:40:39 am Randy Dunlap wrote:
  On Thu, 25 Oct 2007 06:06:03 -0500 Rob Landley wrote:
   The rest sort of seems to make sense, although the kerneldoc comments in
   include/scsi/scsi_device.h are before #defines instead of before function
   definitions so the make xmldocs infrastructure (something in either
   scripts/basic/docproc.c or scripts/kernel-doc) skips right over it
   because it can't figure out the argument types.  Separate issue, todo
   item for later...
 
  scripts/kernel-doc is supposed to (and usually does) handle
  kernel-doc notation of a #define macro.  Are these 2 not working?
 
 Not when I tried it.
 
  $ make xmldocs
  make -C /home/landley/linux/hg O=/home/landley/linux/temp xmldocs
DOCPROC Documentation/DocBook/scsi_midlayer.xml
  Warning(/home/landley/linux/hg//include/scsi/scsi_device.h): no structured
  comments found 
 
 Entirely possible I'm doing something wrong:
 
sect1 id=scsi_device.h
   titleinclude/scsi/scsi_device.h/title
   para
   /para
 !Einclude/scsi/scsi_device.h
 /sect1

!E is for exported symbols and that file has none.
USe !I instead.

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Questions about scsi.c

2007-10-25 Thread Randy Dunlap
On Thu, 25 Oct 2007 16:40:35 -0500 Rob Landley wrote:

 On Thursday 25 October 2007 12:32:41 pm Randy Dunlap wrote:
   Entirely possible I'm doing something wrong:
  
  sect1 id=scsi_device.h
 titleinclude/scsi/scsi_device.h/title
 para
 /para
   !Einclude/scsi/scsi_device.h
   /sect1
 
  !E is for exported symbols and that file has none.
  USe !I instead.
 
 So how do I handle a case like drivers/ata/libata-core.c which has 
 EXPORT_SYMBOL() calls for functions that live in (and are documented in) 
 other files, such as ata_scsi_ioctl() in drivers/ata/libata-scsi.c?

I don't see ata_scsi_ioctl() documented at all.  Are you looking at
a newer tree than I am?  (i'm using 2.6.24-rc1)

Long-term answer is that we prefer EXPORT_SYMBOL() to be used
just under the function that is being exported.  In this case,
the maintainer may be disagreeing with that.  [cc-ed]

Short-term answer is to use !Isource_filename_where_kernel_doc_is
as though it's not EXPORTed.  I think.

---
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >