From c3d833685583f943fb0b5511a9e4602becb1668b Mon Sep 17 00:00:00 2001 From: Thomas Bogendoerfer Date: Tue, 16 May 2006 06:38:29 +0200 Subject: [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 --- drivers/scsi/scsi_devinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 941c1e15c8992c..62f8cb7b3d2bac 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}, -- cgit 1.2.3-korg From 4ff42a669a9ad3eb8274da31c7baabd968c2d365 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Wed, 17 May 2006 18:06:52 -0500 Subject: [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 --- drivers/message/fusion/mptbase.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 9080853fe28355..a30084076ac888 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 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) 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 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) 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 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) 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); } } } -- cgit 1.2.3-korg From 78a904b65420e02bf964af6a83c1fd7a85e0b59d Mon Sep 17 00:00:00 2001 From: "Randy.Dunlap" Date: Fri, 19 May 2006 10:11:02 -0700 Subject: [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 --- drivers/scsi/ppa.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index fee843fab1c7d5..108910f512e477 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_template = { .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, .can_queue = 1, + .slave_alloc = ppa_adjust_queue, }; /*************************************************************************** -- cgit 1.2.3-korg From 6d99a3f372181160a56d7b1ee3259dbe03663f0d Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 19 May 2006 10:49:37 -0500 Subject: [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 --- drivers/scsi/scsi_transport_sas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8b6d65e21bae3a..8126c395de164d 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_Host *shost, uint channel, 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) && -- cgit 1.2.3-korg From 9f434d4f84a235f6b61aec6e691d6b07bc46fc24 Mon Sep 17 00:00:00 2001 From: Eric Moore Date: Wed, 17 May 2006 18:19:43 -0600 Subject: [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 --- drivers/scsi/scsi_transport_sas.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8126c395de164d..f3b16066387cf2 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -978,7 +978,6 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel, #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++ -- cgit 1.2.3-korg From f52359622fa25783cf1a08c0772048d2ed1a7434 Mon Sep 17 00:00:00 2001 From: Bryan Holty Date: Wed, 22 Mar 2006 06:35:39 -0600 Subject: [SCSI] scsi_lib.c: properly count the number of pages in scsi_req_map_sg() 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 Signed-off-by: James Bottomley --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 764a8b375ead10..faee4757c03adb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -367,7 +367,7 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl, 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 = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned int data_len = 0, len, bytes, off; struct page *page; struct bio *bio = NULL; -- cgit 1.2.3-korg