Re: [lkp-robot] [scsi] 5c279bd9e4: blogbench.read_score -10.0% regression

2017-07-05 Thread Ye Xiaolong
Hi, Ming Lei

On 07/06, Ming Lei wrote:
>Hi Xiaolong,
>
>On Mon, Jul 3, 2017 at 10:57 AM, kernel test robot
> wrote:
>>
>> Greeting,
>>
>> FYI, we noticed a -10.0% regression of blogbench.read_score due to commit:
>
>Looks like related with mq scheduler, could you test the following patch to see
>if your issue can be fixed?
>
>https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-linus=32825c45ff8f4cce937ab85b030dc693ceb1aa0a
>

Here is the comparison of commit 5c279bd9e4 and 32825c45, it does help recover
performance back.

$ compare -at 5c279bd9e40624f4ab6e688671026d6005b066fa 
32825c45ff8f4cce937ab85b030dc693ceb1aa0a
tests: 1
testcase/path_params/tbox_group/run: blogbench/1SSD-ext4-performance/lkp-bdw-de1

5c279bd9e40624f4  32825c45ff8f4cce937ab85b03  
  --  
 %stddev  change %stddev
 \  |\  
262860  36% 358558blogbench.read_score
  9913 ±  4%   -33%   6654blogbench.write_score
  86266452  31%  1.129e+08blogbench.time.file_system_inputs
 29.89  22%  36.46blogbench.time.user_time
   214  13%242
blogbench.time.percent_of_cpu_this_job_got
   620  12%696blogbench.time.system_time
  1.11e+08 -29%   79019314blogbench.time.file_system_outputs
439016 -69% 135286
blogbench.time.involuntary_context_switches
  0.64  22%   0.78mpstat.cpu.usr%
  7.02 ±  4%   -47%   3.72mpstat.cpu.idle%
2372161344%3425183softirqs.RCU
430504 376%2048486softirqs.TIMER
188376 211% 586308softirqs.SCHED
306478 ± 32%   -99%   4150 ± 36%  softirqs.NET_RX
  86266452  31%  1.129e+08time.file_system_inputs
 29.89  22%  36.46time.user_time

Thanks,
Xiaolong

>
>Thanks,
>Ming Lei


Re: [lkp-robot] [scsi] 5c279bd9e4: blogbench.read_score -10.0% regression

2017-07-05 Thread Ming Lei
Hi Xiaolong,

On Mon, Jul 3, 2017 at 10:57 AM, kernel test robot
 wrote:
>
> Greeting,
>
> FYI, we noticed a -10.0% regression of blogbench.read_score due to commit:

Looks like related with mq scheduler, could you test the following patch to see
if your issue can be fixed?

https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-linus=32825c45ff8f4cce937ab85b030dc693ceb1aa0a


Thanks,
Ming Lei


Re: [PATCH][V2] scsi: qedf: fix spelling mistake: "offlading" -> "offloading"

2017-07-05 Thread Tyrel Datwyler
On 07/03/2017 12:21 PM, Colin King wrote:
> From: Colin Ian King 
> 
> Trivial fix to spelling mistake in QEDF_INFO message and 
> remove duplicated "since" (thanks to Tyrel Datwyler for spotting
> the latter issue).
> 
> Signed-off-by: Colin Ian King 

Reviewed-by: Tyrel Datwyler 



Re: [PATCH] target: make device_mutex and device_list static

2017-07-05 Thread Mike Christie
On 07/04/2017 03:44 AM, Colin King wrote:
> From: Colin Ian King 
> 
> Variables device_mutex and device_list static are local to the source,
> so make them static.
> 
> Cleans up sparse warnings:
> "symbol 'device_list' was not declared. Should it be static?"
> "symbol 'device_mutex' was not declared. Should it be static?"
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/target/target_core_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/target/target_core_device.c 
> b/drivers/target/target_core_device.c
> index 3ae8fbf01bdf..bbcef3bc66c8 100644
> --- a/drivers/target/target_core_device.c
> +++ b/drivers/target/target_core_device.c
> @@ -49,8 +49,8 @@
>  #include "target_core_pr.h"
>  #include "target_core_ua.h"
>  
> -DEFINE_MUTEX(device_mutex);
> -LIST_HEAD(device_list);
> +static DEFINE_MUTEX(device_mutex);
> +static LIST_HEAD(device_list);
>  static DEFINE_IDR(devices_idr);
>  
>  static struct se_hba *lun0_hba;
> 

My fault. Thanks.

Reviewed-by: Mike Christie 


RE: [PATCH 4/7] aacraid: use aac_tmf_callback for reset fib

2017-07-05 Thread Raghava Aditya Renukunta


