Re: [PATCH] scsi: lpfc: Add shutdown method for kexec

2017-02-14 Thread Brian King
On 02/13/2017 08:04 PM, Benjamin Herrenschmidt wrote: > On Mon, 2017-02-13 at 15:57 -0600, Brian King wrote: >> If we do transition to use remove rather than shutdown, I think we >> want >> some way for a device driver to know whether we are doing kexec or >> not. >> A RAID adapter with a write

[PATCH 4/6] scsi: simplify scsi_execute_req_flags

2017-02-14 Thread Christoph Hellwig
Add a sshdr argument to __scsi_execute so that we can decode the sense data directly into the sense header instead of needing a copy of it. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 27 +-- 1 file changed, 9 insertions(+), 18

RE: [bug report] scsi: aacraid: Added support for hotplug

2017-02-14 Thread Raghava Aditya Renukunta
Hi Dan, > -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Monday, February 13, 2017 11:44 PM > To: Raghava Aditya Renukunta > > Cc: linux-scsi@vger.kernel.org > Subject: Re: [bug report] scsi: aacraid: Added

Re: [PATCH] snic: switch to pci_irq_alloc_vectors

2017-02-14 Thread Narsimhulu Musini (nmusini)
Hi Martin, Thanks for the changes. Looks good. Verified. Acked-by: Narsimhulu Musini Thanks simha On 07/02/17 5:47 am, "Martin K. Petersen" wrote: >> "Christoph" == Christoph Hellwig writes: > >Narsimhulu, > >Please test

[PATCH 5/6] scsi: merge __scsi_execute into scsi_execute

2017-02-14 Thread Christoph Hellwig
All but one caller want the decoded sense header, so offer the existing __scsi_execute helper as the public scsi_execute API to simply the callers. Signed-off-by: Christoph Hellwig --- drivers/ata/libata-scsi.c | 12 -- drivers/scsi/cxlflash/superpipe.c | 8 +++

[PATCH 2/6] sd: improve TUR handling in sd_check_events

2017-02-14 Thread Christoph Hellwig
Remove bogus evaluations of retval and sshdr when the device is offline, and fix a possible NULL pointer dereference by allocating the 8 byte sized sense header on stack. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 25 +++-- 1 file changed, 11

[PATCH 1/6] scsi: always zero sshdr in scsi_normalize_sense

2017-02-14 Thread Christoph Hellwig
This gives us a clear state even if a command didn't return sense data. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c index

[PATCH 6/6] scsi: remove scsi_execute_req_flags

2017-02-14 Thread Christoph Hellwig
And switch all callers to use scsi_execute instead. Signed-off-by: Christoph Hellwig --- drivers/scsi/device_handler/scsi_dh_alua.c | 16 ++-- drivers/scsi/device_handler/scsi_dh_emc.c | 7 +++ drivers/scsi/device_handler/scsi_dh_hp_sw.c | 10 --

sense handling improvements

2017-02-14 Thread Christoph Hellwig
Hi all, this series is on top of the scsi_request changes in Jens' tree and further improves the handling of the sense buffer. The first patch prevents any possibily of reusing stale sense codes in sense headers, and is a bug fix that we should probably get into the block tree ASAP. The rest

[PATCH 3/6] scsi: make the sense header argument to scsi_test_unit_ready mandatory

2017-02-14 Thread Christoph Hellwig
It's a tiny structure that can be allocated on the stack, don't complicate the code by making it optional. Signed-off-by: Christoph Hellwig --- drivers/scsi/osd/osd_uld.c | 3 ++- drivers/scsi/scsi_ioctl.c | 3 ++- drivers/scsi/scsi_lib.c| 14 ++ 3 files changed,

[RESEND][PATCH v2] ata: xgene: Enable NCQ support for APM X-Gene SATA controller hardware v1.1

2017-02-14 Thread Rameshwar Prasad Sahu
This patch enables NCQ support for APM X-Gene SATA controller hardware v1.1 that was broken with hardware v1.0. Second thing, here we should not assume XGENE_AHCI_V2 always in case of having valid _CID in ACPI table. I need to remove this assumption because V1_1 also has a valid _CID for backward

[PATCH v3] sd: Check for unaligned partial completion

2017-02-14 Thread Damien Le Moal
Commit "mpt3sas: Force request partial completion alignment" was not considering the case of REQ_TYPE_FS commands not operating on sector size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned partial replies). This could result is incorrectly retrying (forever) those commands. Move the partial

[bug report] megaraid_sas: Make PI enabled VD 8 byte DMA aligned

