Re: [PATCH 00/71] More fixes, cleanup and modernization for NCR5380 drivers

2015-11-18 Thread Ondrej Zary
On Thursday 19 November 2015, Finn Thain wrote: > On Wed, 18 Nov 2015, Ondrej Zary wrote: > > On Wednesday 18 November 2015, Finn Thain wrote: > > > Like my previous work on the NCR5380 drivers, this patch series has > > > bug fixes, code cleanup and modernization. These drivers suffer from > > > m

Re: [PATCH 06/71] ncr5380: Remove NCR5380_instance_name macro

2015-11-18 Thread Hannes Reinecke
On 11/18/2015 09:35 AM, Finn Thain wrote: This macro makes the code cryptic. Remove it. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 +- drivers/scsi/g_NCR5380.c |7 --- drivers/scsi/g_NCR5380.h |2 -- 3 files changed, 5 insertions(+), 6 deletions(-) Reviewe

Re: [PATCH 05/71] ncr5380: Remove NCR5380_local_declare and NCR5380_setup macros

2015-11-18 Thread Hannes Reinecke
On 11/18/2015 09:35 AM, Finn Thain wrote: The NCR5380_local_declare and NCR5380_setup macros exist to define and initialize a particular local variable, to provide the address of the chip registers needed for the driver's implementation of its NCR5380_read/write register access macros. In cumana

Re: [PATCH 04/71] ncr5380: Remove more pointless macros

2015-11-18 Thread Hannes Reinecke
On 11/18/2015 09:34 AM, Finn Thain wrote: ASM macro is never defined. rtrc in pas16.c is not used. NCR5380_map_config, do_NCR5380_intr, do_t128_intr and do_pas16_intr are unused. NCR_NOT_SET harms readability. Remove them. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.h |3 --- d

Re: [PATCH 03/71] ncr5380: Eliminate PDEBUG*, TDEBUG* and DTCDEBUG* macros

2015-11-18 Thread Hannes Reinecke
On 11/18/2015 09:34 AM, Finn Thain wrote: Replace {P,T,DTC}DEBUG_INIT with NDEBUG_INIT. Remove dead debugging code, including code that's conditional upon *DEBUG_TRANSFER. Signed-off-by: Finn Thain --- drivers/scsi/dtc.c | 18 ++ drivers/scsi/dtc.h | 27 -

Re: [PATCH 02/71] ncr5380: Remove redundant static variable initializers

2015-11-18 Thread Hannes Reinecke
On 11/18/2015 09:34 AM, Finn Thain wrote: Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 +- drivers/scsi/dtc.c |4 ++-- drivers/scsi/g_NCR5380.c |4 ++-- drivers/scsi/pas16.c | 10 +- drivers/scsi/sun3_scsi.c |8 drivers/scsi/t128.

Re: [PATCH 01/71] atari_scsi: Fix SCSI host ID setting

2015-11-18 Thread Hannes Reinecke
On 11/18/2015 09:34 AM, Finn Thain wrote: The NVRAM location of this byte is 16, as documented in http://toshyp.atari.org/en/004009.html This was confirmed by Michael Schmitz, by setting the SCSI host ID under EmuTOS and then checking the value in /proc/driver/nvram and /dev/nvram under Linux.

[PATCH v2] lpfc: replaced kmalloc + memset with kzalloc

2015-11-18 Thread Saurabh Sengar
replacing kmalloc and memset by a single call of kzalloc Signed-off-by: Saurabh Sengar --- v2 : I didn't got any response for my initial patch, I am sending it again on top of latest kernel(today's) drivers/scsi/lpfc/lpfc_els.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: [PATCH for-next 05/10] iser: Have initiator and target to share protocol structures and definitions

