Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f834c755 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge gregkh@master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

parents 62250b3b 0db99e33
Loading
Loading
Loading
Loading
+123 −0
Original line number Diff line number Diff line
Release Date	: Fri May 19 09:31:45 EST 2006 - Seokmann Ju <sju@lsil.com>
Current Version : 2.20.4.9 (scsi module), 2.20.2.6 (cmm module)
Older Version	: 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)

1.	Fixed a bug in megaraid_init_mbox().
	Customer reported "garbage in file on x86_64 platform".
	Root Cause: the driver registered controllers as 64-bit DMA capable
	for those which are not support it.
	Fix: Made change in the function inserting identification machanism
	identifying 64-bit DMA capable controllers.

	> -----Original Message-----
	> From: Vasily Averin [mailto:vvs@sw.ru]
	> Sent: Thursday, May 04, 2006 2:49 PM
	> To: linux-scsi@vger.kernel.org; Kolli, Neela; Mukker, Atul;
	> Ju, Seokmann; Bagalkote, Sreenivas;
	> James.Bottomley@SteelEye.com; devel@openvz.org
	> Subject: megaraid_mbox: garbage in file
	>
	> Hello all,
	>
	> I've investigated customers claim on the unstable work of
	> their node and found a
	> strange effect: reading from some files leads to the
	>  "attempt to access beyond end of device" messages.
	>
	> I've checked filesystem, memory on the node, motherboard BIOS
	> version, but it
	> does not help and issue still has been reproduced by simple
	> file reading.
	>
	> Reproducer is simple:
	>
	> echo 0xffffffff >/proc/sys/dev/scsi/logging_level ;
	> cat /vz/private/101/root/etc/ld.so.cache >/tmp/ttt  ;
	> echo 0 >/proc/sys/dev/scsi/logging
	>
	> It leads to the following messages in dmesg
	>
	> sd_init_command: disk=sda, block=871769260, count=26
	> sda : block=871769260
	> sda : reading 26/26 512 byte blocks.
	> scsi_add_timer: scmd: f79ed980, time: 7500, (c02b1420)
	> sd 0:1:0:0: send 0xf79ed980                  sd 0:1:0:0:
	>         command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
	> buffer = 0xf7cfb540, bufflen = 13312, done = 0xc0366b40,
	> queuecommand 0xc0344010
	> leaving scsi_dispatch_cmnd()
	> scsi_delete_timer: scmd: f79ed980, rtn: 1
	> sd 0:1:0:0: done 0xf79ed980 SUCCESS        0 sd 0:1:0:0:
	>         command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
	> scsi host busy 1 failed 0
	> sd 0:1:0:0: Notifying upper driver of completion (result 0)
	> sd_rw_intr: sda: res=0x0
	> 26 sectors total, 13312 bytes done.
	> use_sg is 4
	> attempt to access beyond end of device
	> sda6: rw=0, want=1044134458, limit=951401367
	> Buffer I/O error on device sda6, logical block 522067228
	> attempt to access beyond end of device

2.	When INQUIRY with EVPD bit set issued to the MegaRAID controller,
	system memory gets corrupted.
	Root Cause: MegaRAID F/W handle the INQUIRY with EVPD bit set
	incorrectly.
	Fix: MegaRAID F/W has fixed the problem and being process of release,
	soon. Meanwhile, driver will filter out the request.

3.	One of member in the data structure of the driver leads unaligne
	issue on 64-bit platform.
	Customer reporeted "kernel unaligned access addrss" issue when
	application communicates with MegaRAID HBA driver.
	Root Cause: in uioc_t structure, one of member had misaligned and it
	led system to display the error message.
	Fix: A patch submitted to community from following folk.

	> -----Original Message-----
	> From: linux-scsi-owner@vger.kernel.org
	> [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Sakurai Hiroomi
	> Sent: Wednesday, July 12, 2006 4:20 AM
	> To: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
	> Subject: Re: Help: strange messages from kernel on IA64 platform
	>
	> Hi,
	>
	> I saw same message.
	>
	> When GAM(Global Array Manager) is started, The following
	> message output.
	> kernel: kernel unaligned access to 0xe0000001fe1080d4,
	> ip=0xa000000200053371
	>
	> The uioc structure used by ioctl is defined by packed,
	> the allignment of each member are disturbed.
	> In a 64 bit structure, the allignment of member doesn't fit 64 bit
	> boundary. this causes this messages.
	> In a 32 bit structure, we don't see the message because the allinment
	> of member fit 32 bit boundary even if packed is specified.
	>
	> patch
	> I Add 32 bit dummy member to fit 64 bit boundary. I tested.
	> We confirmed this patch fix the problem by IA64 server.
	>
	> **************************************************************
	> ****************
	> --- linux-2.6.9/drivers/scsi/megaraid/megaraid_ioctl.h.orig
	> 2006-04-03 17:13:03.000000000 +0900
	> +++ linux-2.6.9/drivers/scsi/megaraid/megaraid_ioctl.h
	> 2006-04-03 17:14:09.000000000 +0900
	> @@ -132,6 +132,10 @@
	>  /* Driver Data: */
	>          void __user *           user_data;
	>          uint32_t                user_data_len;
	> +
	> +        /* 64bit alignment */
	> +        uint32_t                pad_0xBC;
	> +
	>          mraid_passthru_t        __user *user_pthru;
	>
	>          mraid_passthru_t        *pthru32;
	> **************************************************************
	> ****************

Release Date	: Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <sju@lsil.com>
Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
Older Version	: 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
+2 −1
Original line number Diff line number Diff line
@@ -244,7 +244,8 @@ static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)

	if (scatterlen == 0)
		memcpy(sc->request_buffer, buf, len);
	else for (slp = (struct scatterlist *)sc->request_buffer; scatterlen-- > 0 && len > 0; slp++) {
	else for (slp = (struct scatterlist *)sc->request_buffer;
		  scatterlen-- > 0 && len > 0; slp++) {
		unsigned thislen = min(len, slp->length);

		memcpy(page_address(slp->page) + slp->offset, buf, thislen);
+2 −20
Original line number Diff line number Diff line
@@ -378,21 +378,6 @@ iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn)
	return iser_conn_set_full_featured_mode(conn);
}

