RE: [Bugme-new] [Bug 11792] New: Oops when reading /proc/megaraid/hba0/diskdrives-ch*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks TOMM.  If this is the case, it may affect some of other drivers like our MPT and SAS driver.  Is there a way kernel can fix it?

Thanks,

Bo Yang

-----Original Message-----
From: FUJITA Tomonori [mailto:fujita.tomonori@xxxxxxxxxxxxx]
Sent: Wednesday, October 22, 2008 9:39 AM
To: Yang, Bo
Cc: fujita.tomonori@xxxxxxxxxxxxx; bharrosh@xxxxxxxxxxx; pterjan@xxxxxxxxx; matthew@xxxxxx; akpm@xxxxxxxxxxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx; Patro, Sumant; bugme-daemon@xxxxxxxxxxxxxxxxxxx; Austria, Winston
Subject: RE: [Bugme-new] [Bug 11792] New: Oops when reading /proc/megaraid/hba0/diskdrives-ch*

On Wed, 22 Oct 2008 07:03:03 -0600
"Yang, Bo" <Bo.Yang@xxxxxxx> wrote:

> I saw the latest working kernel: 2.6.24 and first failing kernel
> version: 2.6.27-rc8.  I understand there are lots of changes between
> those two kernels.  Can you take a look the changes from kernels to
> find out the root cause?

Sorry, I didn't explain the possible root cause.

struct scsi_cmnd in 2.6.25:

unsigned char cmnd[MAX_COMMAND_SIZE];


struct scsi_cmnd in 2.6.26:

unsigned char *cmnd;


In short, struct scsi_cmnd doesn't have static array for cdb. You need
to allocate memory for it (the scsi midlayer does for common usage).

So

static int
mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
{
...
        scb = &adapter->int_scb;
        memset(scb, 0, sizeof(scb_t));

        scmd = &adapter->int_scmd;
        memset(scmd, 0, sizeof(Scsi_Cmnd));

        sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
        scmd->device = sdev;

        scmd->device->host = adapter->host;
        scmd->host_scribble = (void *)scb;
        scmd->cmnd[0] = MEGA_INTERNAL_CMD;

I suspect that the driver crashes here. My patch adds array to
adapter_t and use it here.

After 2.6.25, sense_buffer also is converted from static array to
pointer. In general, using scsi_allocate_command/scsi_free_command is
the recommended way to use struct scsi_cmnd.

So my latest patch removes struct scsi_cmnd in adapter_t and uses the
API in mega_internal_command().


> Also if you believe this is the driver issue and need LSI to help,
> can you report this issue to LSI?

Yeah, I think that we need to update this driver because of the
changes to SCSI mid-layer.

It would be appreciated if you can test my latest path:

http://marc.info/?l=linux-scsi&m=122467887502481&w=2


Can you think of this thread as a bug report to LSI?
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux