Updated from Linux LTS 3.10.18 to 3.10.19
This commit is contained in:
		
							parent
							
								
									2c3b156896
								
							
						
					
					
						commit
						f44b345fa9
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,6 +1,6 @@ | |||||||
| VERSION = 3 | VERSION = 3 | ||||||
| PATCHLEVEL = 10 | PATCHLEVEL = 10 | ||||||
| SUBLEVEL = 18 | SUBLEVEL = 19 | ||||||
| EXTRAVERSION = | EXTRAVERSION = | ||||||
| NAME = TOSSUG Baby Fish | NAME = TOSSUG Baby Fish | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -16,7 +16,7 @@ | |||||||
| #include <linux/kdebug.h> | #include <linux/kdebug.h> | ||||||
| #include <asm/pgalloc.h> | #include <asm/pgalloc.h> | ||||||
| 
 | 
 | ||||||
| static int handle_vmalloc_fault(struct mm_struct *mm, unsigned long address) | static int handle_vmalloc_fault(unsigned long address) | ||||||
| { | { | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * Synchronize this task's top level page-table | 	 * Synchronize this task's top level page-table | ||||||
| @ -26,7 +26,7 @@ static int handle_vmalloc_fault(struct mm_struct *mm, unsigned long address) | |||||||
| 	pud_t *pud, *pud_k; | 	pud_t *pud, *pud_k; | ||||||
| 	pmd_t *pmd, *pmd_k; | 	pmd_t *pmd, *pmd_k; | ||||||
| 
 | 
 | ||||||
| 	pgd = pgd_offset_fast(mm, address); | 	pgd = pgd_offset_fast(current->active_mm, address); | ||||||
| 	pgd_k = pgd_offset_k(address); | 	pgd_k = pgd_offset_k(address); | ||||||
| 
 | 
 | ||||||
| 	if (!pgd_present(*pgd_k)) | 	if (!pgd_present(*pgd_k)) | ||||||
| @ -72,7 +72,7 @@ void do_page_fault(struct pt_regs *regs, int write, unsigned long address, | |||||||
| 	 * nothing more. | 	 * nothing more. | ||||||
| 	 */ | 	 */ | ||||||
| 	if (address >= VMALLOC_START && address <= VMALLOC_END) { | 	if (address >= VMALLOC_START && address <= VMALLOC_END) { | ||||||
| 		ret = handle_vmalloc_fault(mm, address); | 		ret = handle_vmalloc_fault(address); | ||||||
| 		if (unlikely(ret)) | 		if (unlikely(ret)) | ||||||
| 			goto bad_area_nosemaphore; | 			goto bad_area_nosemaphore; | ||||||
| 		else | 		else | ||||||
|  | |||||||
| @ -195,6 +195,8 @@ common_stext: | |||||||
| 	ldw             MEM_PDC_HI(%r0),%r6 | 	ldw             MEM_PDC_HI(%r0),%r6 | ||||||
| 	depd            %r6, 31, 32, %r3        /* move to upper word */ | 	depd            %r6, 31, 32, %r3        /* move to upper word */ | ||||||
| 
 | 
 | ||||||
|  | 	mfctl		%cr30,%r6		/* PCX-W2 firmware bug */ | ||||||
|  | 
 | ||||||
| 	ldo             PDC_PSW(%r0),%arg0              /* 21 */ | 	ldo             PDC_PSW(%r0),%arg0              /* 21 */ | ||||||
| 	ldo             PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */ | 	ldo             PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */ | ||||||
| 	ldo             PDC_PSW_WIDE_BIT(%r0),%arg2     /* 2 */ | 	ldo             PDC_PSW_WIDE_BIT(%r0),%arg2     /* 2 */ | ||||||
| @ -203,6 +205,8 @@ common_stext: | |||||||
| 	copy            %r0,%arg3 | 	copy            %r0,%arg3 | ||||||
| 
 | 
 | ||||||
| stext_pdc_ret: | stext_pdc_ret: | ||||||
|  | 	mtctl		%r6,%cr30		/* restore task thread info */ | ||||||
|  | 
 | ||||||
| 	/* restore rfi target address*/ | 	/* restore rfi target address*/ | ||||||
| 	ldd             TI_TASK-THREAD_SZ_ALGN(%sp), %r10 | 	ldd             TI_TASK-THREAD_SZ_ALGN(%sp), %r10 | ||||||
| 	tophys_r1       %r10 | 	tophys_r1       %r10 | ||||||
|  | |||||||
| @ -40,9 +40,11 @@ static ssize_t exitcode_proc_write(struct file *file, | |||||||
| 		const char __user *buffer, size_t count, loff_t *pos) | 		const char __user *buffer, size_t count, loff_t *pos) | ||||||
| { | { | ||||||
| 	char *end, buf[sizeof("nnnnn\0")]; | 	char *end, buf[sizeof("nnnnn\0")]; | ||||||
|  | 	size_t size; | ||||||
| 	int tmp; | 	int tmp; | ||||||
| 
 | 
 | ||||||
| 	if (copy_from_user(buf, buffer, count)) | 	size = min(count, sizeof(buf)); | ||||||
|  | 	if (copy_from_user(buf, buffer, size)) | ||||||
| 		return -EFAULT; | 		return -EFAULT; | ||||||
| 
 | 
 | ||||||
| 	tmp = simple_strtol(buf, &end, 0); | 	tmp = simple_strtol(buf, &end, 0); | ||||||
|  | |||||||
| @ -98,7 +98,7 @@ static int __init early_get_pnodeid(void) | |||||||
| 		break; | 		break; | ||||||
| 	case UV3_HUB_PART_NUMBER: | 	case UV3_HUB_PART_NUMBER: | ||||||
| 	case UV3_HUB_PART_NUMBER_X: | 	case UV3_HUB_PART_NUMBER_X: | ||||||
| 		uv_min_hub_revision_id += UV3_HUB_REVISION_BASE - 1; | 		uv_min_hub_revision_id += UV3_HUB_REVISION_BASE; | ||||||
| 		break; | 		break; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -341,7 +341,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||||||
| 
 | 
 | ||||||
| 	sp = regs->areg[1]; | 	sp = regs->areg[1]; | ||||||
| 
 | 
 | ||||||
| 	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) { | 	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && sas_ss_flags(sp) == 0) { | ||||||
| 		sp = current->sas_ss_sp + current->sas_ss_size; | 		sp = current->sas_ss_sp + current->sas_ss_size; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1322,14 +1322,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc) | |||||||
|  *	should be retried.  To be used from EH. |  *	should be retried.  To be used from EH. | ||||||
|  * |  * | ||||||
|  *	SCSI midlayer limits the number of retries to scmd->allowed. |  *	SCSI midlayer limits the number of retries to scmd->allowed. | ||||||
|  *	scmd->retries is decremented for commands which get retried |  *	scmd->allowed is incremented for commands which get retried | ||||||
|  *	due to unrelated failures (qc->err_mask is zero). |  *	due to unrelated failures (qc->err_mask is zero). | ||||||
|  */ |  */ | ||||||
| void ata_eh_qc_retry(struct ata_queued_cmd *qc) | void ata_eh_qc_retry(struct ata_queued_cmd *qc) | ||||||
| { | { | ||||||
| 	struct scsi_cmnd *scmd = qc->scsicmd; | 	struct scsi_cmnd *scmd = qc->scsicmd; | ||||||
| 	if (!qc->err_mask && scmd->retries) | 	if (!qc->err_mask) | ||||||
| 		scmd->retries--; | 		scmd->allowed++; | ||||||
| 	__ata_eh_qc_complete(qc); | 	__ata_eh_qc_complete(qc); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -107,7 +107,7 @@ static int icst_set_rate(struct clk_hw *hw, unsigned long rate, | |||||||
| 
 | 
 | ||||||
| 	vco = icst_hz_to_vco(icst->params, rate); | 	vco = icst_hz_to_vco(icst->params, rate); | ||||||
| 	icst->rate = icst_hz(icst->params, vco); | 	icst->rate = icst_hz(icst->params, vco); | ||||||
| 	vco_set(icst->vcoreg, icst->lockreg, vco); | 	vco_set(icst->lockreg, icst->vcoreg, vco); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -348,9 +348,16 @@ long drm_ioctl(struct file *filp, | |||||||
| 		cmd = ioctl->cmd_drv; | 		cmd = ioctl->cmd_drv; | ||||||
| 	} | 	} | ||||||
| 	else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { | 	else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { | ||||||
|  | 		u32 drv_size; | ||||||
|  | 
 | ||||||
| 		ioctl = &drm_ioctls[nr]; | 		ioctl = &drm_ioctls[nr]; | ||||||
| 		cmd = ioctl->cmd; | 
 | ||||||
|  | 		drv_size = _IOC_SIZE(ioctl->cmd); | ||||||
| 		usize = asize = _IOC_SIZE(cmd); | 		usize = asize = _IOC_SIZE(cmd); | ||||||
|  | 		if (drv_size > asize) | ||||||
|  | 			asize = drv_size; | ||||||
|  | 
 | ||||||
|  | 		cmd = ioctl->cmd; | ||||||
| 	} else | 	} else | ||||||
| 		goto err_i1; | 		goto err_i1; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1641,7 +1641,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) | |||||||
| 			 * does the same thing and more. | 			 * does the same thing and more. | ||||||
| 			 */ | 			 */ | ||||||
| 			if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) && | 			if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) && | ||||||
| 			    (rdev->family != CHIP_RS880)) | 			    (rdev->family != CHIP_RS780) && (rdev->family != CHIP_RS880)) | ||||||
| 				atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); | 				atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); | ||||||
| 		} | 		} | ||||||
| 		if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { | 		if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { | ||||||
|  | |||||||
| @ -738,9 +738,17 @@ static void vmw_postclose(struct drm_device *dev, | |||||||
| 	struct vmw_fpriv *vmw_fp; | 	struct vmw_fpriv *vmw_fp; | ||||||
| 
 | 
 | ||||||
| 	vmw_fp = vmw_fpriv(file_priv); | 	vmw_fp = vmw_fpriv(file_priv); | ||||||
| 	ttm_object_file_release(&vmw_fp->tfile); | 
 | ||||||
| 	if (vmw_fp->locked_master) | 	if (vmw_fp->locked_master) { | ||||||
|  | 		struct vmw_master *vmaster = | ||||||
|  | 			vmw_master(vmw_fp->locked_master); | ||||||
|  | 
 | ||||||
|  | 		ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); | ||||||
|  | 		ttm_vt_unlock(&vmaster->lock); | ||||||
| 		drm_master_put(&vmw_fp->locked_master); | 		drm_master_put(&vmw_fp->locked_master); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	ttm_object_file_release(&vmw_fp->tfile); | ||||||
| 	kfree(vmw_fp); | 	kfree(vmw_fp); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -940,14 +948,13 @@ static void vmw_master_drop(struct drm_device *dev, | |||||||
| 
 | 
 | ||||||
| 	vmw_fp->locked_master = drm_master_get(file_priv->master); | 	vmw_fp->locked_master = drm_master_get(file_priv->master); | ||||||
| 	ret = ttm_vt_lock(&vmaster->lock, false, vmw_fp->tfile); | 	ret = ttm_vt_lock(&vmaster->lock, false, vmw_fp->tfile); | ||||||
| 	vmw_execbuf_release_pinned_bo(dev_priv); |  | ||||||
| 
 |  | ||||||
| 	if (unlikely((ret != 0))) { | 	if (unlikely((ret != 0))) { | ||||||
| 		DRM_ERROR("Unable to lock TTM at VT switch.\n"); | 		DRM_ERROR("Unable to lock TTM at VT switch.\n"); | ||||||
| 		drm_master_put(&vmw_fp->locked_master); | 		drm_master_put(&vmw_fp->locked_master); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); | 	ttm_lock_set_kill(&vmaster->lock, false, SIGTERM); | ||||||
|  | 	vmw_execbuf_release_pinned_bo(dev_priv); | ||||||
| 
 | 
 | ||||||
| 	if (!dev_priv->enable_fb) { | 	if (!dev_priv->enable_fb) { | ||||||
| 		ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); | 		ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); | ||||||
|  | |||||||
| @ -970,7 +970,7 @@ void vmw_resource_unreserve(struct vmw_resource *res, | |||||||
| 	if (new_backup) | 	if (new_backup) | ||||||
| 		res->backup_offset = new_backup_offset; | 		res->backup_offset = new_backup_offset; | ||||||
| 
 | 
 | ||||||
| 	if (!res->func->may_evict) | 	if (!res->func->may_evict || res->id == -1) | ||||||
| 		return; | 		return; | ||||||
| 
 | 
 | ||||||
| 	write_lock(&dev_priv->resource_lock); | 	write_lock(&dev_priv->resource_lock); | ||||||
|  | |||||||
| @ -1059,7 +1059,7 @@ static void request_write(struct cached_dev *dc, struct search *s) | |||||||
| 
 | 
 | ||||||
| 		if (bio->bi_rw & REQ_FLUSH) { | 		if (bio->bi_rw & REQ_FLUSH) { | ||||||
| 			/* Also need to send a flush to the backing device */ | 			/* Also need to send a flush to the backing device */ | ||||||
| 			struct bio *flush = bio_alloc_bioset(0, GFP_NOIO, | 			struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, | ||||||
| 							     dc->disk.bio_split); | 							     dc->disk.bio_split); | ||||||
| 
 | 
 | ||||||
| 			flush->bi_rw	= WRITE_FLUSH; | 			flush->bi_rw	= WRITE_FLUSH; | ||||||
|  | |||||||
| @ -8072,6 +8072,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||||||
| 	u64 *p; | 	u64 *p; | ||||||
| 	int lo, hi; | 	int lo, hi; | ||||||
| 	int rv = 1; | 	int rv = 1; | ||||||
|  | 	unsigned long flags; | ||||||
| 
 | 
 | ||||||
| 	if (bb->shift < 0) | 	if (bb->shift < 0) | ||||||
| 		/* badblocks are disabled */ | 		/* badblocks are disabled */ | ||||||
| @ -8086,7 +8087,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||||||
| 		sectors = next - s; | 		sectors = next - s; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	write_seqlock_irq(&bb->lock); | 	write_seqlock_irqsave(&bb->lock, flags); | ||||||
| 
 | 
 | ||||||
| 	p = bb->page; | 	p = bb->page; | ||||||
| 	lo = 0; | 	lo = 0; | ||||||
| @ -8202,7 +8203,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||||||
| 	bb->changed = 1; | 	bb->changed = 1; | ||||||
| 	if (!acknowledged) | 	if (!acknowledged) | ||||||
| 		bb->unacked_exist = 1; | 		bb->unacked_exist = 1; | ||||||
| 	write_sequnlock_irq(&bb->lock); | 	write_sequnlock_irqrestore(&bb->lock, flags); | ||||||
| 
 | 
 | ||||||
| 	return rv; | 	return rv; | ||||||
| } | } | ||||||
|  | |||||||
| @ -1479,6 +1479,7 @@ static int raid1_spare_active(struct mddev *mddev) | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		if (rdev | 		if (rdev | ||||||
|  | 		    && rdev->recovery_offset == MaxSector | ||||||
| 		    && !test_bit(Faulty, &rdev->flags) | 		    && !test_bit(Faulty, &rdev->flags) | ||||||
| 		    && !test_and_set_bit(In_sync, &rdev->flags)) { | 		    && !test_and_set_bit(In_sync, &rdev->flags)) { | ||||||
| 			count++; | 			count++; | ||||||
|  | |||||||
| @ -1762,6 +1762,7 @@ static int raid10_spare_active(struct mddev *mddev) | |||||||
| 			} | 			} | ||||||
| 			sysfs_notify_dirent_safe(tmp->replacement->sysfs_state); | 			sysfs_notify_dirent_safe(tmp->replacement->sysfs_state); | ||||||
| 		} else if (tmp->rdev | 		} else if (tmp->rdev | ||||||
|  | 			   && tmp->rdev->recovery_offset == MaxSector | ||||||
| 			   && !test_bit(Faulty, &tmp->rdev->flags) | 			   && !test_bit(Faulty, &tmp->rdev->flags) | ||||||
| 			   && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { | 			   && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { | ||||||
| 			count++; | 			count++; | ||||||
|  | |||||||
| @ -668,6 +668,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||||||
| 			bi->bi_io_vec[0].bv_len = STRIPE_SIZE; | 			bi->bi_io_vec[0].bv_len = STRIPE_SIZE; | ||||||
| 			bi->bi_io_vec[0].bv_offset = 0; | 			bi->bi_io_vec[0].bv_offset = 0; | ||||||
| 			bi->bi_size = STRIPE_SIZE; | 			bi->bi_size = STRIPE_SIZE; | ||||||
|  | 			/*
 | ||||||
|  | 			 * If this is discard request, set bi_vcnt 0. We don't | ||||||
|  | 			 * want to confuse SCSI because SCSI will replace payload | ||||||
|  | 			 */ | ||||||
|  | 			if (rw & REQ_DISCARD) | ||||||
|  | 				bi->bi_vcnt = 0; | ||||||
| 			if (rrdev) | 			if (rrdev) | ||||||
| 				set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags); | 				set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags); | ||||||
| 
 | 
 | ||||||
| @ -706,6 +712,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||||||
| 			rbi->bi_io_vec[0].bv_len = STRIPE_SIZE; | 			rbi->bi_io_vec[0].bv_len = STRIPE_SIZE; | ||||||
| 			rbi->bi_io_vec[0].bv_offset = 0; | 			rbi->bi_io_vec[0].bv_offset = 0; | ||||||
| 			rbi->bi_size = STRIPE_SIZE; | 			rbi->bi_size = STRIPE_SIZE; | ||||||
|  | 			/*
 | ||||||
|  | 			 * If this is discard request, set bi_vcnt 0. We don't | ||||||
|  | 			 * want to confuse SCSI because SCSI will replace payload | ||||||
|  | 			 */ | ||||||
|  | 			if (rw & REQ_DISCARD) | ||||||
|  | 				rbi->bi_vcnt = 0; | ||||||
| 			if (conf->mddev->gendisk) | 			if (conf->mddev->gendisk) | ||||||
| 				trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev), | 				trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev), | ||||||
| 						      rbi, disk_devt(conf->mddev->gendisk), | 						      rbi, disk_devt(conf->mddev->gendisk), | ||||||
| @ -2800,6 +2812,14 @@ static void handle_stripe_clean_event(struct r5conf *conf, | |||||||
| 		} | 		} | ||||||
| 		/* now that discard is done we can proceed with any sync */ | 		/* now that discard is done we can proceed with any sync */ | ||||||
| 		clear_bit(STRIPE_DISCARD, &sh->state); | 		clear_bit(STRIPE_DISCARD, &sh->state); | ||||||
|  | 		/*
 | ||||||
|  | 		 * SCSI discard will change some bio fields and the stripe has | ||||||
|  | 		 * no updated data, so remove it from hash list and the stripe | ||||||
|  | 		 * will be reinitialized | ||||||
|  | 		 */ | ||||||
|  | 		spin_lock_irq(&conf->device_lock); | ||||||
|  | 		remove_hash(sh); | ||||||
|  | 		spin_unlock_irq(&conf->device_lock); | ||||||
| 		if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) | 		if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) | ||||||
| 			set_bit(STRIPE_HANDLE, &sh->state); | 			set_bit(STRIPE_HANDLE, &sh->state); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1409,10 +1409,10 @@ static int at91_can_remove(struct platform_device *pdev) | |||||||
| 
 | 
 | ||||||