> -Original Message-
> From: Hannes Reinecke [mailto:h...@suse.de]
> Sent: Friday, June 30, 2017 10:18 AM
> To: Martin K. Petersen 
> Cc: Christoph Hellwig ; James Bottomley
> ; linux-scsi@vger.kernel.org;
> Raghava Aditya Renukunta ;
> Hannes Reinecke ; Hannes Reinecke 
> Subject: [PATCH 4/7] aacraid: use aac_tmf_callback for reset fib
> 
> EXTERNAL EMAIL
> 
> 
> When sending a reset fib we shouldn't rely on the scsi command,
> but rather set the TMF status in the map_info->reset_state variable.
> That allows us to send a TMF independent on a scsi command.
> 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/scsi/aacraid/linit.c | 99 +---
> 
>  1 file changed, 74 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
> index 57b2077..e5d2d91 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -814,8 +814,8 @@ static int aac_eh_abort(struct scsi_cmnd* cmd)
> return ret;
>  }
> 
> -static u8 aac_eh_tmf_lun_reset_fib(struct aac_dev *aac, struct fib *fib,
> -  int bus, int cid, u64 tmf_lun)
> +static u8 aac_eh_tmf_lun_reset_fib(struct aac_hba_map_info *info,
> +  struct fib *fib, u64 tmf_lun)
>  {
> struct aac_hba_tm_req *tmf;
> u64 address;
> @@ -824,7 +824,7 @@ static u8 aac_eh_tmf_lun_reset_fib(struct aac_dev
> *aac, struct fib *fib,
> tmf = (struct aac_hba_tm_req *)fib->hw_fib_va;
> memset(tmf, 0, sizeof(*tmf));
> tmf->tmf = HBA_TMF_LUN_RESET;
> -   tmf->it_nexus = aac->hba_map[bus][cid].rmw_nexus;
> +   tmf->it_nexus = info->rmw_nexus;
> int_to_scsilun(tmf_lun, (struct scsi_lun *)tmf->lun);
> 
> address = (u64)fib->hw_error_pa;
> @@ -838,8 +838,8 @@ static u8 aac_eh_tmf_lun_reset_fib(struct aac_dev
> *aac, struct fib *fib,
> return HBA_IU_TYPE_SCSI_TM_REQ;
>  }
> 
> -static u8 aac_eh_tmf_hard_reset_fib(struct aac_dev *aac, struct fib *fib,
> -   int bus, int cid)
> +static u8 aac_eh_tmf_hard_reset_fib(struct aac_hba_map_info *info,
> +   struct fib *fib)
>  {
> struct aac_hba_reset_req *rst;
> u64 address;
> @@ -847,8 +847,7 @@ static u8 aac_eh_tmf_hard_reset_fib(struct aac_dev
> *aac, struct fib *fib,
> /* already tried, start a hard reset now */
> rst = (struct aac_hba_reset_req *)fib->hw_fib_va;
> memset(rst, 0, sizeof(*rst));
> -   /* reset_type is already zero... */
> -   rst->it_nexus = aac->hba_map[bus][cid].rmw_nexus;
> +   rst->it_nexus = info->rmw_nexus;
> 
> address = (u64)fib->hw_error_pa;
> rst->error_ptr_hi = cpu_to_le32((u32)(address >> 32));
> @@ -860,6 +859,33 @@ static u8 aac_eh_tmf_hard_reset_fib(struct aac_dev
> *aac, struct fib *fib,
> return HBA_IU_TYPE_SATA_REQ;
>  }
> 
> +void aac_tmf_callback(void *context, struct fib *fibptr)
> +{
> +   struct aac_hba_resp *err =
> +   &((struct aac_native_hba *)fibptr->hw_fib_va)->resp.err;
> +   struct aac_hba_map_info *info = context;
> +   int res;
> +
> +   switch (err->service_response) {
> +   case HBA_RESP_SVCRES_TMF_REJECTED:
> +   res = -1;
> +   break;
> +   case HBA_RESP_SVCRES_TMF_LUN_INVALID:
> +   res = 0;
> +   break;
> +   case HBA_RESP_SVCRES_TMF_COMPLETE:
> +   case HBA_RESP_SVCRES_TMF_SUCCEEDED:
> +   res = 0;
> +   break;
> +   default:
> +   res = -2;
> +   break;
> +   }
> +   aac_fib_complete(fibptr);
> +
> +   info->reset_state = res;
> +}
> +
>  /*
>   * aac_eh_dev_reset- Device reset command handling
>   * @scsi_cmd:  SCSI command block causing the reset
> @@ -870,6 +896,7 @@ static int aac_eh_dev_reset(struct scsi_cmnd *cmd)
> struct scsi_device * dev = cmd->device;
> struct Scsi_Host * host = dev->host;
> struct aac_dev * aac = (struct aac_dev *)host->hostdata;
> +   struct aac_hba_map_info *info;
> int count;
> u32 bus, cid;
> struct fib *fib;
> @@ -879,8 +906,12 @@ static int aac_eh_dev_reset(struct scsi_cmnd *cmd)
> 
> bus = aac_logical_to_phys(scmd_channel(cmd));
> cid = scmd_id(cmd);
> +   info = >hba_map[bus][cid];
> if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS ||
> -   aac->hba_map[bus][cid].devtype != AAC_DEVTYPE_NATIVE_RAW)
> +   info->devtype != AAC_DEVTYPE_NATIVE_RAW)
> +   return FAILED;
> +
> +   if (info->reset_state > 0)
> return FAILED;
> 
> pr_err("%s: Host adapter reset request. SCSI hang ?\n",
> @@ -890,21 

Re: [PATCH] cxlflash: return -EFAULT if copy_from_user() fails

2017-07-05 Thread Matthew R. Ochs

> On Jun 30, 2017, at 3:01 AM, Dan Carpenter  wrote:
> 
> The copy_from/to_user() functions return the number of bytes remaining
> to be copied but we had intended to return -EFAULT here.
> 
> Fixes: bc88ac47d5cb ("scsi: cxlflash: Support AFU debug")
> Signed-off-by: Dan Carpenter 

Good catch Dan!

Acked-by: Matthew R. Ochs 



Re: [PATCH][V2] scsi: qedf: fix spelling mistake: "offlading" -> "offloading"

2017-07-05 Thread Chad Dupuis

On Mon, 3 Jul 2017, 3:21pm, Colin King wrote:

> From: Colin Ian King 
> 
> Trivial fix to spelling mistake in QEDF_INFO message and 
> remove duplicated "since" (thanks to Tyrel Datwyler for spotting
> the latter issue).
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/scsi/qedf/qedf_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index b58bba4604e8..7786c97e033f 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -1227,7 +1227,7 @@ static void qedf_rport_event_handler(struct fc_lport 
> *lport,
>  
>   if (rdata->spp_type != FC_TYPE_FCP) {
>   QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
> - "Not offlading since since spp type isn't FCP\n");
> + "Not offloading since spp type isn't FCP\n");
>   break;
>   }
>   if (!(rdata->ids.roles & FC_RPORT_ROLE_FCP_TARGET)) {
> 

Thanks.

Acked-by: Chad Dupuis 


Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 02:45:06PM +0100, Chris Clayton wrote:
> With your patch applied to 4.12.0, all three of the nero applications can now 
> detect my drives again.
> 
> Excellent work! Thank you.
> 
> Tested-by: Chris Clayton 

Thanks for confirmation.

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


[PATCH] scsi: sg: fix SG_DXFER_FROM_DEV transfers

2017-07-05 Thread Johannes Thumshirn
SG_DXFER_FROM_DEV transfers do not have a dxferp as we set it to NULL,
but must have a length bigger than 0. This fixes a regression introduced
by commit 28676d869bbb ("scsi: sg: check for valid direction before
starting the request")

Signed-off-by: Johannes Thumshirn 
Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the 
request")
Reported-by: Chris Clayton 
Tested-by: Chris Clayton 
Cc: Doug Gilbert 
---
 drivers/scsi/sg.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 21225d62b0c1..3c91593260aa 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
if (hp->dxferp || hp->dxfer_len > 0)
return false;
return true;
-   case SG_DXFER_TO_DEV:
case SG_DXFER_FROM_DEV:
+   if (hp->dxferp || hp->dxfer_len < 0)
+   return false;
+   return true;
+   case SG_DXFER_TO_DEV:
case SG_DXFER_TO_FROM_DEV:
if (!hp->dxferp || hp->dxfer_len == 0)
return false;
-- 
2.12.3



Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Chris Clayton


On 05/07/17 13:42, Johannes Thumshirn wrote:
> On Wed, Jul 05, 2017 at 01:19:09PM +0100, Chris Clayton wrote:
>> I'm happy to test any patches you may propose.
> 
> Can you verify this fix? Preferedably with using Nero. It passes my small
> reproducer:
> 
Thanks Johannes.

With your patch applied to 4.12.0, all three of the nero applications can now 
detect my drives again.

Excellent work! Thank you.

Tested-by: Chris Clayton 

> From f52502180cc3843f8acc956253af2575245546a8 Mon Sep 17 00:00:00 2001
> From: Johannes Thumshirn 
> Date: Wed, 5 Jul 2017 14:31:47 +0200
> Subject: [PATCH] scsi: sg: fix SG_DXFER_FROM_DEV transfers
> 
> SG_DXFER_FROM_DEV transfers do not have a dxferp as we set it to NULL,
> but must have a length bigger than 0. This fixes a regression introduced
> by commit 28676d869bbb ("scsi: sg: check for valid direction before
> starting the request")
> 
> Signed-off-by: Johannes Thumshirn 
> Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the 
> request")
> ---
>  drivers/scsi/sg.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 21225d62b0c1..3c91593260aa 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
>   if (hp->dxferp || hp->dxfer_len > 0)
>   return false;
>   return true;
> - case SG_DXFER_TO_DEV:
>   case SG_DXFER_FROM_DEV:
> + if (hp->dxferp || hp->dxfer_len < 0)
> + return false;
> + return true;
> + case SG_DXFER_TO_DEV:
>   case SG_DXFER_TO_FROM_DEV:
>   if (!hp->dxferp || hp->dxfer_len == 0)
>   return false;
> 


Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 01:19:09PM +0100, Chris Clayton wrote:
> I'm happy to test any patches you may propose.

Can you verify this fix? Preferedably with using Nero. It passes my small
reproducer:

>From f52502180cc3843f8acc956253af2575245546a8 Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn 
Date: Wed, 5 Jul 2017 14:31:47 +0200
Subject: [PATCH] scsi: sg: fix SG_DXFER_FROM_DEV transfers

SG_DXFER_FROM_DEV transfers do not have a dxferp as we set it to NULL,
but must have a length bigger than 0. This fixes a regression introduced
by commit 28676d869bbb ("scsi: sg: check for valid direction before
starting the request")

Signed-off-by: Johannes Thumshirn 
Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the 
request")
---
 drivers/scsi/sg.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 21225d62b0c1..3c91593260aa 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
if (hp->dxferp || hp->dxfer_len > 0)
return false;
return true;
-   case SG_DXFER_TO_DEV:
case SG_DXFER_FROM_DEV:
+   if (hp->dxferp || hp->dxfer_len < 0)
+   return false;
+   return true;
+   case SG_DXFER_TO_DEV:
case SG_DXFER_TO_FROM_DEV:
if (!hp->dxferp || hp->dxfer_len == 0)
return false;
-- 
2.12.3

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Chris Clayton


On 05/07/17 13:09, Johannes Thumshirn wrote:
> On Wed, Jul 05, 2017 at 01:05:46PM +0100, Chris Clayton wrote:
>> Yes, I get:
>>
>> [chris:~/rpm/build]$ su -c "./nerotest /dev/sg0"
>> Password:
>> write: Invalid argument
>> FAIL
> 
> Awesome, thanks for confirming.
> 
You're welcome. I've attached a dmesg log with logging turned on when I ran 
"nerocmd --scanbus".
I set the logging level with "scsi_logging_level -s -T4" (i.e.had to add the -s 
argument to your suggested command.
Sorry, for the delay - had to build a new kernel with scsi logging enabled.

> I'll work on it locally now and hopefully send you something to test soon.
> 

I'm happy to test any patches you may propose.

Thanks,
Chris
> Thanks,
>   Johannes
> 
[0.00] Linux version 4.12.0 (chris@laptop) (gcc version 6.4.0 (GCC) ) #2 SMP PREEMPT Wed Jul 5 12:58:07 BST 2017
[0.00] Command line: BOOT_IMAGE=/boot/vmlinuz-4.12.0 ro root=/dev/sda2 resume=/dev/sda6 rootfstype=ext4 net.ifnames=0
[0.00] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[0.00] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[0.00] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[0.00] e820: BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009d7ff] usable
[0.00] BIOS-e820: [mem 0x0009d800-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000e-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0xd7216fff] usable
[0.00] BIOS-e820: [mem 0xd7217000-0xd721dfff] ACPI NVS
[0.00] BIOS-e820: [mem 0xd721e000-0xd7a0cfff] usable
[0.00] BIOS-e820: [mem 0xd7a0d000-0xd7ca1fff] reserved
[0.00] BIOS-e820: [mem 0xd7ca2000-0xdb4d] usable
[0.00] BIOS-e820: [mem 0xdb4e-0xdb82dfff] reserved
[0.00] BIOS-e820: [mem 0xdb82e000-0xdb88afff] usable
[0.00] BIOS-e820: [mem 0xdb88b000-0xdb9bcfff] ACPI NVS
[0.00] BIOS-e820: [mem 0xdb9bd000-0xdbffefff] reserved
[0.00] BIOS-e820: [mem 0xdbfff000-0xdbff] usable
[0.00] BIOS-e820: [mem 0xdd00-0xdf1f] reserved
[0.00] BIOS-e820: [mem 0xf800-0xfbff] reserved
[0.00] BIOS-e820: [mem 0xfec0-0xfec00fff] reserved
[0.00] BIOS-e820: [mem 0xfed0-0xfed03fff] reserved
[0.00] BIOS-e820: [mem 0xfed1c000-0xfed1] reserved
[0.00] BIOS-e820: [mem 0xfee0-0xfee00fff] reserved
[0.00] BIOS-e820: [mem 0xff00-0x] reserved
[0.00] BIOS-e820: [mem 0x0001-0x00041fdf] usable
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.7 present.
[0.00] DMI: Notebook W65_67SZ/W65_67SZ, BIOS 1.03.05 02/26/2014
[0.00] tsc: Fast TSC calibration using PIT
[0.00] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.00] e820: remove [mem 0x000a-0x000f] usable
[0.00] e820: last_pfn = 0x41fe00 max_arch_pfn = 0x4
[0.00] MTRR default type: uncachable
[0.00] MTRR fixed ranges enabled:
[0.00]   0-9 write-back
[0.00]   A-B uncachable
[0.00]   C-C write-protect
[0.00]   D-E7FFF uncachable
[0.00]   E8000-F write-protect
[0.00] MTRR variable ranges enabled:
[0.00]   0 base 00 mask 7C write-back
[0.00]   1 base 04 mask 7FE000 write-back
[0.00]   2 base 00E000 mask 7FE000 uncachable
[0.00]   3 base 00DE00 mask 7FFE00 uncachable
[0.00]   4 base 00DD00 mask 7FFF00 uncachable
[0.00]   5 base 041FE0 mask 7FFFE0 uncachable
[0.00]   6 disabled
[0.00]   7 disabled
[0.00]   8 disabled
[0.00]   9 disabled
[0.00] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- WT  
[0.00] e820: update [mem 0xdd00-0x] usable ==> reserved
[0.00] e820: last_pfn = 0xdc000 max_arch_pfn = 0x4
[0.00] found SMP MP-table at [mem 0x000fd820-0x000fd82f] mapped at [880fd820]
[0.00] Base memory trampoline at [88097000] 97000 size 24576
[0.00] Using GB pages for direct mapping
[0.00] BRK [0x01df9000, 0x01df9fff] PGTABLE
[0.00] BRK [0x01dfa000, 0x01dfafff] PGTABLE
[0.00] BRK [0x01dfb000, 0x01dfbfff] 

Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 01:05:46PM +0100, Chris Clayton wrote:
> Yes, I get:
> 
> [chris:~/rpm/build]$ su -c "./nerotest /dev/sg0"
> Password:
> write: Invalid argument
> FAIL

Awesome, thanks for confirming.

I'll work on it locally now and hopefully send you something to test soon.

Thanks,
Johannes

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Chris Clayton


On 05/07/17 12:52, Johannes Thumshirn wrote:
> On Wed, Jul 05, 2017 at 10:06:49AM +0100, Chris Clayton wrote:
>> I'll do this  and send dmesg(?) output as soon as I've got 
>> scsi_logging_level installed.
> 
> Hi Chris,
> 
> does this reproducer work (i.e. output FAIL) for you?
> 
Hi Johannes.

Yes, I get:

[chris:~/rpm/build]$ su -c "./nerotest /dev/sg0"
Password:
write: Invalid argument
FAIL


Chris


[PATCH v2 11/15] megaraid_sas: Set device queue_depth same as HBA can_queue value in scsi-mq mode

2017-07-05 Thread Shivasharan S
Currently driver sets default queue_depth for VDs at 256 and JBODs based on 
interface type,
ie., for SAS JBOD QD will be 64, for SATA JBOD QD will be 32.
During performance runs with scsi-mq enabled, we are seeing better results by
setting QD same as HBA queue_depth.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index 1d5ca5e..c13b605 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1891,7 +1891,8 @@ static void megasas_set_static_target_properties(struct 
scsi_device *sdev,
if (instance->nvme_page_size && max_io_size_kb)
megasas_set_nvme_device_properties(sdev, (max_io_size_kb << 
10));
 
-   scsi_change_queue_depth(sdev, device_qd);
+   if (!shost_use_blk_mq(sdev->host))
+   scsi_change_queue_depth(sdev, device_qd);
 
 }
 
@@ -5915,6 +5916,9 @@ static int megasas_io_attach(struct megasas_instance 
*instance)
host->max_lun = MEGASAS_MAX_LUN;
host->max_cmd_len = 16;
 
+   if (shost_use_blk_mq(host))
+   host->cmd_per_lun = host->can_queue;
+
/*
 * Notify the mid-layer about the new controller
 */
-- 
1.8.3.1



[PATCH v2 10/15] megaraid_sas: Return pended IOCTLs with cmd_status MFI_STAT_WRONG_STATE in case adapter is dead

2017-07-05 Thread Shivasharan S
Fix - After a kill adapter, since the cmd_status is not set the
IOCTLs will be hung in driver resulting in application hang.
Set cmd_status MFI_STAT_WRONG_STATE when completing pended IOCTLs.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Cc: sta...@vger.kernel.org
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index c63ef88..1d5ca5e 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1996,9 +1996,12 @@ static void megasas_complete_outstanding_ioctls(struct 
megasas_instance *instanc
if (cmd_fusion->sync_cmd_idx != (u32)ULONG_MAX) {
cmd_mfi = 
instance->cmd_list[cmd_fusion->sync_cmd_idx];
if (cmd_mfi->sync_cmd &&
-   cmd_mfi->frame->hdr.cmd != 
MFI_CMD_ABORT)
+   (cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT)) 
{
+   cmd_mfi->frame->hdr.cmd_status =
+   MFI_STAT_WRONG_STATE;
megasas_complete_cmd(instance,
 cmd_mfi, DID_OK);
+   }
}
}
} else {
-- 
1.8.3.1



[PATCH v2 13/15] megaraid_sas: modified few prints in OCR and IOC INIT path

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index ff4a3a8..dc4aada 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -910,7 +910,6 @@ static int megasas_create_sg_sense_fusion(struct 
megasas_instance *instance)
ret = 1;
goto fail_fw_init;
}
-   dev_info(>pdev->dev, "Init cmd success\n");
 
ret = 0;
 
@@ -921,6 +920,10 @@ static int megasas_create_sg_sense_fusion(struct 
megasas_instance *instance)
  sizeof(struct MPI2_IOC_INIT_REQUEST),
  IOCInitMessage, ioc_init_handle);
 fail_get_cmd:
+   dev_err(>pdev->dev,
+   "Init cmd return status %s for SCSI host %d\n",
+   ret ? "FAILED" : "SUCCESS", instance->host->host_no);
+
return ret;
 }
 
