GIT 17b12fbb633869c92369118d5b787a327d3e7ab5 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git commit 17b12fbb633869c92369118d5b787a327d3e7ab5 Author: Bryan Holty Date: Tue May 30 21:09:34 2006 -0700 [SCSI] fix memory building non-aligned sg lists The calculation of nr_pages in scsi_req_map_sg() doesn't account for the fact that the first page could have an offset that pushes the end of the buffer onto a new page. Signed-off-by: Bryan Holty [akpm: use PAGE_ALIGN()] Signed-off-by: Andrew Morton Signed-off-by: James Bottomley commit 9f434d4f84a235f6b61aec6e691d6b07bc46fc24 Author: Eric Moore Date: Wed May 17 18:19:43 2006 -0600 [SCSI] scsi_transport_sas: make write attrs writeable A couple write attributes in sas transport layer have a small bug that prevents them from being written to. Those attributes are the link_reset and write_reset. This is due the store field being set to NULL. Signed-off-by: Eric Moore Signed-off-by: James Bottomley commit 6d99a3f372181160a56d7b1ee3259dbe03663f0d Author: James Bottomley Date: Fri May 19 10:49:37 2006 -0500 [SCSI] scsi_transport_sas; fix user_scan the user_scan() callback currently has the potential to identify the wrong device in the presence of expanders. This is because it finds the first device with a matching target_id, which might be an expander. Fix this by making it look specifically for end devices. Signed-off-by: James Bottomley commit 78a904b65420e02bf964af6a83c1fd7a85e0b59d Author: Randy.Dunlap Date: Fri May 19 10:11:02 2006 -0700 [SCSI] ppa: fix for machines with highmem ppa cannot handle highmem pages, and like imm, which already has this patch, the device is slow, so performance is not a big issue, so just force pages to be in low memory (hence mapped). Signed-off-by: Randy Dunlap Signed-off-by: James Bottomley commit 4ff42a669a9ad3eb8274da31c7baabd968c2d365 Author: James Bottomley Date: Wed May 17 18:06:52 2006 -0500 [SCSI] mptspi: reset handler shouldn't be called for other bus protocols All registered reset callback handlers are called during reset processing. The mptspi modules has its own reset callback handler, just recently added for issuing domain validation after host reset. If either the mptsas or mptfc driver are loaded, this callback could be called. Thus resulting in domain validation being issued for sas or fibre end devices. Fix this by having mptbase.c check the bus type against the driver type and only call the reset handler if they match (or if it's a non-bus specific reset handler). Signed-off-by: James Bottomley commit c3d833685583f943fb0b5511a9e4602becb1668b Author: Thomas Bogendoerfer Date: Tue May 16 06:38:29 2006 +0200 [SCSI] Blacklist entry for HP dat changer after upgrading our SUN E250 from 2.4 to 2.6 I'm seeing following error when the HP DDS4 DAT changer gets probed: scsi: host 1 channel 0 id 5 lun16777216 has a LUN larger than allowed by the host adapter The device is connected to a symbios 875 host. I've talked to Willy about the problem, and he asked me to try to blacklist the device for reportlun. I did that with the patch below and it solved the problem. It now gets properly detected: target1:0:5: FAST-20 WIDE SCSI 40.0 MB/s ST (50 ns, offset 16) Vendor: HP Model: C5713A Rev: H307 Type: Sequential-Access ANSI SCSI revision: 03 target1:0:5: Beginning Domain Validation target1:0:5: FAST-20 SCSI 20.0 MB/s ST (50 ns, offset 16) target1:0:5: FAST-20 WIDE SCSI 40.0 MB/s ST (50 ns, offset 16) target1:0:5: Domain Validation skipping write tests target1:0:5: Ending Domain Validation Vendor: HP Model: C5713A Rev: H307 Type: Medium Changer ANSI SCSI revision: 03 Signed-off-by: tsbogend@alpha.franken.de Signed-off-by: James Bottomley --- diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 9080853..a300840 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1605,6 +1605,21 @@ mpt_resume(struct pci_dev *pdev) } #endif +static int +mpt_signal_reset(int index, MPT_ADAPTER *ioc, int reset_phase) +{ + if ((MptDriverClass[index] == MPTSPI_DRIVER && + ioc->bus_type != SPI) || + (MptDriverClass[index] == MPTFC_DRIVER && + ioc->bus_type != FC) || + (MptDriverClass[index] == MPTSAS_DRIVER && + ioc->bus_type != SAS)) + /* make sure we only call the relevant reset handler + * for the bus */ + return 0; + return (MptResetHandlers[index])(ioc, reset_phase); +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * mpt_do_ioc_recovery - Initialize or recover MPT adapter. @@ -1885,14 +1900,14 @@ #endif if ((ret == 0) && MptResetHandlers[ii]) { dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n", ioc->name, ii)); - rc += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_POST_RESET); + rc += mpt_signal_reset(ii, ioc, MPT_IOC_POST_RESET); handlers++; } if (alt_ioc_ready && MptResetHandlers[ii]) { drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n", ioc->name, ioc->alt_ioc->name, ii)); - rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET); + rc += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_POST_RESET); handlers++; } } @@ -3267,11 +3282,11 @@ #endif if (MptResetHandlers[ii]) { dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n", ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_PRE_RESET); + r += mpt_signal_reset(ii, ioc, MPT_IOC_PRE_RESET); if (ioc->alt_ioc) { dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n", ioc->name, ioc->alt_ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_PRE_RESET); + r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_PRE_RESET); } } } @@ -5706,11 +5721,11 @@ #endif if (MptResetHandlers[ii]) { dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n", ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_SETUP_RESET); + r += mpt_signal_reset(ii, ioc, MPT_IOC_SETUP_RESET); if (ioc->alt_ioc) { dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n", ioc->name, ioc->alt_ioc->name, ii)); - r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_SETUP_RESET); + r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_SETUP_RESET); } } } diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index fee843f..108910f 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -982,6 +982,12 @@ static int device_check(ppa_struct *dev) return -ENODEV; } +static int ppa_adjust_queue(struct scsi_device *device) +{ + blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); + return 0; +} + static struct scsi_host_template ppa_template = { .module = THIS_MODULE, .proc_name = "ppa", @@ -997,6 +1003,7 @@ static struct scsi_host_template ppa_tem .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, .can_queue = 1, + .slave_alloc = ppa_adjust_queue, }; /*************************************************************************** diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 941c1e1..62f8cb7 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -165,6 +165,7 @@ static struct { {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD}, {"HP", "C1557A", NULL, BLIST_FORCELUN}, {"HP", "C3323-300", "4269", BLIST_NOTQ}, + {"HP", "C5713A", NULL, BLIST_NOREPORTLUN}, {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN}, {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 764a8b3..2999c34 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -367,7 +367,7 @@ static int scsi_req_map_sg(struct reques int nsegs, unsigned bufflen, gfp_t gfp) { struct request_queue *q = rq->q; - int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT; + int nr_pages = PAGE_ALIGN(bufflen + sgl[0].offset); unsigned int data_len = 0, len, bytes, off; struct page *page; struct bio *bio = NULL; diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8b6d65e..f3b1606 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Hos list_for_each_entry(rphy, &sas_host->rphy_list, list) { struct sas_phy *parent = dev_to_phy(rphy->dev.parent); - if (rphy->scsi_target_id == -1) + if (rphy->identify.device_type != SAS_END_DEVICE || + rphy->scsi_target_id == -1) continue; if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && @@ -977,7 +978,6 @@ static int sas_user_scan(struct Scsi_Hos #define SETUP_TEMPLATE(attrb, field, perm, test) \ i->private_##attrb[count] = class_device_attr_##field; \ i->private_##attrb[count].attr.mode = perm; \ - i->private_##attrb[count].store = NULL; \ i->attrb[count] = &i->private_##attrb[count]; \ if (test) \ count++