| static const struct platform_device_id at91_can_id_table[] = { | static const struct platform_device_id at91_can_id_table[] = { | ||||||
| 	{ | 	{ | ||||||
| 		.name = "at91_can", | 		.name = "at91sam9x5_can", | ||||||
| 		.driver_data = (kernel_ulong_t)&at91_at91sam9x5_data, | 		.driver_data = (kernel_ulong_t)&at91_at91sam9x5_data, | ||||||
| 	}, { | 	}, { | ||||||
| 		.name = "at91sam9x5_can", | 		.name = "at91_can", | ||||||
| 		.driver_data = (kernel_ulong_t)&at91_at91sam9263_data, | 		.driver_data = (kernel_ulong_t)&at91_at91sam9263_data, | ||||||
| 	}, { | 	}, { | ||||||
| 		/* sentinel */ | 		/* sentinel */ | ||||||
|  | |||||||
| @ -63,7 +63,7 @@ | |||||||
| #define FLEXCAN_MCR_BCC			BIT(16) | #define FLEXCAN_MCR_BCC			BIT(16) | ||||||
| #define FLEXCAN_MCR_LPRIO_EN		BIT(13) | #define FLEXCAN_MCR_LPRIO_EN		BIT(13) | ||||||
| #define FLEXCAN_MCR_AEN			BIT(12) | #define FLEXCAN_MCR_AEN			BIT(12) | ||||||
| #define FLEXCAN_MCR_MAXMB(x)		((x) & 0xf) | #define FLEXCAN_MCR_MAXMB(x)		((x) & 0x1f) | ||||||
| #define FLEXCAN_MCR_IDAM_A		(0 << 8) | #define FLEXCAN_MCR_IDAM_A		(0 << 8) | ||||||
| #define FLEXCAN_MCR_IDAM_B		(1 << 8) | #define FLEXCAN_MCR_IDAM_B		(1 << 8) | ||||||
| #define FLEXCAN_MCR_IDAM_C		(2 << 8) | #define FLEXCAN_MCR_IDAM_C		(2 << 8) | ||||||
| @ -745,9 +745,11 @@ static int flexcan_chip_start(struct net_device *dev) | |||||||
| 	 * | 	 * | ||||||
| 	 */ | 	 */ | ||||||
| 	reg_mcr = flexcan_read(®s->mcr); | 	reg_mcr = flexcan_read(®s->mcr); | ||||||
|  | 	reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); | ||||||
| 	reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | | 	reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | | ||||||
| 		FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | | 		FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | | ||||||
| 		FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS; | 		FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS | | ||||||
|  | 		FLEXCAN_MCR_MAXMB(FLEXCAN_TX_BUF_ID); | ||||||
| 	netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); | 	netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); | ||||||
| 	flexcan_write(reg_mcr, ®s->mcr); | 	flexcan_write(reg_mcr, ®s->mcr); | ||||||
| 
 | 
 | ||||||
| @ -792,6 +794,10 @@ static int flexcan_chip_start(struct net_device *dev) | |||||||
| 			®s->cantxfg[i].can_ctrl); | 			®s->cantxfg[i].can_ctrl); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	/* Abort any pending TX, mark Mailbox as INACTIVE */ | ||||||
|  | 	flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), | ||||||
|  | 		      ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | ||||||
|  | 
 | ||||||
| 	/* acceptance mask/acceptance code (accept everything) */ | 	/* acceptance mask/acceptance code (accept everything) */ | ||||||
| 	flexcan_write(0x0, ®s->rxgmask); | 	flexcan_write(0x0, ®s->rxgmask); | ||||||
| 	flexcan_write(0x0, ®s->rx14mask); | 	flexcan_write(0x0, ®s->rx14mask); | ||||||
| @ -983,9 +989,9 @@ static void unregister_flexcandev(struct net_device *dev) | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static const struct of_device_id flexcan_of_match[] = { | static const struct of_device_id flexcan_of_match[] = { | ||||||
| 	{ .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, |  | ||||||
| 	{ .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, |  | ||||||
| 	{ .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | 	{ .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | ||||||
|  | 	{ .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | ||||||
|  | 	{ .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | ||||||
| 	{ /* sentinel */ }, | 	{ /* sentinel */ }, | ||||||
| }; | }; | ||||||
| MODULE_DEVICE_TABLE(of, flexcan_of_match); | MODULE_DEVICE_TABLE(of, flexcan_of_match); | ||||||
|  | |||||||
| @ -209,6 +209,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||||||
| 	struct ath_hw *ah = sc->sc_ah; | 	struct ath_hw *ah = sc->sc_ah; | ||||||
| 	struct ath_common *common = ath9k_hw_common(ah); | 	struct ath_common *common = ath9k_hw_common(ah); | ||||||
| 	unsigned long flags; | 	unsigned long flags; | ||||||
|  | 	int i; | ||||||
| 
 | 
 | ||||||
| 	if (ath_startrecv(sc) != 0) { | 	if (ath_startrecv(sc) != 0) { | ||||||
| 		ath_err(common, "Unable to restart recv logic\n"); | 		ath_err(common, "Unable to restart recv logic\n"); | ||||||
| @ -236,6 +237,15 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||||||
| 		} | 		} | ||||||
| 	work: | 	work: | ||||||
| 		ath_restart_work(sc); | 		ath_restart_work(sc); | ||||||
|  | 
 | ||||||
|  | 		for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | ||||||
|  | 			if (!ATH_TXQ_SETUP(sc, i)) | ||||||
|  | 				continue; | ||||||
|  | 
 | ||||||
|  | 			spin_lock_bh(&sc->tx.txq[i].axq_lock); | ||||||
|  | 			ath_txq_schedule(sc, &sc->tx.txq[i]); | ||||||
|  | 			spin_unlock_bh(&sc->tx.txq[i].axq_lock); | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) | 	if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) | ||||||
| @ -543,21 +553,10 @@ chip_reset: | |||||||
| 
 | 
 | ||||||
| static int ath_reset(struct ath_softc *sc) | static int ath_reset(struct ath_softc *sc) | ||||||
| { | { | ||||||
| 	int i, r; | 	int r; | ||||||
| 
 | 
 | ||||||
| 	ath9k_ps_wakeup(sc); | 	ath9k_ps_wakeup(sc); | ||||||
| 
 |  | ||||||
| 	r = ath_reset_internal(sc, NULL); | 	r = ath_reset_internal(sc, NULL); | ||||||
| 
 |  | ||||||
| 	for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { |  | ||||||
| 		if (!ATH_TXQ_SETUP(sc, i)) |  | ||||||
| 			continue; |  | ||||||
| 
 |  | ||||||
| 		spin_lock_bh(&sc->tx.txq[i].axq_lock); |  | ||||||
| 		ath_txq_schedule(sc, &sc->tx.txq[i]); |  | ||||||
| 		spin_unlock_bh(&sc->tx.txq[i].axq_lock); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	ath9k_ps_restore(sc); | 	ath9k_ps_restore(sc); | ||||||
| 
 | 
 | ||||||
| 	return r; | 	return r; | ||||||
|  | |||||||
| @ -268,6 +268,12 @@ const struct iwl_cfg iwl6035_2agn_cfg = { | |||||||
| 	.ht_params = &iwl6000_ht_params, | 	.ht_params = &iwl6000_ht_params, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | const struct iwl_cfg iwl6035_2agn_sff_cfg = { | ||||||
|  | 	.name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN", | ||||||
|  | 	IWL_DEVICE_6035, | ||||||
|  | 	.ht_params = &iwl6000_ht_params, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| const struct iwl_cfg iwl1030_bgn_cfg = { | const struct iwl_cfg iwl1030_bgn_cfg = { | ||||||
| 	.name = "Intel(R) Centrino(R) Wireless-N 1030 BGN", | 	.name = "Intel(R) Centrino(R) Wireless-N 1030 BGN", | ||||||
| 	IWL_DEVICE_6030, | 	IWL_DEVICE_6030, | ||||||
|  | |||||||
| @ -316,6 +316,7 @@ extern const struct iwl_cfg iwl2000_2bgn_cfg; | |||||||
| extern const struct iwl_cfg iwl2000_2bgn_d_cfg; | extern const struct iwl_cfg iwl2000_2bgn_d_cfg; | ||||||
| extern const struct iwl_cfg iwl2030_2bgn_cfg; | extern const struct iwl_cfg iwl2030_2bgn_cfg; | ||||||
| extern const struct iwl_cfg iwl6035_2agn_cfg; | extern const struct iwl_cfg iwl6035_2agn_cfg; | ||||||
|  | extern const struct iwl_cfg iwl6035_2agn_sff_cfg; | ||||||
| extern const struct iwl_cfg iwl105_bgn_cfg; | extern const struct iwl_cfg iwl105_bgn_cfg; | ||||||
| extern const struct iwl_cfg iwl105_bgn_d_cfg; | extern const struct iwl_cfg iwl105_bgn_d_cfg; | ||||||
| extern const struct iwl_cfg iwl135_bgn_cfg; | extern const struct iwl_cfg iwl135_bgn_cfg; | ||||||
|  | |||||||
| @ -138,13 +138,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||||||
| 
 | 
 | ||||||
| /* 6x00 Series */ | /* 6x00 Series */ | ||||||
| 	{IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)}, | 	{IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x422B, 0x1108, iwl6000_3agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)}, | 	{IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x422B, 0x1128, iwl6000_3agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)}, | 	{IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)}, | 	{IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)}, | 	{IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)}, | 	{IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x4238, 0x1118, iwl6000_3agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)}, | 	{IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)}, | ||||||
| 
 | 
 | ||||||
| @ -152,12 +155,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x0082, 0x1308, iwl6005_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x0082, 0x1328, iwl6005_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x0085, 0x1318, iwl6005_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)}, | 	{IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)}, | 	{IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x0085, 0xC228, iwl6005_2agn_sff_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)}, | 	{IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */ | 	{IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */ | ||||||
| 	{IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */ | 	{IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */ | ||||||
| @ -239,8 +246,11 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||||||
| 
 | 
 | ||||||
| /* 6x35 Series */ | /* 6x35 Series */ | ||||||
| 	{IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x088E, 0x406A, iwl6035_2agn_sff_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x088F, 0x426A, iwl6035_2agn_sff_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)}, | ||||||
|  | 	{IWL_PCI_DEVICE(0x088E, 0x446A, iwl6035_2agn_sff_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)}, | ||||||
| 	{IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)}, | 	{IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)}, | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -270,10 +270,12 @@ process_start: | |||||||
| 		} | 		} | ||||||
| 	} while (true); | 	} while (true); | ||||||
| 
 | 
 | ||||||