2017-02-14 Thread Dan Carpenter
Hello sumit.sax...@avagotech.com, The patch 0b48d12d0365: "megaraid_sas: Make PI enabled VD 8 byte DMA aligned" from Oct 15, 2015, leads to the following static checker warning: drivers/scsi/megaraid/megaraid_sas_base.c:1784 megasas_set_dynamic_target_properties() warn: if

Re: [PATCH] cdrom: Make device operations read-only

2017-02-14 Thread Jens Axboe
On 02/13/2017 05:25 PM, Kees Cook wrote: > Since function tables are a common target for attackers, it's best to keep > them in read-only memory. As such, this makes the CDROM device ops tables > const. This drops additionally n_minors, since it isn't used meaningfully, > and sets the only user of

[patch] scsi: megaraid_sas: array overflow in megasas_dump_frame()

2017-02-14 Thread Dan Carpenter
The "sz" variable is in terms of bytes, but we're treating the buffer as an array of __le32 so we have to divide by 4. Fixes: def0eab3af86 ("scsi: megaraid_sas: enhance debug logs in OCR context") Signed-off-by: Dan Carpenter diff --git

Re: [PATCH V4 net-next 1/2] qed: Add support for hardware offloaded FCoE.

2017-02-14 Thread David Miller
From: "Dupuis, Chad" Date: Mon, 13 Feb 2017 11:17:00 -0800 > @@ -255,6 +259,10 @@ struct qed_hw_info { > u32 part_num[4]; > > unsigned char hw_mac_addr[ETH_ALEN]; > + u64 node_wwn;

Re: [PATCH] sg: protect access to to 'reserved' page array

2017-02-14 Thread Dmitry Vyukov
On Wed, Feb 1, 2017 at 2:21 PM, Hannes Reinecke wrote: > On 02/01/2017 02:12 PM, Christoph Hellwig wrote: >> On Wed, Feb 01, 2017 at 12:22:15PM +0100, Hannes Reinecke wrote: >>> The 'reserved' page array is used as a short-cut for mapping >>> data, saving us to allocate pages per

[PATCH] scsi: megaraid_sas: handle dma_addr_t right on 32-bit

2017-02-14 Thread Arnd Bergmann
When building with a dma_addr_t that is different from pointer size, we get this warning: drivers/scsi/megaraid/megaraid_sas_fusion.c: In function 'megasas_make_prp_nvme': drivers/scsi/megaraid/megaraid_sas_fusion.c:1654:17: error: cast to pointer from integer of different size

[PATCH 08/16] aacraid: Skip wellness sync on controller failure

2017-02-14 Thread Raghava Aditya Renukunta
aac_command_thread checks on the health of controller periodically, using aac_check_health. If the status is an error state KERNEL_PANIC or anything else. The driver will attempt to restart the adapter, but the response is not checked in aac_command_thread. This allows the periodic sync to go thru

[PATCH 07/16] aacraid: Fix sync fibs time out on controller reset

2017-02-14 Thread Raghava Aditya Renukunta
After controller shutdown, all sync fibs time out due to not knowing about the switch to INT-x mode Fixed by replacing aac_src_access_devreg() to aac_set_intx_mode() call. Cc: sta...@vger.kernel.org Fixes: 495c021767bd78c998 (aacraid: MSI-x support) Signed-off-by: Raghava Aditya Renukunta

[PATCH 01/16] aacraid: Fix camel case

2017-02-14 Thread Raghava Aditya Renukunta
Replaced camel case with snake case for init supported options. Suggested-by: Johannes Thumshirn Signed-off-by: Raghava Aditya Renukunta Reviewed-by: David Carroll --- drivers/scsi/aacraid/aachba.c | 53

[PATCH 00/16] aacraid: Fixes and enhancements for arc family

2017-02-14 Thread Raghava Aditya Renukunta
This patch set contains issue fixes, enhancements and other misc changes. The majority of the fixes are a direct outcome of testing and work done on the adapter reset mechanism. Initially it just had IOP reset and then was augmented with IWBR soft hardware resets in the previous patch set. The

[PATCH 03/16] aacraid: Fix for excessive prints on EEH

2017-02-14 Thread Raghava Aditya Renukunta
This issue showed up on a kdump debug(single CPU on powerkvm), when EEH errors rendered the adapter unusable. The driver correctly detected the issue and attempted to restart the controller, in doing so the driver attempted to read the status registers of the controller. This triggered additional

[PATCH 02/16] aacraid: Use correct channel number for raw srb

2017-02-14 Thread Raghava Aditya Renukunta
The channel being used for raw srb commands is retrieved from the utility sent fibs and is converted into physical channel id. The driver does not need to to do this since the management utility sends the correct channel id in the first place and in addition the driver sets inaccurate information

Re: [PATCH RFC] target/user: Add double ring buffers support.

2017-02-14 Thread Andy Grover
On 02/13/2017 09:50 PM, Xiubo Li wrote: > The struct tcmu_cmd_entry {} size is fixed 44 bytes without iovec[], and > the size of struct iovec[N] is about 16 bytes * N. > > The cmd entry size will be [44B, N *16 + 44B], and the data size will be > [0, N * 4096], so the ratio of sizeof(cmd entry):

[PATCH v4] sd: Check for unaligned partial completion

2017-02-14 Thread Damien Le Moal
Commit "mpt3sas: Force request partial completion alignment" was not considering the case of REQ_TYPE_FS commands not operating on sector size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned partial replies). This could result is incorrectly retrying (forever) those commands. Move the partial