2015-11-18 Thread Or Gerlitz
On 11/16/2015 6:37 PM, Sagi Grimberg wrote: +/** + * struct iser_hello - iSER Hello header + * + * @opcode: opcode (must be set to ISER_HELLO) + * @max_min_ver: maximum and minimum iser versions + * @iser_ird: iSER IRD + * @rsvd: reserved + */ +struct iser_hello { + u8

Re: [PATCH 10/71] atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOT

2015-11-18 Thread Michael Schmitz
Hi Finn, Am 19.11.2015 um 17:05 schrieb Finn Thain: > w > On Thu, 19 Nov 2015, Michael Schmitz wrote: > >> Hi Finn, >> >> Am 18.11.2015 um 21:35 schrieb Finn Thain: >> >>> The bus reset may raise an interrupt. That would be new behaviour for >>> atari_scsi only when CONFIG_ATARI_SCSI_RESET_BOOT=

Re: [PATCH 10/71] atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOT

2015-11-18 Thread Finn Thain
w On Thu, 19 Nov 2015, Michael Schmitz wrote: > Hi Finn, > > Am 18.11.2015 um 21:35 schrieb Finn Thain: > > > The bus reset may raise an interrupt. That would be new behaviour for > > atari_scsi only when CONFIG_ATARI_SCSI_RESET_BOOT=n. The ST DMA > > interrupt is not assigned to atari_scsi at

Re: [PATCH v5 00/32] HiSilicon SAS driver

2015-11-18 Thread Martin K. Petersen
> "John" == John Garry writes: John> thanks, please note that we still have the dependency on John> http://www.spinics.net/lists/arm-kernel/msg452833.html John> Without it the driver can only be built into the kernel, and not John> as a module. I have your driver in a staging branch rather

Re: [PATCH 10/71] atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOT

2015-11-18 Thread Michael Schmitz
Hi Finn, Am 18.11.2015 um 21:35 schrieb Finn Thain: > The bus reset may raise an interrupt. That would be new behaviour for > atari_scsi only when CONFIG_ATARI_SCSI_RESET_BOOT=n. The ST DMA interrupt > is not assigned to atari_scsi at this stage, so > CONFIG_ATARI_SCSI_RESET_BOOT=y may well be pr

Re: [PATCH 00/71] More fixes, cleanup and modernization for NCR5380 drivers

2015-11-18 Thread Michael Schmitz
Hi Finn, >>> >>> I have compile-tested all patches to all NCR5380 drivers (x86, ARM, >>> m68k) and regression tested mac_scsi and dmx3191d modules on suitable >>> hardware. Testing the mac_scsi and dmx3191d modules provides only >>> limited coverage. It would be good to see some testing of ISA

Re: [PATCH 00/71] More fixes, cleanup and modernization for NCR5380 drivers

2015-11-18 Thread Finn Thain
On Wed, 18 Nov 2015, Ondrej Zary wrote: > On Wednesday 18 November 2015, Finn Thain wrote: > > > Like my previous work on the NCR5380 drivers, this patch series has > > bug fixes, code cleanup and modernization. These drivers suffer from > > mistakes, poor style and neglect and this long serie

Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-18 Thread Michael Ellerman
On Wed, 2015-11-18 at 09:03 -0500, Mark Salter wrote: > On Wed, 2015-11-18 at 20:18 +1100, Michael Ellerman wrote: > > Hi folks, > > > > I'm intermittently seeing the following oops on at least one powerpc box. > > > > The BUG_ON() is from: > > > > static int scsi_init_sgtable(struct request *re

Re: [PATCH v2] Separate target visibility from reaped state information

2015-11-18 Thread Bart Van Assche
On 11/16/2015 10:22 PM, James Bottomley wrote: OK, could you justify this, please ... like with traces and things. [ ... ] If that isn't the case, we can fix it, but I'd like to see the evidence. Hello James, To my own surprise so far I have not yet been able to trigger a lockup without this

[PATCH] IB/srp: Fix a memory leak

2015-11-18 Thread Bart Van Assche
If srp_connect_ch() returns a positive value then that is considered by its caller as a connection failure but this does not result in a scsi_host_put() call and additionally causes the srp_create_target() function to return a positive value while it should return a negative value. Avoid all this c

[PATCH] Fix a memory leak in scsi_host_dev_release()

2015-11-18 Thread Bart Van Assche
Avoid that kmemleak reports the following memory leak if a SCSI LLD calls scsi_host_alloc() and scsi_host_put() but neither scsi_host_add() nor scsi_host_remove(). The following shell command triggers that scenario: for ((i=0; i<2; i++)); do srp_daemon -oac | while read line; do echo $line

Re: [PATCH 1/1] iscsi: fix regression caused by session lock patch

2015-11-18 Thread Mike Christie
On 11/18/15, 5:30 AM, Or Gerlitz wrote: On Mon, Nov 16, 2015 at 7:30 PM, Michael Christie wrote: On Nov 15, 2015, at 4:10 AM, Or Gerlitz wrote: On Fri, Nov 13, 2015 at 6:51 PM, Mike Christie wrote: On 11/13/2015 09:06 AM, Or Gerlitz wrote: After the locking change, adding a task to any of

RE: [PATCH] scsi: hpsa: fix multiple issues in path_info_show

2015-11-18 Thread Don Brace
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > ow...@vger.kernel.org] On Behalf Of Rasmus Villemoes > Sent: Saturday, November 14, 2015 9:24 AM > To: Don Brace > Cc: Joe Handzik; James E.J. Bottomley; Kevin Barnett; Scott Teel; Tomas Henzl; > iss_storage

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-18 Thread Bart Van Assche
On 11/17/2015 11:55 PM, Sagi Grimberg wrote: +static void ib_cq_poll_work(struct work_struct *work) +{ +struct ib_cq *cq = container_of(work, struct ib_cq, work); +int completed; + +completed = __ib_process_cq(cq, IB_POLL_BUDGET_WORKQUEUE); +if (completed >= IB_POLL_BUDGET_WORKQUE

Re: [PATCH v2] qla2xxx: Remove unavailable firmware files

2015-11-18 Thread Martin K. Petersen
> "Himanshu" == Himanshu Madhani writes: Himanshu> Remove firmware binary names for the ISPs, which are not Himanshu> submitted to linux-firmware Queued for 4.5. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

Re: [PATCH] [SCSI] st: Remove obsolete scsi_tape.max_pfn

2015-11-18 Thread Martin K. Petersen
> "Geert" == Geert Uytterhoeven writes: Geert> Its last user was removed 10 years ago, in commit Geert> 8b05b773b6030de5 ("[SCSI] convert st to use scsi_execute_async"). Applied to the 4.5 queue. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the

Re: [PATCH v5 00/32] HiSilicon SAS driver

2015-11-18 Thread Martin K. Petersen
> "John" == John Garry writes: John> This is the driver patchset for the HiSilicon SAS driver. The John> driver is a platform driver. I have staged this driver for 4.5. Changes as a result of Rob's comments to patch 20 should be made as an incremental patch. -- Martin K. Petersen Ora

Re: [PATCH 4/9] srpt: chain RDMA READ/WRITE requests

2015-11-18 Thread Bart Van Assche
On 11/18/2015 01:15 AM, Sagi Grimberg wrote: On 18/11/2015 03:17, Bart Van Assche wrote: On 11/13/2015 05:46 AM, Christoph Hellwig wrote: -ret = ib_post_send(ch->qp, &wr.wr, &bad_wr); -if (ret) -break; +if (i == n_rdma - 1) { +/* only get completi

Re: [PATCH v5 20/32] scsi: hisi_sas: add v1 hw interrupt init

2015-11-18 Thread John Garry
On 18/11/2015 15:26, Rob Herring wrote: On Tue, Nov 17, 2015 at 10:50 AM, John Garry wrote: Add code to interrupts, so now we can get a phy up interrupt when a disk is connected. So I started looking at why you are using of_irq_count which drivers shouldn't need to. In patch 5 you use it to

Re: [PATCH v5 20/32] scsi: hisi_sas: add v1 hw interrupt init

2015-11-18 Thread Rob Herring
On Tue, Nov 17, 2015 at 10:50 AM, John Garry wrote: > Add code to interrupts, so now we can get a phy up > interrupt when a disk is connected. So I started looking at why you are using of_irq_count which drivers shouldn't need to. In patch 5 you use it to allocate memory to store the irq names, t

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-18 Thread Steve Wise
On 11/18/2015 8:06 AM, Christoph Hellwig wrote: On Wed, Nov 18, 2015 at 01:32:19PM +0200, Sagi Grimberg wrote: Christoph, Given the discussion around this patch I think it would be a good idea remove it from the patchset since it's not mandatory for the CQ abstraction. I think that we should ta

Re: [PATCH, resend] scsi: advansys: fix big-endian builds

2015-11-18 Thread Martin K. Petersen
> "Arnd" == Arnd Bergmann writes: Arnd> Building the advansys driver in a big-endian configuration such as Arnd> ARM allmodconfig shows a warning: Applied to 4.4. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

Re: [PATCH] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
Please ignore this one, I sent a V2 On 11/18/2015 02:18 PM, Maurizio Lombardi wrote: > If cdev_add() returns an error, the code calls > cdev_del() passing the STm->cdevs[rew] pointer as parameter; > the problem is that the pointer has not been initialized yet. > > This patch fixes the problem by

[PATCH V2] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
If cdev_add() returns an error, the code calls cdev_del() passing the STm->cdevs[rew] pointer as parameter; the problem is that the pointer has not been initialized yet. This patch fixes the problem by moving the STm->cdevs[rew] pointer initialization before the call to cdev_add(). It also sets ST

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-18 Thread Christoph Hellwig
On Wed, Nov 18, 2015 at 01:32:19PM +0200, Sagi Grimberg wrote: > Christoph, > > Given the discussion around this patch I think it would > be a good idea remove it from the patchset since it's not > mandatory for the CQ abstraction. I think that we should > take it with Steve to come up with a compl

Re: [PATCH 4/9] srpt: chain RDMA READ/WRITE requests

2015-11-18 Thread Christoph Hellwig
On Tue, Nov 17, 2015 at 05:17:35PM -0800, Bart Van Assche wrote: > Chaining RDMA requests is a great idea. But it seems to me that this patch > is based on the assumption that posting multiple RDMA requests either > succeeds as a whole or fails as a whole. Sorry but I'm not sure that the > verbs

Re: [PATCH 6/9] srp: use the new CQ API

2015-11-18 Thread Christoph Hellwig
On Tue, Nov 17, 2015 at 11:56:39AM -0800, Bart Van Assche wrote: > On 11/13/2015 05:46 AM, Christoph Hellwig wrote: >> +static void srp_inv_rkey_done(struct ib_cq *cq, struct ib_wc *wc) >> +{ >> +srp_handle_qp_err(cq, wc, "INV RKEY"); >> +} > > >> [ ... ] > > >> +static void srp_reg_mr_done(str

Re: kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-18 Thread Mark Salter
On Wed, 2015-11-18 at 20:18 +1100, Michael Ellerman wrote: > Hi folks, > > I'm intermittently seeing the following oops on at least one powerpc box. > > The BUG_ON() is from: > > static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer > *sdb) > { > ... > count = bl

Re: [PATCH 5/9] srpt: use the new CQ API

2015-11-18 Thread Christoph Hellwig
On Tue, Nov 17, 2015 at 11:38:48AM -0800, Bart Van Assche wrote: > On 11/13/2015 05:46 AM, Christoph Hellwig wrote: >> [ ... ] > > This patch contains two logical changes: > - Conversion to the new CQ API. > - Removal of the ib_srpt_compl thread. > > Had it been considered to implement these change

Re: [PATCH 2/9] IB: add a proper completion queue abstraction

2015-11-18 Thread Christoph Hellwig
On Tue, Nov 17, 2015 at 09:52:58AM -0800, Bart Van Assche wrote: > On 11/13/2015 05:46 AM, Christoph Hellwig wrote: >> + * context and does not ask from completion interrupts from the HCA. > > Should this perhaps be changed into "for" ? Yes. > >> + */ >> +void

Re: [PATCH 1/9] move blk_iopoll to limit and make it generally available

2015-11-18 Thread Christoph Hellwig
On Tue, Nov 17, 2015 at 09:16:28AM -0800, Bart Van Assche wrote: > How about renaming blk_iopoll into blk_poll ? That way the name still > refers to the block layer. And although the current implementation performs > polling from IRQ context future implementations maybe will allow polling > from

[PATCH] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
If cdev_add() returns an error, the code calls cdev_del() passing the STm->cdevs[rew] pointer as parameter; the problem is that the pointer has not been initialized yet. This patch fixes the problem by moving the STm->cdevs[rew] pointer initialization before the call to cdev_add(). It also sets ST

Re: [PATCH 00/71] More fixes, cleanup and modernization for NCR5380 drivers

2015-11-18 Thread Ondrej Zary
On Wednesday 18 November 2015, Finn Thain wrote: > Like my previous work on the NCR5380 drivers, this patch series has bug > fixes, code cleanup and modernization. These drivers suffer from mistakes, > poor style and neglect and this long series addresses the worst of it, > covering all ten wrapper

Re: [PATCH 3/9] IB: add a helper to safely drain a QP

2015-11-18 Thread Sagi Grimberg
Christoph, Given the discussion around this patch I think it would be a good idea remove it from the patchset since it's not mandatory for the CQ abstraction. I think that we should take it with Steve to come up with a complete solution for this bit. Thoughts? -- To unsubscribe from this list: s

Re: [PATCH 1/1] iscsi: fix regression caused by session lock patch

2015-11-18 Thread Or Gerlitz
On Mon, Nov 16, 2015 at 7:30 PM, Michael Christie wrote: >> On Nov 15, 2015, at 4:10 AM, Or Gerlitz wrote: >> On Fri, Nov 13, 2015 at 6:51 PM, Mike Christie wrote: >>> On 11/13/2015 09:06 AM, Or Gerlitz wrote: >> After the locking change, adding a task to any of the connection >> mgmtqueue, cmd

[PATCH 02/71] ncr5380: Remove redundant static variable initializers

2015-11-18 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 +- drivers/scsi/dtc.c |4 ++-- drivers/scsi/g_NCR5380.c |4 ++-- drivers/scsi/pas16.c | 10 +- drivers/scsi/sun3_scsi.c |8 drivers/scsi/t128.c |4 ++-- 6 files changed, 16 insertions

[PATCH 03/71] ncr5380: Eliminate PDEBUG*, TDEBUG* and DTCDEBUG* macros

2015-11-18 Thread Finn Thain
Replace {P,T,DTC}DEBUG_INIT with NDEBUG_INIT. Remove dead debugging code, including code that's conditional upon *DEBUG_TRANSFER. Signed-off-by: Finn Thain --- drivers/scsi/dtc.c | 18 ++ drivers/scsi/dtc.h | 27 --- drivers/scsi/pas16.c | 21 ++

kernel BUG at drivers/scsi/scsi_lib.c:1096!

2015-11-18 Thread Michael Ellerman
Hi folks, I'm intermittently seeing the following oops on at least one powerpc box. The BUG_ON() is from: static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb) { ... count = blk_rq_map_sg(req->q, req, sdb->table.sgl); BUG_ON(count > sdb->table.ne

[PATCH 04/71] ncr5380: Remove more pointless macros

2015-11-18 Thread Finn Thain
ASM macro is never defined. rtrc in pas16.c is not used. NCR5380_map_config, do_NCR5380_intr, do_t128_intr and do_pas16_intr are unused. NCR_NOT_SET harms readability. Remove them. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.h |3 --- drivers/scsi/g_NCR5380.c | 29 ++-

[PATCH 06/71] ncr5380: Remove NCR5380_instance_name macro

2015-11-18 Thread Finn Thain
This macro makes the code cryptic. Remove it. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 +- drivers/scsi/g_NCR5380.c |7 --- drivers/scsi/g_NCR5380.h |2 -- 3 files changed, 5 insertions(+), 6 deletions(-) Index: linux/drivers/scsi/g_NCR5380.c ==

[PATCH 01/71] atari_scsi: Fix SCSI host ID setting

2015-11-18 Thread Finn Thain
The NVRAM location of this byte is 16, as documented in http://toshyp.atari.org/en/004009.html This was confirmed by Michael Schmitz, by setting the SCSI host ID under EmuTOS and then checking the value in /proc/driver/nvram and /dev/nvram under Linux. Signed-off-by: Finn Thain --- drivers/scs

[PATCH 00/71] More fixes, cleanup and modernization for NCR5380 drivers

2015-11-18 Thread Finn Thain
Like my previous work on the NCR5380 drivers, this patch series has bug fixes, code cleanup and modernization. These drivers suffer from mistakes, poor style and neglect and this long series addresses the worst of it, covering all ten wrapper drivers and both of the core driver forks. The combined

[PATCH 05/71] ncr5380: Remove NCR5380_local_declare and NCR5380_setup macros

2015-11-18 Thread Finn Thain
The NCR5380_local_declare and NCR5380_setup macros exist to define and initialize a particular local variable, to provide the address of the chip registers needed for the driver's implementation of its NCR5380_read/write register access macros. In cumana_1 and macscsi, these macros generate pointl

[PATCH 08/71] ncr5380: Move NCR53C400-specific code

2015-11-18 Thread Finn Thain
Move board-specific code like this, NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE); from the core driver to the board driver. Eliminate the NCR53C400 macro from the core driver. Removal of all macros like this one will be necessary in order to have one core driver that can support all kin

[PATCH 07/71] ncr5380: Split NCR5380_init() into two functions

2015-11-18 Thread Finn Thain
This patch splits the NCR5380_init() function into two parts, similar to the scheme used with atari_NCR5380.c. This avoids two problems. Firstly, NCR5380_init() may perform a bus reset, which would cause the chip to assert IRQ. The chip is unable to mask its bus reset interrupt. Drivers can't call

Re: [PATCH 4/9] srpt: chain RDMA READ/WRITE requests

2015-11-18 Thread Sagi Grimberg
On 18/11/2015 03:17, Bart Van Assche wrote: On 11/13/2015 05:46 AM, Christoph Hellwig wrote: -ret = ib_post_send(ch->qp, &wr.wr, &bad_wr); -if (ret) -break; +if (i == n_rdma - 1) { +/* only get completion event for the last rdma read */ +

[PATCH 10/71] atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOT

2015-11-18 Thread Finn Thain
The atari_NCR5380.c core driver now takes care of bus reset upon driver initialization if required (same as NCR5380.c). Move the Toshiba CD-ROM support into the core driver, enabled with a host flag, so that all NCR5380 drivers can make use of it. Drop the RESET_BOOT macros and the ATARI_SCSI_RESE

[PATCH 12/71] ncr5380: Remove unused hostdata->aborted flag

2015-11-18 Thread Finn Thain
The aborted flag was introduced in v1.1.38 but never used. Remove it. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 -- drivers/scsi/NCR5380.h |1 - drivers/scsi/atari_NCR5380.c |2 -- 3 files changed, 5 deletions(-) Index: linux/drivers/scsi/NCR5380.c ===

[PATCH 11/71] ncr5380: Simplify bus reset handlers

2015-11-18 Thread Finn Thain
Make use of do_reset() in the bus reset handler in atari_NCR5380.c. The version in NCR5380.c already does so. Keep them in sync. Signed-off-by: Finn Thain --- Bus reset handlers in both core drivers still have serious problems for EH purposes. Those problems are addressed later in this series.

[PATCH 09/71] atari_NCR5380: Reset bus on driver initialization if required

2015-11-18 Thread Finn Thain
Merge the bus reset code from NCR5380.c into atari_NCR5380.c. This allows for removal of a lot of duplicated code conditional on the RESET_BOOT macro (in the next patch). The atari_NCR5380.c fork lacks the do_reset() and NCR5380_poll_politely() routines from NCR5380.c, so introduce them. They are

[PATCH 15/71] ncr5380: Always escalate bad target time-out in NCR5380_select()

2015-11-18 Thread Finn Thain
Remove the restart_select and targets_present variables introduced in Linux v1.1.38. The former was used only for a questionable debug printk and the latter "so we can call a select failure a retryable condition". Well, retrying select failure in general is a different problem to a target that does

[PATCH 13/71] ncr5380: Remove redundant register writes

2015-11-18 Thread Finn Thain
Remove the duplicate write to the Select Enable Register that appeared in v1.1.38. Also remove the redundant write to Initiator Command Register prior to calling do_abort(). Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 -- drivers/scsi/atari_NCR5380.c |3 --- 2 files c

[PATCH 16/71] ncr5380: Proceed with next command after NCR5380_select() calls scsi_done

2015-11-18 Thread Finn Thain
If a target disappears from the SCSI bus, NCR5380_select() may subsequently fail with a time-out. In this situation, scsi_done is called and NCR5380_select() returns 0. Both hostdata->connected and hostdata->selecting are NULL and the main loop should proceed with the next command in the issue queu

[PATCH 14/71] ncr5380: Use return instead of goto in NCR5380_select()

2015-11-18 Thread Finn Thain
The "failed" label in NCR5380_select() is not helpful. Some failures return 0, others -1. Use return instead of goto to improve clarity and brevity, like atari_NCR5380.c does. Fix the relevant comments. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 30 --

[PATCH 17/71] ncr5380: Keep BSY asserted when entering SELECTION phase

2015-11-18 Thread Finn Thain
NCR5380.c is not compliant with the SCSI-2 standard (at least, not with the draft revision 10L that I have to refer to). The selection algorithm in atari_NCR5380.c is correct, so use that. Signed-off-by: Finn Thain --- The NCR 5380 Family datasheet has a flow chart to support this. Please see h

[PATCH 18/71] ncr5380: Eliminate USLEEP_WAITLONG delay

2015-11-18 Thread Finn Thain
Linux 2.1.105 introduced the USLEEP_WAITLONG delay, apparently "needed for Mustek scanners". It is intended to stall the issue queue for 5 seconds. There are a number of problems with this. 1. Only g_NCR5380 enables the delay, which implies that the other five drivers using the NCR5380.c core d

[PATCH 20/71] ncr5380: Introduce unbound workqueue

2015-11-18 Thread Finn Thain
Allocate a work queue that will permit busy waiting and sleeping. This means NCR5380_init() can potentially fail, so add this error path. Signed-off-by: Finn Thain --- In subsequent patches, the work function adopts this work queue so it can sleep while polling, which allows the removal of some

[PATCH 22/71] ncr5380: Eliminate selecting state

2015-11-18 Thread Finn Thain
Linux v2.1.105 changed the algorithm for polling for the BSY signal in NCR5380_select() and NCR5380_main(). Presently, this code has a bug. Back then, NCR5380_set_timer(hostdata, 1) meant reschedule main() after sleeping for 10 ms. Repeated 25 times this provided the recommended 250 ms selection t

[PATCH 21/71] ncr5380: Sleep when polling, if possible

2015-11-18 Thread Finn Thain
When in process context, sleep during polling if doing so won't add significant latency. In interrupt context or if the lock is held, poll briefly then give up. Keep both core drivers in sync. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 73 +---

[PATCH 28/71] ncr5380: Drop DEF_SCSI_QCMD macro

2015-11-18 Thread Finn Thain
Remove the DEF_SCSI_QCMD macro (already removed from atari_NCR5380.c). The lock provided by DEF_SCSI_QCMD is only needed for queue data structures. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 30 +++--- drivers/scsi/atari_NCR5380.c |2 +- 2 files c

[PATCH 19/71] ncr5380: Cleanup bogus {request,release}_region() calls

2015-11-18 Thread Finn Thain
Commit 8b801ead3d7a ("[ARM] rpc: update Acorn SCSI drivers to modern ecard interfaces") neglected to remove a request_region() call in cumana_1.c. Commit eda32612f7b2 ("[PATCH] give all LLDD driver a ->release method") in history/history.git added some pointless release_region() calls in dtc.c, pa

[PATCH 25/71] ncr5380: Rework disconnect versus poll logic

2015-11-18 Thread Finn Thain
The atari_NCR5380.c and NCR5380.c core drivers differ in their handling of target disconnection. This is partly because atari_NCR5380.c had all of the polling and sleeping removed to become entirely interrupt-driven, and it is partly because of damage done to NCR5380.c after atari_NCR5380.c was for

[PATCH 23/71] ncr5380: Always retry arbitration and selection

2015-11-18 Thread Finn Thain
If NCR5380_select() returns -1, it means arbitration was lost or selection failed and should be retried. If the main loop simply terminates when there are still commands on the issue queue, they will remain queued until they expire. Fix this by clearing the 'done' flag after selection failure or l

[PATCH 27/71] ncr5380: Add missing lock in eh_abort_handler

2015-11-18 Thread Finn Thain
The host spin lock needs to be acquired by NCR5380_abort() before it calls NCR5380_select(). This patch doesn't actually fix the EH issues in this driver but it does avoid this: BUG: spinlock already unlocked on CPU#0, kworker/u4:1/14 lock: 0xc0c0f834, .magic: dead4ead, .owner: /-1, .owner_cpu: -

[PATCH 29/71] ncr5380: Remove references to linked commands

2015-11-18 Thread Finn Thain
From: Hannes Reinecke Some old drivers partially implemented support for linked commands using a "proposed" next_link pointer in struct scsi_cmnd that never actually existed. Remove this code. Signed-off-by: Finn Thain --- This is a modified version of Hannes' patch so I have dropped his sign

[PATCH 32/71] ncr5380: Fix bus phase in do_abort()

2015-11-18 Thread Finn Thain
NCR5380_poll_politely() returns either 0 (success) or -ETIMEDOUT. However, in do_abort(), the return value is incorrectly taken to be the status register value. This means that the bus is put into DATA OUT phase instead of MESSAGE OUT. Fix this. Signed-off-by: Finn Thain --- drivers/scsi/NCR538

[PATCH 33/71] atari_NCR5380: Set do_abort() timeouts

2015-11-18 Thread Finn Thain
Use timeouts in do_abort() in atari_NCR5380.c instead of infinite loops. Also fix the kernel-doc comment. Keep the two core driver forks in sync. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 26 +- drivers/scsi/atari_NCR5380.c | 34 +++

[PATCH 30/71] ncr5380: Add missing break after case MESSAGE_REJECT

2015-11-18 Thread Finn Thain
MESSAGE REJECT does not imply DISCONNECT: the target is about to enter MESSAGE IN or MESSAGE OUT phase. This bug fix comes from atari_NCR5380.c. Unfortunately it never made it into the original NCR5380.c core driver. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |1 + 1 file changed

[PATCH 31/71] ncr5380: Fix !REQ timeout in do_abort()

2015-11-18 Thread Finn Thain
NCR5380_poll_politely() never returns -1. That means do_abort() can fail to handle a timeout after waiting for the target to negate REQ. Fix this and cleanup other NCR5380_poll_politely() call sites. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 10 +- 1 file changed, 5 inser

[PATCH 38/71] ncr5380: Remove UNSAFE macro

2015-11-18 Thread Finn Thain
Configuring core drivers using macros like this one prevents re-unifying the core driver forks, and prevents implementing the core driver as a library or a platform driver. The UNSAFE macro in particular is a poor workaround for the problem of interrupt latency. Releasing the locks complicates thi

[PATCH 34/71] atari_NCR5380: Use arbitration timeout

2015-11-18 Thread Finn Thain
Allow target selection to fail with a timeout instead of waiting in infinite loops. This gets rid of the unused NCR_TIMEOUT macro, it is more defensive and has proved helpful in debugging. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 44 ++--- drive

[PATCH 37/71] ncr5380: Standardize work queueing algorithm

2015-11-18 Thread Finn Thain
The complex main_running/queue_main mechanism is peculiar to atari_NCR5380.c. It isn't SMP safe and offers little value given that the work queue already offers concurrency management. Remove this complexity to bring atari_NCR5380.c closer to NCR5380.c. It is not a good idea to call the informatio

[PATCH 35/71] ncr5380: Dont wait for BUS FREE after disconnect

2015-11-18 Thread Finn Thain
When there is a queued command and no connected command, NCR5380_select() is called and arbitration begins. The chip waits for BUS FREE once the MR_ARBITRATE bit in the mode register is enabled. That means there is no need to wait for BUS FREE after disconnecting. There is presently no polling for

[PATCH 36/71] ncr5380: Use work_struct instead of delayed_work

2015-11-18 Thread Finn Thain
Each host instance now has it's own work queue so the main() work item can sleep when necessary. That means we can use a simple work item rather than a delayed work item. This brings NCR5380.c closer to atari_NCR5380.c. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 12 +--- d

[PATCH 41/71] ncr5380: Replace redundant flags with FLAG_NO_DMA_FIXUP

2015-11-18 Thread Finn Thain
The flags DMA_WORKS_RIGHT, FLAG_NCR53C400 and FLAG_HAS_LAST_BYTE_SENT all mean the same thing, i.e. the chip is not a 538[01]. (More recent devices such as the 53C80 have a 'Last Byte Sent' bit in the Target Command Register as well as other fixes for End-of-DMA errata.) These flags have no additi

[PATCH 39/71] ncr5380: Standardize interrupt handling

2015-11-18 Thread Finn Thain
Because interrupt handling is crucial to the core driver(s), all wrapper drivers need to agree on this code. This patch removes discrepancies. NCR5380_intr() in NCR5380.c has the following pointless loop that differs from the code in atari_NCR5380.c. done = 1; do {

[PATCH 26/71] ncr5380: Fix NCR5380_transfer_pio() result

2015-11-18 Thread Finn Thain
According to the SCSI-2 draft revision 10L, atari_NCR5380.c is correct when it says that the phase lines are valid up until ACK is negated following the transmission of the last byte in MESSAGE IN phase. This is true for all information transfer phases, from target to initiator. Sample the phase b

[PATCH 44/71] ncr5380: Fix off-by-one bug in extended_msg[] bounds check

2015-11-18 Thread Finn Thain
Fix the array bounds check when transferring an extended message from the target. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |3 ++- drivers/scsi/atari_NCR5380.c |4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) Index: linux/drivers/scsi/NCR5380.c ==

[PATCH 43/71] ncr5380: Standardize reselection handling

2015-11-18 Thread Finn Thain
Bring the two NCR5380_reselect() implementations into agreement. Replace infinite loops in atari_NCR5380.c with timeouts, as per NCR5380.c. Remove 'abort' flag in NCR5380.c as per atari_NCR5380.c -- if reselection fails, there may be no MESSAGE IN phase so don't attempt data transfer. During sel

[PATCH 40/71] ncr5380: Introduce NCR5380_poll_politely2

2015-11-18 Thread Finn Thain
SCSI bus protocol sometimes requires monitoring two related conditions simultaneously. Enhance NCR5380_poll_politely() for this purpose, and put it to use in the arbitration algorithm. It will also find use in pseudo DMA. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 68 +++

[PATCH 24/71] ncr5380: Implement NCR5380_dma_xfer_len and remove LIMIT_TRANSFERSIZE macro

2015-11-18 Thread Finn Thain
Follow the example of the atari_NCR5380.c core driver and adopt the NCR5380_dma_xfer_len() hook. Implement NCR5380_dma_xfer_len() for dtc.c and g_NCR5380.c to take care of the limitations of these cards. Keep the default for drivers using PSEUDO_DMA. Eliminate the unused macro LIMIT_TRANSFERSIZE.

[PATCH 42/71] ncr5380: Replace READ_OVERRUNS macro with FLAG_NO_DMA_FIXUPS

2015-11-18 Thread Finn Thain
The workarounds for chip errata appear twice, in slightly different forms. One is used when defined(REAL_DMA) || defined(REAL_DMA_POLL), the other when defined(PSEUDO_DMA). In the PDMA case, the workarounds have been made conditional on FLAG_NO_DMA_FIXUPS. Do the same for the DMA case, to eliminate

[PATCH 66/71] ncr5380: Fix soft lockups

2015-11-18 Thread Finn Thain
When exercising dmx3191d using sequential IO from dd, the driver is sent 512 KiB WRITE commands and 128 KiB READs. For a PIO transfer, the rate is is only about 300 KiB/s, so these are long-running commands. Because of the rudimentary design of the chip, it is necessary to poll the SCSI bus signal

[PATCH 67/71] ncr5380: Cleanup comments

2015-11-18 Thread Finn Thain
The CVS revision log is not nearly as useful as the history/history.git repo, so remove it. Roman's commentary at the top of his driver repeats the same information elsewhere in the file so remove it. Also remove some other redundant or obsolete comments. Both the driver and the datasheets confusi

[PATCH 64/71] atari_NCR5380: Eliminate HOSTNO macro

2015-11-18 Thread Finn Thain
Keep the two core driver forks in sync. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 71 +++-- drivers/scsi/atari_NCR5380.c | 102 +++ 2 files changed, 84 insertions(+), 89 deletions(-) Index: linux/drivers/scsi

[PATCH 65/71] atari_scsi, sun3_scsi: Remove global Scsi_Host pointer

2015-11-18 Thread Finn Thain
This refactoring removes two global Scsi_Host pointers. This improves consistency with other ncr5380 drivers. Adopting the same conventions as the other drivers makes them easier to read. Signed-off-by: Finn Thain --- drivers/scsi/atari_NCR5380.c |5 +- drivers/scsi/atari_scsi.c| 29 +

[PATCH 71/71] ncr5380: Cleanup whitespace and parentheses

2015-11-18 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 30 +++--- drivers/scsi/atari_NCR5380.c | 26 +- 2 files changed, 32 insertions(+), 24 deletions(-) Index: linux/drivers/scsi/NCR5380.c ==

[PATCH 68/71] ncr5380: Fix whitespace issues using regexp

2015-11-18 Thread Finn Thain
This patch is just the result of two substitutions. The first removes any tabs and spaces at the end of the line. The second replaces runs of tabs and spaces at the beginning of comment lines with a single space. perl -i -pe 's,[\t ]+$,,; s,^(\t*[/ ]\*)[ \t]+,$1 ,' drivers/scsi/{atari_,}NCR5380.c

[PATCH 69/71] ncr5380: Merge changes from atari_NCR5380.c

2015-11-18 Thread Finn Thain
In the past, NCR5380.c was overlooked by those working on atari_NCR5380.c and this caused needless divergence. All of the changes in this patch were taken from atari_NCR5380.c. This removes some unimportant discrepancies between the two core driver forks so that 'diff' can be used to reveal the im

[PATCH 56/71] ncr5380: Remove redundant volatile qualifiers

2015-11-18 Thread Finn Thain
The hostdata struct is now protected by a spin lock so the volatile qualifiers are redundant. Remove them. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.h | 12 ++-- drivers/scsi/atari_NCR5380.c |2 +- 2 files changed, 7 insertions(+), 7 deletions(-) Index: linux/drive

[PATCH 50/71] ncr5380: Change instance->host_lock to hostdata->lock

2015-11-18 Thread Finn Thain
NCR5380.c presently uses the instance->host_lock spin lock. Convert this to a new spin lock that protects the NCR5380_hostdata struct. atari_NCR5380.c previously used local_irq_save/restore() rather than a spin lock. Convert this to hostdata->lock in irq mode. For SMP platforms, the interrupt hand

[PATCH 70/71] atari_NCR5380: Merge changes from NCR5380.c

2015-11-18 Thread Finn Thain
In the past, atari_NCR5380.c was overlooked by those working on NCR5380.c and this caused needless divergence. All of the changes in this patch were taken from NCR5380.c. This removes some unimportant discrepancies between the two core driver forks so that 'diff' can be used to reveal the importan

  1   2   >