| 	if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) |  | ||||||
| 		goto process_start; |  | ||||||
| 
 |  | ||||||
| 	spin_lock_irqsave(&adapter->main_proc_lock, flags); | 	spin_lock_irqsave(&adapter->main_proc_lock, flags); | ||||||
|  | 	if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) { | ||||||
|  | 		spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | ||||||
|  | 		goto process_start; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	adapter->mwifiex_processing = false; | 	adapter->mwifiex_processing = false; | ||||||
| 	spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | 	spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -343,7 +343,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||||||
| 					(bool)GET_RX_DESC_PAGGR(pdesc)); | 					(bool)GET_RX_DESC_PAGGR(pdesc)); | ||||||
| 	rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 	rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | ||||||
| 	if (phystatus) { | 	if (phystatus) { | ||||||
| 		p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE); | 		p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + | ||||||
|  | 						     stats->rx_bufshift); | ||||||
| 		rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, | 		rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, | ||||||
| 						 p_drvinfo); | 						 p_drvinfo); | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -78,6 +78,8 @@ enum { | |||||||
| 	BWD_HW, | 	BWD_HW, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | static struct dentry *debugfs_dir; | ||||||
|  | 
 | ||||||
| /* Translate memory window 0,1 to BAR 2,4 */ | /* Translate memory window 0,1 to BAR 2,4 */ | ||||||
| #define MW_TO_BAR(mw)	(mw * 2 + 2) | #define MW_TO_BAR(mw)	(mw * 2 + 2) | ||||||
| 
 | 
 | ||||||
| @ -531,9 +533,9 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (val & SNB_PPD_DEV_TYPE) | 	if (val & SNB_PPD_DEV_TYPE) | ||||||
| 		ndev->dev_type = NTB_DEV_DSD; |  | ||||||
| 	else |  | ||||||
| 		ndev->dev_type = NTB_DEV_USD; | 		ndev->dev_type = NTB_DEV_USD; | ||||||
|  | 	else | ||||||
|  | 		ndev->dev_type = NTB_DEV_DSD; | ||||||
| 
 | 
 | ||||||
| 	ndev->reg_ofs.pdb = ndev->reg_base + SNB_PDOORBELL_OFFSET; | 	ndev->reg_ofs.pdb = ndev->reg_base + SNB_PDOORBELL_OFFSET; | ||||||
| 	ndev->reg_ofs.pdb_mask = ndev->reg_base + SNB_PDBMSK_OFFSET; | 	ndev->reg_ofs.pdb_mask = ndev->reg_base + SNB_PDBMSK_OFFSET; | ||||||
| @ -547,7 +549,7 @@ static int ntb_xeon_setup(struct ntb_device *ndev) | |||||||
| 	if (ndev->conn_type == NTB_CONN_B2B) { | 	if (ndev->conn_type == NTB_CONN_B2B) { | ||||||
| 		ndev->reg_ofs.sdb = ndev->reg_base + SNB_B2B_DOORBELL_OFFSET; | 		ndev->reg_ofs.sdb = ndev->reg_base + SNB_B2B_DOORBELL_OFFSET; | ||||||
| 		ndev->reg_ofs.spad_write = ndev->reg_base + SNB_B2B_SPAD_OFFSET; | 		ndev->reg_ofs.spad_write = ndev->reg_base + SNB_B2B_SPAD_OFFSET; | ||||||
| 		ndev->limits.max_spads = SNB_MAX_SPADS; | 		ndev->limits.max_spads = SNB_MAX_B2B_SPADS; | ||||||
| 	} else { | 	} else { | ||||||
| 		ndev->reg_ofs.sdb = ndev->reg_base + SNB_SDOORBELL_OFFSET; | 		ndev->reg_ofs.sdb = ndev->reg_base + SNB_SDOORBELL_OFFSET; | ||||||
| 		ndev->reg_ofs.spad_write = ndev->reg_base + SNB_SPAD_OFFSET; | 		ndev->reg_ofs.spad_write = ndev->reg_base + SNB_SPAD_OFFSET; | ||||||
| @ -644,10 +646,16 @@ static int ntb_device_setup(struct ntb_device *ndev) | |||||||
| 		rc = -ENODEV; | 		rc = -ENODEV; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	if (rc) | ||||||
|  | 		return rc; | ||||||
|  | 
 | ||||||
|  | 	dev_info(&ndev->pdev->dev, "Device Type = %s\n", | ||||||
|  | 		 ndev->dev_type == NTB_DEV_USD ? "USD/DSP" : "DSD/USP"); | ||||||
|  | 
 | ||||||
| 	/* Enable Bus Master and Memory Space on the secondary side */ | 	/* Enable Bus Master and Memory Space on the secondary side */ | ||||||
| 	writew(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, ndev->reg_ofs.spci_cmd); | 	writew(PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, ndev->reg_ofs.spci_cmd); | ||||||
| 
 | 
 | ||||||
| 	return rc; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void ntb_device_free(struct ntb_device *ndev) | static void ntb_device_free(struct ntb_device *ndev) | ||||||
| @ -992,6 +1000,28 @@ static void ntb_free_callbacks(struct ntb_device *ndev) | |||||||
| 	kfree(ndev->db_cb); | 	kfree(ndev->db_cb); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static void ntb_setup_debugfs(struct ntb_device *ndev) | ||||||
|  | { | ||||||
|  | 	if (!debugfs_initialized()) | ||||||
|  | 		return; | ||||||
|  | 
 | ||||||
|  | 	if (!debugfs_dir) | ||||||
|  | 		debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); | ||||||
|  | 
 | ||||||
|  | 	ndev->debugfs_dir = debugfs_create_dir(pci_name(ndev->pdev), | ||||||
|  | 					       debugfs_dir); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | static void ntb_free_debugfs(struct ntb_device *ndev) | ||||||
|  | { | ||||||
|  | 	debugfs_remove_recursive(ndev->debugfs_dir); | ||||||
|  | 
 | ||||||
|  | 	if (debugfs_dir && simple_empty(debugfs_dir)) { | ||||||
|  | 		debugfs_remove_recursive(debugfs_dir); | ||||||
|  | 		debugfs_dir = NULL; | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
| static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | ||||||
| { | { | ||||||
| 	struct ntb_device *ndev; | 	struct ntb_device *ndev; | ||||||
| @ -1004,6 +1034,7 @@ static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||||||
| 	ndev->pdev = pdev; | 	ndev->pdev = pdev; | ||||||
| 	ndev->link_status = NTB_LINK_DOWN; | 	ndev->link_status = NTB_LINK_DOWN; | ||||||
| 	pci_set_drvdata(pdev, ndev); | 	pci_set_drvdata(pdev, ndev); | ||||||
|  | 	ntb_setup_debugfs(ndev); | ||||||
| 
 | 
 | ||||||
| 	rc = pci_enable_device(pdev); | 	rc = pci_enable_device(pdev); | ||||||
| 	if (rc) | 	if (rc) | ||||||
| @ -1100,6 +1131,7 @@ err2: | |||||||
| err1: | err1: | ||||||
| 	pci_disable_device(pdev); | 	pci_disable_device(pdev); | ||||||
| err: | err: | ||||||
|  | 	ntb_free_debugfs(ndev); | ||||||
| 	kfree(ndev); | 	kfree(ndev); | ||||||
| 
 | 
 | ||||||
| 	dev_err(&pdev->dev, "Error loading %s module\n", KBUILD_MODNAME); | 	dev_err(&pdev->dev, "Error loading %s module\n", KBUILD_MODNAME); | ||||||
| @ -1129,6 +1161,7 @@ static void ntb_pci_remove(struct pci_dev *pdev) | |||||||
| 	iounmap(ndev->reg_base); | 	iounmap(ndev->reg_base); | ||||||
| 	pci_release_selected_regions(pdev, NTB_BAR_MASK); | 	pci_release_selected_regions(pdev, NTB_BAR_MASK); | ||||||
| 	pci_disable_device(pdev); | 	pci_disable_device(pdev); | ||||||
|  | 	ntb_free_debugfs(ndev); | ||||||
| 	kfree(ndev); | 	kfree(ndev); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -127,6 +127,8 @@ struct ntb_device { | |||||||
| 	unsigned char link_status; | 	unsigned char link_status; | ||||||
| 	struct delayed_work hb_timer; | 	struct delayed_work hb_timer; | ||||||
| 	unsigned long last_ts; | 	unsigned long last_ts; | ||||||
|  | 
 | ||||||
|  | 	struct dentry *debugfs_dir; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
| @ -155,6 +157,20 @@ static inline struct pci_dev *ntb_query_pdev(struct ntb_device *ndev) | |||||||
| 	return ndev->pdev; | 	return ndev->pdev; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /**
 | ||||||
|  |  * ntb_query_debugfs() - return the debugfs pointer | ||||||
|  |  * @ndev: pointer to ntb_device instance | ||||||
|  |  * | ||||||
|  |  * Given the ntb pointer, return the debugfs directory pointer for the NTB | ||||||
|  |  * hardware device | ||||||
|  |  * | ||||||
|  |  * RETURNS: a pointer to the debugfs directory | ||||||
|  |  */ | ||||||
|  | static inline struct dentry *ntb_query_debugfs(struct ntb_device *ndev) | ||||||
|  | { | ||||||
|  | 	return ndev->debugfs_dir; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| struct ntb_device *ntb_register_transport(struct pci_dev *pdev, | struct ntb_device *ntb_register_transport(struct pci_dev *pdev, | ||||||
| 					  void *transport); | 					  void *transport); | ||||||
| void ntb_unregister_transport(struct ntb_device *ndev); | void ntb_unregister_transport(struct ntb_device *ndev); | ||||||
|  | |||||||
| @ -53,8 +53,8 @@ | |||||||
| #define NTB_LINK_WIDTH_MASK	0x03f0 | #define NTB_LINK_WIDTH_MASK	0x03f0 | ||||||
| 
 | 
 | ||||||
| #define SNB_MSIX_CNT		4 | #define SNB_MSIX_CNT		4 | ||||||
| #define SNB_MAX_SPADS		16 | #define SNB_MAX_B2B_SPADS	16 | ||||||
| #define SNB_MAX_COMPAT_SPADS	8 | #define SNB_MAX_COMPAT_SPADS	16 | ||||||
| /* Reserve the uppermost bit for link interrupt */ | /* Reserve the uppermost bit for link interrupt */ | ||||||
| #define SNB_MAX_DB_BITS		15 | #define SNB_MAX_DB_BITS		15 | ||||||
| #define SNB_DB_BITS_PER_VEC	5 | #define SNB_DB_BITS_PER_VEC	5 | ||||||
|  | |||||||
| @ -157,7 +157,6 @@ struct ntb_transport { | |||||||
| 	bool transport_link; | 	bool transport_link; | ||||||
| 	struct delayed_work link_work; | 	struct delayed_work link_work; | ||||||
| 	struct work_struct link_cleanup; | 	struct work_struct link_cleanup; | ||||||
| 	struct dentry *debugfs_dir; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| enum { | enum { | ||||||
| @ -824,12 +823,12 @@ static void ntb_transport_init_queue(struct ntb_transport *nt, | |||||||
| 	qp->tx_max_frame = min(transport_mtu, tx_size / 2); | 	qp->tx_max_frame = min(transport_mtu, tx_size / 2); | ||||||
| 	qp->tx_max_entry = tx_size / qp->tx_max_frame; | 	qp->tx_max_entry = tx_size / qp->tx_max_frame; | ||||||
| 
 | 
 | ||||||
| 	if (nt->debugfs_dir) { | 	if (ntb_query_debugfs(nt->ndev)) { | ||||||
| 		char debugfs_name[4]; | 		char debugfs_name[4]; | ||||||
| 
 | 
 | ||||||
| 		snprintf(debugfs_name, 4, "qp%d", qp_num); | 		snprintf(debugfs_name, 4, "qp%d", qp_num); | ||||||
| 		qp->debugfs_dir = debugfs_create_dir(debugfs_name, | 		qp->debugfs_dir = debugfs_create_dir(debugfs_name, | ||||||
| 						     nt->debugfs_dir); | 						 ntb_query_debugfs(nt->ndev)); | ||||||
| 
 | 
 | ||||||
| 		qp->debugfs_stats = debugfs_create_file("stats", S_IRUSR, | 		qp->debugfs_stats = debugfs_create_file("stats", S_IRUSR, | ||||||
| 							qp->debugfs_dir, qp, | 							qp->debugfs_dir, qp, | ||||||
| @ -857,11 +856,6 @@ int ntb_transport_init(struct pci_dev *pdev) | |||||||
| 	if (!nt) | 	if (!nt) | ||||||
| 		return -ENOMEM; | 		return -ENOMEM; | ||||||
| 
 | 
 | ||||||
| 	if (debugfs_initialized()) |  | ||||||
| 		nt->debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL); |  | ||||||
| 	else |  | ||||||
| 		nt->debugfs_dir = NULL; |  | ||||||
| 
 |  | ||||||
| 	nt->ndev = ntb_register_transport(pdev, nt); | 	nt->ndev = ntb_register_transport(pdev, nt); | ||||||
| 	if (!nt->ndev) { | 	if (!nt->ndev) { | ||||||
| 		rc = -EIO; | 		rc = -EIO; | ||||||
| @ -907,7 +901,6 @@ err2: | |||||||
| err1: | err1: | ||||||
| 	ntb_unregister_transport(nt->ndev); | 	ntb_unregister_transport(nt->ndev); | ||||||
| err: | err: | ||||||
| 	debugfs_remove_recursive(nt->debugfs_dir); |  | ||||||
| 	kfree(nt); | 	kfree(nt); | ||||||
| 	return rc; | 	return rc; | ||||||
| } | } | ||||||
| @ -921,16 +914,16 @@ void ntb_transport_free(void *transport) | |||||||
| 	nt->transport_link = NTB_LINK_DOWN; | 	nt->transport_link = NTB_LINK_DOWN; | ||||||
| 
 | 
 | ||||||
| 	/* verify that all the qp's are freed */ | 	/* verify that all the qp's are freed */ | ||||||
| 	for (i = 0; i < nt->max_qps; i++) | 	for (i = 0; i < nt->max_qps; i++) { | ||||||
| 		if (!test_bit(i, &nt->qp_bitmap)) | 		if (!test_bit(i, &nt->qp_bitmap)) | ||||||
| 			ntb_transport_free_queue(&nt->qps[i]); | 			ntb_transport_free_queue(&nt->qps[i]); | ||||||
|  | 		debugfs_remove_recursive(nt->qps[i].debugfs_dir); | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	ntb_bus_remove(nt); | 	ntb_bus_remove(nt); | ||||||
| 
 | 
 | ||||||
| 	cancel_delayed_work_sync(&nt->link_work); | 	cancel_delayed_work_sync(&nt->link_work); | ||||||
| 
 | 
 | ||||||
| 	debugfs_remove_recursive(nt->debugfs_dir); |  | ||||||
| 
 |  | ||||||
| 	ntb_unregister_event_callback(nt->ndev); | 	ntb_unregister_event_callback(nt->ndev); | ||||||
| 
 | 
 | ||||||
| 	pdev = ntb_query_pdev(nt->ndev); | 	pdev = ntb_query_pdev(nt->ndev); | ||||||
|  | |||||||
| @ -771,6 +771,8 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long | |||||||
| static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | ||||||
| { | { | ||||||
| 	struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; | 	struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; | ||||||
|  | 	if (!capable(CAP_SYS_RAWIO)) | ||||||
|  | 		return -EPERM; | ||||||
| 	return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg); | 	return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2848,6 +2848,7 @@ static void sd_probe_async(void *data, async_cookie_t cookie) | |||||||
| 		gd->events |= DISK_EVENT_MEDIA_CHANGE; | 		gd->events |= DISK_EVENT_MEDIA_CHANGE; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	blk_pm_runtime_init(sdp->request_queue, dev); | ||||||
| 	add_disk(gd); | 	add_disk(gd); | ||||||
| 	if (sdkp->capacity) | 	if (sdkp->capacity) | ||||||
| 		sd_dif_config_host(sdkp); | 		sd_dif_config_host(sdkp); | ||||||
| @ -2856,7 +2857,6 @@ static void sd_probe_async(void *data, async_cookie_t cookie) | |||||||
| 
 | 
 | ||||||
| 	sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", | 	sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", | ||||||
| 		  sdp->removable ? "removable " : ""); | 		  sdp->removable ? "removable " : ""); | ||||||
| 	blk_pm_runtime_init(sdp->request_queue, dev); |  | ||||||
| 	scsi_autopm_put_device(sdp); | 	scsi_autopm_put_device(sdp); | ||||||
| 	put_device(&sdkp->dev); | 	put_device(&sdkp->dev); | ||||||
| } | } | ||||||
|  | |||||||
| @ -1960,6 +1960,7 @@ cntrlEnd: | |||||||
| 
 | 
 | ||||||
| 		BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Called IOCTL_BCM_GET_DEVICE_DRIVER_INFO\n"); | 		BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Called IOCTL_BCM_GET_DEVICE_DRIVER_INFO\n"); | ||||||
| 
 | 
 | ||||||
|  | 		memset(&DevInfo, 0, sizeof(DevInfo)); | ||||||
| 		DevInfo.MaxRDMBufferSize = BUFFER_4K; | 		DevInfo.MaxRDMBufferSize = BUFFER_4K; | ||||||
| 		DevInfo.u32DSDStartOffset = EEPROM_CALPARAM_START; | 		DevInfo.u32DSDStartOffset = EEPROM_CALPARAM_START; | ||||||
| 		DevInfo.u32RxAlignmentCorrection = 0; | 		DevInfo.u32RxAlignmentCorrection = 0; | ||||||
|  | |||||||
| @ -153,6 +153,9 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, | |||||||
| 	struct oz_app_hdr *app_hdr; | 	struct oz_app_hdr *app_hdr; | ||||||
| 	struct oz_serial_ctx *ctx; | 	struct oz_serial_ctx *ctx; | ||||||
| 
 | 
 | ||||||
|  | 	if (count > sizeof(ei->data) - sizeof(*elt) - sizeof(*app_hdr)) | ||||||
|  | 		return -EINVAL; | ||||||
|  | 
 | ||||||
| 	spin_lock_bh(&g_cdev.lock); | 	spin_lock_bh(&g_cdev.lock); | ||||||
| 	pd = g_cdev.active_pd; | 	pd = g_cdev.active_pd; | ||||||
| 	if (pd) | 	if (pd) | ||||||
|  | |||||||
| @ -1063,7 +1063,7 @@ static int mp_wait_modem_status(struct sb_uart_state *state, unsigned long arg) | |||||||
| 
 | 
 | ||||||
| static int mp_get_count(struct sb_uart_state *state, struct serial_icounter_struct *icnt) | static int mp_get_count(struct sb_uart_state *state, struct serial_icounter_struct *icnt) | ||||||
| { | { | ||||||
| 	struct serial_icounter_struct icount; | 	struct serial_icounter_struct icount = {}; | ||||||
| 	struct sb_uart_icount cnow; | 	struct sb_uart_icount cnow; | ||||||
| 	struct sb_uart_port *port = state->port; | 	struct sb_uart_port *port = state->port; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -570,6 +570,7 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) | |||||||
| 	ltv_t                   *pLtv; | 	ltv_t                   *pLtv; | ||||||
| 	bool_t                  ltvAllocated = FALSE; | 	bool_t                  ltvAllocated = FALSE; | ||||||
| 	ENCSTRCT                sEncryption; | 	ENCSTRCT                sEncryption; | ||||||
|  | 	size_t			len; | ||||||
| 
 | 
 | ||||||
| #ifdef USE_WDS | #ifdef USE_WDS | ||||||
| 	hcf_16                  hcfPort  = HCF_PORT_0; | 	hcf_16                  hcfPort  = HCF_PORT_0; | ||||||
| @ -686,7 +687,8 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) | |||||||
| 					break; | 					break; | ||||||
| 				case CFG_CNF_OWN_NAME: | 				case CFG_CNF_OWN_NAME: | ||||||
| 					memset(lp->StationName, 0, sizeof(lp->StationName)); | 					memset(lp->StationName, 0, sizeof(lp->StationName)); | ||||||
| 					memcpy((void *)lp->StationName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]); | 					len = min_t(size_t, pLtv->u.u16[0], sizeof(lp->StationName)); | ||||||
|  | 					strlcpy(lp->StationName, &pLtv->u.u8[2], len); | ||||||
| 					pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]); | 					pLtv->u.u16[0] = CNV_INT_TO_LITTLE(pLtv->u.u16[0]); | ||||||
| 					break; | 					break; | ||||||
| 				case CFG_CNF_LOAD_BALANCING: | 				case CFG_CNF_LOAD_BALANCING: | ||||||
| @ -1783,6 +1785,7 @@ int wvlan_set_station_nickname(struct net_device *dev, | |||||||
| { | { | ||||||
| 	struct wl_private *lp = wl_priv(dev); | 	struct wl_private *lp = wl_priv(dev); | ||||||
| 	unsigned long flags; | 	unsigned long flags; | ||||||
|  | 	size_t len; | ||||||
| 	int         ret = 0; | 	int         ret = 0; | ||||||
| 	/*------------------------------------------------------------------------*/ | 	/*------------------------------------------------------------------------*/ | ||||||
| 
 | 
 | ||||||
| @ -1793,8 +1796,8 @@ int wvlan_set_station_nickname(struct net_device *dev, | |||||||
| 	wl_lock(lp, &flags); | 	wl_lock(lp, &flags); | ||||||
| 
 | 
 | ||||||
| 	memset(lp->StationName, 0, sizeof(lp->StationName)); | 	memset(lp->StationName, 0, sizeof(lp->StationName)); | ||||||
| 
 | 	len = min_t(size_t, wrqu->data.length, sizeof(lp->StationName)); | ||||||
| 	memcpy(lp->StationName, extra, wrqu->data.length); | 	strlcpy(lp->StationName, extra, len); | ||||||
| 
 | 
 | ||||||
| 	/* Commit the adapter parameters */ | 	/* Commit the adapter parameters */ | ||||||
| 	wl_apply(lp); | 	wl_apply(lp); | ||||||
|  | |||||||
| @ -134,10 +134,10 @@ static int pscsi_pmode_enable_hba(struct se_hba *hba, unsigned long mode_flag) | |||||||
| 	 * pSCSI Host ID and enable for phba mode | 	 * pSCSI Host ID and enable for phba mode | ||||||
| 	 */ | 	 */ | ||||||
| 	sh = scsi_host_lookup(phv->phv_host_id); | 	sh = scsi_host_lookup(phv->phv_host_id); | ||||||
| 	if (IS_ERR(sh)) { | 	if (!sh) { | ||||||
| 		pr_err("pSCSI: Unable to locate SCSI Host for" | 		pr_err("pSCSI: Unable to locate SCSI Host for" | ||||||
| 			" phv_host_id: %d\n", phv->phv_host_id); | 			" phv_host_id: %d\n", phv->phv_host_id); | ||||||
| 		return PTR_ERR(sh); | 		return -EINVAL; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	phv->phv_lld_host = sh; | 	phv->phv_lld_host = sh; | ||||||
| @ -515,10 +515,10 @@ static int pscsi_configure_device(struct se_device *dev) | |||||||
| 			sh = phv->phv_lld_host; | 			sh = phv->phv_lld_host; | ||||||
| 		} else { | 		} else { | ||||||
| 			sh = scsi_host_lookup(pdv->pdv_host_id); | 			sh = scsi_host_lookup(pdv->pdv_host_id); | ||||||
| 			if (IS_ERR(sh)) { | 			if (!sh) { | ||||||
| 				pr_err("pSCSI: Unable to locate" | 				pr_err("pSCSI: Unable to locate" | ||||||
| 					" pdv_host_id: %d\n", pdv->pdv_host_id); | 					" pdv_host_id: %d\n", pdv->pdv_host_id); | ||||||
| 				return PTR_ERR(sh); | 				return -EINVAL; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} else { | 	} else { | ||||||
|  | |||||||
| @ -630,36 +630,57 @@ static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static const struct vm_operations_struct uio_vm_ops = { | static const struct vm_operations_struct uio_logical_vm_ops = { | ||||||
| 	.open = uio_vma_open, | 	.open = uio_vma_open, | ||||||
| 	.close = uio_vma_close, | 	.close = uio_vma_close, | ||||||
| 	.fault = uio_vma_fault, | 	.fault = uio_vma_fault, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | static int uio_mmap_logical(struct vm_area_struct *vma) | ||||||
|  | { | ||||||
|  | 	vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; | ||||||
|  | 	vma->vm_ops = &uio_logical_vm_ops; | ||||||
|  | 	uio_vma_open(vma); | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | static const struct vm_operations_struct uio_physical_vm_ops = { | ||||||
|  | #ifdef CONFIG_HAVE_IOREMAP_PROT | ||||||
|  | 	.access = generic_access_phys, | ||||||
|  | #endif | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| static int uio_mmap_physical(struct vm_area_struct *vma) | static int uio_mmap_physical(struct vm_area_struct *vma) | ||||||
| { | { | ||||||
| 	struct uio_device *idev = vma->vm_private_data; | 	struct uio_device *idev = vma->vm_private_data; | ||||||
| 	int mi = uio_find_mem_index(vma); | 	int mi = uio_find_mem_index(vma); | ||||||
|  | 	struct uio_mem *mem; | ||||||
| 	if (mi < 0) | 	if (mi < 0) | ||||||
| 		return -EINVAL; | 		return -EINVAL; | ||||||
|  | 	mem = idev->info->mem + mi; | ||||||
| 
 | 
 | ||||||
|  | 	if (vma->vm_end - vma->vm_start > mem->size) | ||||||
|  | 		return -EINVAL; | ||||||
|  | 
 | ||||||
|  | 	vma->vm_ops = &uio_physical_vm_ops; | ||||||
| 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||||||
| 
 | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * We cannot use the vm_iomap_memory() helper here, | ||||||
|  | 	 * because vma->vm_pgoff is the map index we looked | ||||||
|  | 	 * up above in uio_find_mem_index(), rather than an | ||||||
|  | 	 * actual page offset into the mmap. | ||||||
|  | 	 * | ||||||
|  | 	 * So we just do the physical mmap without a page | ||||||
|  | 	 * offset. | ||||||
|  | 	 */ | ||||||
| 	return remap_pfn_range(vma, | 	return remap_pfn_range(vma, | ||||||
| 			       vma->vm_start, | 			       vma->vm_start, | ||||||
| 			       idev->info->mem[mi].addr >> PAGE_SHIFT, | 			       mem->addr >> PAGE_SHIFT, | ||||||
| 			       vma->vm_end - vma->vm_start, | 			       vma->vm_end - vma->vm_start, | ||||||
| 			       vma->vm_page_prot); | 			       vma->vm_page_prot); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static int uio_mmap_logical(struct vm_area_struct *vma) |  | ||||||
| { |  | ||||||
| 	vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |  | ||||||
| 	vma->vm_ops = &uio_vm_ops; |  | ||||||
| 	uio_vma_open(vma); |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| static int uio_mmap(struct file *filep, struct vm_area_struct *vma) | static int uio_mmap(struct file *filep, struct vm_area_struct *vma) | ||||||
| { | { | ||||||
| 	struct uio_listener *listener = filep->private_data; | 	struct uio_listener *listener = filep->private_data; | ||||||
|  | |||||||
| @ -107,6 +107,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||||||
| 	/* Alcor Micro Corp. Hub */ | 	/* Alcor Micro Corp. Hub */ | ||||||
| 	{ USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME }, | 	{ USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME }, | ||||||
| 
 | 
 | ||||||
|  | 	/* MicroTouch Systems touchscreen */ | ||||||
|  | 	{ USB_DEVICE(0x0596, 0x051e), .driver_info = USB_QUIRK_RESET_RESUME }, | ||||||
|  | 
 | ||||||
| 	/* appletouch */ | 	/* appletouch */ | ||||||
| 	{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, | 	{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, | ||||||
| 
 | 
 | ||||||
| @ -140,6 +143,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||||||
| 	/* Broadcom BCM92035DGROM BT dongle */ | 	/* Broadcom BCM92035DGROM BT dongle */ | ||||||
| 	{ USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, | 	{ USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, | ||||||
| 
 | 
 | ||||||
|  | 	/* MAYA44USB sound device */ | ||||||
|  | 	{ USB_DEVICE(0x0a92, 0x0091), .driver_info = USB_QUIRK_RESET_RESUME }, | ||||||
|  | 
 | ||||||
| 	/* Action Semiconductor flash disk */ | 	/* Action Semiconductor flash disk */ | ||||||
| 	{ USB_DEVICE(0x10d6, 0x2200), .driver_info = | 	{ USB_DEVICE(0x10d6, 0x2200), .driver_info = | ||||||
| 			USB_QUIRK_STRING_FETCH_255 }, | 			USB_QUIRK_STRING_FETCH_255 }, | ||||||
|  | |||||||
| @ -906,6 +906,7 @@ static struct usb_device_id id_table_combined [] = { | |||||||
| 	{ USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, | 	{ USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, | ||||||
| 	/* Crucible Devices */ | 	/* Crucible Devices */ | ||||||
| 	{ USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, | 	{ USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, | ||||||
|  | 	{ USB_DEVICE(FTDI_VID, FTDI_Z3X_PID) }, | ||||||
| 	{ },					/* Optional parameter entry */ | 	{ },					/* Optional parameter entry */ | ||||||
| 	{ }					/* Terminating entry */ | 	{ }					/* Terminating entry */ | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -1307,3 +1307,9 @@ | |||||||
|  * Manufacturer: Crucible Technologies |  * Manufacturer: Crucible Technologies | ||||||
|  */ |  */ | ||||||
| #define FTDI_CT_COMET_PID	0x8e08 | #define FTDI_CT_COMET_PID	0x8e08 | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * Product: Z3X Box | ||||||
|  |  * Manufacturer: Smart GSM Team | ||||||
|  |  */ | ||||||
|  | #define FTDI_Z3X_PID		0x0011 | ||||||
|  | |||||||
| @ -696,6 +696,222 @@ static const struct usb_device_id option_ids[] = { | |||||||
| 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7A) }, | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7A) }, | ||||||
| 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7B) }, | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7B) }, | ||||||
| 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7C) }, | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x01) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x02) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x03) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x04) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x05) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x06) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x10) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x12) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x13) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x14) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x15) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x17) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x18) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x19) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x31) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x32) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x33) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x34) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x35) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x36) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x48) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x49) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x61) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x62) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x63) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x64) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x65) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x66) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x78) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x79) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x01) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x02) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x03) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x04) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x05) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x06) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x10) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x12) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x13) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x14) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x15) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x17) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x18) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x19) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x1A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x1B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x1C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x31) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x32) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x33) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x34) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x35) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x36) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x48) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x49) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x4A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x4B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x4C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x61) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x62) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x63) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x64) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x65) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x66) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x78) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x79) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x01) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x02) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x03) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x04) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x05) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x06) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x10) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x12) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x13) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x14) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x15) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x17) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x18) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x19) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x1A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x1B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x1C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x31) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x32) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x33) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x34) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x35) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x36) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x48) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x49) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x4A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x4B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x4C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x61) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x62) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x63) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x64) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x65) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x66) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x78) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x79) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x01) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x02) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x03) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x04) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x05) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x06) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x10) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x12) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x13) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x14) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x15) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x17) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x18) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x19) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x1A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x1B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x1C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x31) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x32) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x33) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x34) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x35) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x36) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x48) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x49) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x4A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x4B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x4C) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x61) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x62) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x63) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x64) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x65) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x66) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6D) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6E) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6F) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x78) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x79) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7A) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7B) }, | ||||||
|  | 	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7C) }, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, | 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, | ||||||
|  | |||||||
| @ -211,8 +211,11 @@ static int slave_configure(struct scsi_device *sdev) | |||||||
| 		/*
 | 		/*
 | ||||||
| 		 * Many devices do not respond properly to READ_CAPACITY_16. | 		 * Many devices do not respond properly to READ_CAPACITY_16. | ||||||
| 		 * Tell the SCSI layer to try READ_CAPACITY_10 first. | 		 * Tell the SCSI layer to try READ_CAPACITY_10 first. | ||||||
|  | 		 * However some USB 3.0 drive enclosures return capacity | ||||||
|  | 		 * modulo 2TB. Those must use READ_CAPACITY_16 | ||||||
| 		 */ | 		 */ | ||||||
| 		sdev->try_rc_10_first = 1; | 		if (!(us->fflags & US_FL_NEEDS_CAP16)) | ||||||
|  | 			sdev->try_rc_10_first = 1; | ||||||
| 
 | 
 | ||||||
