···16361636W: http://ldm.sourceforge.net16371637S: Maintained1638163816391639+LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)16401640+P: Eric Moore16411641+M: Eric.Moore@lsil.com16421642+M: support@lsil.com16431643+L: mpt_linux_developer@lsil.com16441644+L: linux-scsi@vger.kernel.org16451645+W: http://www.lsilogic.com/support16461646+S: Supported16471647+16391648LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers16401649P: Matthew Wilcox16411650M: matthew@wil.cx
+62-2
drivers/message/fusion/mptbase.c
···11181118 return -1;11191119}1120112011211121+int11221122+mpt_alt_ioc_wait(MPT_ADAPTER *ioc)11231123+{11241124+ int loop_count = 30 * 4; /* Wait 30 seconds */11251125+ int status = -1; /* -1 means failed to get board READY */11261126+11271127+ do {11281128+ spin_lock(&ioc->initializing_hba_lock);11291129+ if (ioc->initializing_hba_lock_flag == 0) {11301130+ ioc->initializing_hba_lock_flag=1;11311131+ spin_unlock(&ioc->initializing_hba_lock);11321132+ status = 0;11331133+ break;11341134+ }11351135+ spin_unlock(&ioc->initializing_hba_lock);11361136+ set_current_state(TASK_INTERRUPTIBLE);11371137+ schedule_timeout(HZ/4);11381138+ } while (--loop_count);11391139+11401140+ return status;11411141+}11421142+11431143+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/11441144+/*11451145+ * mpt_bringup_adapter - This is a wrapper function for mpt_do_ioc_recovery11461146+ * @ioc: Pointer to MPT adapter structure11471147+ * @sleepFlag: Use schedule if CAN_SLEEP else use udelay.11481148+ *11491149+ * This routine performs all the steps necessary to bring the IOC11501150+ * to a OPERATIONAL state.11511151+ *11521152+ * Special Note: This function was added with spin lock's so as to allow11531153+ * the dv(domain validation) work thread to succeed on the other channel11541154+ * that maybe occuring at the same time when this function is called.11551155+ * Without this lock, the dv would fail when message frames were11561156+ * requested during hba bringup on the alternate ioc.11571157+ */11581158+static int11591159+mpt_bringup_adapter(MPT_ADAPTER *ioc, int sleepFlag)11601160+{11611161+ int r;11621162+11631163+ if(ioc->alt_ioc) {11641164+ if((r=mpt_alt_ioc_wait(ioc->alt_ioc)!=0))11651165+ return r;11661166+ }11671167+11681168+ r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,11691169+ CAN_SLEEP);11701170+11711171+ if(ioc->alt_ioc) {11721172+ spin_lock(&ioc->alt_ioc->initializing_hba_lock);11731173+ ioc->alt_ioc->initializing_hba_lock_flag=0;11741174+ spin_unlock(&ioc->alt_ioc->initializing_hba_lock);11751175+ }11761176+11771177+return r;11781178+}11791179+11211180/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/11221181/*11231182 * mpt_attach - Install a PCI intelligent MPT adapter.···12451186 ioc->pcidev = pdev;12461187 ioc->diagPending = 0;12471188 spin_lock_init(&ioc->diagLock);11891189+ spin_lock_init(&ioc->initializing_hba_lock);1248119012491191 /* Initialize the event logging.12501192 */···14681408 */14691409 mpt_detect_bound_ports(ioc, pdev);1470141014711471- if ((r = mpt_do_ioc_recovery(ioc,14721472- MPT_HOSTEVENT_IOC_BRINGUP, CAN_SLEEP)) != 0) {14111411+ if ((r = mpt_bringup_adapter(ioc, CAN_SLEEP)) != 0){14731412 printk(KERN_WARNING MYNAM14741413 ": WARNING - %s did not initialize properly! (%d)\n",14751414 ioc->name, r);···63576298EXPORT_SYMBOL(mpt_alloc_fw_memory);63586299EXPORT_SYMBOL(mpt_free_fw_memory);63596300EXPORT_SYMBOL(mptbase_sas_persist_operation);63016301+EXPORT_SYMBOL(mpt_alt_ioc_wait);636063026361630363626304/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+3
drivers/message/fusion/mptbase.h
···611611 int DoneCtx;612612 int TaskCtx;613613 int InternalCtx;614614+ spinlock_t initializing_hba_lock;615615+ int initializing_hba_lock_flag;614616 struct list_head list;615617 struct net_device *netdev;616618 struct list_head sas_topology;···10031001extern int mpt_findImVolumes(MPT_ADAPTER *ioc);10041002extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);10051003extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);10041004+extern int mpt_alt_ioc_wait(MPT_ADAPTER *ioc);1006100510071006/*10081007 * Public data decl's...
+10
drivers/message/fusion/mptscsih.c
···41624162 }41634163 }4164416441654165+ if(mpt_alt_ioc_wait(hd->ioc)!=0) {41664166+ ddvprintk((MYIOC_s_WARN_FMT "alt_ioc busy!\n",41674167+ hd->ioc->name));41684168+ continue;41694169+ }41704170+41654171 if (mptscsih_doDv(hd, 0, id) == 1) {41664172 /* Untagged device was busy, try again41674173 */···41784172 */41794173 hd->ioc->spi_data.dvStatus[id] &= ~(MPT_SCSICFG_DV_NOT_DONE | MPT_SCSICFG_DV_PENDING);41804174 }41754175+41764176+ spin_lock(&hd->ioc->initializing_hba_lock);41774177+ hd->ioc->initializing_hba_lock_flag=0;41784178+ spin_unlock(&hd->ioc->initializing_hba_lock);4181417941824180 if (isPhysDisk) {41834181 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
···926926 char dbf_name[DEBUG_MAX_NAME_LEN];927927928928 /* debug feature area which records recovery activity */929929- spin_lock_init(&adapter->erp_dbf_lock);930929 sprintf(dbf_name, "zfcp_%s_erp", zfcp_get_busid_by_adapter(adapter));931930 adapter->erp_dbf = debug_register(dbf_name, dbfsize, 2,932931 sizeof(struct zfcp_erp_dbf_record));···935936 debug_set_level(adapter->erp_dbf, 3);936937937938 /* debug feature area which records HBA (FSF and QDIO) conditions */938938- spin_lock_init(&adapter->hba_dbf_lock);939939 sprintf(dbf_name, "zfcp_%s_hba", zfcp_get_busid_by_adapter(adapter));940940 adapter->hba_dbf = debug_register(dbf_name, dbfsize, 1,941941 sizeof(struct zfcp_hba_dbf_record));···945947 debug_set_level(adapter->hba_dbf, 3);946948947949 /* debug feature area which records SAN command failures and recovery */948948- spin_lock_init(&adapter->san_dbf_lock);949950 sprintf(dbf_name, "zfcp_%s_san", zfcp_get_busid_by_adapter(adapter));950951 adapter->san_dbf = debug_register(dbf_name, dbfsize, 1,951952 sizeof(struct zfcp_san_dbf_record));···955958 debug_set_level(adapter->san_dbf, 6);956959957960 /* debug feature area which records SCSI command failures and recovery */958958- spin_lock_init(&adapter->scsi_dbf_lock);959961 sprintf(dbf_name, "zfcp_%s_scsi", zfcp_get_busid_by_adapter(adapter));960962 adapter->scsi_dbf = debug_register(dbf_name, dbfsize, 1,961963 sizeof(struct zfcp_scsi_dbf_record));
+32-62
drivers/s390/scsi/zfcp_erp.c
···1071107110721072 atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status);1073107310741074- rwlock_init(&adapter->erp_lock);10751075- INIT_LIST_HEAD(&adapter->erp_ready_head);10761076- INIT_LIST_HEAD(&adapter->erp_running_head);10771077- sema_init(&adapter->erp_ready_sem, 0);10781078-10791074 retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD);10801075 if (retval < 0) {10811076 ZFCP_LOG_NORMAL("error: creation of erp thread failed for "···22432248 return retval;22442249}2245225022462246-/*22472247- * function: zfcp_fsf_init22482248- *22492249- * purpose: initializes FSF operation for the specified adapter22502250- *22512251- * returns: 0 - succesful initialization of FSF operation22522252- * !0 - failed to initialize FSF operation22532253- */22542251static int22552252zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)22562253{22572257- int xconfig, xport;22542254+ int retval;2258225522592259- if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,22602260- &erp_action->adapter->status)) {22562256+ if ((atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,22572257+ &erp_action->adapter->status)) &&22582258+ (erp_action->adapter->adapter_features &22592259+ FSF_FEATURE_HBAAPI_MANAGEMENT)) {22612260 zfcp_erp_adapter_strategy_open_fsf_xport(erp_action);22622261 atomic_set(&erp_action->adapter->erp_counter, 0);22632262 return ZFCP_ERP_FAILED;22642263 }2265226422662266- xconfig = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action);22672267- xport = zfcp_erp_adapter_strategy_open_fsf_xport(erp_action);22682268- if ((xconfig == ZFCP_ERP_FAILED) || (xport == ZFCP_ERP_FAILED))22652265+ retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action);22662266+ if (retval == ZFCP_ERP_FAILED)22672267+ return ZFCP_ERP_FAILED;22682268+22692269+ retval = zfcp_erp_adapter_strategy_open_fsf_xport(erp_action);22702270+ if (retval == ZFCP_ERP_FAILED)22692271 return ZFCP_ERP_FAILED;2270227222712273 return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action);···23512359static int23522360zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)23532361{23542354- int retval = ZFCP_ERP_SUCCEEDED;23622362+ int ret;23552363 int retries;23562364 int sleep;23572365 struct zfcp_adapter *adapter = erp_action->adapter;2358236623592367 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);2360236823612361- for (retries = 0; ; retries++) {23622362- ZFCP_LOG_DEBUG("Doing exchange port data\n");23692369+ retries = 0;23702370+ do {23712371+ write_lock(&adapter->erp_lock);23632372 zfcp_erp_action_to_running(erp_action);23732373+ write_unlock(&adapter->erp_lock);23642374 zfcp_erp_timeout_init(erp_action);23652365- if (zfcp_fsf_exchange_port_data(erp_action, adapter, NULL)) {23662366- retval = ZFCP_ERP_FAILED;23672367- debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf");23682368- ZFCP_LOG_INFO("error: initiation of exchange of "23692369- "port data failed for adapter %s\n",23702370- zfcp_get_busid_by_adapter(adapter));23712371- break;23752375+ ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);23762376+ if (ret == -EOPNOTSUPP) {23772377+ debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");23782378+ return ZFCP_ERP_SUCCEEDED;23792379+ } else if (ret) {23802380+ debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");23812381+ return ZFCP_ERP_FAILED;23722382 }23732373- debug_text_event(adapter->erp_dbf, 6, "a_fstx_xok");23742374- ZFCP_LOG_DEBUG("Xchange underway\n");23832383+ debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");2375238423762376- /*23772377- * Why this works:23782378- * Both the normal completion handler as well as the timeout23792379- * handler will do an 'up' when the 'exchange port data'23802380- * request completes or times out. Thus, the signal to go on23812381- * won't be lost utilizing this semaphore.23822382- * Furthermore, this 'adapter_reopen' action is23832383- * guaranteed to be the only action being there (highest action23842384- * which prevents other actions from being created).23852385- * Resulting from that, the wake signal recognized here23862386- * _must_ be the one belonging to the 'exchange port23872387- * data' request.23882388- */23892385 down(&adapter->erp_ready_sem);23902386 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {23912387 ZFCP_LOG_INFO("error: exchange of port data "···23812401 zfcp_get_busid_by_adapter(adapter));23822402 break;23832403 }23842384-23852404 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,23862405 &adapter->status))23872406 break;2388240723892389- ZFCP_LOG_DEBUG("host connection still initialising... "23902390- "waiting and retrying...\n");23912391- /* sleep a little bit before retry */23922392- sleep = retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES ?23932393- ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP :23942394- ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP;23952395- msleep(jiffies_to_msecs(sleep));23962396- }24082408+ if (retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES) {24092409+ sleep = ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP;24102410+ retries++;24112411+ } else24122412+ sleep = ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP;24132413+ schedule_timeout(sleep);24142414+ } while (1);2397241523982398- if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,23992399- &adapter->status)) {24002400- ZFCP_LOG_INFO("error: exchange of port data for "24012401- "adapter %s failed\n",24022402- zfcp_get_busid_by_adapter(adapter));24032403- retval = ZFCP_ERP_FAILED;24042404- }24052405-24062406- return retval;24162416+ return ZFCP_ERP_SUCCEEDED;24072417}2408241824092419/*
+63-47
drivers/s390/scsi/zfcp_fsf.c
···554554zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,555555 struct fsf_link_down_info *link_down)556556{557557+ if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,558558+ &adapter->status))559559+ return;560560+561561+ atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status);562562+563563+ if (link_down == NULL) {564564+ zfcp_erp_adapter_reopen(adapter, 0);565565+ return;566566+ }567567+557568 switch (link_down->error_code) {558569 case FSF_PSQ_LINK_NO_LIGHT:559570 ZFCP_LOG_NORMAL("The local link to adapter %s is down "···645634 link_down->explanation_code,646635 link_down->vendor_specific_code);647636648648- if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,649649- &adapter->status)) {650650- atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,651651- &adapter->status);652652- switch (link_down->error_code) {653653- case FSF_PSQ_LINK_NO_LIGHT:654654- case FSF_PSQ_LINK_WRAP_PLUG:655655- case FSF_PSQ_LINK_NO_FCP:656656- case FSF_PSQ_LINK_FIRMWARE_UPDATE:657657- zfcp_erp_adapter_reopen(adapter, 0);658658- break;659659- default:660660- zfcp_erp_adapter_failed(adapter);661661- }637637+ switch (link_down->error_code) {638638+ case FSF_PSQ_LINK_NO_LIGHT:639639+ case FSF_PSQ_LINK_WRAP_PLUG:640640+ case FSF_PSQ_LINK_NO_FCP:641641+ case FSF_PSQ_LINK_FIRMWARE_UPDATE:642642+ zfcp_erp_adapter_reopen(adapter, 0);643643+ break;644644+ default:645645+ zfcp_erp_adapter_failed(adapter);662646 }663647}664648···925919 case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK:926920 ZFCP_LOG_INFO("Physical link to adapter %s is down\n",927921 zfcp_get_busid_by_adapter(adapter));922922+ zfcp_fsf_link_down_info_eval(adapter,923923+ (struct fsf_link_down_info *)924924+ &status_buffer->payload);928925 break;929926 case FSF_STATUS_READ_SUB_FDISC_FAILED:930927 ZFCP_LOG_INFO("Local link to adapter %s is down "931928 "due to failed FDISC login\n",932932- zfcp_get_busid_by_adapter(adapter));929929+ zfcp_get_busid_by_adapter(adapter));930930+ zfcp_fsf_link_down_info_eval(adapter,931931+ (struct fsf_link_down_info *)932932+ &status_buffer->payload);933933 break;934934 case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE:935935 ZFCP_LOG_INFO("Local link to adapter %s is down "936936 "due to firmware update on adapter\n",937937 zfcp_get_busid_by_adapter(adapter));938938+ zfcp_fsf_link_down_info_eval(adapter, NULL);938939 break;939940 default:940941 ZFCP_LOG_INFO("Local link to adapter %s is down "941942 "due to unknown reason\n",942943 zfcp_get_busid_by_adapter(adapter));944944+ zfcp_fsf_link_down_info_eval(adapter, NULL);943945 };944944- zfcp_fsf_link_down_info_eval(adapter,945945- (struct fsf_link_down_info *) &status_buffer->payload);946946 break;947947948948 case FSF_STATUS_READ_LINK_UP:949949 ZFCP_LOG_NORMAL("Local link to adapter %s was replugged. "950950- "Restarting operations on this adapter\n",951951- zfcp_get_busid_by_adapter(adapter));950950+ "Restarting operations on this adapter\n",951951+ zfcp_get_busid_by_adapter(adapter));952952 /* All ports should be marked as ready to run again */953953 zfcp_erp_modify_adapter_status(adapter,954954 ZFCP_STATUS_COMMON_RUNNING,···22032191 return -EOPNOTSUPP;22042192 }2205219322062206- timer = kmalloc(sizeof(struct timer_list), GFP_KERNEL);22072207- if (!timer)22082208- return -ENOMEM;22092209-22102194 /* setup new FSF request */22112195 retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,22122212- 0, 0, &lock_flags, &fsf_req);21962196+ erp_action ? ZFCP_REQ_AUTO_CLEANUP : 0,21972197+ 0, &lock_flags, &fsf_req);22132198 if (retval < 0) {22142199 ZFCP_LOG_INFO("error: Out of resources. Could not create an "22152200 "exchange port data request for"···22142205 zfcp_get_busid_by_adapter(adapter));22152206 write_unlock_irqrestore(&adapter->request_queue.queue_lock,22162207 lock_flags);22172217- goto out;22182218- }22192219-22202220- if (erp_action) {22212221- erp_action->fsf_req = fsf_req;22222222- fsf_req->erp_action = erp_action;22082208+ return retval;22232209 }2224221022252211 if (data)22262226- fsf_req->data = (unsigned long) data;22122212+ fsf_req->data = (unsigned long) data;2227221322282214 sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0);22292215 sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;22302216 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;2231221722322232- init_timer(timer);22332233- timer->function = zfcp_fsf_request_timeout_handler;22342234- timer->data = (unsigned long) adapter;22352235- timer->expires = ZFCP_FSF_REQUEST_TIMEOUT;22182218+ if (erp_action) {22192219+ erp_action->fsf_req = fsf_req;22202220+ fsf_req->erp_action = erp_action;22212221+ timer = &erp_action->timer;22222222+ } else {22232223+ timer = kmalloc(sizeof(struct timer_list), GFP_ATOMIC);22242224+ if (!timer) {22252225+ write_unlock_irqrestore(&adapter->request_queue.queue_lock,22262226+ lock_flags);22272227+ zfcp_fsf_req_free(fsf_req);22282228+ return -ENOMEM;22292229+ }22302230+ init_timer(timer);22312231+ timer->function = zfcp_fsf_request_timeout_handler;22322232+ timer->data = (unsigned long) adapter;22332233+ timer->expires = ZFCP_FSF_REQUEST_TIMEOUT;22342234+ }2236223522372236 retval = zfcp_fsf_req_send(fsf_req, timer);22382237 if (retval) {···22502233 zfcp_fsf_req_free(fsf_req);22512234 if (erp_action)22522235 erp_action->fsf_req = NULL;22362236+ else22372237+ kfree(timer);22532238 write_unlock_irqrestore(&adapter->request_queue.queue_lock,22542239 lock_flags);22552255- goto out;22402240+ return retval;22562241 }2257224222582258- ZFCP_LOG_DEBUG("Exchange Port Data request initiated (adapter %s)\n",22592259- zfcp_get_busid_by_adapter(adapter));22432243+ write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags);2260224422612261- write_unlock_irqrestore(&adapter->request_queue.queue_lock,22622262- lock_flags);22632263-22642264- wait_event(fsf_req->completion_wq,22652265- fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);22662266- del_timer_sync(timer);22672267- zfcp_fsf_req_free(fsf_req);22682268- out:22692269- kfree(timer);22452245+ if (!erp_action) {22462246+ wait_event(fsf_req->completion_wq,22472247+ fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);22482248+ del_timer_sync(timer);22492249+ zfcp_fsf_req_free(fsf_req);22502250+ kfree(timer);22512251+ }22702252 return retval;22712253}22722254
+1-1
drivers/s390/scsi/zfcp_scsi.c
···179179 struct zfcp_adapter *adapter;180180 struct zfcp_unit *unit;181181 unsigned long flags;182182- int retval = -ENODEV;182182+ int retval = -ENXIO;183183184184 adapter = (struct zfcp_adapter *) sdp->host->hostdata[0];185185 if (!adapter)
···812812 if (!scsi_device_sync(sdev) && !scsi_device_dt(sdev))813813 return;814814815815- /* see if the device has an echo buffer. If it does we can816816- * do the SPI pattern write tests */817817-818818- len = 0;819819- if (scsi_device_dt(sdev))820820- len = spi_dv_device_get_echo_buffer(sdev, buffer);815815+ /* len == -1 is the signal that we need to ascertain the816816+ * presence of an echo buffer before trying to use it. len ==817817+ * 0 means we don't have an echo buffer */818818+ len = -1;821819822820 retry:823821···838840 if (spi_min_period(starget) == 8)839841 DV_SET(pcomp_en, 1);840842 }843843+ /* Do the read only INQUIRY tests */844844+ spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len,845845+ spi_dv_device_compare_inquiry);846846+ /* See if we actually managed to negotiate and sustain DT */847847+ if (i->f->get_dt)848848+ i->f->get_dt(starget);841849842842- if (len == 0) {850850+ /* see if the device has an echo buffer. If it does we can do851851+ * the SPI pattern write tests. Because of some broken852852+ * devices, we *only* try this on a device that has actually853853+ * negotiated DT */854854+855855+ if (len == -1 && spi_dt(starget))856856+ len = spi_dv_device_get_echo_buffer(sdev, buffer);857857+858858+ if (len <= 0) {843859 starget_printk(KERN_INFO, starget, "Domain Validation skipping write tests\n");844844- spi_dv_retrain(sdev, buffer, buffer + len,845845- spi_dv_device_compare_inquiry);846860 return;847861 }848862
+3-3
drivers/scsi/sg.c
···18601860 unlock_page(pages[j]); */18611861 res = 0;18621862 out_unmap:18631863- if (res > 0)18631863+ if (res > 0) {18641864 for (j=0; j < res; j++)18651865 page_cache_release(pages[j]);18661866+ res = 0;18671867+ }18661868 kfree(pages);18671869 return res;18681870}···18801878 for (i=0; i < nr_pages; i++) {18811879 struct page *page = sgl[i].page;1882188018831883- /* XXX: just for debug. Remove when PageReserved is removed */18841884- BUG_ON(PageReserved(page));18851881 if (dirtied)18861882 SetPageDirty(page);18871883 /* unlock_page(page); */
+1-2
drivers/scsi/st.c
···45094509 if (res > 0) {45104510 for (j=0; j < res; j++)45114511 page_cache_release(pages[j]);45124512+ res = 0;45124513 }45134514 kfree(pages);45144515 return res;···45254524 for (i=0; i < nr_pages; i++) {45264525 struct page *page = sgl[i].page;4527452645284528- /* XXX: just for debug. Remove when PageReserved is removed */45294529- BUG_ON(PageReserved(page));45304527 if (dirtied)45314528 SetPageDirty(page);45324529 /* FIXME: cache flush missing for rw==READ