static void
iscsi_iser_conn_terminate(struct iscsi_conn *conn)
{
	struct iscsi_iser_conn *iser_conn = conn->dd_data;
	struct iser_conn *ib_conn = iser_conn->ib_conn;

	BUG_ON(!ib_conn);
	/* starts conn teardown process, waits until all previously   *
	 * posted buffers get flushed, deallocates all conn resources */
	iser_conn_terminate(ib_conn);
	iser_conn->ib_conn = NULL;
	conn->recv_lock = NULL;
}


static struct iscsi_transport iscsi_iser_transport;

static struct iscsi_cls_session *
@@ -555,13 +540,13 @@ iscsi_iser_ep_poll(__u64 ep_handle, int timeout_ms)
static void
iscsi_iser_ep_disconnect(__u64 ep_handle)
{
	struct iser_conn *ib_conn = iscsi_iser_ib_conn_lookup(ep_handle);
	struct iser_conn *ib_conn;

	ib_conn = iscsi_iser_ib_conn_lookup(ep_handle);
	if (!ib_conn)
		return;

	iser_err("ib conn %p state %d\n",ib_conn, ib_conn->state);

	iser_conn_terminate(ib_conn);
}

@@ -614,9 +599,6 @@ static struct iscsi_transport iscsi_iser_transport = {
	.get_session_param	= iscsi_session_get_param,
	.start_conn             = iscsi_iser_conn_start,
	.stop_conn              = iscsi_conn_stop,
	/* these are called as part of conn recovery */
	.suspend_conn_recv	= NULL, /* FIXME is/how this relvant to iser? */
	.terminate_conn		= iscsi_iser_conn_terminate,
	/* IO */
	.send_pdu		= iscsi_conn_send_pdu,
	.get_stats		= iscsi_iser_conn_get_stats,
+0 −1
Original line number Diff line number Diff line
@@ -640,7 +640,6 @@ typedef struct _MPT_ADAPTER
	struct work_struct	 fc_setup_reset_work;
	struct list_head	 fc_rports;
	spinlock_t		 fc_rescan_work_lock;
	int			 fc_rescan_work_count;
	struct work_struct	 fc_rescan_work;
	char			 fc_rescan_work_q_name[KOBJ_NAME_LEN];
	struct workqueue_struct *fc_rescan_work_q;
+38 −54
Original line number Diff line number Diff line
@@ -669,7 +669,10 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
			 * if still doing discovery,
			 * hang loose a while until finished
			 */
			if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
			if ((pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) ||
			    (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_ONLINE &&
			     (pp0dest->Flags & MPI_FCPORTPAGE0_FLAGS_ATTACH_TYPE_MASK)
			      == MPI_FCPORTPAGE0_FLAGS_ATTACH_NO_INIT)) {
				if (count-- > 0) {
					msleep(100);
					goto try_again;
@@ -895,12 +898,9 @@ mptfc_rescan_devices(void *arg)
{
	MPT_ADAPTER		*ioc = (MPT_ADAPTER *)arg;
	int			ii;
	int			work_to_do;
	u64			pn;
	unsigned long		flags;
	struct mptfc_rport_info *ri;

	do {
	/* start by tagging all ports as missing */
	list_for_each_entry(ri, &ioc->fc_rports, list) {
		if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
@@ -937,17 +937,6 @@ mptfc_rescan_devices(void *arg)
				(unsigned long long)pn));
		}
	}

		/*
		 * allow multiple passes as target state
		 * might have changed during scan
		 */
		spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
		if (ioc->fc_rescan_work_count > 2) 	/* only need one more */
			ioc->fc_rescan_work_count = 2;
		work_to_do = --ioc->fc_rescan_work_count;
		spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
	} while (work_to_do);
}

static int
@@ -1159,7 +1148,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
	 *	by doing it via the workqueue, some locking is eliminated
	 */

	ioc->fc_rescan_work_count = 1;
	queue_work(ioc->fc_rescan_work_q, &ioc->fc_rescan_work);
	flush_workqueue(ioc->fc_rescan_work_q);

@@ -1202,11 +1190,9 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
	case MPI_EVENT_RESCAN:
		spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
		if (ioc->fc_rescan_work_q) {
			if (ioc->fc_rescan_work_count++ == 0) {
			queue_work(ioc->fc_rescan_work_q,
				   &ioc->fc_rescan_work);
		}
		}
		spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
		break;
	default:
@@ -1248,11 +1234,9 @@ mptfc_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
		mptfc_SetFcPortPage1_defaults(ioc);
		spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
		if (ioc->fc_rescan_work_q) {
			if (ioc->fc_rescan_work_count++ == 0) {
			queue_work(ioc->fc_rescan_work_q,
				   &ioc->fc_rescan_work);
		}
		}
		spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
	}
	return 1;
Loading