| 		/* assume SPC3 or latter devices support sense size > 18 */ | 		/* assume SPC3 or latter devices support sense size > 18 */ | ||||||
| 		if (sdev->scsi_level > SCSI_SPC_2) | 		if (sdev->scsi_level > SCSI_SPC_2) | ||||||
|  | |||||||
| @ -1925,6 +1925,13 @@ UNUSUAL_DEV(  0x1652, 0x6600, 0x0201, 0x0201, | |||||||
| 		USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 		USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||||||
| 		US_FL_IGNORE_RESIDUE ), | 		US_FL_IGNORE_RESIDUE ), | ||||||
| 
 | 
 | ||||||
|  | /* Reported by Oliver Neukum <oneukum@suse.com> */ | ||||||
|  | UNUSUAL_DEV(  0x174c, 0x55aa, 0x0100, 0x0100, | ||||||
|  | 		"ASMedia", | ||||||
|  | 		"AS2105", | ||||||
|  | 		USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||||||
|  | 		US_FL_NEEDS_CAP16), | ||||||
|  | 
 | ||||||
| /* Reported by Jesse Feddema <jdfeddema@gmail.com> */ | /* Reported by Jesse Feddema <jdfeddema@gmail.com> */ | ||||||
| UNUSUAL_DEV(  0x177f, 0x0400, 0x0000, 0x0000, | UNUSUAL_DEV(  0x177f, 0x0400, 0x0000, 0x0000, | ||||||
| 		"Yarvik", | 		"Yarvik", | ||||||
|  | |||||||
| @ -1017,7 +1017,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||||||
| 		if (data_direction != DMA_NONE) { | 		if (data_direction != DMA_NONE) { | ||||||
| 			ret = vhost_scsi_map_iov_to_sgl(tv_cmd, | 			ret = vhost_scsi_map_iov_to_sgl(tv_cmd, | ||||||
| 					&vq->iov[data_first], data_num, | 					&vq->iov[data_first], data_num, | ||||||
| 					data_direction == DMA_TO_DEVICE); | 					data_direction == DMA_FROM_DEVICE); | ||||||
| 			if (unlikely(ret)) { | 			if (unlikely(ret)) { | ||||||
| 				vq_err(vq, "Failed to map iov to sgl\n"); | 				vq_err(vq, "Failed to map iov to sgl\n"); | ||||||
| 				goto err_free; | 				goto err_free; | ||||||
|  | |||||||
| @ -361,39 +361,13 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle) | |||||||
| int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) | ||||||
| { | { | ||||||
| 	struct au1100fb_device *fbdev; | 	struct au1100fb_device *fbdev; | ||||||
| 	unsigned int len; |  | ||||||
| 	unsigned long start=0, off; |  | ||||||
| 
 | 
 | ||||||
| 	fbdev = to_au1100fb_device(fbi); | 	fbdev = to_au1100fb_device(fbi); | ||||||
| 
 | 
 | ||||||
| 	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { |  | ||||||
| 		return -EINVAL; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	start = fbdev->fb_phys & PAGE_MASK; |  | ||||||
| 	len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len); |  | ||||||
| 
 |  | ||||||
| 	off = vma->vm_pgoff << PAGE_SHIFT; |  | ||||||
| 
 |  | ||||||
| 	if ((vma->vm_end - vma->vm_start + off) > len) { |  | ||||||
| 		return -EINVAL; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	off += start; |  | ||||||
| 	vma->vm_pgoff = off >> PAGE_SHIFT; |  | ||||||
| 
 |  | ||||||
| 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||||||
| 	pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
 | 	pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
 | ||||||
| 
 | 
 | ||||||
| 	vma->vm_flags |= VM_IO; | 	return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); | ||||||
| 
 |  | ||||||
| 	if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, |  | ||||||
| 				vma->vm_end - vma->vm_start, |  | ||||||
| 				vma->vm_page_prot)) { |  | ||||||
| 		return -EAGAIN; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static struct fb_ops au1100fb_ops = | static struct fb_ops au1100fb_ops = | ||||||
|  | |||||||
| @ -1233,38 +1233,13 @@ static int au1200fb_fb_blank(int blank_mode, struct fb_info *fbi) | |||||||
|  * method mainly to allow the use of the TLB streaming flag (CCA=6) |  * method mainly to allow the use of the TLB streaming flag (CCA=6) | ||||||
|  */ |  */ | ||||||
| static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | ||||||
| 
 |  | ||||||
| { | { | ||||||
| 	unsigned int len; |  | ||||||
| 	unsigned long start=0, off; |  | ||||||
| 	struct au1200fb_device *fbdev = info->par; | 	struct au1200fb_device *fbdev = info->par; | ||||||
| 
 | 
 | ||||||
| 	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { |  | ||||||
| 		return -EINVAL; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	start = fbdev->fb_phys & PAGE_MASK; |  | ||||||
| 	len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len); |  | ||||||
| 
 |  | ||||||
| 	off = vma->vm_pgoff << PAGE_SHIFT; |  | ||||||
| 
 |  | ||||||
| 	if ((vma->vm_end - vma->vm_start + off) > len) { |  | ||||||
| 		return -EINVAL; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	off += start; |  | ||||||
| 	vma->vm_pgoff = off >> PAGE_SHIFT; |  | ||||||
| 
 |  | ||||||
| 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||||||
| 	pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */ | 	pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */ | ||||||
| 
 | 
 | ||||||
| 	vma->vm_flags |= VM_IO; | 	return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); | ||||||
| 
 |  | ||||||
| 	return io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, |  | ||||||
| 				  vma->vm_end - vma->vm_start, |  | ||||||
| 				  vma->vm_page_prot); |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) | static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) | ||||||
|  | |||||||
| @ -1149,7 +1149,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||||||
| 	struct ecryptfs_msg_ctx *msg_ctx; | 	struct ecryptfs_msg_ctx *msg_ctx; | ||||||
| 	struct ecryptfs_message *msg = NULL; | 	struct ecryptfs_message *msg = NULL; | ||||||
| 	char *auth_tok_sig; | 	char *auth_tok_sig; | ||||||
| 	char *payload; | 	char *payload = NULL; | ||||||
| 	size_t payload_len = 0; | 	size_t payload_len = 0; | ||||||
| 	int rc; | 	int rc; | ||||||
| 
 | 
 | ||||||
| @ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||||||
| 	} | 	} | ||||||
| out: | out: | ||||||
| 	kfree(msg); | 	kfree(msg); | ||||||
|  | 	kfree(payload); | ||||||
| 	return rc; | 	return rc; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -95,7 +95,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) | |||||||
| 
 | 
 | ||||||
| 	if (insert_inode_locked(inode) < 0) { | 	if (insert_inode_locked(inode) < 0) { | ||||||
| 		rc = -EINVAL; | 		rc = -EINVAL; | ||||||
| 		goto fail_unlock; | 		goto fail_put; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	inode_init_owner(inode, parent, mode); | 	inode_init_owner(inode, parent, mode); | ||||||
| @ -156,7 +156,6 @@ struct inode *ialloc(struct inode *parent, umode_t mode) | |||||||
| fail_drop: | fail_drop: | ||||||
| 	dquot_drop(inode); | 	dquot_drop(inode); | ||||||
| 	inode->i_flags |= S_NOQUOTA; | 	inode->i_flags |= S_NOQUOTA; | ||||||
| fail_unlock: |  | ||||||
| 	clear_nlink(inode); | 	clear_nlink(inode); | ||||||
| 	unlock_new_inode(inode); | 	unlock_new_inode(inode); | ||||||
| fail_put: | fail_put: | ||||||
|  | |||||||
| @ -328,6 +328,8 @@ loff_t seq_lseek(struct file *file, loff_t offset, int whence) | |||||||
| 				m->read_pos = offset; | 				m->read_pos = offset; | ||||||
| 				retval = file->f_pos = offset; | 				retval = file->f_pos = offset; | ||||||
| 			} | 			} | ||||||
|  | 		} else { | ||||||
|  | 			file->f_pos = offset; | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	file->f_version = m->version; | 	file->f_version = m->version; | ||||||
|  | |||||||
| @ -66,7 +66,9 @@ | |||||||
| 	US_FLAG(INITIAL_READ10,	0x00100000)			\ | 	US_FLAG(INITIAL_READ10,	0x00100000)			\ | ||||||
| 		/* Initial READ(10) (and others) must be retried */	\ | 		/* Initial READ(10) (and others) must be retried */	\ | ||||||
| 	US_FLAG(WRITE_CACHE,	0x00200000)			\ | 	US_FLAG(WRITE_CACHE,	0x00200000)			\ | ||||||
| 		/* Write Cache status is not available */ | 		/* Write Cache status is not available */	\ | ||||||
|  | 	US_FLAG(NEEDS_CAP16,	0x00400000) | ||||||
|  | 		/* cannot handle READ_CAPACITY_10 */ | ||||||
| 
 | 
 | ||||||
| #define US_FLAG(name, value)	US_FL_##name = value , | #define US_FLAG(name, value)	US_FL_##name = value , | ||||||
| enum { US_DO_ALL_FLAGS }; | enum { US_DO_ALL_FLAGS }; | ||||||
|  | |||||||
| @ -236,6 +236,8 @@ struct drm_mode_get_connector { | |||||||
| 	__u32 connection; | 	__u32 connection; | ||||||
| 	__u32 mm_width, mm_height; /**< HxW in millimeters */ | 	__u32 mm_width, mm_height; /**< HxW in millimeters */ | ||||||
| 	__u32 subpixel; | 	__u32 subpixel; | ||||||
|  | 
 | ||||||
|  | 	__u32 pad; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #define DRM_MODE_PROP_PENDING	(1<<0) | #define DRM_MODE_PROP_PENDING	(1<<0) | ||||||
|  | |||||||
| @ -1995,7 +1995,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, | |||||||
| 
 | 
 | ||||||
| 		/* @tsk either already exited or can't exit until the end */ | 		/* @tsk either already exited or can't exit until the end */ | ||||||
| 		if (tsk->flags & PF_EXITING) | 		if (tsk->flags & PF_EXITING) | ||||||
| 			continue; | 			goto next; | ||||||
| 
 | 
 | ||||||
| 		/* as per above, nr_threads may decrease, but not increase. */ | 		/* as per above, nr_threads may decrease, but not increase. */ | ||||||
| 		BUG_ON(i >= group_size); | 		BUG_ON(i >= group_size); | ||||||
| @ -2003,7 +2003,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, | |||||||
| 		ent.cgrp = task_cgroup_from_root(tsk, root); | 		ent.cgrp = task_cgroup_from_root(tsk, root); | ||||||
| 		/* nothing to do if this task is already in the cgroup */ | 		/* nothing to do if this task is already in the cgroup */ | ||||||
| 		if (ent.cgrp == cgrp) | 		if (ent.cgrp == cgrp) | ||||||
| 			continue; | 			goto next; | ||||||
| 		/*
 | 		/*
 | ||||||
| 		 * saying GFP_ATOMIC has no effect here because we did prealloc | 		 * saying GFP_ATOMIC has no effect here because we did prealloc | ||||||
| 		 * earlier, but it's good form to communicate our expectations. | 		 * earlier, but it's good form to communicate our expectations. | ||||||
| @ -2011,7 +2011,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, | |||||||
| 		retval = flex_array_put(group, i, &ent, GFP_ATOMIC); | 		retval = flex_array_put(group, i, &ent, GFP_ATOMIC); | ||||||
| 		BUG_ON(retval != 0); | 		BUG_ON(retval != 0); | ||||||
| 		i++; | 		i++; | ||||||
| 
 | 	next: | ||||||
| 		if (!threadgroup) | 		if (!threadgroup) | ||||||
| 			break; | 			break; | ||||||
| 	} while_each_thread(leader, tsk); | 	} while_each_thread(leader, tsk); | ||||||
|  | |||||||
| @ -30,6 +30,54 @@ static RAW_NOTIFIER_HEAD(clockevents_chain); | |||||||
| /* Protection for the above */ | /* Protection for the above */ | ||||||
| static DEFINE_RAW_SPINLOCK(clockevents_lock); | static DEFINE_RAW_SPINLOCK(clockevents_lock); | ||||||
| 
 | 
 | ||||||
|  | static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt, | ||||||
|  | 			bool ismax) | ||||||
|  | { | ||||||
|  | 	u64 clc = (u64) latch << evt->shift; | ||||||
|  | 	u64 rnd; | ||||||
|  | 
 | ||||||
|  | 	if (unlikely(!evt->mult)) { | ||||||
|  | 		evt->mult = 1; | ||||||
|  | 		WARN_ON(1); | ||||||
|  | 	} | ||||||
|  | 	rnd = (u64) evt->mult - 1; | ||||||
|  | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * Upper bound sanity check. If the backwards conversion is | ||||||
|  | 	 * not equal latch, we know that the above shift overflowed. | ||||||
|  | 	 */ | ||||||
|  | 	if ((clc >> evt->shift) != (u64)latch) | ||||||
|  | 		clc = ~0ULL; | ||||||
|  | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * Scaled math oddities: | ||||||
|  | 	 * | ||||||
|  | 	 * For mult <= (1 << shift) we can safely add mult - 1 to | ||||||
|  | 	 * prevent integer rounding loss. So the backwards conversion | ||||||
|  | 	 * from nsec to device ticks will be correct. | ||||||
|  | 	 * | ||||||
|  | 	 * For mult > (1 << shift), i.e. device frequency is > 1GHz we | ||||||
|  | 	 * need to be careful. Adding mult - 1 will result in a value | ||||||
|  | 	 * which when converted back to device ticks can be larger | ||||||
|  | 	 * than latch by up to (mult - 1) >> shift. For the min_delta | ||||||
|  | 	 * calculation we still want to apply this in order to stay | ||||||
|  | 	 * above the minimum device ticks limit. For the upper limit | ||||||
|  | 	 * we would end up with a latch value larger than the upper | ||||||
|  | 	 * limit of the device, so we omit the add to stay below the | ||||||
|  | 	 * device upper boundary. | ||||||
|  | 	 * | ||||||
|  | 	 * Also omit the add if it would overflow the u64 boundary. | ||||||
|  | 	 */ | ||||||
|  | 	if ((~0ULL - clc > rnd) && | ||||||
|  | 	    (!ismax || evt->mult <= (1U << evt->shift))) | ||||||
|  | 		clc += rnd; | ||||||
|  | 
 | ||||||
|  | 	do_div(clc, evt->mult); | ||||||
|  | 
 | ||||||
|  | 	/* Deltas less than 1usec are pointless noise */ | ||||||
|  | 	return clc > 1000 ? clc : 1000; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /**
 | /**
 | ||||||
|  * clockevents_delta2ns - Convert a latch value (device ticks) to nanoseconds |  * clockevents_delta2ns - Convert a latch value (device ticks) to nanoseconds | ||||||
|  * @latch:	value to convert |  * @latch:	value to convert | ||||||
| @ -39,20 +87,7 @@ static DEFINE_RAW_SPINLOCK(clockevents_lock); | |||||||
|  */ |  */ | ||||||
| u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt) | u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt) | ||||||
| { | { | ||||||
| 	u64 clc = (u64) latch << evt->shift; | 	return cev_delta2ns(latch, evt, false); | ||||||
| 
 |  | ||||||
| 	if (unlikely(!evt->mult)) { |  | ||||||
| 		evt->mult = 1; |  | ||||||
| 		WARN_ON(1); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	do_div(clc, evt->mult); |  | ||||||
| 	if (clc < 1000) |  | ||||||
| 		clc = 1000; |  | ||||||
| 	if (clc > KTIME_MAX) |  | ||||||
| 		clc = KTIME_MAX; |  | ||||||
| 
 |  | ||||||
| 	return clc; |  | ||||||
| } | } | ||||||
| EXPORT_SYMBOL_GPL(clockevent_delta2ns); | EXPORT_SYMBOL_GPL(clockevent_delta2ns); | ||||||
| 
 | 
 | ||||||
| @ -317,8 +352,8 @@ void clockevents_config(struct clock_event_device *dev, u32 freq) | |||||||
| 		sec = 600; | 		sec = 600; | ||||||
| 
 | 
 | ||||||
| 	clockevents_calc_mult_shift(dev, freq, sec); | 	clockevents_calc_mult_shift(dev, freq, sec); | ||||||
| 	dev->min_delta_ns = clockevent_delta2ns(dev->min_delta_ticks, dev); | 	dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false); | ||||||
| 	dev->max_delta_ns = clockevent_delta2ns(dev->max_delta_ticks, dev); | 	dev->max_delta_ns = cev_delta2ns(dev->max_delta_ticks, dev, true); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | |||||||
| @ -529,7 +529,8 @@ void sg_miter_stop(struct sg_mapping_iter *miter) | |||||||
| 		miter->__offset += miter->consumed; | 		miter->__offset += miter->consumed; | ||||||
| 		miter->__remaining -= miter->consumed; | 		miter->__remaining -= miter->consumed; | ||||||
| 
 | 
 | ||||||
