wifi: cfg80211: fix missing interfaces when dumping
Subsystems (14)
Sasha Levin
maintainerPATCH 1/15 wifi: cfg80211: fix missing interfaces when dumping
From: Michal Kazior <[email protected]>
[ Upstream commit a6e4f85d3820d00694ed10f581f4c650445dbcda ]
The nl80211_dump_interface() supports resumption in case nl80211_send_iface() doesn't have the resources to complete its work.
The logic would store the progress as iteration offsets for rdev and wdev loops.
However the logic did not properly handle resumption for non-last rdev. Assuming a system with 2 rdevs, with 2 wdevs each, this could happen:
dump(cb=[0, 0]):
if_start=cb[1] (=0)
send rdev0.wdev0 -> ok
send rdev0.wdev1 -> yield
cb[1] = 1
dump(cb=[0, 1]):
if_start=cb[1] (=1)
send rdev0.wdev1 -> ok
// since if_start=1 the rdev0.wdev0 got skipped // through if_idx < if_start
send rdev1.wdev1 -> ok
The if_start needs to be reset back to 0 upon wdev loop end.
The problem is actually hard to hit on a desktop, and even on most routers. The prerequisites for this manifesting was:
- more than 1 wiphy
- a few handful of interfaces
- dump without rdev or wdev filter
I was seeing this with 4 wiphys 9 interfaces each. It'd miss 6 interfaces from the last wiphy reported to userspace.
--- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+)
net/wireless/nl80211.c +1 -0
@@ -3960,6 +3960,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback * if_idx++; } + if_start =0 ; wp_idx++; } out:
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/15 wifi: mac80211: fix race condition on enabling fast-xmit
From: Felix Fietkau <[email protected]>
[ Upstream commit bcbc84af1183c8cf3d1ca9b78540c2185cd85e7f ]
fast-xmit must only be enabled after the sta has been uploaded to the driver, otherwise it could end up passing the not-yet-uploaded sta via drv_tx calls to the driver, leading to potential crashes because of uninitialized drv_priv data.
Add a missing sta->uploaded check and re-check fast xmit after inserting a sta.
--- net/mac80211/sta_info.c | 2 ++ net/mac80211/tx.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
net/mac80211/sta_info.c +2 -0
@@ -888,6 +888,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)if (ieee80211_vif_is_mesh (&sdata->vif))mesh_accept_plinks_update (sdata); +ieee80211_check_fast_xmit (sta); +return 0 ; out_remove:if (sta->sta.valid_links)
net/mac80211/tx.c +1 -1
@@ -3044,7 +3044,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) sdata->vif.type == NL80211_IFTYPE_STATION) goto out; -if (!test_sta_flag (sta,WLAN_STA_AUTHORIZED )) +if (!test_sta_flag (sta,WLAN_STA_AUTHORIZED ) || !sta->uploaded) goto out; if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/15 fbdev: savage: Error out if pixclock equals zero
In reply to Sasha LevinFrom: Fullway Wang <[email protected]>
[ Upstream commit 04e5eac8f3ab2ff52fa191c187a46d4fdbc1e288 ]
The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of pixclock, it may cause divide-by-zero error.
Although pixclock is checked in savagefb_decode_var(), but it is not checked properly in savagefb_probe(). Fix this by checking whether pixclock is zero in the function savagefb_check_var() before info->var.pixclock is used as the divisor.
This is similar to CVE-2022-3061 in i740fb which was fixed by commit 15cf0b8.
--- drivers/video/fbdev/savage/savagefb_driver.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/savage/savagefb_driver.c +3 -0
@@ -869,6 +869,9 @@ static int savagefb_check_var(struct fb_var_screeninfo *var,DBG ("savagefb_check_var" ); +if (!var->pixclock) +return -EINVAL ; + var->transp.offset =0 ; var->transp.length =0 ;switch (var->bits_per_pixel) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/15 fbdev: sis: Error out if pixclock equals zero
In reply to Sasha LevinFrom: Fullway Wang <[email protected]>
[ Upstream commit e421946be7d9bf545147bea8419ef8239cb7ca52 ]
The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of pixclock, it may cause divide-by-zero error.
In sisfb_check_var(), var->pixclock is used as a divisor to caculate drate before it is checked against zero. Fix this by checking it at the beginning.
This is similar to CVE-2022-3061 in i740fb which was fixed by commit 15cf0b8.
--- drivers/video/fbdev/sis/sis_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/video/fbdev/sis/sis_main.c +2 -0
@@ -1475,6 +1475,8 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) vtotal = var->upper_margin + var->lower_margin + var->vsync_len; +if (!var->pixclock) +return -EINVAL ; pixclock = var->pixclock;if ((var->vmode &FB_VMODE_MASK ) ==FB_VMODE_NONINTERLACED ) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/15 x86/cpu: Add model number for Intel Clearwater Forest processor
In reply to Sasha LevinFrom: Tony Luck <[email protected]>
[ Upstream commit 090e3bec01763e415bccae445f5bfe3d0c61b629 ]
Server product based on the Atom Darkmont core.
--- arch/x86/include/asm/intel-family.h | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/include/asm/intel-family.h +2 -0
@@ -160,6 +160,8 @@#define INTEL_FAM6_GRANDRIDGE 0xB6 +#define INTEL_FAM6_ATOM_DARKMONT_X 0xDD/* Clearwater Forest */ +/* Xeon Phi */ #define INTEL_FAM6_XEON_PHI_KNL 0x57/* Knights Landing */
Signature · 1 line
2.43.0
Re: [PATCH AUTOSEL 6.1 05/15] x86/cpu: Add model number for Intel Clearwater Forest processor
Hi!
Quoted 3 lines
[ Upstream commit
090e3bec01763e415bccae445f5bfe3d0c61b629]Server product based on the Atom Darkmont core.
This adds unused include, I don't believe we need it in AUTOSEL.
Best regards,
Pavel
Quoted 10 lines
+++
b/arch/x86/include/asm/intel-family.harch/x86/include/asm/intel-family.h +2
-0@@ -160,6 +160,8 @@#define INTEL_FAM6_GRANDRIDGE 0xB6 +#define INTEL_FAM6_ATOM_DARKMONT_X 0xDD/* Clearwater Forest */ +/* Xeon Phi */ #define INTEL_FAM6_XEON_PHI_KNL 0x57/* Knights Landing */
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.1 05/15] x86/cpu: Add model number for Intel Clearwater Forest processor
Quoted 7 lines · Pavel Machek
Hi!
Quoted 3 lines
[ Upstream commit
090e3bec01763e415bccae445f5bfe3d0c61b629]Server product based on the Atom Darkmont core.
This adds unused include, I don't believe we need it in AUTOSEL.
Dropped, thanks!
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 6/15 spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected
In reply to Sasha LevinFrom: Devyn Liu <[email protected]>
[ Upstream commit de8b6e1c231a95abf95ad097b993d34b31458ec9 ]
Return IRQ_NONE from the interrupt handler when no interrupt was detected. Because an empty interrupt will cause a null pointer error:
Unable to handle kernel NULL pointer dereference at virtual
address 0000000000000008
Call trace:
complete+0x54/0x100
hisi_sfc_v3xx_isr+0x2c/0x40 [spi_hisi_sfc_v3xx]
__handle_irq_event_percpu+0x64/0x1e0
handle_irq_event+0x7c/0x1cc--- drivers/spi/spi-hisi-sfc-v3xx.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/spi/spi-hisi-sfc-v3xx.c +5 -0
@@ -377,6 +377,11 @@ static const struct spi_controller_mem_ops hisi_sfc_v3xx_mem_ops = {static irqreturn_t hisi_sfc_v3xx_isr (int irq,void *data) {struct hisi_sfc_v3xx_host *host = data; +u32 reg; + + reg =readl (host->regbase +HISI_SFC_V3XX_INT_STAT ); +if (!reg) +return IRQ_NONE ;hisi_sfc_v3xx_disable_int (host);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/15 block: Fix WARNING in _copy_from_iter
In reply to Sasha LevinFrom: "Christian A. Ehrhardt" <[email protected]>
[ Upstream commit 13f3956eb5681a4045a8dfdef48df5dc4d9f58a6 ]
Syzkaller reports a warning in _copy_from_iter because an iov_iter is supposedly used in the wrong direction. The reason is that syzcaller managed to generate a request with a transfer direction of SG_DXFER_TO_FROM_DEV. This instructs the kernel to copy user buffers into the kernel, read into the copied buffers and then copy the data back to user space.
Thus the iovec is used in both directions.
Detect this situation in the block layer and construct a new iterator with the correct direction for the copy-in.
--- block/blk-map.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
block/blk-map.c +10 -3
@@ -203,12 +203,19 @@ static int bio_copy_user_iov(struct request *rq, struct rq_map_data *map_data,/* * success */ -if ((iov_iter_rw (iter) ==WRITE && - (!map_data || !map_data->null_mapped)) || - (map_data && map_data->from_user)) { +if (iov_iter_rw (iter) ==WRITE && + (!map_data || !map_data->null_mapped)) { ret =bio_copy_from_iter (bio, iter);if (ret) goto cleanup; + }else if (map_data && map_data->from_user) { +struct iov_iter iter2 = *iter; + +/* This is the copy-in part of SG_DXFER_TO_FROM_DEV. */ + iter2.data_source =ITER_SOURCE ; + ret =bio_copy_from_iter (bio, &iter2); +if (ret) + goto cleanup; }else {if (bmd->is_our_pages)zero_fill_bio (bio);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/15 smb: Work around Clang __bdos() type confusion
In reply to Sasha LevinFrom: Kees Cook <[email protected]>
[ Upstream commit 8deb05c84b63b4fdb8549e08942867a68924a5b8 ]
Recent versions of Clang gets confused about the possible size of the "user" allocation, and CONFIG_FORTIFY_SOURCE ends up emitting a warning[1]:
repro.c:126:4: warning: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
126 | __write_overflow_field(p_size_field, size);
| ^for this memset():
int len;
__le16 *user;
...
len = ses->user_name ? strlen(ses->user_name) : 0;
user = kmalloc(2 + (len * 2), GFP_KERNEL);
...
if (len) {
...
} else {
memset(user, '\0', 2);
}While Clang works on this bug[2], switch to using a direct assignment, which avoids memset() entirely which both simplifies the code and silences the false positive warning. (Making "len" size_t also silences the warning, but the direct assignment seems better.)
--- fs/smb/client/cifsencrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/cifsencrypt.c +1 -1
@@ -444,7 +444,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, len =cifs_strtoUTF16 (user, ses->user_name, len, nls_cp);UniStrupr (user); }else { -memset (user,'\0' ,2 ); + *(u16 *)user =0 ; } rc = crypto_shash_update(ses->server->secmech.hmacmd5,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/15 cifs: translate network errors on send to -ECONNABORTED
In reply to Sasha LevinFrom: Shyam Prasad N <[email protected]>
[ Upstream commit a68106a6928e0a6680f12bcc7338c0dddcfe4d11 ]
When the network stack returns various errors, we today bubble up the error to the user (in case of soft mounts).
This change translates all network errors except -EINTR and -EAGAIN to -ECONNABORTED. A similar approach is taken when we receive network errors when reading from the socket.
The change also forces the cifsd thread to reconnect during it's next activity.
--- fs/smb/client/transport.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
fs/smb/client/transport.c +9 -2
@@ -427,10 +427,17 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, server->conn_id, server->hostname); } smbd_done: -if (rc <0 && rc != -EINTR ) +/* +* there's hardly any use for the layers above to know the +* actual error code here. All they should do at this point is +* to retry the connection and hope it goes away. +*/ +if (rc <0 && rc != -EINTR && rc != -EAGAIN ) {cifs_server_dbg (VFS ,"Error %d sending data on socket to server\n" , rc); -else if (rc >0 ) + rc = -ECONNABORTED ; +cifs_signal_cifsd_for_reconnect (server, false); + }else if (rc >0 ) rc =0 ; out:cifs_in_send_dec (server);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 10/15 ahci: asm1166: correct count of reported ports
In reply to Sasha LevinFrom: Conrad Kostecki <[email protected]>
[ Upstream commit 0077a504e1a4468669fd2e011108db49133db56e ]
The ASM1166 SATA host controller always reports wrongly, that it has 32 ports. But in reality, it only has six ports.
This seems to be a hardware issue, as all tested ASM1166 SATA host controllers reports such high count of ports.
Example output: ahci 0000:09:00.0: AHCI 0001.0301 32 slots 32 ports 6 Gbps 0xffffff3f impl SATA mode.
By adjusting the port_map, the count is limited to six ports.
New output: ahci 0000:09:00.0: AHCI 0001.0301 32 slots 32 ports 6 Gbps 0x3f impl SATA mode.
--- drivers/ata/ahci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/ata/ahci.c +5 -0
@@ -658,6 +658,11 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");static void ahci_pci_save_initial_config (struct pci_dev *pdev,struct ahci_host_priv *hpriv) { +if (pdev->vendor ==PCI_VENDOR_ID_ASMEDIA && pdev->device ==0x1166 ) { +dev_info (&pdev->dev,"ASM1166 has only six ports\n" ); + hpriv->saved_port_map =0x3f ; + } +if (pdev->vendor ==PCI_VENDOR_ID_JMICRON && pdev->device ==0x2361 ) {dev_info (&pdev->dev,"JMB361 has only one port\n" ); hpriv->saved_port_map =1 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 11/15 aoe: avoid potential deadlock at set_capacity
In reply to Sasha LevinFrom: Maksim Kiselev <[email protected]>
[ Upstream commit e169bd4fb2b36c4b2bee63c35c740c85daeb2e86 ]
Move set_capacity() outside of the section procected by (&d->lock). To avoid possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
[1] lock(&bdev->bd_size_lock);
local_irq_disable();
[2] lock(&d->lock);
[3] lock(&bdev->bd_size_lock); <Interrupt>
[4] lock(&d->lock);
*** DEADLOCK ***
Where [1](&bdev->bd_size_lock) hold by zram_add()->set_capacity(). [2]lock(&d->lock) hold by aoeblk_gdalloc(). And aoeblk_gdalloc() is trying to acquire [3](&bdev->bd_size_lock) at set_capacity() call. In this situation an attempt to acquire [4]lock(&d->lock) from aoecmd_cfg_rsp() will lead to deadlock.
So the simplest solution is breaking lock dependency [2](&d->lock) -> [3](&bdev->bd_size_lock) by moving set_capacity() outside.
--- drivers/block/aoe/aoeblk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/block/aoe/aoeblk.c +4 -1
@@ -333,6 +333,7 @@ aoeblk_gdalloc(void *vp)struct gendisk *gd;mempool_t *mp;struct blk_mq_tag_set *set; +sector_t ssize;ulong flags;int late =0 ;int err;
@@ -395,7 +396,7 @@ aoeblk_gdalloc(void *vp) gd->minors =AOE_PARTITIONS ; gd->fops = &aoe_bdops; gd->private_data = d; -set_capacity (gd, d->ssize); + ssize = d->ssize;snprintf (gd->disk_name,sizeof gd->disk_name,"etherd/e%ld.%d" , d->aoemajor, d->aoeminor);
@@ -404,6 +405,8 @@ aoeblk_gdalloc(void *vp)spin_unlock_irqrestore (&d->lock, flags); +set_capacity (gd, ssize); + err =device_add_disk (NULL , gd, aoe_attr_groups);if (err) goto out_disk_cleanup;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/15 exec: Distinguish in_execve from in_exec
In reply to Sasha LevinFrom: Kees Cook <[email protected]>
[ Upstream commit 90383cc07895183c75a0db2460301c2ffd912359 ]
Just to help distinguish the fs->in_exec flag from the current->in_execve flag, add comments in check_unsafe_exec() and copy_fs() for more context. Also note that in_execve is only used by TOMOYO now.
--- fs/exec.c | 1 + include/linux/sched.h | 2 +- kernel/fork.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
fs/exec.c +1 -0
@@ -1584,6 +1584,7 @@ static void check_unsafe_exec(struct linux_binprm *bprm) }rcu_read_unlock (); +/* "users" and "in_exec" locked for copy_fs() */ if (p->fs->users > n_fs) bprm->unsafe |=LSM_UNSAFE_SHARE ;else
include/linux/sched.h +1 -1
@@ -912,7 +912,7 @@ struct task_struct {*/ unsigned sched_remote_wakeup:1; -/* Bit to tell LSMs we're in execve(): */ +/* Bit to tell TOMOYO we're in execve(): */ unsigned in_execve:1; unsigned in_iowait:1;#ifndef TIF_RESTORE_SIGMASK
kernel/fork.c +1 -0
@@ -1602,6 +1602,7 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)if (clone_flags &CLONE_FS ) {/* tsk->fs is already what we want */ spin_lock (&fs->lock); +/* "users" and "in_exec" locked for check_unsafe_exec() */ if (fs->in_exec) {spin_unlock (&fs->lock);return -EAGAIN ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/15 ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers
In reply to Sasha LevinFrom: Lennert Buytenhek <[email protected]>
[ Upstream commit 20730e9b277873deeb6637339edcba64468f3da3 ]
With one of the on-board ASM1061 AHCI controllers (1b21:0612) on an ASUSTeK Pro WS WRX80E-SAGE SE WIFI mainboard, a controller hang was observed that was immediately preceded by the following kernel messages:
ahci 0000:28:00.0: Using 64-bit DMA addresses
ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00000 flags=0x0000] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00300 flags=0x0000] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00380 flags=0x0000] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00400 flags=0x0000] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00680 flags=0x0000] ahci 0000:28:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0035 address=0x7fffff00700 flags=0x0000]
The first message is produced by code in drivers/iommu/dma-iommu.c which is accompanied by the following comment that seems to apply:
/*
* Try to use all the 32-bit PCI addresses first. The original SAC vs.
* DAC reasoning loses relevance with PCIe, but enough hardware and
* firmware bugs are still lurking out there that it's safest not to
* venture into the 64-bit space until necessary.
*
* If your device goes wrong after seeing the notice then likely either
* its driver is not setting DMA masks accurately, the hardware has
* some inherent bug in handling >32-bit addresses, or not all the
* expected address bits are wired up between the device and the IOMMU. */
Asking the ASM1061 on a discrete PCIe card to DMA from I/O virtual address 0xffffffff00000000 produces the following I/O page faults:
vfio-pci 0000:07:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0021 address=0x7ff00000000 flags=0x0010] vfio-pci 0000:07:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0021 address=0x7ff00000500 flags=0x0010]
Note that the upper 21 bits of the logged DMA address are zero. (When asking a different PCIe device in the same PCIe slot to DMA to the same I/O virtual address, we do see all the upper 32 bits of the DMA address as 1, so this is not an issue with the chipset or IOMMU configuration on the test system.)
Also, hacking libahci to always set the upper 21 bits of all DMA addresses to 1 produces no discernible effect on the behavior of the ASM1061, and mkfs/mount/scrub/etc work as without this hack.
This all strongly suggests that the ASM1061 has a 43 bit DMA address limit, and this commit therefore adds a quirk to deal with this limit.
This issue probably applies to (some of) the other supported ASMedia parts as well, but we limit it to the PCI IDs known to refer to ASM1061 parts, as that's the only part we know for sure to be affected by this issue at this point.
--- drivers/ata/ahci.c | 29 +++++++++++++++++++++++------ drivers/ata/ahci.h | 1 + 2 files changed, 24 insertions(+), 6 deletions(-)
drivers/ata/ahci.c +23 -6
@@ -49,6 +49,7 @@ enum {enum board_ids {/* board IDs by feature in alphabetical order */ board_ahci, + board_ahci_43bit_dma, board_ahci_ign_iferr, board_ahci_low_power, board_ahci_no_debounce_delay,
@@ -129,6 +130,13 @@ static const struct ata_port_info ahci_port_info[] = { .udma_mask = ATA_UDMA6, .port_ops = &ahci_ops, }, + [board_ahci_43bit_dma] = { + AHCI_HFLAGS (AHCI_HFLAG_43BIT_ONLY), + .flags = AHCI_FLAG_COMMON, + .pio_mask = ATA_PIO4, + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, [board_ahci_ign_iferr] = { AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR), .flags = AHCI_FLAG_COMMON,
@@ -597,11 +605,11 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */ -/* Asmedia */ +/* ASMedia */ { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */ - { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ - { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ + { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci_43bit_dma }, /* ASM1061 */ + { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci_43bit_dma }, /* ASM1061/1062 */ { PCI_VDEVICE(ASMEDIA, 0x0621), board_ahci }, /* ASM1061R */ { PCI_VDEVICE(ASMEDIA, 0x0622), board_ahci }, /* ASM1062R */ { PCI_VDEVICE(ASMEDIA, 0x0624), board_ahci }, /* ASM1062+JMB575 */
@@ -949,11 +957,20 @@ static int ahci_pci_device_resume(struct device *dev)#endif /* CONFIG_PM */ -static int ahci_configure_dma_masks (struct pci_dev *pdev,int using_dac) +static int ahci_configure_dma_masks (struct pci_dev *pdev, +struct ahci_host_priv *hpriv) { -const int dma_bits = using_dac ?64 :32 ; +int dma_bits;int rc; +if (hpriv->cap &HOST_CAP_64 ) { + dma_bits =64 ; +if (hpriv->flags &AHCI_HFLAG_43BIT_ONLY ) + dma_bits =43 ; + }else { + dma_bits =32 ; + } +/* * If the device fixup already set the dma_mask to some non-standard * value, don't extend it here. This happens on STA2X11, for example.
@@ -1926,7 +1943,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)ahci_gtf_filter_workaround (host);/* initialize adapter */ - rc =ahci_configure_dma_masks (pdev, hpriv->cap &HOST_CAP_64 ); + rc =ahci_configure_dma_masks (pdev, hpriv);if (rc)return rc;
drivers/ata/ahci.h +1 -0
@@ -247,6 +247,7 @@ enum {AHCI_HFLAG_SUSPEND_PHYS =BIT (26 ),/* handle PHYs during suspend/resume */ AHCI_HFLAG_NO_SXS =BIT (28 ),/* SXS not supported */ + AHCI_HFLAG_43BIT_ONLY = BIT(29), /* 43bit DMA addr limit *//* ap->flags bits */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 14/15 MIPS: reserve exception vector space ONLY ONCE
In reply to Sasha LevinFrom: Huang Pei <[email protected]>
[ Upstream commit abcabb9e30a1f9a69c76776f8abffc31c377b542 ]
"cpu_probe" is called both by BP and APs, but reserving exception vector (like 0x0-0x1000) called by "cpu_probe" need once and calling on APs is too late since memblock is unavailable at that time.
So, reserve exception vector ONLY by BP.
--- arch/mips/kernel/traps.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/mips/kernel/traps.c +7 -1
@@ -2007,7 +2007,13 @@ unsigned long vi_handlers[64];void reserve_exception_space (phys_addr_t addr,unsigned long size) { -memblock_reserve (addr, size); +/* +* reserve exception space on CPUs other than CPU0 +* is too late, since memblock is unavailable when APs +* up +*/ +if (smp_processor_id () ==0 ) +memblock_reserve (addr, size); }void __init *set_except_vector (int n,void *addr)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 15/15 platform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet
In reply to Sasha LevinFrom: Phoenix Chen <[email protected]>
[ Upstream commit 1abdf288b0ef5606f76b6e191fa6df05330e3d7e ]
Add touch screen info for TECLAST X16 Plus tablet.
--- drivers/platform/x86/touchscreen_dmi.c | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/platform/x86/touchscreen_dmi.c +35 -0
@@ -913,6 +913,32 @@ static const struct ts_dmi_data teclast_tbook11_data = { .properties = teclast_tbook11_props, }; +static const struct property_entry teclast_x16_plus_props[] = { +PROPERTY_ENTRY_U32 ("touchscreen-min-x" ,8 ), +PROPERTY_ENTRY_U32 ("touchscreen-min-y" ,14 ), +PROPERTY_ENTRY_U32 ("touchscreen-size-x" ,1916 ), +PROPERTY_ENTRY_U32 ("touchscreen-size-y" ,1264 ), +PROPERTY_ENTRY_BOOL ("touchscreen-inverted-y" ), +PROPERTY_ENTRY_STRING ("firmware-name" ,"gsl3692-teclast-x16-plus.fw" ), +PROPERTY_ENTRY_U32 ("silead,max-fingers" ,10 ), +PROPERTY_ENTRY_BOOL ("silead,home-button" ), + { } +}; + +static const struct ts_dmi_data teclast_x16_plus_data = { + .embedded_fw = { + .name ="silead/gsl3692-teclast-x16-plus.fw" , + .prefix = {0xf0 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 }, + .length =43560 , + .sha256 = {0x9d ,0xb0 ,0x3d ,0xf1 ,0x00 ,0x3c ,0xb5 ,0x25 , +0x62 ,0x8a ,0xa0 ,0x93 ,0x4b ,0xe0 ,0x4e ,0x75 , +0xd1 ,0x27 ,0xb1 ,0x65 ,0x3c ,0xba ,0xa5 ,0x0f , +0xcd ,0xb4 ,0xbe ,0x00 ,0xbb ,0xf6 ,0x43 ,0x29 }, + }, + .acpi_name ="MSSL1680:00" , + .properties = teclast_x16_plus_props, +}; +static const struct property_entry teclast_x3_plus_props[] = {PROPERTY_ENTRY_U32 ("touchscreen-size-x" ,1980 ),PROPERTY_ENTRY_U32 ("touchscreen-size-y" ,1500 ),
@@ -1567,6 +1593,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_SKU, "E5A6_A1"), }, }, + { +/* Teclast X16 Plus */ + .driver_data = (void *)&teclast_x16_plus_data, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"TECLAST" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Default string" ), + DMI_MATCH(DMI_PRODUCT_SKU, "D3A5_A1"), + }, + }, {/* Teclast X3 Plus */ .driver_data = (void *)&teclast_x3_plus_data,
Signature · 1 line
2.43.0