crypto/nx842: Ignore queue overflow informative error

2015-12-05 Thread Haren Myneni
NX842 coprocessor sets bit 3 if queue is overflow. It is just for information to the user. So the driver prints this informative message and ignores it. Signed-off-by: Haren Myneni diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h index 9f8402b..d1a2a2d 100644

Re: [PATCH RESEND] fm10k:Fix error handling in the function fm10k_resume

2015-12-05 Thread Jeff Kirsher
On Sat, 2015-12-05 at 21:36 -0500, Nicholas Krause wrote: > This fixes error handling to proper check if the call to the function > fm10k_mbx_request_irq has failed by returning a error code and if > so return immediately to the caller of fm10k_resume to properly > signal a failure has occurred whe

Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-05 Thread Sanidhya Solanki
I disagree with the output of the automaton. Included below are my compile checks before and after the patch. The output has been scrubbed to remove information about my file layout. -- [~ linux]$ git branch -v master 31ade3b Linux

RE: [PATCH V4 net-next 4/5] net:hns: Add support of ethtool TSO set option for Hip06 in HNS

2015-12-05 Thread Yuval Mintz
> > Isn't AE_VERSION_1 something fixed once you publish your features? > > If it can't be changed, why not simply remove the features from > > `hw_features' instead of having to implement this ndo? > There could be a case where the feature is supported by the SoC > and therefore it is already part

[PATCH] MAINTAINERS: Add Guenter Roeck as reviewer of watchdog drivers

2015-12-05 Thread Guenter Roeck
I have been reviewing watchdog drivers for years, so we might as well make it official. Signed-off-by: Guenter Roeck --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index cba790b42f23..b1e3da7dc393 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11602

[PATCH] brcm80211: fix compare_const_fl.cocci warnings

2015-12-05 Thread Julia Lawall
Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- Minor point. But in my opinion, it would look a little nicer to have the thing acted on (code[...]) come first. channel.

[GIT PULL] SCSI fixes for 4.4-rc3

2015-12-05 Thread James Bottomley
This is quite a bumper crop of fixes: Three from Arnd correcting various build issues in some configurations, a lock recursion in qla2xxx. Two potentially exploitable issues in hpsa and mvsas, a potential null deref in st, A revert of a bdi registration fix that turned out to cause even more prob

Re: Possible issue with commit 4961b6e11825?

2015-12-05 Thread Paul E. McKenney
On Sun, Dec 06, 2015 at 08:06:47AM +0530, Viresh Kumar wrote: > On 05-12-15, 11:01, Paul E. McKenney wrote: > > And it was getting lucky. In a set of 24 two-hour runs (triple parallel) > > on an earlier commit (not 3497d206c4d9, no clue what I was thinking) got > > me two failed runs, for a total

Re: [PATCH 1/2] add new platform driver for PCI RC

2015-12-05 Thread kbuild test robot
Hi Joao, [auto build test ERROR on arc/for-next] [also build test ERROR on v4.4-rc3 next-20151203] url: https://github.com/0day-ci/linux/commits/Joao-Pinto/adding-PCI-support-to-AXS10x/20151124-223533 base: https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc for-next config: microbla

undefined reference to `nf_conntrack_untracked'

2015-12-05 Thread kbuild test robot
Hi Pablo, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: a2dbb7b56f2c29fc78b18a3fbe47ad80f6912092 commit: bbde9fc1824aab58bc78c084163007dd6c03fe5b netfilter: factor out packet duplication for IPv4/IPv6 date: 4 mo

[PATCH LINUX v4 13/13] tty: xuartps: Remove '_OFFSET' suffix from #defines

2015-12-05 Thread Soren Brinkmann
Remove the _OFFSET suffix from all register defines which makes code a little easier to read and avoids a few line breaks. Suggested-by: Peter Hurley Signed-off-by: Soren Brinkmann --- v4: - added this patch --- drivers/tty/serial/xilinx_uartps.c | 221 ++--- 1