| 		if (miter->__flags & SG_MITER_TO_SG) | 		if ((miter->__flags & SG_MITER_TO_SG) && | ||||||
|  | 		    !PageSlab(miter->page)) | ||||||
| 			flush_kernel_dcache_page(miter->page); | 			flush_kernel_dcache_page(miter->page); | ||||||
| 
 | 
 | ||||||
| 		if (miter->__flags & SG_MITER_ATOMIC) { | 		if (miter->__flags & SG_MITER_ATOMIC) { | ||||||
|  | |||||||
| @ -1288,64 +1288,90 @@ out: | |||||||
| int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | ||||||
| 				unsigned long addr, pmd_t pmd, pmd_t *pmdp) | 				unsigned long addr, pmd_t pmd, pmd_t *pmdp) | ||||||
| { | { | ||||||
|  | 	struct anon_vma *anon_vma = NULL; | ||||||
| 	struct page *page; | 	struct page *page; | ||||||
| 	unsigned long haddr = addr & HPAGE_PMD_MASK; | 	unsigned long haddr = addr & HPAGE_PMD_MASK; | ||||||
|  | 	int page_nid = -1, this_nid = numa_node_id(); | ||||||
| 	int target_nid; | 	int target_nid; | ||||||
| 	int current_nid = -1; | 	bool page_locked; | ||||||
| 	bool migrated; | 	bool migrated = false; | ||||||
| 
 | 
 | ||||||
| 	spin_lock(&mm->page_table_lock); | 	spin_lock(&mm->page_table_lock); | ||||||
| 	if (unlikely(!pmd_same(pmd, *pmdp))) | 	if (unlikely(!pmd_same(pmd, *pmdp))) | ||||||
| 		goto out_unlock; | 		goto out_unlock; | ||||||
| 
 | 
 | ||||||
| 	page = pmd_page(pmd); | 	page = pmd_page(pmd); | ||||||
| 	get_page(page); | 	page_nid = page_to_nid(page); | ||||||
| 	current_nid = page_to_nid(page); |  | ||||||
| 	count_vm_numa_event(NUMA_HINT_FAULTS); | 	count_vm_numa_event(NUMA_HINT_FAULTS); | ||||||
| 	if (current_nid == numa_node_id()) | 	if (page_nid == this_nid) | ||||||
| 		count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL); | 		count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL); | ||||||
| 
 | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * Acquire the page lock to serialise THP migrations but avoid dropping | ||||||