Re: [PATCH] scsi: lpfc: Add shutdown method for kexec

2017-02-14 Thread Eric W. Biederman
Brian King writes: > On 02/13/2017 08:04 PM, Benjamin Herrenschmidt wrote: >> On Mon, 2017-02-13 at 15:57 -0600, Brian King wrote: >>> If we do transition to use remove rather than shutdown, I think we >>> want >>> some way for a device driver to know whether we are

[PATCH 06/16] aacraid: Added sysfs for driver version

2017-02-14 Thread Raghava Aditya Renukunta
Added support to retrieve driver version from a new sysfs variable called driver_version. It makes it easier for the user to figure out the driver version that is currently running. Signed-off-by: Raghava Aditya Renukunta Reviewed-by: David Carroll

[PATCH 14/16] aacraid: Save adapter fib log before an IOP reset

2017-02-14 Thread Raghava Aditya Renukunta
Currently the adapter firmware does not save outstanding I/O's log information when an IOP reset is triggered. This is problematic when trying to root cause and debug issues. Fixed by adding sync command to trigger I/O log file save in the adapter firmware before issuing an IOP reset.

[PATCH 05/16] aacraid: Fix memory leak in fib init path

2017-02-14 Thread Raghava Aditya Renukunta
aac_fib_map_free frees misaligned fib dma memory, additionally it does not free up the whole memory. Fixed by changing the code to free up the correct and full memory allocation. Cc: sta...@vger.kernel.org Fixes: e8b12f0fb835223 ([SCSI] aacraid: Add new code for PMC-Sierra's SRC based

[PATCH 09/16] aacraid: Reload offlined drives after controller reset

2017-02-14 Thread Raghava Aditya Renukunta
During the IOP reset stress testing, it was found that the drives can be marked offline when the adapter controller crashes and IO's are running in parallel. When the controller does come back from the reset, the drive that is marked offline is not exposed. Fixed by removing and adding drives

[PATCH 13/16] aacraid: Reorder Adapter status check

2017-02-14 Thread Raghava Aditya Renukunta
The driver currently checks the SELF_TEST_FAILED first and then KERNEL_PANIC next. Under error conditions(boot code failure) both SELF_TEST_FAILED and KERNEL_PANIC can be set at the same time. The driver has the capability to reset the controller on an KERNEL_PANIC , but not on SELF_TEST_FAILED.

[PATCH 12/16] aacraid: Skip IOP reset on controller panic(SMART Family)

2017-02-14 Thread Raghava Aditya Renukunta
When the SMART family of controller panic (KERNEL_PANIC) , they do not honor IOP resets. So better to skip it and directly perform a IWBR reset. Signed-off-by: Raghava Aditya Renukunta Reviewed-by: David Carroll ---

[PATCH 11/16] aacraid: Decrease adapter health check interval

2017-02-14 Thread Raghava Aditya Renukunta
Currently driver checks the health status of the adapter once every 24 hours. When that happens the driver becomes dependent on the kernel to figure out if the adapter is misbehaving. This might take some time (when the adapter is idle). The driver currently has support to restart/recover the

[PATCH 04/16] aacraid: Prevent E3 lockup when deleting units

2017-02-14 Thread Raghava Aditya Renukunta
Arrconf management utility at times sends fibs with AdapterProcessed set in its fibs. This causes the controller to panic and lockup. Fixed by failing the commands that have AdapterProcessed set in its flag. Signed-off-by: Raghava Aditya Renukunta

[PATCH 16/16] aacraid: Update driver version

2017-02-14 Thread Raghava Aditya Renukunta
Updated driver version to 50792 Signed-off-by: Raghava Aditya Renukunta Reviewed-by: David Carroll --- drivers/scsi/aacraid/aacraid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 10/16] aacraid: Terminate kthread on controller fw assert