[PATCH LINUX v4 03/13] tty: xuartps: Don't consider circular buffer when enabling transmitter

2015-12-05 Thread Soren Brinkmann
Restarting the transmitter even if the circ buffer is empty may be necessary to push out remaining data when the port is restarted after being stopped. Cc: Peter Hurley Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley --- v3: - changed this patch to not always enable the transmitter, b

[PATCH LINUX v4 05/13] tty: xuartps: Improve startup function

2015-12-05 Thread Soren Brinkmann
The startup function is supposed to initialize the UART for receiving. Hence, don't enable the TX part. Also, protect HW accesses with the port lock. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley --- drivers/tty/serial/xilinx_uartps.c | 20 1 file changed, 12 ins

[PATCH LINUX v4 11/13] tty: xuartps: Cleanup: Reformat if-else

2015-12-05 Thread Soren Brinkmann
Convert an if-else into the more common early return on error, reducing the indent level of the happy path. Signed-off-by: Soren Brinkmann --- drivers/tty/serial/xilinx_uartps.c | 124 ++--- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/t

[PATCH LINUX v4 04/13] tty: xuartps: Clear interrupt status register in shutdown

2015-12-05 Thread Soren Brinkmann
When shutting down the UART, clear the interrupt status register. Bits in the ISR are cleared by writing them as '1'. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley Reviewed-by: Moritz Fischer --- v4: - clarify workings of the ISR in the commit message --- drivers/tty/serial/xilinx_

[PATCH LINUX v4 01/13] tty: xuartps: Beautify read-modify writes

2015-12-05 Thread Soren Brinkmann
Non-functional, formatting changes to ease reading the code. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley Reviewed-by: Moritz Fischer --- drivers/tty/serial/xilinx_uartps.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/xilinx

[PATCH LINUX v4 00/13] tty: xuartps: Fix lock ups

2015-12-05 Thread Soren Brinkmann
Hi, I picked up all the review tags from Peter and Moritz and addressed Peter's comments. Most patches are unchanged but I added the info Peter suggested/provided to some commit messages. The patches "tty: xuartps: Move request_irq to after setting up the HW", "tty: xuartps: Improve sysrq handling

[PATCH LINUX v4 02/13] tty: xuartps: Use spinlock to serialize HW access

2015-12-05 Thread Soren Brinkmann
Instead of disabling the IRQ, use the spin lock to serialize accesses to the HW. This protects the driver from interference of non-IRQ callbacks with each other and makes the driver more consistent in its serialization method. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley --- drivers

[PATCH LINUX v4 09/13] tty: xuartps: Move RX path into helper function

2015-12-05 Thread Soren Brinkmann
Move RX-related IRQ handling into a helper function. Fixes a problem where every char received after a parity or frame error in the current isr will also be tagged as a parity or frame error. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley --- v4: - added Peter's additional information

[PATCH LINUX v4 08/13] tty: xuartps: Acquire port lock for shutdown

2015-12-05 Thread Soren Brinkmann
Shutting down the UART port can happen while console operations are in progress. Holding the port lock serializes these operations and avoids the UART HW to be disabled in the middle of console prints. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley --- drivers/tty/serial/xilinx_uartps

[PATCH LINUX v4 12/13] tty: xuartps: Improve sysrq handling

2015-12-05 Thread Soren Brinkmann
Handling magic sysrq included dropping a lock to avoid a deadlock that happened when cdns_uart_console_write tried to acquire a lock in the from the sysrq code path. By making the acquisition of the lock in cdns_uart_console_write depending on port->sysrq, cdns_uart_handle_rx can be simplified to s

[PATCH LINUX v4 06/13] tty: xuartps: Move request_irq to after setting up the HW