|  | 	 * page_table_lock if at all possible | ||||||
|  | 	 */ | ||||||
|  | 	page_locked = trylock_page(page); | ||||||
| 	target_nid = mpol_misplaced(page, vma, haddr); | 	target_nid = mpol_misplaced(page, vma, haddr); | ||||||
| 	if (target_nid == -1) { | 	if (target_nid == -1) { | ||||||
| 		put_page(page); | 		/* If the page was locked, there are no parallel migrations */ | ||||||
| 		goto clear_pmdnuma; | 		if (page_locked) | ||||||
|  | 			goto clear_pmdnuma; | ||||||
|  | 
 | ||||||
|  | 		/*
 | ||||||
|  | 		 * Otherwise wait for potential migrations and retry. We do | ||||||
|  | 		 * relock and check_same as the page may no longer be mapped. | ||||||
|  | 		 * As the fault is being retried, do not account for it. | ||||||
|  | 		 */ | ||||||
|  | 		spin_unlock(&mm->page_table_lock); | ||||||
|  | 		wait_on_page_locked(page); | ||||||
|  | 		page_nid = -1; | ||||||
|  | 		goto out; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/* Acquire the page lock to serialise THP migrations */ | 	/* Page is misplaced, serialise migrations and parallel THP splits */ | ||||||
|  | 	get_page(page); | ||||||
| 	spin_unlock(&mm->page_table_lock); | 	spin_unlock(&mm->page_table_lock); | ||||||
| 	lock_page(page); | 	if (!page_locked) | ||||||
|  | 		lock_page(page); | ||||||
|  | 	anon_vma = page_lock_anon_vma_read(page); | ||||||
| 
 | 
 | ||||||
| 	/* Confirm the PTE did not while locked */ | 	/* Confirm the PTE did not while locked */ | ||||||
| 	spin_lock(&mm->page_table_lock); | 	spin_lock(&mm->page_table_lock); | ||||||
| 	if (unlikely(!pmd_same(pmd, *pmdp))) { | 	if (unlikely(!pmd_same(pmd, *pmdp))) { | ||||||
| 		unlock_page(page); | 		unlock_page(page); | ||||||
| 		put_page(page); | 		put_page(page); | ||||||
|  | 		page_nid = -1; | ||||||
| 		goto out_unlock; | 		goto out_unlock; | ||||||
| 	} | 	} | ||||||
| 	spin_unlock(&mm->page_table_lock); |  | ||||||
| 
 | 
 | ||||||
| 	/* Migrate the THP to the requested node */ | 	/*
 | ||||||
|  | 	 * Migrate the THP to the requested node, returns with page unlocked | ||||||
|  | 	 * and pmd_numa cleared. | ||||||
|  | 	 */ | ||||||
|  | 	spin_unlock(&mm->page_table_lock); | ||||||
| 	migrated = migrate_misplaced_transhuge_page(mm, vma, | 	migrated = migrate_misplaced_transhuge_page(mm, vma, | ||||||
| 				pmdp, pmd, addr, page, target_nid); | 				pmdp, pmd, addr, page, target_nid); | ||||||
| 	if (!migrated) | 	if (migrated) | ||||||
| 		goto check_same; | 		page_nid = target_nid; | ||||||
| 
 | 
 | ||||||
| 	task_numa_fault(target_nid, HPAGE_PMD_NR, true); | 	goto out; | ||||||
| 	return 0; |  | ||||||
| 
 |  | ||||||
| check_same: |  | ||||||
| 	spin_lock(&mm->page_table_lock); |  | ||||||
| 	if (unlikely(!pmd_same(pmd, *pmdp))) |  | ||||||
| 		goto out_unlock; |  | ||||||
| clear_pmdnuma: | clear_pmdnuma: | ||||||
|  | 	BUG_ON(!PageLocked(page)); | ||||||
| 	pmd = pmd_mknonnuma(pmd); | 	pmd = pmd_mknonnuma(pmd); | ||||||
| 	set_pmd_at(mm, haddr, pmdp, pmd); | 	set_pmd_at(mm, haddr, pmdp, pmd); | ||||||
| 	VM_BUG_ON(pmd_numa(*pmdp)); | 	VM_BUG_ON(pmd_numa(*pmdp)); | ||||||
| 	update_mmu_cache_pmd(vma, addr, pmdp); | 	update_mmu_cache_pmd(vma, addr, pmdp); | ||||||
|  | 	unlock_page(page); | ||||||
| out_unlock: | out_unlock: | ||||||
| 	spin_unlock(&mm->page_table_lock); | 	spin_unlock(&mm->page_table_lock); | ||||||
| 	if (current_nid != -1) | 
 | ||||||
| 		task_numa_fault(current_nid, HPAGE_PMD_NR, false); | out: | ||||||
|  | 	if (anon_vma) | ||||||
|  | 		page_unlock_anon_vma_read(anon_vma); | ||||||
|  | 
 | ||||||
|  | 	if (page_nid != -1) | ||||||
|  | 		task_numa_fault(page_nid, HPAGE_PMD_NR, migrated); | ||||||
|  | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										54
									
								
								mm/memory.c
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								mm/memory.c
									
									
									
									
									
								
							| @ -3484,12 +3484,12 @@ static int do_nonlinear_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int numa_migrate_prep(struct page *page, struct vm_area_struct *vma, | int numa_migrate_prep(struct page *page, struct vm_area_struct *vma, | ||||||
| 				unsigned long addr, int current_nid) | 				unsigned long addr, int page_nid) | ||||||
| { | { | ||||||
| 	get_page(page); | 	get_page(page); | ||||||
| 
 | 
 | ||||||
| 	count_vm_numa_event(NUMA_HINT_FAULTS); | 	count_vm_numa_event(NUMA_HINT_FAULTS); | ||||||
| 	if (current_nid == numa_node_id()) | 	if (page_nid == numa_node_id()) | ||||||
| 		count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL); | 		count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL); | ||||||
| 
 | 
 | ||||||
| 	return mpol_misplaced(page, vma, addr); | 	return mpol_misplaced(page, vma, addr); | ||||||
| @ -3500,7 +3500,7 @@ int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| { | { | ||||||
| 	struct page *page = NULL; | 	struct page *page = NULL; | ||||||
| 	spinlock_t *ptl; | 	spinlock_t *ptl; | ||||||
| 	int current_nid = -1; | 	int page_nid = -1; | ||||||
| 	int target_nid; | 	int target_nid; | ||||||
| 	bool migrated = false; | 	bool migrated = false; | ||||||
| 
 | 
 | ||||||
| @ -3530,15 +3530,10 @@ int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| 		return 0; | 		return 0; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	current_nid = page_to_nid(page); | 	page_nid = page_to_nid(page); | ||||||
| 	target_nid = numa_migrate_prep(page, vma, addr, current_nid); | 	target_nid = numa_migrate_prep(page, vma, addr, page_nid); | ||||||
| 	pte_unmap_unlock(ptep, ptl); | 	pte_unmap_unlock(ptep, ptl); | ||||||
| 	if (target_nid == -1) { | 	if (target_nid == -1) { | ||||||
| 		/*
 |  | ||||||
| 		 * Account for the fault against the current node if it not |  | ||||||
| 		 * being replaced regardless of where the page is located. |  | ||||||
| 		 */ |  | ||||||
| 		current_nid = numa_node_id(); |  | ||||||
| 		put_page(page); | 		put_page(page); | ||||||
| 		goto out; | 		goto out; | ||||||
| 	} | 	} | ||||||
| @ -3546,11 +3541,11 @@ int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| 	/* Migrate to the requested node */ | 	/* Migrate to the requested node */ | ||||||
| 	migrated = migrate_misplaced_page(page, target_nid); | 	migrated = migrate_misplaced_page(page, target_nid); | ||||||
| 	if (migrated) | 	if (migrated) | ||||||
| 		current_nid = target_nid; | 		page_nid = target_nid; | ||||||
| 
 | 
 | ||||||
| out: | out: | ||||||
| 	if (current_nid != -1) | 	if (page_nid != -1) | ||||||
| 		task_numa_fault(current_nid, 1, migrated); | 		task_numa_fault(page_nid, 1, migrated); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -3565,7 +3560,6 @@ static int do_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| 	unsigned long offset; | 	unsigned long offset; | ||||||
| 	spinlock_t *ptl; | 	spinlock_t *ptl; | ||||||
| 	bool numa = false; | 	bool numa = false; | ||||||
| 	int local_nid = numa_node_id(); |  | ||||||
| 
 | 
 | ||||||
| 	spin_lock(&mm->page_table_lock); | 	spin_lock(&mm->page_table_lock); | ||||||
| 	pmd = *pmdp; | 	pmd = *pmdp; | ||||||
| @ -3588,9 +3582,10 @@ static int do_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| 	for (addr = _addr + offset; addr < _addr + PMD_SIZE; pte++, addr += PAGE_SIZE) { | 	for (addr = _addr + offset; addr < _addr + PMD_SIZE; pte++, addr += PAGE_SIZE) { | ||||||
| 		pte_t pteval = *pte; | 		pte_t pteval = *pte; | ||||||
| 		struct page *page; | 		struct page *page; | ||||||
| 		int curr_nid = local_nid; | 		int page_nid = -1; | ||||||
| 		int target_nid; | 		int target_nid; | ||||||
| 		bool migrated; | 		bool migrated = false; | ||||||
|  | 
 | ||||||
| 		if (!pte_present(pteval)) | 		if (!pte_present(pteval)) | ||||||
| 			continue; | 			continue; | ||||||
| 		if (!pte_numa(pteval)) | 		if (!pte_numa(pteval)) | ||||||
| @ -3612,25 +3607,19 @@ static int do_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||||||
| 		if (unlikely(page_mapcount(page) != 1)) | 		if (unlikely(page_mapcount(page) != 1)) | ||||||
| 			continue; | 			continue; | ||||||
| 
 | 
 | ||||||
| 		/*
 | 		page_nid = page_to_nid(page); | ||||||
| 		 * Note that the NUMA fault is later accounted to either | 		target_nid = numa_migrate_prep(page, vma, addr, page_nid); | ||||||
| 		 * the node that is currently running or where the page is | 		pte_unmap_unlock(pte, ptl); | ||||||
| 		 * migrated to. | 		if (target_nid != -1) { | ||||||
| 		 */ | 			migrated = migrate_misplaced_page(page, target_nid); | ||||||
| 		curr_nid = local_nid; | 			if (migrated) | ||||||
| 		target_nid = numa_migrate_prep(page, vma, addr, | 				page_nid = target_nid; | ||||||
| 					       page_to_nid(page)); | 		} else { | ||||||
| 		if (target_nid == -1) { |  | ||||||
| 			put_page(page); | 			put_page(page); | ||||||
| 			continue; |  | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		/* Migrate to the requested node */ | 		if (page_nid != -1) | ||||||
| 		pte_unmap_unlock(pte, ptl); | 			task_numa_fault(page_nid, 1, migrated); | ||||||
| 		migrated = migrate_misplaced_page(page, target_nid); |  | ||||||
| 		if (migrated) |  | ||||||
| 			curr_nid = target_nid; |  | ||||||
| 		task_numa_fault(curr_nid, 1, migrated); |  | ||||||
| 
 | 
 | ||||||
| 		pte = pte_offset_map_lock(mm, pmdp, addr, &ptl); | 		pte = pte_offset_map_lock(mm, pmdp, addr, &ptl); | ||||||
| 	} | 	} | ||||||
| @ -4032,6 +4021,7 @@ int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | |||||||
| 
 | 
 | ||||||
| 	return len; | 	return len; | ||||||
| } | } | ||||||
|  | EXPORT_SYMBOL_GPL(generic_access_phys); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  | |||||||
							
								
								
									
										19
									
								
								mm/migrate.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								mm/migrate.c
									
									
									
									
									
								
							| @ -1710,12 +1710,12 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm, | |||||||
| 		unlock_page(new_page); | 		unlock_page(new_page); | ||||||
| 		put_page(new_page);		/* Free it */ | 		put_page(new_page);		/* Free it */ | ||||||
| 
 | 
 | ||||||
| 		unlock_page(page); | 		/* Retake the callers reference and putback on LRU */ | ||||||
|  | 		get_page(page); | ||||||
| 		putback_lru_page(page); | 		putback_lru_page(page); | ||||||
| 
 | 		mod_zone_page_state(page_zone(page), | ||||||
| 		count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR); | 			 NR_ISOLATED_ANON + page_lru, -HPAGE_PMD_NR); | ||||||
| 		isolated = 0; | 		goto out_fail; | ||||||
| 		goto out; |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/*
 | 	/*
 | ||||||
| @ -1732,9 +1732,9 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm, | |||||||
| 	entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma); | 	entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma); | ||||||
| 	entry = pmd_mkhuge(entry); | 	entry = pmd_mkhuge(entry); | ||||||
| 
 | 
 | ||||||
| 	page_add_new_anon_rmap(new_page, vma, haddr); | 	pmdp_clear_flush(vma, haddr, pmd); | ||||||
| 
 |  | ||||||
| 	set_pmd_at(mm, haddr, pmd, entry); | 	set_pmd_at(mm, haddr, pmd, entry); | ||||||
|  | 	page_add_new_anon_rmap(new_page, vma, haddr); | ||||||
| 	update_mmu_cache_pmd(vma, address, &entry); | 	update_mmu_cache_pmd(vma, address, &entry); | ||||||
| 	page_remove_rmap(page); | 	page_remove_rmap(page); | ||||||
| 	/*
 | 	/*
 | ||||||
| @ -1753,7 +1753,6 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm, | |||||||
| 	count_vm_events(PGMIGRATE_SUCCESS, HPAGE_PMD_NR); | 	count_vm_events(PGMIGRATE_SUCCESS, HPAGE_PMD_NR); | ||||||
| 	count_vm_numa_events(NUMA_PAGE_MIGRATE, HPAGE_PMD_NR); | 	count_vm_numa_events(NUMA_PAGE_MIGRATE, HPAGE_PMD_NR); | ||||||
| 
 | 
 | ||||||
| out: |  | ||||||
| 	mod_zone_page_state(page_zone(page), | 	mod_zone_page_state(page_zone(page), | ||||||
| 			NR_ISOLATED_ANON + page_lru, | 			NR_ISOLATED_ANON + page_lru, | ||||||
| 			-HPAGE_PMD_NR); | 			-HPAGE_PMD_NR); | ||||||
| @ -1762,6 +1761,10 @@ out: | |||||||
| out_fail: | out_fail: | ||||||
| 	count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR); | 	count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR); | ||||||
| out_dropref: | out_dropref: | ||||||
|  | 	entry = pmd_mknonnuma(entry); | ||||||
|  | 	set_pmd_at(mm, haddr, pmd, entry); | ||||||
|  | 	update_mmu_cache_pmd(vma, address, &entry); | ||||||
|  | 
 | ||||||
| 	unlock_page(page); | 	unlock_page(page); | ||||||
| 	put_page(page); | 	put_page(page); | ||||||
| 	return 0; | 	return 0; | ||||||
|  | |||||||
| @ -145,7 +145,7 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma, | |||||||
| 				split_huge_page_pmd(vma, addr, pmd); | 				split_huge_page_pmd(vma, addr, pmd); | ||||||
| 			else if (change_huge_pmd(vma, pmd, addr, newprot, | 			else if (change_huge_pmd(vma, pmd, addr, newprot, | ||||||
| 						 prot_numa)) { | 						 prot_numa)) { | ||||||
| 				pages += HPAGE_PMD_NR; | 				pages++; | ||||||
| 				continue; | 				continue; | ||||||
| 			} | 			} | ||||||
| 			/* fall through */ | 			/* fall through */ | ||||||
|  | |||||||
| @ -242,7 +242,7 @@ int walk_page_range(unsigned long addr, unsigned long end, | |||||||
| 		if (err) | 		if (err) | ||||||
| 			break; | 			break; | ||||||
| 		pgd++; | 		pgd++; | ||||||
| 	} while (addr = next, addr != end); | 	} while (addr = next, addr < end); | ||||||
| 
 | 
 | ||||||
| 	return err; | 	return err; | ||||||
| } | } | ||||||
|  | |||||||
| @ -388,12 +388,12 @@ nocache: | |||||||
| 		addr = ALIGN(first->va_end, align); | 		addr = ALIGN(first->va_end, align); | ||||||
| 		if (addr < vstart) | 		if (addr < vstart) | ||||||
| 			goto nocache; | 			goto nocache; | ||||||
| 		if (addr + size - 1 < addr) | 		if (addr + size < addr) | ||||||
| 			goto overflow; | 			goto overflow; | ||||||
| 
 | 
 | ||||||