@@ -4308,9 +4311,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int 
reason)
megasas_fusion_update_can_queue(instance, OCR_CONTEXT);
 
if (megasas_ioc_init_fusion(instance)) {
-   dev_warn(>pdev->dev,
-  "megasas_ioc_init_fusion() failed! for "
-  "scsi%d\n", instance->host->host_no);
if (instance->requestorId && !reason)
goto fail_kill_adapter;
else
@@ -4356,6 +4356,10 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int 
reason)
instance->instancet->enable_intr(instance);
atomic_set(>adprecovery, 
MEGASAS_HBA_OPERATIONAL);
 
+   dev_info(>pdev->dev, "Interrupts are enabled 
and"
+   " controller is OPERATIONAL for scsi:%d\n",
+   instance->host->host_no);
+
/* Restart SR-IOV heartbeat */
if (instance->requestorId) {
if (!megasas_sriov_start_heartbeat(instance, 0))
@@ -4367,11 +4371,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int 
reason)
instance->skip_heartbeat_timer_del = 1;
}
 
-   /* Adapter reset completed successfully */
-   dev_warn(>pdev->dev, "Reset "
-  "successful for scsi%d.\n",
-   instance->host->host_no);
-
if (instance->crash_dump_drv_support &&
instance->crash_dump_app_support)
megasas_set_crash_dump_params(instance,
@@ -4381,6 +4380,12 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int 
reason)
MR_CRASH_BUF_TURN_OFF);
 