2015-12-05 Thread Soren Brinkmann
Request_irq() should be _after_ h/w programming, otherwise an interrupt could be triggered and in-progress before the h/w has been setup. Reported-by: Peter Hurley Signed-off-by: Soren Brinkmann --- v4: - this patch has been added. Thanks to Peter for pointing it out and providing commit mes

[PATCH LINUX v4 07/13] tty: xuartps: Keep lock for whole ISR

2015-12-05 Thread Soren Brinkmann
The RX path in the interrupt handler released a lock unnecessarily. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Hurley --- drivers/tty/serial/xilinx_uartps.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index

[PATCH LINUX v4 10/13] tty: xuartps: Refactor IRQ handling

2015-12-05 Thread Soren Brinkmann
The system could deadlock handling RX IRQs when RX-related IRQ conditions became true while the receiver was disabled. To avoid this, enable/disable the RX/TX IRQs together with the receiver/transmitter. Signed-off-by: Soren Brinkmann --- drivers/tty/serial/xilinx_uartps.c | 18 -

Re: [RFC] User space to kernel space copy optimization

2015-12-05 Thread Sinan Kaya
On 12/5/2015 3:10 AM, Vinod Koul wrote: > On Mon, Nov 16, 2015 at 04:53:27PM -0500, Sinan Kaya wrote: >> One of the things I'm interested in is to use a memcpy capable DMA >> engine HW to optimize user space and kernel space parameter copying. >> >> Of course, this will not be viable for all parame

Re: [tpmdd-devel] [PATCH v2 0/3] tpm_tis: Clean up force module parameter

2015-12-05 Thread Jarkko Sakkinen
On Sun, Dec 06, 2015 at 06:15:44AM +0200, Jarkko Sakkinen wrote: > On Sun, Dec 06, 2015 at 06:02:26AM +0200, Jarkko Sakkinen wrote: > > On Thu, Dec 03, 2015 at 11:19:32AM -0700, Jason Gunthorpe wrote: > > > On Thu, Dec 03, 2015 at 08:00:42AM +0200, Jarkko Sakkinen wrote: > > > > > > > I guess it'd

Re: [PATCH v2] PCI/AER: enable SERR# forwarding for bridges and switches

2015-12-05 Thread Sinan Kaya
On 12/4/2015 4:06 PM, Bjorn Helgaas wrote: > I'm sitting on this for the moment because if you have _HPP, it seems > like that should be enough to get SERR# forwarding turned on, and if > it's not, I'd like to understand why. So no hurry, but I'm waiting on > your investigation. > > Bjorn OK. I'

Re: [tpmdd-devel] [PATCH v2 0/3] tpm_tis: Clean up force module parameter

2015-12-05 Thread Jarkko Sakkinen
On Sun, Dec 06, 2015 at 06:02:26AM +0200, Jarkko Sakkinen wrote: > On Thu, Dec 03, 2015 at 11:19:32AM -0700, Jason Gunthorpe wrote: > > On Thu, Dec 03, 2015 at 08:00:42AM +0200, Jarkko Sakkinen wrote: > > > > > I guess it'd be more realiable. In my NUC the current fix works and the > > > people wh

Re: [PATCH v8] i40e: Look up MAC address in Open Firmware or IDPROM

2015-12-05 Thread David Miller
From: Sowmini Varadhan Date: Sat, 5 Dec 2015 15:33:00 -0500 > +static void i40e_get_platform_mac_addr(struct pci_dev *pdev, struct i40e_pf > *pf) > +{ > + struct device_node *dp = pci_device_to_OF_node(pdev); > + const unsigned char *addr; > + u8 *mac_addr = pf->hw.mac.addr; > + > +

[PATCH v2 04/72] ncr5380: Remove more pointless macros

2015-12-05 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 Reviewed-by: Hannes Reinecke --- drivers/scsi/NCR5380.h |3 --- drivers/scsi/g_NC

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

2015-12-05 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 Reviewed-by: Hannes Reinecke --- drivers/scsi/dtc.c | 18 ++ drivers/scsi/dtc.h | 27 ---

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

2015-12-05 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 v2 07/72] ncr5380: Split NCR5380_init() into two functions