| 	} else { | 	} else { | ||||||
| 		addr = ALIGN(vstart, align); | 		addr = ALIGN(vstart, align); | ||||||
| 		if (addr + size - 1 < addr) | 		if (addr + size < addr) | ||||||
| 			goto overflow; | 			goto overflow; | ||||||
| 
 | 
 | ||||||
| 		n = vmap_area_root.rb_node; | 		n = vmap_area_root.rb_node; | ||||||
| @ -420,7 +420,7 @@ nocache: | |||||||
| 		if (addr + cached_hole_size < first->va_start) | 		if (addr + cached_hole_size < first->va_start) | ||||||
| 			cached_hole_size = first->va_start - addr; | 			cached_hole_size = first->va_start - addr; | ||||||
| 		addr = ALIGN(first->va_end, align); | 		addr = ALIGN(first->va_end, align); | ||||||
| 		if (addr + size - 1 < addr) | 		if (addr + size < addr) | ||||||
| 			goto overflow; | 			goto overflow; | ||||||
| 
 | 
 | ||||||
| 		if (list_is_last(&first->list, &vmap_area_list)) | 		if (list_is_last(&first->list, &vmap_area_list)) | ||||||
|  | |||||||
| @ -3315,7 +3315,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, | |||||||
| 		return -EINVAL; | 		return -EINVAL; | ||||||
| 	} | 	} | ||||||
| 	band = chanctx_conf->def.chan->band; | 	band = chanctx_conf->def.chan->band; | ||||||
| 	sta = sta_info_get(sdata, peer); | 	sta = sta_info_get_bss(sdata, peer); | ||||||
| 	if (sta) { | 	if (sta) { | ||||||
| 		qos = test_sta_flag(sta, WLAN_STA_WME); | 		qos = test_sta_flag(sta, WLAN_STA_WME); | ||||||
| 	} else { | 	} else { | ||||||
|  | |||||||
| @ -842,6 +842,8 @@ struct tpt_led_trigger { | |||||||
|  *	that the scan completed. |  *	that the scan completed. | ||||||
|  * @SCAN_ABORTED: Set for our scan work function when the driver reported |  * @SCAN_ABORTED: Set for our scan work function when the driver reported | ||||||
|  *	a scan complete for an aborted scan. |  *	a scan complete for an aborted scan. | ||||||
|  |  * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being | ||||||
|  |  *	cancelled. | ||||||
|  */ |  */ | ||||||
| enum { | enum { | ||||||
| 	SCAN_SW_SCANNING, | 	SCAN_SW_SCANNING, | ||||||
| @ -849,6 +851,7 @@ enum { | |||||||
| 	SCAN_ONCHANNEL_SCANNING, | 	SCAN_ONCHANNEL_SCANNING, | ||||||
| 	SCAN_COMPLETED, | 	SCAN_COMPLETED, | ||||||
| 	SCAN_ABORTED, | 	SCAN_ABORTED, | ||||||
|  | 	SCAN_HW_CANCELLED, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | |||||||
| @ -3002,6 +3002,9 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||||||
| 	case NL80211_IFTYPE_ADHOC: | 	case NL80211_IFTYPE_ADHOC: | ||||||
| 		if (!bssid) | 		if (!bssid) | ||||||
| 			return 0; | 			return 0; | ||||||
|  | 		if (ether_addr_equal(sdata->vif.addr, hdr->addr2) || | ||||||
|  | 		    ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2)) | ||||||
|  | 			return 0; | ||||||
| 		if (ieee80211_is_beacon(hdr->frame_control)) { | 		if (ieee80211_is_beacon(hdr->frame_control)) { | ||||||
| 			return 1; | 			return 1; | ||||||
| 		} else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) { | 		} else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) { | ||||||
|  | |||||||
| @ -202,6 +202,9 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) | |||||||
| 	enum ieee80211_band band; | 	enum ieee80211_band band; | ||||||
| 	int i, ielen, n_chans; | 	int i, ielen, n_chans; | ||||||
| 
 | 
 | ||||||
|  | 	if (test_bit(SCAN_HW_CANCELLED, &local->scanning)) | ||||||
|  | 		return false; | ||||||
|  | 
 | ||||||
| 	do { | 	do { | ||||||
| 		if (local->hw_scan_band == IEEE80211_NUM_BANDS) | 		if (local->hw_scan_band == IEEE80211_NUM_BANDS) | ||||||
| 			return false; | 			return false; | ||||||
| @ -878,7 +881,23 @@ void ieee80211_scan_cancel(struct ieee80211_local *local) | |||||||
| 	if (!local->scan_req) | 	if (!local->scan_req) | ||||||
| 		goto out; | 		goto out; | ||||||
| 
 | 
 | ||||||
|  | 	/*
 | ||||||
|  | 	 * We have a scan running and the driver already reported completion, | ||||||
|  | 	 * but the worker hasn't run yet or is stuck on the mutex - mark it as | ||||||
|  | 	 * cancelled. | ||||||
|  | 	 */ | ||||||
|  | 	if (test_bit(SCAN_HW_SCANNING, &local->scanning) && | ||||||
|  | 	    test_bit(SCAN_COMPLETED, &local->scanning)) { | ||||||
|  | 		set_bit(SCAN_HW_CANCELLED, &local->scanning); | ||||||
|  | 		goto out; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	if (test_bit(SCAN_HW_SCANNING, &local->scanning)) { | 	if (test_bit(SCAN_HW_SCANNING, &local->scanning)) { | ||||||
|  | 		/*
 | ||||||
|  | 		 * Make sure that __ieee80211_scan_completed doesn't trigger a | ||||||
|  | 		 * scan on another band. | ||||||
|  | 		 */ | ||||||
|  | 		set_bit(SCAN_HW_CANCELLED, &local->scanning); | ||||||
| 		if (local->ops->cancel_hw_scan) | 		if (local->ops->cancel_hw_scan) | ||||||
| 			drv_cancel_hw_scan(local, | 			drv_cancel_hw_scan(local, | ||||||
| 				rcu_dereference_protected(local->scan_sdata, | 				rcu_dereference_protected(local->scan_sdata, | ||||||
|  | |||||||
| @ -180,6 +180,9 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb) | |||||||
| 	struct ieee80211_local *local = sta->local; | 	struct ieee80211_local *local = sta->local; | ||||||
| 	struct ieee80211_sub_if_data *sdata = sta->sdata; | 	struct ieee80211_sub_if_data *sdata = sta->sdata; | ||||||
| 
 | 
 | ||||||
|  | 	if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||||||
|  | 		sta->last_rx = jiffies; | ||||||
|  | 
 | ||||||
| 	if (ieee80211_is_data_qos(mgmt->frame_control)) { | 	if (ieee80211_is_data_qos(mgmt->frame_control)) { | ||||||
| 		struct ieee80211_hdr *hdr = (void *) skb->data; | 		struct ieee80211_hdr *hdr = (void *) skb->data; | ||||||
| 		u8 *qc = ieee80211_get_qos_ctl(hdr); | 		u8 *qc = ieee80211_get_qos_ctl(hdr); | ||||||
|  | |||||||
| @ -1115,7 +1115,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, | |||||||
| 		tx->sta = rcu_dereference(sdata->u.vlan.sta); | 		tx->sta = rcu_dereference(sdata->u.vlan.sta); | ||||||
| 		if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) | 		if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) | ||||||
| 			return TX_DROP; | 			return TX_DROP; | ||||||
| 	} else if (info->flags & IEEE80211_TX_CTL_INJECTED || | 	} else if (info->flags & (IEEE80211_TX_CTL_INJECTED | | ||||||
|  | 				  IEEE80211_TX_INTFL_NL80211_FRAME_TX) || | ||||||
| 		   tx->sdata->control_port_protocol == tx->skb->protocol) { | 		   tx->sdata->control_port_protocol == tx->skb->protocol) { | ||||||
| 		tx->sta = sta_info_get_bss(sdata, hdr->addr1); | 		tx->sta = sta_info_get_bss(sdata, hdr->addr1); | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -2174,6 +2174,10 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	rate = cfg80211_calculate_bitrate(&ri); | 	rate = cfg80211_calculate_bitrate(&ri); | ||||||
|  | 	if (WARN_ONCE(!rate, | ||||||
|  | 		      "Invalid bitrate: flags=0x%x, idx=%d, vht_nss=%d\n", | ||||||
|  | 		      status->flag, status->rate_idx, status->vht_nss)) | ||||||
|  | 		return 0; | ||||||
| 
 | 
 | ||||||
| 	/* rewind from end of MPDU */ | 	/* rewind from end of MPDU */ | ||||||
| 	if (status->flag & RX_FLAG_MACTIME_END) | 	if (status->flag & RX_FLAG_MACTIME_END) | ||||||
|  | |||||||
| @ -269,6 +269,8 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, | |||||||
| 				if (chan->flags & IEEE80211_CHAN_DISABLED) | 				if (chan->flags & IEEE80211_CHAN_DISABLED) | ||||||
| 					continue; | 					continue; | ||||||
| 				wdev->wext.ibss.chandef.chan = chan; | 				wdev->wext.ibss.chandef.chan = chan; | ||||||
|  | 				wdev->wext.ibss.chandef.center_freq1 = | ||||||
|  | 					chan->center_freq; | ||||||
| 				break; | 				break; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| @ -353,6 +355,7 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | |||||||
| 	if (chan) { | 	if (chan) { | ||||||
| 		wdev->wext.ibss.chandef.chan = chan; | 		wdev->wext.ibss.chandef.chan = chan; | ||||||
| 		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; | 		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; | ||||||
|  | 		wdev->wext.ibss.chandef.center_freq1 = freq; | ||||||
| 		wdev->wext.ibss.channel_fixed = true; | 		wdev->wext.ibss.channel_fixed = true; | ||||||
| 	} else { | 	} else { | ||||||
| 		/* cfg80211_ibss_wext_join will pick one if needed */ | 		/* cfg80211_ibss_wext_join will pick one if needed */ | ||||||
|  | |||||||
| @ -55,6 +55,7 @@ static struct sym_entry *table; | |||||||
| static unsigned int table_size, table_cnt; | static unsigned int table_size, table_cnt; | ||||||
| static int all_symbols = 0; | static int all_symbols = 0; | ||||||
| static char symbol_prefix_char = '\0'; | static char symbol_prefix_char = '\0'; | ||||||
|  | static unsigned long long kernel_start_addr = 0; | ||||||
| 
 | 
 | ||||||
| int token_profit[0x10000]; | int token_profit[0x10000]; | ||||||
| 
 | 
 | ||||||
| @ -65,7 +66,10 @@ unsigned char best_table_len[256]; | |||||||
| 
 | 
 | ||||||
| static void usage(void) | static void usage(void) | ||||||
| { | { | ||||||
| 	fprintf(stderr, "Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] < in.map > out.S\n"); | 	fprintf(stderr, "Usage: kallsyms [--all-symbols] " | ||||||
|  | 			"[--symbol-prefix=<prefix char>] " | ||||||
|  | 			"[--page-offset=<CONFIG_PAGE_OFFSET>] " | ||||||
|  | 			"< in.map > out.S\n"); | ||||||
| 	exit(1); | 	exit(1); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -194,6 +198,9 @@ static int symbol_valid(struct sym_entry *s) | |||||||
| 	int i; | 	int i; | ||||||
| 	int offset = 1; | 	int offset = 1; | ||||||
| 
 | 
 | ||||||
|  | 	if (s->addr < kernel_start_addr) | ||||||
|  | 		return 0; | ||||||
|  | 
 | ||||||
| 	/* skip prefix char */ | 	/* skip prefix char */ | ||||||
| 	if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char) | 	if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char) | ||||||
| 		offset++; | 		offset++; | ||||||
| @ -646,6 +653,9 @@ int main(int argc, char **argv) | |||||||
| 				if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\'')) | 				if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\'')) | ||||||
| 					p++; | 					p++; | ||||||
| 				symbol_prefix_char = *p; | 				symbol_prefix_char = *p; | ||||||
|  | 			} else if (strncmp(argv[i], "--page-offset=", 14) == 0) { | ||||||
|  | 				const char *p = &argv[i][14]; | ||||||
|  | 				kernel_start_addr = strtoull(p, NULL, 16); | ||||||
| 			} else | 			} else | ||||||
| 				usage(); | 				usage(); | ||||||
| 		} | 		} | ||||||
|  | |||||||
| @ -82,6 +82,8 @@ kallsyms() | |||||||
| 		kallsymopt="${kallsymopt} --all-symbols" | 		kallsymopt="${kallsymopt} --all-symbols" | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
|  | 	kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET" | ||||||
|  | 
 | ||||||
| 	local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL}               \ | 	local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL}               \ | ||||||
| 		      ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" | 		      ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -49,6 +49,8 @@ static struct snd_pcm *snd_pcm_get(struct snd_card *card, int device) | |||||||
| 	struct snd_pcm *pcm; | 	struct snd_pcm *pcm; | ||||||
| 
 | 
 | ||||||
| 	list_for_each_entry(pcm, &snd_pcm_devices, list) { | 	list_for_each_entry(pcm, &snd_pcm_devices, list) { | ||||||
|  | 		if (pcm->internal) | ||||||
|  | 			continue; | ||||||
| 		if (pcm->card == card && pcm->device == device) | 		if (pcm->card == card && pcm->device == device) | ||||||
| 			return pcm; | 			return pcm; | ||||||
| 	} | 	} | ||||||
| @ -60,6 +62,8 @@ static int snd_pcm_next(struct snd_card *card, int device) | |||||||
| 	struct snd_pcm *pcm; | 	struct snd_pcm *pcm; | ||||||
| 
 | 
 | ||||||
| 	list_for_each_entry(pcm, &snd_pcm_devices, list) { | 	list_for_each_entry(pcm, &snd_pcm_devices, list) { | ||||||
|  | 		if (pcm->internal) | ||||||
|  | 			continue; | ||||||
| 		if (pcm->card == card && pcm->device > device) | 		if (pcm->card == card && pcm->device > device) | ||||||
| 			return pcm->device; | 			return pcm->device; | ||||||
| 		else if (pcm->card->number > card->number) | 		else if (pcm->card->number > card->number) | ||||||
|  | |||||||
| @ -4915,8 +4915,8 @@ static void hda_power_work(struct work_struct *work) | |||||||
| 	spin_unlock(&codec->power_lock); | 	spin_unlock(&codec->power_lock); | ||||||
| 
 | 
 | ||||||
| 	state = hda_call_codec_suspend(codec, true); | 	state = hda_call_codec_suspend(codec, true); | ||||||
| 	codec->pm_down_notified = 0; | 	if (!codec->pm_down_notified && | ||||||
| 	if (!bus->power_keep_link_on && (state & AC_PWRST_CLK_STOP_OK)) { | 	    !bus->power_keep_link_on && (state & AC_PWRST_CLK_STOP_OK)) { | ||||||
| 		codec->pm_down_notified = 1; | 		codec->pm_down_notified = 1; | ||||||
| 		hda_call_pm_notify(bus, false); | 		hda_call_pm_notify(bus, false); | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -4466,9 +4466,11 @@ int snd_hda_gen_build_controls(struct hda_codec *codec) | |||||||
| 					    true, &spec->vmaster_mute.sw_kctl); | 					    true, &spec->vmaster_mute.sw_kctl); | ||||||
| 		if (err < 0) | 		if (err < 0) | ||||||
| 			return err; | 			return err; | ||||||
| 		if (spec->vmaster_mute.hook) | 		if (spec->vmaster_mute.hook) { | ||||||
| 			snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, | 			snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, | ||||||
| 						 spec->vmaster_mute_enum); | 						 spec->vmaster_mute_enum); | ||||||
|  | 			snd_hda_sync_vmaster_hook(&spec->vmaster_mute); | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	free_kctls(spec); /* no longer needed */ | 	free_kctls(spec); /* no longer needed */ | ||||||
|  | |||||||
| @ -4356,6 +4356,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { | |||||||
| 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | ||||||
| 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), | 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), | ||||||
| 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_ASUS_MODE4), | 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_ASUS_MODE4), | ||||||
|  | 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_ASUS_MODE4), | ||||||
| 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), | 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), | ||||||
| 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), | 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), | ||||||
| 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | ||||||
|  | |||||||
| @ -530,6 +530,7 @@ static int hp_supply_event(struct snd_soc_dapm_widget *w, | |||||||
| 				hubs->hp_startup_mode); | 				hubs->hp_startup_mode); | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
|  | 		break; | ||||||
| 
 | 
 | ||||||
| 	case SND_SOC_DAPM_PRE_PMD: | 	case SND_SOC_DAPM_PRE_PMD: | ||||||
| 		snd_soc_update_bits(codec, WM8993_CHARGE_PUMP_1, | 		snd_soc_update_bits(codec, WM8993_CHARGE_PUMP_1, | ||||||
|  | |||||||
| @ -1797,7 +1797,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file, | |||||||
| 				w->active ? "active" : "inactive"); | 				w->active ? "active" : "inactive"); | ||||||
| 
 | 
 | ||||||
| 	list_for_each_entry(p, &w->sources, list_sink) { | 	list_for_each_entry(p, &w->sources, list_sink) { | ||||||
| 		if (p->connected && !p->connected(w, p->sink)) | 		if (p->connected && !p->connected(w, p->source)) | ||||||
| 			continue; | 			continue; | ||||||
| 
 | 
 | ||||||
| 		if (p->connect) | 		if (p->connect) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user