retval = SUCCESS;
+
+   /* Adapter reset completed successfully */
+   dev_warn(>pdev->dev,
+"Reset successful for scsi%d.\n",
+instance->host->host_no);
+
goto out;
}
 fail_kill_adapter:
-- 
1.8.3.1



[PATCH v2 12/15] megaraid_sas: replace internal FALSE/TRUE definitions with false/true

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_fp.c | 40 +
 1 file changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c 
b/drivers/scsi/megaraid/megaraid_sas_fp.c
index 62affa7..ecc699a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
@@ -67,16 +67,6 @@
 #define ABS_DIFF(a, b)   (((a) > (b)) ? ((a) - (b)) : ((b) - (a)))
 #define MR_LD_STATE_OPTIMAL 3
 
-#ifdef FALSE
-#undef FALSE
-#endif
-#define FALSE 0
-
-#ifdef TRUE
-#undef TRUE
-#endif
-#define TRUE 1
-
 #define SPAN_ROW_SIZE(map, ld, index_) (MR_LdSpanPtrGet(ld, index_, 
map)->spanRowSize)
 #define SPAN_ROW_DATA_SIZE(map_, ld, index_)   (MR_LdSpanPtrGet(ld, index_, 
map)->spanRowDataSize)
 #define SPAN_INVALID  0xff
@@ -709,7 +699,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance 
*instance, u32 ld,
u32 pd, arRef, r1_alt_pd;
u8  physArm, span;
u64 row;
-   u8  retval = TRUE;
+   u8  retval = true;
u64 *pdBlock = _info->pdBlock;
__le16  *pDevHandle = _info->devHandle;
u8  *pPdInterface = _info->pd_interface;
@@ -727,7 +717,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance 
*instance, u32 ld,
if (raid->level == 6) {
logArm = get_arm_from_strip(instance, ld, stripRow, map);
if (logArm == -1U)
-   return FALSE;
+   return false;
rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span));
armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod;
arm = armQ + 1 + logArm;
@@ -738,7 +728,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance 
*instance, u32 ld,
/* Calculate the arm */
physArm = get_arm(instance, ld, span, stripRow, map);
if (physArm == 0xFF)
-   return FALSE;
+   return false;
 
arRef   = MR_LdSpanArrayGet(ld, span, map);
pd  = MR_ArPdGet(arRef, physArm, map);
@@ -812,7 +802,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
u32 pd, arRef, r1_alt_pd;
u8  physArm, span;
u64 row;
-   u8  retval = TRUE;
+   u8  retval = true;
u64 *pdBlock = _info->pdBlock;
__le16  *pDevHandle = _info->devHandle;
u8  *pPdInterface = _info->pd_interface;
@@ -829,7 +819,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
u32 rowMod, armQ, arm;
 
if (raid->rowSize == 0)
-   return FALSE;
+   return false;
/* get logical row mod */
rowMod = mega_mod64(row, raid->rowSize);
armQ = raid->rowSize-1-rowMod; /* index of Q drive */
@@ -839,7 +829,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
physArm = (u8)arm;
} else  {
if (raid->modFactor == 0)
-   return FALSE;
+   return false;
physArm = MR_LdDataArmGet(ld,  mega_mod64(stripRow,
  raid->modFactor),
  map);
@@ -851,7 +841,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
} else {
span = (u8)MR_GetSpanBlock(ld, row, pdBlock, map);
if (span == SPAN_INVALID)
-   return FALSE;
+   return false;
}
 
/* Get the array on which this span is present */
@@ -954,7 +944,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
 */
if (raid->rowDataSize == 0) {
if (MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize == 0)
-   return FALSE;
+   return false;
else if (instance->UnevenSpanSupport) {
io_info->IoforUnevenSpan = 1;
} else {
@@ -963,7 +953,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
"rowDataSize = 0x%0x,"
"but there is _NO_ UnevenSpanSupport\n",
MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize);
-   return FALSE;
+   return false;
}
}
 
@@ -988,7 +978,7 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 
ld, u64 stripRow,
dev_info(>pdev->dev, "return from %s %d."
"Send IO 

[PATCH v2 14/15] megaraid_sas: call megasas_dump_frame with correct IO frame size

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index c13b605..d760023 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -2796,7 +2796,7 @@ static int megasas_reset_bus_host(struct scsi_cmnd *scmd)
cmd = (struct megasas_cmd_fusion *)scmd->SCp.ptr;
if (cmd)
megasas_dump_frame(cmd->io_request,
-   sizeof(struct MPI2_RAID_SCSI_IO_REQUEST));
+   MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE);
ret = megasas_reset_fusion(scmd->device->host,
SCSIIO_TIMEOUT_OCR);
} else
-- 
1.8.3.1



[PATCH v2 15/15] megaraid_sas: driver version upgrade

2017-07-05 Thread Shivasharan S
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h 
b/drivers/scsi/megaraid/megaraid_sas.h
index 6d9f111..a6722c9 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -35,8 +35,8 @@
 /*
  * MegaRAID SAS Driver meta data
  */