2015-12-05 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

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

2015-12-05 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 v2 10/72] atari_NCR5380: Remove RESET_BOOT, CONFIG_ATARI_SCSI_TOSHIBA_DELAY and CONFIG_ATARI_SCSI_RESET_BOOT

2015-12-05 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 v2 11/72] ncr5380: Simplify bus reset handlers

2015-12-05 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 Reviewed-by: Hannes Reinecke --- Bus reset handlers in both core drivers still have serious problems for EH purposes. Those problems are ad

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

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

[PATCH v2 13/72] ncr5380: Remove redundant register writes

2015-12-05 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 Reviewed-by: Hannes Reinecke --- drivers/scsi/NCR5380.c |2 -- drivers/scsi/atari_N

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

2015-12-05 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 v2 16/72] ncr5380: Proceed with next command after NCR5380_select() calls scsi_done

2015-12-05 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 v2 14/72] ncr5380: Use return instead of goto in NCR5380_select()

2015-12-05 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 Reviewed-by: Hannes Reinecke --- drivers/scsi/NCR5380.c |

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

2015-12-05 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 Reviewed-by: Hann

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

2015-12-05 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 v2 19/72] ncr5380: Cleanup bogus {request,release}_region() calls

2015-12-05 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

Re: [tpmdd-devel] [PATCH v2 0/3] tpm_tis: Clean up force module parameter

2015-12-05 Thread Jarkko Sakkinen
On Thu, Dec 03, 2015 at 11:19:32AM -0700, Jason Gunthorpe wrote: > On Thu, Dec 03, 2015 at 08:00:42AM +0200, Jarkko Sakkinen wrote: > > > I guess it'd be more realiable. In my NUC the current fix works and the > > people who tested it. If you supply me a fix that changes it to use that > > I can t

[PATCH v2 18/72] ncr5380: Eliminate USLEEP_WAITLONG delay

2015-12-05 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 v2 20/72] ncr5380: Introduce unbound workqueue

2015-12-05 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 v2 23/72] ncr5380: Always retry arbitration and selection

2015-12-05 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 v2 21/72] ncr5380: Sleep when polling, if possible

2015-12-05 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. Calibrate busy-wait iterations to allow for variation in chip register access times between different 538

[PATCH v2 22/72] ncr5380: Eliminate selecting state

2015-12-05 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 v2 24/72] ncr5380: Implement NCR5380_dma_xfer_len and remove LIMIT_TRANSFERSIZE macro

2015-12-05 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 v2 02/72] ncr5380: Remove redundant static variable initializers

2015-12-05 Thread Finn Thain
Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke --- 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 ++--

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

2015-12-05 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 v2 27/72] ncr5380: Add missing lock in eh_abort_handler

2015-12-05 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 v2 26/72] ncr5380: Fix NCR5380_transfer_pio() result

2015-12-05 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 v2 29/72] ncr5380: Remove references to linked commands

2015-12-05 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 v2 28/72] ncr5380: Drop DEF_SCSI_QCMD macro

2015-12-05 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 v2 31/72] ncr5380: Fix !REQ timeout in do_abort()

2015-12-05 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 v2 30/72] ncr5380: Add missing break after case MESSAGE_REJECT

2015-12-05 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 v2 34/72] atari_NCR5380: Use arbitration timeout

2015-12-05 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 v2 32/72] ncr5380: Fix bus phase in do_abort()

2015-12-05 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 v2 08/72] ncr5380: Move NCR53C400-specific code

2015-12-05 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 v2 35/72] ncr5380: Dont wait for BUS FREE after disconnect

2015-12-05 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 v2 33/72] atari_NCR5380: Set do_abort() timeouts

