···106106 unsigned long mask = cpumask_bits(cpumask)[0];107107 unsigned long flags;108108109109+ if (WARN_ONCE(!mask, "empty IPI mask"))110110+ return;111111+109112 local_irq_save(flags);110113 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);111114 __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
+10-11
arch/x86/mm/tlb.c
···183183184184 f->flush_mm = mm;185185 f->flush_va = va;186186- cpumask_andnot(to_cpumask(f->flush_cpumask),187187- cpumask, cpumask_of(smp_processor_id()));186186+ if (cpumask_andnot(to_cpumask(f->flush_cpumask), cpumask, cpumask_of(smp_processor_id()))) {187187+ /*188188+ * We have to send the IPI only to189189+ * CPUs affected.190190+ */191191+ apic->send_IPI_mask(to_cpumask(f->flush_cpumask),192192+ INVALIDATE_TLB_VECTOR_START + sender);188193189189- /*190190- * We have to send the IPI only to191191- * CPUs affected.192192- */193193- apic->send_IPI_mask(to_cpumask(f->flush_cpumask),194194- INVALIDATE_TLB_VECTOR_START + sender);195195-196196- while (!cpumask_empty(to_cpumask(f->flush_cpumask)))197197- cpu_relax();194194+ while (!cpumask_empty(to_cpumask(f->flush_cpumask)))195195+ cpu_relax();196196+ }198197199198 f->flush_mm = NULL;200199 f->flush_va = 0;
+27-20
drivers/gpu/drm/drm_sysfs.c
···2222#define to_drm_minor(d) container_of(d, struct drm_minor, kdev)2323#define to_drm_connector(d) container_of(d, struct drm_connector, kdev)24242525+static struct device_type drm_sysfs_device_minor = {2626+ .name = "drm_minor"2727+};2828+2529/**2626- * drm_sysfs_suspend - DRM class suspend hook3030+ * drm_class_suspend - DRM class suspend hook2731 * @dev: Linux device to suspend2832 * @state: power state to enter2933 *3034 * Just figures out what the actual struct drm_device associated with3135 * @dev is and calls its suspend hook, if present.3236 */3333-static int drm_sysfs_suspend(struct device *dev, pm_message_t state)3737+static int drm_class_suspend(struct device *dev, pm_message_t state)3438{3535- struct drm_minor *drm_minor = to_drm_minor(dev);3636- struct drm_device *drm_dev = drm_minor->dev;3939+ if (dev->type == &drm_sysfs_device_minor) {4040+ struct drm_minor *drm_minor = to_drm_minor(dev);4141+ struct drm_device *drm_dev = drm_minor->dev;37423838- if (drm_minor->type == DRM_MINOR_LEGACY &&3939- !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&4040- drm_dev->driver->suspend)4141- return drm_dev->driver->suspend(drm_dev, state);4242-4343+ if (drm_minor->type == DRM_MINOR_LEGACY &&4444+ !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&4545+ drm_dev->driver->suspend)4646+ return drm_dev->driver->suspend(drm_dev, state);4747+ }4348 return 0;4449}45504651/**4747- * drm_sysfs_resume - DRM class resume hook5252+ * drm_class_resume - DRM class resume hook4853 * @dev: Linux device to resume4954 *5055 * Just figures out what the actual struct drm_device associated with5156 * @dev is and calls its resume hook, if present.5257 */5353-static int drm_sysfs_resume(struct device *dev)5858+static int drm_class_resume(struct device *dev)5459{5555- struct drm_minor *drm_minor = to_drm_minor(dev);5656- struct drm_device *drm_dev = drm_minor->dev;6060+ if (dev->type == &drm_sysfs_device_minor) {6161+ struct drm_minor *drm_minor = to_drm_minor(dev);6262+ struct drm_device *drm_dev = drm_minor->dev;57635858- if (drm_minor->type == DRM_MINOR_LEGACY &&5959- !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&6060- drm_dev->driver->resume)6161- return drm_dev->driver->resume(drm_dev);6262-6464+ if (drm_minor->type == DRM_MINOR_LEGACY &&6565+ !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&6666+ drm_dev->driver->resume)6767+ return drm_dev->driver->resume(drm_dev);6868+ }6369 return 0;6470}6571···10599 goto err_out;106100 }107101108108- class->suspend = drm_sysfs_suspend;109109- class->resume = drm_sysfs_resume;102102+ class->suspend = drm_class_suspend;103103+ class->resume = drm_class_resume;110104111105 err = class_create_file(class, &class_attr_version);112106 if (err)···486480 minor->kdev.class = drm_class;487481 minor->kdev.release = drm_sysfs_device_release;488482 minor->kdev.devt = minor->device;483483+ minor->kdev.type = &drm_sysfs_device_minor;489484 if (minor->type == DRM_MINOR_CONTROL)490485 minor_str = "controlD%d";491486 else if (minor->type == DRM_MINOR_RENDER)
+10
drivers/gpu/drm/radeon/r100.c
···10911091 tmp |= tile_flags;10921092 ib[idx] = tmp;10931093 break;10941094+ case RADEON_RB3D_ZPASS_ADDR:10951095+ r = r100_cs_packet_next_reloc(p, &reloc);10961096+ if (r) {10971097+ DRM_ERROR("No reloc for ib[%d]=0x%04X\n",10981098+ idx, reg);10991099+ r100_cs_dump_packet(p, pkt);11001100+ return r;11011101+ }11021102+ ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset);11031103+ break;10941104 default:10951105 /* FIXME: we don't want to allow anyothers packet */10961106 break;
+3-1
drivers/gpu/drm/radeon/r300.c
···448448 /* rv350,rv370,rv380 */449449 rdev->num_gb_pipes = 1;450450 }451451+ rdev->num_z_pipes = 1;451452 gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16);452453 switch (rdev->num_gb_pipes) {453454 case 2:···487486 printk(KERN_WARNING "Failed to wait MC idle while "488487 "programming pipes. Bad things might happen.\n");489488 }490490- DRM_INFO("radeon: %d pipes initialized.\n", rdev->num_gb_pipes);489489+ DRM_INFO("radeon: %d quad pipes, %d Z pipes initialized.\n",490490+ rdev->num_gb_pipes, rdev->num_z_pipes);491491}492492493493int r300_ga_reset(struct radeon_device *rdev)
+12-1
drivers/gpu/drm/radeon/r420.c
···165165 printk(KERN_WARNING "Failed to wait GUI idle while "166166 "programming pipes. Bad things might happen.\n");167167 }168168- DRM_INFO("radeon: %d pipes initialized.\n", rdev->num_gb_pipes);168168+169169+ if (rdev->family == CHIP_RV530) {170170+ tmp = RREG32(RV530_GB_PIPE_SELECT2);171171+ if ((tmp & 3) == 3)172172+ rdev->num_z_pipes = 2;173173+ else174174+ rdev->num_z_pipes = 1;175175+ } else176176+ rdev->num_z_pipes = 1;177177+178178+ DRM_INFO("radeon: %d quad pipes, %d z pipes initialized.\n",179179+ rdev->num_gb_pipes, rdev->num_z_pipes);169180}170181171182void r420_gpu_init(struct radeon_device *rdev)
-1
drivers/gpu/drm/radeon/r520.c
···177177 */178178 /* workaround for RV530 */179179 if (rdev->family == CHIP_RV530) {180180- WREG32(0x4124, 1);181180 WREG32(0x4128, 0xFF);182181 }183182 r420_pipes_init(rdev);
+1
drivers/gpu/drm/radeon/radeon.h
···655655 int usec_timeout;656656 enum radeon_pll_errata pll_errata;657657 int num_gb_pipes;658658+ int num_z_pipes;658659 int disp_priority;659660 /* BIOS */660661 uint8_t *bios;
···30813081 case RADEON_PARAM_NUM_GB_PIPES:30823082 value = dev_priv->num_gb_pipes;30833083 break;30843084+ case RADEON_PARAM_NUM_Z_PIPES:30853085+ value = dev_priv->num_z_pipes;30863086+ break;30843087 default:30853088 DRM_DEBUG("Invalid parameter %d\n", param->param);30863089 return -EINVAL;
+12-2
drivers/i2c/busses/i2c-omap.c
···674674675675 err = 0;676676complete:677677- omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);677677+ /*678678+ * Ack the stat in one go, but [R/X]DR and [R/X]RDY should be679679+ * acked after the data operation is complete.680680+ * Ref: TRM SWPU114Q Figure 18-31681681+ */682682+ omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &683683+ ~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |684684+ OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));678685679686 if (stat & OMAP_I2C_STAT_NACK) {680687 err |= OMAP_I2C_STAT_NACK;···694687 }695688 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |696689 OMAP_I2C_STAT_AL)) {690690+ omap_i2c_ack_stat(dev, stat &691691+ (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |692692+ OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));697693 omap_i2c_complete_cmd(dev, err);698694 return IRQ_HANDLED;699695 }···784774 * memory to the I2C interface.785775 */786776787787- if (cpu_is_omap34xx()) {777777+ if (dev->rev <= OMAP_I2C_REV_ON_3430) {788778 while (!(stat & OMAP_I2C_STAT_XUDF)) {789779 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {790780 omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
+91-64
drivers/i2c/busses/i2c-stu300.c
···117117 STU300_ERROR_NONE = 0,118118 STU300_ERROR_ACKNOWLEDGE_FAILURE,119119 STU300_ERROR_BUS_ERROR,120120- STU300_ERROR_ARBITRATION_LOST120120+ STU300_ERROR_ARBITRATION_LOST,121121+ STU300_ERROR_UNKNOWN121122};122123123124/* timeout waiting for the controller to respond */···128127 * The number of address send athemps tried before giving up.129128 * If the first one failes it seems like 5 to 8 attempts are required.130129 */131131-#define NUM_ADDR_RESEND_ATTEMPTS 10130130+#define NUM_ADDR_RESEND_ATTEMPTS 12132131133132/* I2C clock speed, in Hz 0-400kHz*/134133static unsigned int scl_frequency = 100000;···150149 * @msg_index: index of current message151150 * @msg_len: length of current message152151 */152152+153153struct stu300_dev {154154 struct platform_device *pdev;155155 struct i2c_adapter adapter;···190188 return readl(address) & 0x000000FFU;191189}192190191191+static void stu300_irq_enable(struct stu300_dev *dev)192192+{193193+ u32 val;194194+ val = stu300_r8(dev->virtbase + I2C_CR);195195+ val |= I2C_CR_INTERRUPT_ENABLE;196196+ /* Twice paranoia (possible HW glitch) */197197+ stu300_wr8(val, dev->virtbase + I2C_CR);198198+ stu300_wr8(val, dev->virtbase + I2C_CR);199199+}200200+201201+static void stu300_irq_disable(struct stu300_dev *dev)202202+{203203+ u32 val;204204+ val = stu300_r8(dev->virtbase + I2C_CR);205205+ val &= ~I2C_CR_INTERRUPT_ENABLE;206206+ /* Twice paranoia (possible HW glitch) */207207+ stu300_wr8(val, dev->virtbase + I2C_CR);208208+ stu300_wr8(val, dev->virtbase + I2C_CR);209209+}210210+211211+193212/*194213 * Tells whether a certain event or events occurred in195214 * response to a command. The events represent states in···219196 * documentation and can only be treated as abstract state220197 * machine states.221198 *222222- * @ret 0 = event has not occurred, any other value means223223- * the event occurred.199199+ * @ret 0 = event has not occurred or unknown error, any200200+ * other value means the correct event occurred or an error.224201 */202202+225203static int stu300_event_occurred(struct stu300_dev *dev,226204 enum stu300_event mr_event) {227205 u32 status1;···230206231207 /* What event happened? */232208 status1 = stu300_r8(dev->virtbase + I2C_SR1);209209+233210 if (!(status1 & I2C_SR1_EVF_IND))234211 /* No event at all */235212 return 0;213213+236214 status2 = stu300_r8(dev->virtbase + I2C_SR2);215215+216216+ /* Block any multiple interrupts */217217+ stu300_irq_disable(dev);218218+219219+ /* Check for errors first */220220+ if (status2 & I2C_SR2_AF_IND) {221221+ dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE;222222+ return 1;223223+ } else if (status2 & I2C_SR2_BERR_IND) {224224+ dev->cmd_err = STU300_ERROR_BUS_ERROR;225225+ return 1;226226+ } else if (status2 & I2C_SR2_ARLO_IND) {227227+ dev->cmd_err = STU300_ERROR_ARBITRATION_LOST;228228+ return 1;229229+ }237230238231 switch (mr_event) {239232 case STU300_EVENT_1:···262221 case STU300_EVENT_7:263222 case STU300_EVENT_8:264223 if (status1 & I2C_SR1_BTF_IND) {265265- if (status2 & I2C_SR2_AF_IND)266266- dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE;267267- else if (status2 & I2C_SR2_BERR_IND)268268- dev->cmd_err = STU300_ERROR_BUS_ERROR;269224 return 1;270225 }271226 break;···277240 case STU300_EVENT_6:278241 if (status2 & I2C_SR2_ENDAD_IND) {279242 /* First check for any errors */280280- if (status2 & I2C_SR2_AF_IND)281281- dev->cmd_err = STU300_ERROR_ACKNOWLEDGE_FAILURE;282243 return 1;283244 }284245 break;···287252 default:288253 break;289254 }290290- if (status2 & I2C_SR2_ARLO_IND)291291- dev->cmd_err = STU300_ERROR_ARBITRATION_LOST;255255+ /* If we get here, we're on thin ice.256256+ * Here we are in a status where we have257257+ * gotten a response that does not match258258+ * what we requested.259259+ */260260+ dev->cmd_err = STU300_ERROR_UNKNOWN;261261+ dev_err(&dev->pdev->dev,262262+ "Unhandled interrupt! %d sr1: 0x%x sr2: 0x%x\n",263263+ mr_event, status1, status2);292264 return 0;293265}294266···304262 struct stu300_dev *dev = data;305263 int res;306264265265+ /* Just make sure that the block is clocked */266266+ clk_enable(dev->clk);267267+307268 /* See if this was what we were waiting for */308269 spin_lock(&dev->cmd_issue_lock);309309- if (dev->cmd_event != STU300_EVENT_NONE) {310310- res = stu300_event_occurred(dev, dev->cmd_event);311311- if (res || dev->cmd_err != STU300_ERROR_NONE) {312312- u32 val;313270314314- complete(&dev->cmd_complete);315315- /* Block any multiple interrupts */316316- val = stu300_r8(dev->virtbase + I2C_CR);317317- val &= ~I2C_CR_INTERRUPT_ENABLE;318318- stu300_wr8(val, dev->virtbase + I2C_CR);319319- }320320- }271271+ res = stu300_event_occurred(dev, dev->cmd_event);272272+ if (res || dev->cmd_err != STU300_ERROR_NONE)273273+ complete(&dev->cmd_complete);274274+321275 spin_unlock(&dev->cmd_issue_lock);276276+277277+ clk_disable(dev->clk);278278+322279 return IRQ_HANDLED;323280}324281···349308 stu300_wr8(cr_value, dev->virtbase + I2C_CR);350309 ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete,351310 STU300_TIMEOUT);352352-353311 if (ret < 0) {354312 dev_err(&dev->pdev->dev,355313 "wait_for_completion_interruptible_timeout() "···382342 enum stu300_event mr_event)383343{384344 int ret;385385- u32 val;386345387346 if (unlikely(irqs_disabled())) {388347 /* TODO: implement polling for this case if need be. */···393354 /* Is it already here? */394355 spin_lock_irq(&dev->cmd_issue_lock);395356 dev->cmd_err = STU300_ERROR_NONE;396396- if (stu300_event_occurred(dev, mr_event)) {397397- spin_unlock_irq(&dev->cmd_issue_lock);398398- goto exit_await_check_err;399399- }400400- init_completion(&dev->cmd_complete);401401- dev->cmd_err = STU300_ERROR_NONE;402357 dev->cmd_event = mr_event;403358359359+ init_completion(&dev->cmd_complete);360360+404361 /* Turn on the I2C interrupt for current operation */405405- val = stu300_r8(dev->virtbase + I2C_CR);406406- val |= I2C_CR_INTERRUPT_ENABLE;407407- stu300_wr8(val, dev->virtbase + I2C_CR);408408-409409- /* Twice paranoia (possible HW glitch) */410410- stu300_wr8(val, dev->virtbase + I2C_CR);411411-412412- /* Check again: is it already here? */413413- if (unlikely(stu300_event_occurred(dev, mr_event))) {414414- /* Disable IRQ again. */415415- val &= ~I2C_CR_INTERRUPT_ENABLE;416416- stu300_wr8(val, dev->virtbase + I2C_CR);417417- spin_unlock_irq(&dev->cmd_issue_lock);418418- goto exit_await_check_err;419419- }362362+ stu300_irq_enable(dev);420363421364 /* Unlock the command block and wait for the event to occur */422365 spin_unlock_irq(&dev->cmd_issue_lock);366366+423367 ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete,424368 STU300_TIMEOUT);425425-426369 if (ret < 0) {427370 dev_err(&dev->pdev->dev,428371 "wait_for_completion_interruptible_timeout()"···422401 return -ETIMEDOUT;423402 }424403425425- exit_await_check_err:426404 if (dev->cmd_err != STU300_ERROR_NONE) {427405 if (mr_event != STU300_EVENT_6) {428406 dev_err(&dev->pdev->dev, "controller "···477457};478458479459static const struct stu300_clkset stu300_clktable[] = {480480- { 0, 0xFFU },481481- { 2500000, I2C_OAR2_FR_25_10MHZ },482482- { 10000000, I2C_OAR2_FR_10_1667MHZ },483483- { 16670000, I2C_OAR2_FR_1667_2667MHZ },484484- { 26670000, I2C_OAR2_FR_2667_40MHZ },485485- { 40000000, I2C_OAR2_FR_40_5333MHZ },486486- { 53330000, I2C_OAR2_FR_5333_66MHZ },487487- { 66000000, I2C_OAR2_FR_66_80MHZ },488488- { 80000000, I2C_OAR2_FR_80_100MHZ },460460+ { 0, 0xFFU },461461+ { 2500000, I2C_OAR2_FR_25_10MHZ },462462+ { 10000000, I2C_OAR2_FR_10_1667MHZ },463463+ { 16670000, I2C_OAR2_FR_1667_2667MHZ },464464+ { 26670000, I2C_OAR2_FR_2667_40MHZ },465465+ { 40000000, I2C_OAR2_FR_40_5333MHZ },466466+ { 53330000, I2C_OAR2_FR_5333_66MHZ },467467+ { 66000000, I2C_OAR2_FR_66_80MHZ },468468+ { 80000000, I2C_OAR2_FR_80_100MHZ },489469 { 100000000, 0xFFU },490470};471471+491472492473static int stu300_set_clk(struct stu300_dev *dev, unsigned long clkrate)493474{···515494516495 if (dev->speed > 100000)517496 /* Fast Mode I2C */518518- val = ((clkrate/dev->speed)-9)/3;497497+ val = ((clkrate/dev->speed) - 9)/3 + 1;519498 else520499 /* Standard Mode I2C */521521- val = ((clkrate/dev->speed)-7)/2;500500+ val = ((clkrate/dev->speed) - 7)/2 + 1;522501523502 /* According to spec the divider must be > 2 */524503 if (val < 0x002) {···578557 */579558 clkrate = clk_get_rate(dev->clk);580559 ret = stu300_set_clk(dev, clkrate);560560+581561 if (ret)582562 return ret;583563 /*···663641 int attempts = 0;664642 struct stu300_dev *dev = i2c_get_adapdata(adap);665643666666-667644 clk_enable(dev->clk);668645669646 /* Remove this if (0) to trace each and every message. */···736715737716 if (attempts < NUM_ADDR_RESEND_ATTEMPTS && attempts > 0) {738717 dev_dbg(&dev->pdev->dev, "managed to get address "739739- "through after %d attempts\n", attempts);718718+ "through after %d attempts\n", attempts);740719 } else if (attempts == NUM_ADDR_RESEND_ATTEMPTS) {741720 dev_dbg(&dev->pdev->dev, "I give up, tried %d times "742742- "to resend address.\n",743743- NUM_ADDR_RESEND_ATTEMPTS);721721+ "to resend address.\n",722722+ NUM_ADDR_RESEND_ATTEMPTS);744723 goto exit_disable;745724 }725725+746726747727 if (msg->flags & I2C_M_RD) {748728 /* READ: we read the actual bytes one at a time */···826804{827805 int ret = -1;828806 int i;807807+829808 struct stu300_dev *dev = i2c_get_adapdata(adap);830809 dev->msg_len = num;810810+831811 for (i = 0; i < num; i++) {832812 /*833813 * Another driver appears to send stop for each message,···841817 dev->msg_index = i;842818843819 ret = stu300_xfer_msg(adap, &msgs[i], (i == (num - 1)));820820+844821 if (ret != 0) {845822 num = ret;846823 break;···870845 struct resource *res;871846 int bus_nr;872847 int ret = 0;848848+ char clk_name[] = "I2C0";873849874850 dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);875851 if (!dev) {···880854 }881855882856 bus_nr = pdev->id;883883- dev->clk = clk_get(&pdev->dev, NULL);857857+ clk_name[3] += (char)bus_nr;858858+ dev->clk = clk_get(&pdev->dev, clk_name);884859 if (IS_ERR(dev->clk)) {885860 ret = PTR_ERR(dev->clk);886861 dev_err(&pdev->dev, "could not retrieve i2c bus clock\n");
···846846 int i;847847 u32 val;848848849849+ if (!dev->state_saved)850850+ return 0;849851 /* PCI Express register must be restored first */850852 pci_restore_pcie_state(dev);851853
+67-31
drivers/scsi/mpt2sas/mpt2sas_base.c
···119119 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);120120}121121122122+/**123123+ * mpt2sas_base_start_watchdog - start the fault_reset_work_q124124+ * @ioc: pointer to scsi command object125125+ * Context: sleep.126126+ *127127+ * Return nothing.128128+ */129129+void130130+mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc)131131+{132132+ unsigned long flags;133133+134134+ if (ioc->fault_reset_work_q)135135+ return;136136+137137+ /* initialize fault polling */138138+ INIT_DELAYED_WORK(&ioc->fault_reset_work, _base_fault_reset_work);139139+ snprintf(ioc->fault_reset_work_q_name,140140+ sizeof(ioc->fault_reset_work_q_name), "poll_%d_status", ioc->id);141141+ ioc->fault_reset_work_q =142142+ create_singlethread_workqueue(ioc->fault_reset_work_q_name);143143+ if (!ioc->fault_reset_work_q) {144144+ printk(MPT2SAS_ERR_FMT "%s: failed (line=%d)\n",145145+ ioc->name, __func__, __LINE__);146146+ return;147147+ }148148+ spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);149149+ if (ioc->fault_reset_work_q)150150+ queue_delayed_work(ioc->fault_reset_work_q,151151+ &ioc->fault_reset_work,152152+ msecs_to_jiffies(FAULT_POLLING_INTERVAL));153153+ spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);154154+}155155+156156+/**157157+ * mpt2sas_base_stop_watchdog - stop the fault_reset_work_q158158+ * @ioc: pointer to scsi command object159159+ * Context: sleep.160160+ *161161+ * Return nothing.162162+ */163163+void164164+mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc)165165+{166166+ unsigned long flags;167167+ struct workqueue_struct *wq;168168+169169+ spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);170170+ wq = ioc->fault_reset_work_q;171171+ ioc->fault_reset_work_q = NULL;172172+ spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);173173+ if (wq) {174174+ if (!cancel_delayed_work(&ioc->fault_reset_work))175175+ flush_workqueue(wq);176176+ destroy_workqueue(wq);177177+ }178178+}179179+122180#ifdef CONFIG_SCSI_MPT2SAS_LOGGING123181/**124182 * _base_sas_ioc_info - verbose translation of the ioc status···496438497439 sas_loginfo.loginfo = log_info;498440 if (sas_loginfo.dw.bus_type != 3 /*SAS*/)441441+ return;442442+443443+ /* each nexus loss loginfo */444444+ if (log_info == 0x31170000)499445 return;500446501447 /* eat the loginfos associated with task aborts */···11711109 }11721110 }1173111111741174- pci_set_drvdata(pdev, ioc->shost);11751112 _base_mask_interrupts(ioc);11761113 r = _base_enable_msix(ioc);11771114 if (r)···11931132 ioc->pci_irq = -1;11941133 pci_release_selected_regions(ioc->pdev, ioc->bars);11951134 pci_disable_device(pdev);11961196- pci_set_drvdata(pdev, NULL);11971135 return r;11981136}11991137···32513191 ioc->chip_phys = 0;32523192 pci_release_selected_regions(ioc->pdev, ioc->bars);32533193 pci_disable_device(pdev);32543254- pci_set_drvdata(pdev, NULL);32553194 return;32563195}32573196···32643205mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)32653206{32663207 int r, i;32673267- unsigned long flags;3268320832693209 dinitprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s\n", ioc->name,32703210 __func__));···32723214 if (r)32733215 return r;3274321632173217+ pci_set_drvdata(ioc->pdev, ioc->shost);32753218 r = _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET);32763219 if (r)32773220 goto out_free_resources;···33473288 if (r)33483289 goto out_free_resources;3349329033503350- /* initialize fault polling */33513351- INIT_DELAYED_WORK(&ioc->fault_reset_work, _base_fault_reset_work);33523352- snprintf(ioc->fault_reset_work_q_name,33533353- sizeof(ioc->fault_reset_work_q_name), "poll_%d_status", ioc->id);33543354- ioc->fault_reset_work_q =33553355- create_singlethread_workqueue(ioc->fault_reset_work_q_name);33563356- if (!ioc->fault_reset_work_q) {33573357- printk(MPT2SAS_ERR_FMT "%s: failed (line=%d)\n",33583358- ioc->name, __func__, __LINE__);33593359- goto out_free_resources;33603360- }33613361- spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);33623362- if (ioc->fault_reset_work_q)33633363- queue_delayed_work(ioc->fault_reset_work_q,33643364- &ioc->fault_reset_work,33653365- msecs_to_jiffies(FAULT_POLLING_INTERVAL));33663366- spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);32913291+ mpt2sas_base_start_watchdog(ioc);33673292 return 0;3368329333693294 out_free_resources:···33553312 ioc->remove_host = 1;33563313 mpt2sas_base_free_resources(ioc);33573314 _base_release_memory_pools(ioc);33153315+ pci_set_drvdata(ioc->pdev, NULL);33583316 kfree(ioc->tm_cmds.reply);33593317 kfree(ioc->transport_cmds.reply);33603318 kfree(ioc->config_cmds.reply);···33813337void33823338mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc)33833339{33843384- unsigned long flags;33853385- struct workqueue_struct *wq;3386334033873341 dexitprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s\n", ioc->name,33883342 __func__));3389334333903390- spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);33913391- wq = ioc->fault_reset_work_q;33923392- ioc->fault_reset_work_q = NULL;33933393- spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);33943394- if (!cancel_delayed_work(&ioc->fault_reset_work))33953395- flush_workqueue(wq);33963396- destroy_workqueue(wq);33973397-33443344+ mpt2sas_base_stop_watchdog(ioc);33983345 mpt2sas_base_free_resources(ioc);33993346 _base_release_memory_pools(ioc);33473347+ pci_set_drvdata(ioc->pdev, NULL);34003348 kfree(ioc->pfacts);34013349 kfree(ioc->ctl_cmds.reply);34023350 kfree(ioc->base_cmds.reply);
···9494 const unsigned long *src, int shift, int bits);9595extern void __bitmap_shift_left(unsigned long *dst,9696 const unsigned long *src, int shift, int bits);9797-extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,9797+extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,9898 const unsigned long *bitmap2, int bits);9999extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,100100 const unsigned long *bitmap2, int bits);101101extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,102102 const unsigned long *bitmap2, int bits);103103-extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,103103+extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,104104 const unsigned long *bitmap2, int bits);105105extern int __bitmap_intersects(const unsigned long *bitmap1,106106 const unsigned long *bitmap2, int bits);···171171 }172172}173173174174-static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,174174+static inline int bitmap_and(unsigned long *dst, const unsigned long *src1,175175 const unsigned long *src2, int nbits)176176{177177 if (small_const_nbits(nbits))178178- *dst = *src1 & *src2;179179- else180180- __bitmap_and(dst, src1, src2, nbits);178178+ return (*dst = *src1 & *src2) != 0;179179+ return __bitmap_and(dst, src1, src2, nbits);181180}182181183182static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,···197198 __bitmap_xor(dst, src1, src2, nbits);198199}199200200200-static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,201201+static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1,201202 const unsigned long *src2, int nbits)202203{203204 if (small_const_nbits(nbits))204204- *dst = *src1 & ~(*src2);205205- else206206- __bitmap_andnot(dst, src1, src2, nbits);205205+ return (*dst = *src1 & ~(*src2)) != 0;206206+ return __bitmap_andnot(dst, src1, src2, nbits);207207}208208209209static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
+10-10
include/linux/cpumask.h
···4343 * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask4444 * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask4545 *4646- * void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]4646+ * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]4747 * void cpus_or(dst, src1, src2) dst = src1 | src2 [union]4848 * void cpus_xor(dst, src1, src2) dst = src1 ^ src24949- * void cpus_andnot(dst, src1, src2) dst = src1 & ~src24949+ * int cpus_andnot(dst, src1, src2) dst = src1 & ~src25050 * void cpus_complement(dst, src) dst = ~src5151 *5252 * int cpus_equal(mask1, mask2) Does mask1 == mask2?···179179}180180181181#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)182182-static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,182182+static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,183183 const cpumask_t *src2p, int nbits)184184{185185- bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);185185+ return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);186186}187187188188#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)···201201202202#define cpus_andnot(dst, src1, src2) \203203 __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)204204-static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,204204+static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,205205 const cpumask_t *src2p, int nbits)206206{207207- bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);207207+ return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);208208}209209210210#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)···738738 * @src1p: the first input739739 * @src2p: the second input740740 */741741-static inline void cpumask_and(struct cpumask *dstp,741741+static inline int cpumask_and(struct cpumask *dstp,742742 const struct cpumask *src1p,743743 const struct cpumask *src2p)744744{745745- bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),745745+ return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),746746 cpumask_bits(src2p), nr_cpumask_bits);747747}748748···779779 * @src1p: the first input780780 * @src2p: the second input781781 */782782-static inline void cpumask_andnot(struct cpumask *dstp,782782+static inline int cpumask_andnot(struct cpumask *dstp,783783 const struct cpumask *src1p,784784 const struct cpumask *src2p)785785{786786- bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),786786+ return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),787787 cpumask_bits(src2p), nr_cpumask_bits);788788}789789
+8-4
lib/bitmap.c
···179179}180180EXPORT_SYMBOL(__bitmap_shift_left);181181182182-void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,182182+int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,183183 const unsigned long *bitmap2, int bits)184184{185185 int k;186186 int nr = BITS_TO_LONGS(bits);187187+ unsigned long result = 0;187188188189 for (k = 0; k < nr; k++)189189- dst[k] = bitmap1[k] & bitmap2[k];190190+ result |= (dst[k] = bitmap1[k] & bitmap2[k]);191191+ return result != 0;190192}191193EXPORT_SYMBOL(__bitmap_and);192194···214212}215213EXPORT_SYMBOL(__bitmap_xor);216214217217-void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,215215+int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,218216 const unsigned long *bitmap2, int bits)219217{220218 int k;221219 int nr = BITS_TO_LONGS(bits);220220+ unsigned long result = 0;222221223222 for (k = 0; k < nr; k++)224224- dst[k] = bitmap1[k] & ~bitmap2[k];223223+ result |= (dst[k] = bitmap1[k] & ~bitmap2[k]);224224+ return result != 0;225225}226226EXPORT_SYMBOL(__bitmap_andnot);227227