-#define MEGASAS_VERSION"07.701.17.00-rc1"
-#define MEGASAS_RELDATE"March 2, 2017"
+#define MEGASAS_VERSION"07.702.06.00-rc1"
+#define MEGASAS_RELDATE"June 21, 2017"
 
 /*
  * Device IDs
-- 
1.8.3.1



[PATCH v2 07/15] megaraid_sas: Check valid aen class range to avoid kernel panic

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index 3c50a7b..e490272 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5650,6 +5650,14 @@ static void megasas_release_mfi(struct megasas_instance 
*instance)
prev_aen.word =
le32_to_cpu(instance->aen_cmd->frame->dcmd.mbox.w[1]);
 
+   if ((curr_aen.members.class < MFI_EVT_CLASS_DEBUG) ||
+   (curr_aen.members.class > MFI_EVT_CLASS_DEAD)) {
+   dev_info(>pdev->dev,
+"%s %d out of range class %d send by 
application\n",
+__func__, __LINE__, curr_aen.members.class);
+   return 0;
+   }
+
/*
 * A class whose enum value is smaller is inclusive of all
 * higher values. If a PROGRESS (= -1) was previously
-- 
1.8.3.1



[PATCH v2 03/15] megaraid_sas: Use synchronize_irq in target reset case

2017-07-05 Thread Shivasharan S
Similar to task abort case, use synchronize_irq API in target reset case.
Also, remove redundant call to megasas_complete_cmd_dpc_fusion
after calling megasas_sync_irqs in task abort case.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index f717fbc..5018a3f 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3826,8 +3826,6 @@ static int megasas_track_scsiio(struct megasas_instance 
*instance,
else {
instance->instancet->disable_intr(instance);
megasas_sync_irqs((unsigned long)instance);
-   megasas_complete_cmd_dpc_fusion
-   ((unsigned long)instance);
instance->instancet->enable_intr(instance);
if (scsi_lookup->scmd == NULL)
break;
@@ -3839,9 +3837,7 @@ static int megasas_track_scsiio(struct megasas_instance 
*instance,
if ((channel == 0x) && (id == 0x))
break;
instance->instancet->disable_intr(instance);
-   msleep(1000);
-   megasas_complete_cmd_dpc_fusion
-   ((unsigned long)instance);
+   megasas_sync_irqs((unsigned long)instance);
rc = megasas_track_scsiio(instance, id, channel);
instance->instancet->enable_intr(instance);
 
-- 
1.8.3.1



[PATCH v2 08/15] megaraid_sas: Use SMID for Task abort case only

2017-07-05 Thread Shivasharan S
Fix - In TM code, smid_task is valid only in case of task aborts.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index a308e14..c239762 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3754,7 +3754,7 @@ static int megasas_track_scsiio(struct megasas_instance 
*instance,
struct megasas_cmd_fusion *cmd_fusion;
struct megasas_cmd *cmd_mfi;
union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc;
-   struct fusion_context *fusion;
+   struct fusion_context *fusion = NULL;
struct megasas_cmd_fusion *scsi_lookup;
int rc;
struct MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply;
@@ -3781,8 +3781,6 @@ static int megasas_track_scsiio(struct megasas_instance 
*instance,
cmd_fusion->request_desc = req_desc;
req_desc->Words = 0;
 
-   scsi_lookup = fusion->cmd_list[smid_task - 1];
-
mr_request = (struct MR_TASK_MANAGE_REQUEST *) cmd_fusion->io_request;
memset(mr_request, 0, sizeof(struct MR_TASK_MANAGE_REQUEST));
mpi_request = (struct MPI2_SCSI_TASK_MANAGE_REQUEST *) 
_request->TmRequest;
@@ -3829,6 +3827,8 @@ static int megasas_track_scsiio(struct megasas_instance 
*instance,
rc = SUCCESS;
switch (type) {
case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK:
+   scsi_lookup = fusion->cmd_list[smid_task - 1];
+
if (scsi_lookup->scmd == NULL)
break;
else {
-- 
1.8.3.1



[PATCH v2 02/15] megaraid_sas: set minimum value of resetwaittime to be 1 secs

2017-07-05 Thread Shivasharan S
Setting resetwaittime to 0 during a FW fault will result in driver
not calling the OCR.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index 316c3df..395c3aa 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5478,7 +5478,8 @@ static int megasas_init_fw(struct megasas_instance 
*instance)
instance->throttlequeuedepth =
MEGASAS_THROTTLE_QUEUE_DEPTH;
 
-   if (resetwaittime > MEGASAS_RESET_WAIT_TIME)
+   if ((resetwaittime < 1) ||
+   (resetwaittime > MEGASAS_RESET_WAIT_TIME))
resetwaittime = MEGASAS_RESET_WAIT_TIME;
 
if ((scmd_timeout < 10) || (scmd_timeout > MEGASAS_DEFAULT_CMD_TIMEOUT))
-- 
1.8.3.1



[PATCH v2 06/15] megaraid_sas: Fix endianness issues in DCMD handling

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index 395c3aa..3c50a7b 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6867,6 +6867,7 @@ static int megasas_set_crash_dump_params_ioctl(struct 
megasas_cmd *cmd)
void *sense = NULL;
dma_addr_t sense_handle;
unsigned long *sense_ptr;
+   u32 opcode;
 
memset(kbuff_arr, 0, sizeof(kbuff_arr));
 
@@ -6894,15 +6895,16 @@ static int megasas_set_crash_dump_params_ioctl(struct 
megasas_cmd *cmd)
cmd->frame->hdr.flags &= cpu_to_le16(~(MFI_FRAME_IEEE |
   MFI_FRAME_SGL64 |
   MFI_FRAME_SENSE64));
+   opcode = le32_to_cpu(cmd->frame->dcmd.opcode);
 
-   if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_SHUTDOWN) {
+   if (opcode == MR_DCMD_CTRL_SHUTDOWN) {
if (megasas_get_ctrl_info(instance) != DCMD_SUCCESS) {
megasas_return_cmd(instance, cmd);
return -1;
}
}
 
-   if (cmd->frame->dcmd.opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) {
+   if (opcode == MR_DRIVER_SET_APP_CRASHDUMP_MODE) {
error = megasas_set_crash_dump_params_ioctl(cmd);
megasas_return_cmd(instance, cmd);
return error;
@@ -6976,8 +6978,7 @@ static int megasas_set_crash_dump_params_ioctl(struct 
megasas_cmd *cmd)
cmd->sync_cmd = 0;
dev_err(>pdev->dev,
"return -EBUSY from %s %d opcode 0x%x 
cmd->cmd_status_drv 0x%x\n",
-   __func__, __LINE__, cmd->frame->dcmd.opcode,
-   cmd->cmd_status_drv);
+   __func__, __LINE__, opcode, cmd->cmd_status_drv);
return -EBUSY;
}
 
-- 
1.8.3.1



[PATCH v2 05/15] megaraid_sas: Do not re-fire shutdown DCMD after OCR

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 0f13c58..a308e14 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3618,6 +3618,15 @@ void megasas_refire_mgmt_cmd(struct megasas_instance 
*instance)
 
if (!smid)
continue;
+
+   /* Do not refire shutdown command */
+   if (le32_to_cpu(cmd_mfi->frame->dcmd.opcode) ==
+   MR_DCMD_CTRL_SHUTDOWN) {
+   cmd_mfi->frame->dcmd.cmd_status = MFI_STAT_OK;
+   megasas_complete_cmd(instance, cmd_mfi, DID_OK);
+   continue;
+   }
+
req_desc = megasas_get_request_descriptor
(instance, smid - 1);
refire_cmd = req_desc && ((cmd_mfi->frame->dcmd.opcode !=
-- 
1.8.3.1



[PATCH v2 04/15] megaraid_sas: Call megasas_complete_cmd_dpc_fusion every 1 second while there are pending commands

2017-07-05 Thread Shivasharan S
Fix - megasas_wait_for_outstanding_fusion checks for pending commands every
1second. But megasas_complete_cmd_dpc_fusion is only called every 5seconds.
If the commands are already completed by firmware, there is an additional
delay of 5seconds before driver will process completion for these commands.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 5018a3f..0f13c58 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3552,6 +3552,7 @@ int megasas_wait_for_outstanding_fusion(struct 
megasas_instance *instance,
}
}
 
+   megasas_complete_cmd_dpc_fusion((unsigned long)instance);
outstanding = atomic_read(>fw_outstanding);
if (!outstanding)
goto out;
@@ -3560,8 +3561,6 @@ int megasas_wait_for_outstanding_fusion(struct 
megasas_instance *instance,
dev_notice(>pdev->dev, "[%2d]waiting for %d "
   "commands to complete for scsi%d\n", i,
   outstanding, instance->host->host_no);
-   megasas_complete_cmd_dpc_fusion(
-   (unsigned long)instance);
}
msleep(1000);
}
-- 
1.8.3.1



[PATCH v2 09/15] megaraid_sas: use vmalloc for crash dump buffers and driver's local RAID map

2017-07-05 Thread Shivasharan S
Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas.h|   1 -
 drivers/scsi/megaraid/megaraid_sas_base.c   |  12 ++-
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 121 ++--
 3 files changed, 88 insertions(+), 46 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.h 
b/drivers/scsi/megaraid/megaraid_sas.h
index 2b209bb..6d9f111 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -2115,7 +2115,6 @@ struct megasas_instance {
u32 *crash_dump_buf;
dma_addr_t crash_dump_h;
void *crash_buf[MAX_CRASH_DUMP_SIZE];
-   u32 crash_buf_pages;
unsigned intfw_crash_buffer_size;
unsigned intfw_crash_state;
unsigned intfw_crash_buffer_offset;
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index e490272..c63ef88 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -6672,9 +6673,14 @@ static void megasas_detach_one(struct pci_dev *pdev)
  fusion->max_map_sz,
  fusion->ld_map[i],
  fusion->ld_map_phys[i]);