2015-12-05 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 v2 36/72] ncr5380: Use work_struct instead of delayed_work

2015-12-05 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 v2 39/72] ncr5380: Standardize interrupt handling

2015-12-05 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 v2 38/72] ncr5380: Remove UNSAFE macro

2015-12-05 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 v2 37/72] ncr5380: Standardize work queueing algorithm

2015-12-05 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 v2 45/72] ncr5380: Cleanup #include directives

2015-12-05 Thread Finn Thain
Remove unused includes (stat.h, signal.h, proc_fs.h) and move includes needed by the core drivers into the common header (delay.h etc). Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 -- drivers/scsi/NCR5380.h |4 drivers/scsi/arm/cumana_1.c |4 drive

[PATCH v2 40/72] ncr5380: Introduce NCR5380_poll_politely2

2015-12-05 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 | 66 +++

[PATCH v2 06/72] ncr5380: Remove NCR5380_instance_name macro

2015-12-05 Thread Finn Thain
This macro makes the code cryptic. Remove it. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke --- 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/

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

2015-12-05 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 v2 43/72] ncr5380: Standardize reselection handling

2015-12-05 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 v2 46/72] ncr5380: Fix NDEBUG_NO_DATAOUT flag

2015-12-05 Thread Finn Thain
NDEBUG_NO_DATAOUT should not disable DATA IN phases too. Fix this. (This bug has long been fixed in atari_NCR5380.c.) Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/drivers/scsi/NCR5380.c ==

[PATCH v2 48/72] atari_NCR5380: Fix queue_size limit

2015-12-05 Thread Finn Thain
When a target reports a QUEUE_FULL condition it causes the driver to update the 'queue_size' limit with the number of currently allocated tags. At least, that's what's supposed to happen, according to the comments. Unfortunately the terms in the assignment are swapped. Fix this and cleanup some obs

[PATCH v2 47/72] ncr5380: Fix and cleanup scsi_host_template initializers

2015-12-05 Thread Finn Thain
Add missing .module initializer. Use distinct .proc_name values for the g_NCR5380 and g_NCR5380_mmio modules. Remove pointless CAN_QUEUE and CMD_PER_LUN override macros. Cleanup whitespace and code style. Signed-off-by: Finn Thain --- drivers/scsi/atari_scsi.c |2 +- drivers/scsi/dmx3191d.c

[PATCH v2 53/72] ncr5380: Use shost_priv helper

2015-12-05 Thread Finn Thain
Make use of the shost_priv() helper. Remove HOSTDATA and SETUP_HOSTDATA macros because they harm readability. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 23 ++- drivers/scsi/atari_NCR5380.c | 20 +++- 2 files changed, 17 insertions(+), 2

[PATCH v2 49/72] ncr5380: Remove redundant ICR_ARBITRATION_LOST test and eliminate FLAG_DTC3181E

2015-12-05 Thread Finn Thain
Remove FLAG_DTC3181E. It was used to suppress a final Arbitration Lost (SEL asserted) test that isn't actually needed. The test was suppressed because it causes problems for DTC436 and DTC536 chips. It takes place after the host wins arbitration, so SEL has been asserted. These chips can't seem to

[PATCH v2 51/72] ncr5380: Remove command list debug code

2015-12-05 Thread Finn Thain
Some NCR5380 hosts offer a .show_info method to access the contents of the various command list data structures from a procfs file. When NDEBUG is set, the same information is sent to the console during EH. The two core drivers, atari_NCR5380.c and NCR5380.c differ here. Because it is just for deb

[PATCH v2 52/72] ncr5380: Remove H_NO macro and introduce dsprintk

2015-12-05 Thread Finn Thain
Replace all H_NO and some HOSTNO macros (both peculiar to atari_NCR5380.c) with a new dsprintk macro that's more useful and more consistent. The new macro avoids a lot of boilerplate in new code in subsequent patches. Keep NCR5380.c in sync. Remaining HOSTNO macros are removed as side-effects of su

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