2017-02-14 Thread Raghava Aditya Renukunta
When the command thread performs a periodic time sync and the firmware is going through an assert during that time, the command thread waits for the response that would never arrive. The SCSI Mid layer's error handler would eventually reset the controller, but the eh_handler just issues a "thread

[PATCH 15/16] aacraid: Fix a potential spinlock double unlock bug

2017-02-14 Thread Raghava Aditya Renukunta
The driver does not unlock the reply queue spin lock after handling SMART adapter events. Instead it might attempt to unlock an already unlocked spin lock. Fixed by making sure the driver locks the spin lock before freeing it. Thank you dan for finding this issue out. Fixes: 6223a39fe6fbbeef

Re: [PATCH] sg: protect access to to 'reserved' page array

2017-02-14 Thread Hannes Reinecke
On 02/14/2017 09:48 PM, Dmitry Vyukov wrote: > On Wed, Feb 1, 2017 at 2:21 PM, Hannes Reinecke wrote: >> On 02/01/2017 02:12 PM, Christoph Hellwig wrote: >>> On Wed, Feb 01, 2017 at 12:22:15PM +0100, Hannes Reinecke wrote: The 'reserved' page array is used as a short-cut for

RE: [bug report] megaraid_sas: Make PI enabled VD 8 byte DMA aligned

2017-02-14 Thread Sumit Saxena
>-Original Message- >From: Dan Carpenter [mailto:dan.carpen...@oracle.com] >Sent: Tuesday, February 14, 2017 9:54 PM >To: sumit.sax...@avagotech.com >Cc: megaraidlinux@broadcom.com; linux-scsi@vger.kernel.org >Subject: [bug report] megaraid_sas: Make PI enabled VD 8 byte DMA aligned >

RE: [PATCH] scsi: megaraid_sas: handle dma_addr_t right on 32-bit

2017-02-14 Thread Sumit Saxena
>-Original Message- >From: Arnd Bergmann [mailto:a...@arndb.de] >Sent: Wednesday, February 15, 2017 2:52 AM >To: James E.J. Bottomley; Martin K. Petersen >Cc: Arnd Bergmann; Kashyap Desai; Sumit Saxena; Shivasharan S; Tomas Henzl; >Hannes Reinecke; Sasikumar Chandrasekaran;

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-14 Thread Christoph Hellwig
Hi Damien, this looks reasonable, but we should ask Guilherme and Ram to confirm it fixes their originally reported issue. I've added them to Cc. On Wed, Feb 15, 2017 at 11:12:30AM +0900, Damien Le Moal wrote: > Commit "mpt3sas: Force request partial completion alignment" was not > considering

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-14 Thread Ram Pai
On Wed, Feb 15, 2017 at 03:48:52PM +0900, Damien Le Moal wrote: > Christoph, > > On 2/15/17 15:34, Christoph Hellwig wrote: > > this looks reasonable, but we should ask Guilherme and Ram to confirm > > it fixes their originally reported issue. I've added them to Cc. > > Thank you. > >

RE: [patch] scsi: megaraid_sas: array overflow in megasas_dump_frame()

2017-02-14 Thread Sumit Saxena
>-Original Message- >From: Dan Carpenter [mailto:dan.carpen...@oracle.com] >Sent: Tuesday, February 14, 2017 10:09 PM >To: Kashyap Desai; Shivasharan S >Cc: Sumit Saxena; James E.J. Bottomley; Martin K. Petersen; >megaraidlinux@broadcom.com; linux-scsi@vger.kernel.org; kernel-

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-14 Thread Damien Le Moal
Christoph, On 2/15/17 15:34, Christoph Hellwig wrote: > this looks reasonable, but we should ask Guilherme and Ram to confirm > it fixes their originally reported issue. I've added them to Cc. Thank you. Guilherme, Ram, Please test ! The original fix breaks the zoned block device support that

Re: [PATCH RFC] target/user: Add double ring buffers support.

2017-02-14 Thread Xiubo Li
The struct tcmu_cmd_entry {} size is fixed 44 bytes without iovec[], and the size of struct iovec[N] is about 16 bytes * N. The cmd entry size will be [44B, N *16 + 44B], and the data size will be [0, N * 4096], so the ratio of sizeof(cmd entry): sizeof(entry datas) == (N * 16 + 44)Bytes : (N *