-   if (fusion->ld_drv_map[i])
-   free_pages((ulong)fusion->ld_drv_map[i],
-   fusion->drv_map_pages);
+   if (fusion->ld_drv_map[i]) {
+   if (is_vmalloc_addr(fusion->ld_drv_map[i]))
+   vfree(fusion->ld_drv_map[i]);
+   else
+   free_pages((ulong)fusion->ld_drv_map[i],
+  fusion->drv_map_pages);
+   }
+
if (fusion->pd_seq_sync[i])
dma_free_coherent(>pdev->dev,
pd_seq_map_sz,
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index c239762..ff4a3a8 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1257,6 +1257,80 @@ static int megasas_create_sg_sense_fusion(struct 
megasas_instance *instance)
 }
 
 /**
+ * megasas_allocate_raid_maps -Allocate memory for RAID maps
+ * @instance:  Adapter soft state
+ *
+ * return: if success: return 0
+ * failed:  return -ENOMEM
+ */
+static inline int megasas_allocate_raid_maps(struct megasas_instance *instance)
+{
+   struct fusion_context *fusion;
+   int i = 0;
+
+   fusion = instance->ctrl_context;
+
+   fusion->drv_map_pages = get_order(fusion->drv_map_sz);
+
+   for (i = 0; i < 2; i++) {
+   fusion->ld_map[i] = NULL;
+
+   fusion->ld_drv_map[i] = (void *)
+   __get_free_pages(__GFP_ZERO | GFP_KERNEL,
+fusion->drv_map_pages);
+
+   if (!fusion->ld_drv_map[i]) {
+   fusion->ld_drv_map[i] = vzalloc(fusion->drv_map_sz);
+
+   if (!fusion->ld_drv_map[i]) {
+   dev_err(>pdev->dev,
+   "Could not allocate memory for local 
map"
+   " size requested: %d\n",
+   fusion->drv_map_sz);
+   goto ld_drv_map_alloc_fail;
+   }
+   }
+   }
+
+   for (i = 0; i < 2; i++) {
+   fusion->ld_map[i] = dma_alloc_coherent(>pdev->dev,
+  fusion->max_map_sz,
+  >ld_map_phys[i],
+  GFP_KERNEL);
+   if (!fusion->ld_map[i]) {
+   dev_err(>pdev->dev,
+   "Could not allocate memory for map info 
%s:%d\n",
+   __func__, __LINE__);
+   goto ld_map_alloc_fail;
+   }
+   }
+
+   return 0;
+
+ld_map_alloc_fail:
+   for (i = 0; i < 2; i++) {
+   if (fusion->ld_map[i])
+   dma_free_coherent(>pdev->dev,
+ fusion->max_map_sz,
+ fusion->ld_map[i],
+ fusion->ld_map_phys[i]);
+   }
+

[PATCH v2 01/15] megaraid_sas: mismatch of allocated MFI frame size and length exposed in MFI MPT pass through command

2017-07-05 Thread Shivasharan S
 Fix - Driver allocated 256 byte MFI frames bytes but while sending MFI
 frame (embedded inside chain frame of MPT frame) to firmware, driver
 sets the length as 4k. This results in DMA read error messages during
 boot.

Signed-off-by: Kashyap Desai 
Signed-off-by: Shivasharan S 
Reviewed-by: Hannes Reinecke 
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index f990ab4d..f717fbc 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3283,7 +3283,7 @@ irqreturn_t megasas_isr_fusion(int irq, void *devp)
mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT |
MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR;
 
-   mpi25_ieee_chain->Length = cpu_to_le32(instance->max_chain_frame_sz);
+   mpi25_ieee_chain->Length = cpu_to_le32(instance->mfi_frame_size);
 }
 
 /**
-- 
1.8.3.1



[PATCH v2 00/15] megaraid_sas: Updates for scsi-next

2017-07-05 Thread Shivasharan S
Changes from v1:
- Patch 4: Updated patch description
- Patch 9: Cleanup ld_drv_map in case ld_map allocation fails

Shivasharan S (15):
  megaraid_sas: mismatch of allocated MFI frame size and length exposed
in MFI MPT pass through command
  megaraid_sas: set minimum value of resetwaittime to be 1 secs
  megaraid_sas: Use synchronize_irq in target reset case
  megaraid_sas: Call megasas_complete_cmd_dpc_fusion every 1 second
while there are pending commands
  megaraid_sas: Do not re-fire shutdown DCMD after OCR
  megaraid_sas: Fix endianness issues in DCMD handling
  megaraid_sas: Check valid aen class range to avoid kernel panic
  megaraid_sas: Use SMID for Task abort case only
  megaraid_sas: use vmalloc for crash dump buffers and driver's local
RAID map
  megaraid_sas: Return pended IOCTLs with cmd_status
MFI_STAT_WRONG_STATE in case adapter is dead
  megaraid_sas: Set device queue_depth same as HBA can_queue value in
scsi-mq mode
  megaraid_sas: replace internal FALSE/TRUE definitions with false/true
  megaraid_sas: modified few prints in OCR and IOC INIT path
  megaraid_sas: call megasas_dump_frame with correct IO frame size
  megaraid_sas: driver version upgrade

 drivers/scsi/megaraid/megaraid_sas.h|   5 +-
 drivers/scsi/megaraid/megaraid_sas_base.c   |  45 +--
 drivers/scsi/megaraid/megaraid_sas_fp.c |  40 +++
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 174 ++--
 4 files changed, 163 insertions(+), 101 deletions(-)

-- 
2.8.3



Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 10:06:49AM +0100, Chris Clayton wrote:
> I'll do this  and send dmesg(?) output as soon as I've got scsi_logging_level 
> installed.

Hi Chris,

does this reproducer work (i.e. output FAIL) for you?

#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 

#include 

int main(int argc, char **argv)
{
int fd;
int rc;
int rsz = 131072;
int tout = 1080;
char buf[42] = { 0 };

if (argc != 2) {
printf("usage: %s /dev/sgX\n", argv[0]);
return 1;
}

fd = open(argv[1], O_RDWR);
if (fd < 0) {
perror("open");
return 1;
}

rc = ioctl(fd, SG_SET_RESERVED_SIZE, );
if (rc < 0) {
perror("ioctl SG_SET_RESERVED_SIZE");
goto out_close;
}

rc = ioctl(fd, SG_SET_TIMEOUT, );
if (rc < 0) {
perror("ioctl SG_SET_TIMEOUT");
goto out_close;
}

buf[4] = 'H';
rc = write(fd, , sizeof(buf));
if (rc < 0) {
perror("write");
if (errno == EINVAL)
printf("FAIL\n");
goto out_close;
}

printf("PASS\n");

out_close:
close(fd);
}

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD after OCR

2017-07-05 Thread Hannes Reinecke
On 07/05/2017 12:33 PM, Shivasharan Srikanteshwara wrote:
>> -Original Message-
>> From: Shivasharan Srikanteshwara
>> [mailto:shivasharan.srikanteshw...@broadcom.com]
>> Sent: Tuesday, July 04, 2017 12:39 PM
>> To: 'Hannes Reinecke'; 'linux-scsi@vger.kernel.org'
>> Cc: 'martin.peter...@oracle.com'; 'the...@redhat.com';
>> 'j...@linux.vnet.ibm.com'; Kashyap Desai; Sumit Saxena; 'h...@suse.com';
>> 'h...@lst.de'
>> Subject: RE: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD
>> after
>> OCR
>>
>>> -Original Message-
>>> From: Hannes Reinecke [mailto:h...@suse.de]
>>> Sent: Friday, June 30, 2017 7:00 PM
>>> To: Shivasharan S; linux-scsi@vger.kernel.org
>>> Cc: martin.peter...@oracle.com; the...@redhat.com;
>>> j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com;
>>> sumit.sax...@broadcom.com; h...@suse.com; h...@lst.de
>>> Subject: Re: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD
>>> after OCR
>>>
>>> On 06/30/2017 10:29 AM, Shivasharan S wrote:
 Signed-off-by: Kashyap Desai 
 Signed-off-by: Shivasharan S
 
 ---
  drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 +
  1 file changed, 9 insertions(+)

 diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c
 b/drivers/scsi/megaraid/megaraid_sas_fusion.c
 index 0f13c58..a308e14 100644
 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
 +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
 @@ -3618,6 +3618,15 @@ void megasas_refire_mgmt_cmd(struct
 megasas_instance *instance)

if (!smid)
continue;
 +
 +  /* Do not refire shutdown command */
 +  if (le32_to_cpu(cmd_mfi->frame->dcmd.opcode) ==
 +  MR_DCMD_CTRL_SHUTDOWN) {
 +  cmd_mfi->frame->dcmd.cmd_status = MFI_STAT_OK;
 +  megasas_complete_cmd(instance, cmd_mfi, DID_OK);
 +  continue;
 +  }
 +