2015-12-05 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 v2 55/72] ncr5380: Remove LIST and REMOVE macros

2015-12-05 Thread Finn Thain
Printing command pointers can be useful when debugging queues. Other than that, the LIST and REMOVE macros are just clutter. These macros are redundant now that NDEBUG_QUEUES causes pointers to be printed, so remove them. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 19 ---

[PATCH v2 56/72] ncr5380: Remove redundant volatile qualifiers

2015-12-05 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 v2 41/72] ncr5380: Replace redundant flags with FLAG_NO_DMA_FIXUP

2015-12-05 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 v2 54/72] ncr5380: Use dsprintk() for queue debugging

2015-12-05 Thread Finn Thain
Print the command pointers in the log messages for debugging queue data structures. The LIST and REMOVE macros can then be removed. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 36 drivers/scsi/atari_NCR5380.c | 43 +++

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

2015-12-05 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 v2 66/72] ncr5380: Fix soft lockups

2015-12-05 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 v2 64/72] atari_NCR5380: Eliminate HOSTNO macro

2015-12-05 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 v2 59/72] ncr5380: Fix autosense bugs

2015-12-05 Thread Finn Thain
NCR5380_information_transfer() may re-queue a command for autosense, after calling scsi_eh_prep_cmnd(). This creates several possibilities: 1. Reselection may intervene before the re-queued command gets processed. If the reconnected command then undergoes autosense, this causes the scsi_eh_s

[PATCH v2 61/72] ncr5380: Fix EH during arbitration and selection

2015-12-05 Thread Finn Thain
During arbitration and selection, the relevant command is invisible to exception handlers and can be found only in a pointer on the stack of a different thread. When eh_abort_handler can't find a given command, it can't decide whether that command was completed already or is still in arbitration o

Re: rhashtable: Use __vmalloc with GFP_ATOMIC for table allocation

2015-12-05 Thread David Miller
From: Herbert Xu Date: Sat, 5 Dec 2015 15:03:54 +0800 > Sorry Dave but you'll have to revert this because I've been able > to trigger the following crash with the patch: > > Testing concurrent rhashtable access from 50 threads > [ cut here ] > kernel BUG at ../mm/vmalloc.

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

2015-12-05 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 v2 57/72] ncr5380: Use standard list data structure

2015-12-05 Thread Finn Thain
The NCR5380 drivers have a home-spun linked list implementation for scsi_cmnd structs that uses cmd->host_scribble as a 'next' pointer. Adopt the standard list_head data structure and list operations instead. Remove the eh_abort_handler rather than convert it. Doing the conversion would only be chu

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

2015-12-05 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 v2 70/72] atari_NCR5380: Merge changes from NCR5380.c

2015-12-05 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

[PATCH v2 67/72] ncr5380: Cleanup comments

2015-12-05 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 v2 68/72] ncr5380: Fix whitespace issues using regexp

2015-12-05 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 v2 65/72] atari_scsi, sun3_scsi: Remove global Scsi_Host pointer

2015-12-05 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 v2 72/72] ncr5380: Fix pseudo DMA transfers on 53C400

2015-12-05 Thread Finn Thain
From: Ondrej Zary Pseudo-DMA (PDMA) has been broken for ages, resulting in hangs on 53C400-based cards. According to 53C400 datasheet, PDMA transfer length must be a multiple of 128. Check if that's true and use PIO if it's not. This makes PDMA work on 53C400 (Canon FG2-5202). Signed-off-by: O

[PATCH v2 58/72] ncr5380: Refactor command completion

2015-12-05 Thread Finn Thain
Implement a 'complete_cmd' function to complete commands. This is needed by the following patch; the new function provides a site for the logic needed to correctly handle REQUEST SENSE commands. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 31 ++-- driv

  1   2   3   4   >