req_desc = megasas_get_request_descriptor
(instance, smid - 1);
refire_cmd = req_desc && ((cmd_mfi->frame->dcmd.opcode !=

>>> Please, no.
>>> You already have a selector further down whether to refire the
>>> command, pending on the DRV_DCMD_SKIP_REFIRE flag.
>>> If you always set this flag for the shutdown command you wouldn't need
>>> to touch this at all.
>>> And if you particularly dislike that solution convert the 'refire_cmd ='
>>> statement into a proper switch and blank it out from there.
>>>
>>
>> Hi Hannes,
>> The management commands that get skipped further down in this function are
>> internally generated by the driver itself so we don’t need to complete it
>> back to
>> the application.
>> In case of shutdown DCMD, it’s an IOCTL command(issued by application) so
>> we
>> need to return status back to application.
>> Combining handling of both the cases or using DRV_DCMD_SKIP_REFIRE will
>> not
>> be as straightforward.
>>
>> Thanks,
>> Shivasharan
>>
> Hi Hannes,
> We will implement the switch case approach during our next submission as
> this
> the current code is well tested internally and want to avoid regressions.
> Are you ok if we keep it this way for now?
> 
Yes, sure.

Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


RE: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD after OCR

2017-07-05 Thread Shivasharan Srikanteshwara
> -Original Message-
> From: Shivasharan Srikanteshwara
> [mailto:shivasharan.srikanteshw...@broadcom.com]
> Sent: Tuesday, July 04, 2017 12:39 PM
> To: 'Hannes Reinecke'; 'linux-scsi@vger.kernel.org'
> Cc: 'martin.peter...@oracle.com'; 'the...@redhat.com';
> 'j...@linux.vnet.ibm.com'; Kashyap Desai; Sumit Saxena; 'h...@suse.com';
> 'h...@lst.de'
> Subject: RE: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD
> after
> OCR
>
> > -Original Message-
> > From: Hannes Reinecke [mailto:h...@suse.de]
> > Sent: Friday, June 30, 2017 7:00 PM
> > To: Shivasharan S; linux-scsi@vger.kernel.org
> > Cc: martin.peter...@oracle.com; the...@redhat.com;
> > j...@linux.vnet.ibm.com; kashyap.de...@broadcom.com;
> > sumit.sax...@broadcom.com; h...@suse.com; h...@lst.de
> > Subject: Re: [PATCH 05/15] megaraid_sas: Do not re-fire shutdown DCMD
> > after OCR
> >
> > On 06/30/2017 10:29 AM, Shivasharan S wrote:
> > > Signed-off-by: Kashyap Desai 
> > > Signed-off-by: Shivasharan S
> > > 
> > > ---
> > >  drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 +
> > >  1 file changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > > b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > > index 0f13c58..a308e14 100644
> > > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > > @@ -3618,6 +3618,15 @@ void megasas_refire_mgmt_cmd(struct
> > > megasas_instance *instance)
> > >
> > >   if (!smid)
> > >   continue;
> > > +
> > > + /* Do not refire shutdown command */
> > > + if (le32_to_cpu(cmd_mfi->frame->dcmd.opcode) ==
> > > + MR_DCMD_CTRL_SHUTDOWN) {
> > > + cmd_mfi->frame->dcmd.cmd_status = MFI_STAT_OK;
> > > + megasas_complete_cmd(instance, cmd_mfi, DID_OK);
> > > + continue;
> > > + }
> > > +
> > >   req_desc = megasas_get_request_descriptor
> > >   (instance, smid - 1);
> > >   refire_cmd = req_desc && ((cmd_mfi->frame->dcmd.opcode !=
> > >
> > Please, no.
> > You already have a selector further down whether to refire the
> > command, pending on the DRV_DCMD_SKIP_REFIRE flag.
> > If you always set this flag for the shutdown command you wouldn't need
> > to touch this at all.
> > And if you particularly dislike that solution convert the 'refire_cmd ='
> > statement into a proper switch and blank it out from there.
> >
>
> Hi Hannes,
> The management commands that get skipped further down in this function are
> internally generated by the driver itself so we don’t need to complete it
> back to
> the application.
> In case of shutdown DCMD, it’s an IOCTL command(issued by application) so
> we
> need to return status back to application.
> Combining handling of both the cases or using DRV_DCMD_SKIP_REFIRE will
> not
> be as straightforward.
>
> Thanks,
> Shivasharan
>
Hi Hannes,
We will implement the switch case approach during our next submission as
this
the current code is well tested internally and want to avoid regressions.
Are you ok if we keep it this way for now?

Thanks,
Shivasharan

> > Cheers,
> >
> > Hannes
> > --
> > Dr. Hannes ReineckeTeamlead Storage & Networking
> > h...@suse.de   +49 911 74053 688
> > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> > GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB
> > 21284 (AG
> > Nürnberg)


Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Chris Clayton


On 05/07/17 09:48, Johannes Thumshirn wrote:
> On Wed, Jul 05, 2017 at 10:44:47AM +0200, Johannes Thumshirn wrote:
>> On Wed, Jul 05, 2017 at 08:57:54AM +0100, Chris Clayton wrote:
>>> Thanks for the reply, Johannes.
>>> The strace log for 4.12.0 is attached.
>>
>> Thanks Chris.
>>
>> Can I have a known good version as well? The counterpart to this snippet 
>> would
>> be great:
>>
>> open("/dev/sg0", O_RDWR)= 6
>> ioctl(6, SG_SET_RESERVED_SIZE, [131072]) = 0
>> ioctl(6, SG_SET_TIMEOUT, [1080])= 0
>> write(6, 
>> "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 42) = 
>> -1 EINVAL (Invalid argument)
> 

Thanks Johannes.

The counterpart is shown in the diff snippet in my original post, but I've 
attached the strace log from 4.11.8 in any case.

> And please activate the SG debug prints. Should be via
> 'scsi_logging_level -T 4'.
> 

I'll do this  and send dmesg(?) output as soon as I've got scsi_logging_level 
installed.

Chris
execve("/usr/bin/nerocmd", ["nerocmd", "--scanbus"], 0x7fff08a0c1d8 /* 48 vars 
*/) = 0
brk(NULL)   = 0x1053000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f251fb79000
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=205457, ...}) = 0
mmap(NULL, 205457, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f251fb46000
close(3)= 0
open("/usr/lib/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\6\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=5944, ...}) = 0
mmap(NULL, 2101304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f251f755000
mprotect(0x7f251f756000, 2093056, PROT_NONE) = 0
mmap(0x7f251f955000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f251f955000
close(3)= 0
open("/usr/lib/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\\246\1\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1114952, ...}) = 0
mmap(NULL, 3212968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f251f444000
mprotect(0x7f251f553000, 2093056, PROT_NONE) = 0
mmap(0x7f251f752000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10e000) = 0x7f251f752000
mmap(0x7f251f754000, 1704, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f251f754000
close(3)= 0
open("/usr/lib/libgtk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\312\6\0\0\0\0\0"..., 832) = 
832
fstat(3, {st_mode=S_IFREG|0755, st_size=4419752, ...}) = 0
mmap(NULL, 6525176, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f251ee0a000
mprotect(0x7f251f236000, 2097152, PROT_NONE) = 0
mmap(0x7f251f436000, 45056, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x42c000) = 0x7f251f436000
mmap(0x7f251f441000, 8440, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f251f441000
close(3)= 0
open("/usr/lib/libgdk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\342\1\0\0\0\0\0"..., 832) = 
832
fstat(3, {st_mode=S_IFREG|0755, st_size=723960, ...}) = 0
mmap(NULL, 2820600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f251eb59000
mprotect(0x7f251ec05000, 2093056, PROT_NONE) = 0
mmap(0x7f251ee04000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xab000) = 0x7f251ee04000
close(3)= 0
open("/usr/lib/libatk-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\261\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=155064, ...}) = 0
mmap(NULL, 2251480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f251e933000
mprotect(0x7f251e955000, 2097152, PROT_NONE) = 0
mmap(0x7f251eb55000, 16384, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f251eb55000
close(3)= 0
open("/usr/lib/libgdk_pixbuf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240g\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=146632, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f251fb44000
mmap(NULL, 2242224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f251e70f000
mprotect(0x7f251e731000, 2097152, PROT_NONE) = 0
mmap(0x7f251e931000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f251e931000
close(3)= 0
open("/usr/lib/libpangocairo-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, 

Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 10:44:47AM +0200, Johannes Thumshirn wrote:
> On Wed, Jul 05, 2017 at 08:57:54AM +0100, Chris Clayton wrote:
> > Thanks for the reply, Johannes.
> > The strace log for 4.12.0 is attached.
> 
> Thanks Chris.
> 
> Can I have a known good version as well? The counterpart to this snippet would
> be great:
> 
> open("/dev/sg0", O_RDWR)= 6
> ioctl(6, SG_SET_RESERVED_SIZE, [131072]) = 0
> ioctl(6, SG_SET_TIMEOUT, [1080])= 0
> write(6, 
> "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 42) = 
> -1 EINVAL (Invalid argument)

And please activate the SG debug prints. Should be via
'scsi_logging_level -T 4'.

Thanks.

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 08:57:54AM +0100, Chris Clayton wrote:
> Thanks for the reply, Johannes.
> The strace log for 4.12.0 is attached.

Thanks Chris.

Can I have a known good version as well? The counterpart to this snippet would
be great:

open("/dev/sg0", O_RDWR)= 6
ioctl(6, SG_SET_RESERVED_SIZE, [131072]) = 0
ioctl(6, SG_SET_TIMEOUT, [1080])= 0
write(6, "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
42) = -1 EINVAL (Invalid argument)


-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: [PATCH] virtio_scsi: always read VPD pages for multiqueue too

2017-07-05 Thread Fam Zheng
On Wed, 07/05 10:30, Paolo Bonzini wrote:
> Multi-queue virtio-scsi uses a different scsi_host_template struct.
> Add the .device_alloc field there, too.
> 
> Fixes: 25d1d50e23275e141e3a3fe06c25a99f4c4bf4e0
> Cc: sta...@vger.kernel.org
> Cc: David Gibson 
> Signed-off-by: Paolo Bonzini 
> ---
>  drivers/scsi/virtio_scsi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index f8dbfeee6c63..ad1e7f1aba4c 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -826,6 +826,7 @@ static int virtscsi_map_queues(struct Scsi_Host *shost)
>   .change_queue_depth = virtscsi_change_queue_depth,
>   .eh_abort_handler = virtscsi_abort,
>   .eh_device_reset_handler = virtscsi_device_reset,
> + .slave_alloc = virtscsi_device_alloc,
>  
>   .can_queue = 1024,
>   .dma_boundary = UINT_MAX,
> -- 
> 1.8.3.1
> 

Reviewed-by: Fam Zheng 


[PATCH] virtio_scsi: always read VPD pages for multiqueue too

2017-07-05 Thread Paolo Bonzini
Multi-queue virtio-scsi uses a different scsi_host_template struct.
Add the .device_alloc field there, too.

Fixes: 25d1d50e23275e141e3a3fe06c25a99f4c4bf4e0
Cc: sta...@vger.kernel.org
Cc: David Gibson 
Signed-off-by: Paolo Bonzini 
---
 drivers/scsi/virtio_scsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index f8dbfeee6c63..ad1e7f1aba4c 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -826,6 +826,7 @@ static int virtscsi_map_queues(struct Scsi_Host *shost)
.change_queue_depth = virtscsi_change_queue_depth,
.eh_abort_handler = virtscsi_abort,
.eh_device_reset_handler = virtscsi_device_reset,
+   .slave_alloc = virtscsi_device_alloc,
 
.can_queue = 1024,
.dma_boundary = UINT_MAX,
-- 
1.8.3.1



Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Chris Clayton


On 05/07/17 08:39, Johannes Thumshirn wrote:
> On Wed, Jul 05, 2017 at 08:06:17AM +0100, Chris Clayton wrote:
>> I can provide the full traces or any other diagnostics, if they would help.
> 
> Yes this would definitively help. An strace log would be great so I
> can make a local reproducer.
> 

Thanks for the reply, Johannes.
The strace log for 4.12.0 is attached.

Chris

> Thanks,
>   Johannes
> 
execve("/usr/bin/nerocmd", ["nerocmd", "--scanbus"], 0x7ffc5e7f3b28 /* 48 vars 
*/) = 0
brk(NULL)   = 0x252e000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f46404d
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=205457, ...}) = 0
mmap(NULL, 205457, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f464049d000
close(3)= 0
open("/usr/lib/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\6\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=5944, ...}) = 0
mmap(NULL, 2101304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f46400ac000
mprotect(0x7f46400ad000, 2093056, PROT_NONE) = 0
mmap(0x7f46402ac000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f46402ac000
close(3)= 0
open("/usr/lib/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\\246\1\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1114952, ...}) = 0
mmap(NULL, 3212968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f463fd9b000
mprotect(0x7f463feaa000, 2093056, PROT_NONE) = 0
mmap(0x7f46400a9000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10e000) = 0x7f46400a9000
mmap(0x7f46400ab000, 1704, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f46400ab000
close(3)= 0
open("/usr/lib/libgtk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\312\6\0\0\0\0\0"..., 832) = 
832
fstat(3, {st_mode=S_IFREG|0755, st_size=4419752, ...}) = 0
mmap(NULL, 6525176, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f463f761000
mprotect(0x7f463fb8d000, 2097152, PROT_NONE) = 0
mmap(0x7f463fd8d000, 45056, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x42c000) = 0x7f463fd8d000
mmap(0x7f463fd98000, 8440, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f463fd98000
close(3)= 0
open("/usr/lib/libgdk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\342\1\0\0\0\0\0"..., 832) = 
832
fstat(3, {st_mode=S_IFREG|0755, st_size=723960, ...}) = 0
mmap(NULL, 2820600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f463f4b
mprotect(0x7f463f55c000, 2093056, PROT_NONE) = 0
mmap(0x7f463f75b000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xab000) = 0x7f463f75b000
close(3)= 0
open("/usr/lib/libatk-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\261\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=155064, ...}) = 0
mmap(NULL, 2251480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f463f28a000
mprotect(0x7f463f2ac000, 2097152, PROT_NONE) = 0
mmap(0x7f463f4ac000, 16384, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f463f4ac000
close(3)= 0
open("/usr/lib/libgdk_pixbuf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240g\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=146632, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f464049b000
mmap(NULL, 2242224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f463f066000
mprotect(0x7f463f088000, 2097152, PROT_NONE) = 0
mmap(0x7f463f288000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f463f288000
close(3)= 0
open("/usr/lib/libpangocairo-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340O\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=52424, ...}) = 0
mmap(NULL, 2147896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f463ee59000
mprotect(0x7f463ee65000, 2093056, PROT_NONE) = 0
mmap(0x7f463f064000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f463f064000
close(3)= 0
open("/usr/lib/libfontconfig.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260l\0\0\0\0\0\0"..., 
832) = 832
fstat(3, 

Re: Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Johannes Thumshirn
On Wed, Jul 05, 2017 at 08:06:17AM +0100, Chris Clayton wrote:
> I can provide the full traces or any other diagnostics, if they would help.

Yes this would definitively help. An strace log would be great so I
can make a local reproducer.

Thanks,
Johannes

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Nero 4 Linux applications broken in 4.12

2017-07-05 Thread Chris Clayton
Hi.

I use the applications from Nero 4 Linux to write to blu-ray media, 
principally, but not exclusively, as part of my
back-up regime. Those applications have stopped working with Linux 4.12 because 
they fail to detect my drives (one built
in to my laptop and the other attached via USB). The applications successfully 
detect my drives with 4.11.8 and 4.9.35
kernels. I have been using the applications since 3.x.x days. Unfortunately, 
development of the applications has deeb
discontinued.

I've bisected the problem and the outcome is:

28676d869bbb5257b5f14c0c95ad3af3a7019dd5 is the first bad commit
commit 28676d869bbb5257b5f14c0c95ad3af3a7019dd5
Author: Johannes Thumshirn 
Date:   Fri Apr 7 09:34:15 2017 +0200

scsi: sg: check for valid direction before starting the request

Check for a valid direction before starting the request, otherwise we
risk running into an assertion in the scsi midlayer checking for valid
requests.

[mkp: fixed typo]

Signed-off-by: Johannes Thumshirn 
Link: http://www.spinics.net/lists/linux-scsi/msg104400.html
Reported-by: Dmitry Vyukov 
Signed-off-by: Hannes Reinecke 
Tested-by: Johannes Thumshirn 
Reviewed-by: Christoph Hellwig 
Signed-off-by: Martin K. Petersen 

:04 04 5f268585ddc59bdc4e7bd3b473b8e041f59083af 
6d44c177d8eb1df63a3e285e8a77010de0368d01 M  drivers

With this change reversed in 4.12.0, the applications can detect my drive 
again, although I haven't tried burning
anything to media yet.

Using kernels 4.11.8 and 4.12.0, I ran the console command "nerocmd --scanbus" 
under strace and logged the resultant
traces. The first material difference between the traces seems to be:

diff -up nerocmd-strace.log-4.11.8 nerocmd-strace.log-4.12.0  > 
nerocmd-strace.log.diff
--- nerocmd-strace.log-4.11.8   2017-07-04 22:25:19.251996566 +0100
+++ nerocmd-strace.log-4.12.0   2017-07-04 22:31:05.575997661 +0100
...
 open("/dev/sg0", O_RDWR)= 6
 ioctl(6, SG_SET_RESERVED_SIZE, [131072]) = 0
 ioctl(6, SG_SET_TIMEOUT, [1080])= 0
-write(6, "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
42) = 42
-read(6, "H\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
72) = 72
+write(6, "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
42) = -1 EINVAL (Invalid argument)
 close(6)= 0
 open("/dev/sg1", O_RDWR)= 6
 ioctl(6, SG_SET_RESERVED_SIZE, [131072]) = 0
 ioctl(6, SG_SET_TIMEOUT, [1080])= 0
-write(6, "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
42) = 42
-read(6, "H\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
72) = 72
+write(6, "\0\0\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
42) = -1 EINVAL (Invalid argument)
 close(6)= 0
 open("/usr/lib64/nero/libMmc.so", O_RDONLY|O_CLOEXEC) = 6
 read(6, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0k\v\0\0\0\0\0"..., 
832) = 832
...

I can provide the full traces or any other diagnostics, if they would help.

Thanks

Chris