Skip to content

Commit 34f36f2

Browse files
committed
Merge 4.9.314 into android-4.9-q
Changes in 4.9.314 MIPS: Use address-of operator on section symbols block: drbd: drbd_nl: Make conversion to 'enum drbd_ret_code' explicit can: grcan: grcan_probe(): fix broken system id check for errata workaround needs can: grcan: only use the NAPI poll budget for RX Bluetooth: Fix the creation of hdev->name mmc: rtsx: add 74 Clocks in power on flow mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic() Linux 4.9.314 Signed-off-by: Greg Kroah-Hartman <[email protected]> Change-Id: I787a9e5c4da26661fc24a7e6600711eebf7be3df
2 parents f1a1131 + ef618f4 commit 34f36f2

File tree

10 files changed

+59
-42
lines changed

10 files changed

+59
-42
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 9
3-
SUBLEVEL = 313
3+
SUBLEVEL = 314
44
EXTRAVERSION =
55
NAME = Roaring Lionus
66

arch/mips/bmips/setup.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void __init plat_mem_setup(void)
174174
dtb = phys_to_virt(fw_arg2);
175175
else if (fw_passed_dtb) /* UHI interface */
176176
dtb = (void *)fw_passed_dtb;
177-
else if (__dtb_start != __dtb_end)
177+
else if (&__dtb_start != &__dtb_end)
178178
dtb = (void *)__dtb_start;
179179
else
180180
panic("no dtb found");

arch/mips/lantiq/prom.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void __init plat_mem_setup(void)
7676

7777
if (fw_passed_dtb) /* UHI interface */
7878
dtb = (void *)fw_passed_dtb;
79-
else if (__dtb_start != __dtb_end)
79+
else if (&__dtb_start != &__dtb_end)
8080
dtb = (void *)__dtb_start;
8181
else
8282
panic("no dtb found");

arch/mips/pic32/pic32mzda/init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static ulong get_fdtaddr(void)
3636
if (fw_passed_dtb && !fw_arg2 && !fw_arg3)
3737
return (ulong)fw_passed_dtb;
3838

39-
if (__dtb_start < __dtb_end)
39+
if (&__dtb_start < &__dtb_end)
4040
ftaddr = (ulong)__dtb_start;
4141

4242
return ftaddr;

drivers/block/drbd/drbd_nl.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,11 @@ int drbd_adm_set_role(struct sk_buff *skb, struct genl_info *info)
774774
mutex_lock(&adm_ctx.resource->adm_mutex);
775775

776776
if (info->genlhdr->cmd == DRBD_ADM_PRIMARY)
777-
retcode = drbd_set_role(adm_ctx.device, R_PRIMARY, parms.assume_uptodate);
777+
retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device,
778+
R_PRIMARY, parms.assume_uptodate);
778779
else
779-
retcode = drbd_set_role(adm_ctx.device, R_SECONDARY, 0);
780+
retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device,
781+
R_SECONDARY, 0);
780782

781783
mutex_unlock(&adm_ctx.resource->adm_mutex);
782784
genl_lock();
@@ -1933,7 +1935,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
19331935
drbd_flush_workqueue(&connection->sender_work);
19341936

19351937
rv = _drbd_request_state(device, NS(disk, D_ATTACHING), CS_VERBOSE);
1936-
retcode = rv; /* FIXME: Type mismatch. */
1938+
retcode = (enum drbd_ret_code)rv;
19371939
drbd_resume_io(device);
19381940
if (rv < SS_SUCCESS)
19391941
goto fail;
@@ -2684,7 +2686,8 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
26842686
}
26852687
rcu_read_unlock();
26862688

2687-
retcode = conn_request_state(connection, NS(conn, C_UNCONNECTED), CS_VERBOSE);
2689+
retcode = (enum drbd_ret_code)conn_request_state(connection,
2690+
NS(conn, C_UNCONNECTED), CS_VERBOSE);
26882691

26892692
conn_reconfig_done(connection);
26902693
mutex_unlock(&adm_ctx.resource->adm_mutex);
@@ -2790,7 +2793,7 @@ int drbd_adm_disconnect(struct sk_buff *skb, struct genl_info *info)
27902793
mutex_lock(&adm_ctx.resource->adm_mutex);
27912794
rv = conn_try_disconnect(connection, parms.force_disconnect);
27922795
if (rv < SS_SUCCESS)
2793-
retcode = rv; /* FIXME: Type mismatch. */
2796+
retcode = (enum drbd_ret_code)rv;
27942797
else
27952798
retcode = NO_ERROR;
27962799
mutex_unlock(&adm_ctx.resource->adm_mutex);

drivers/mmc/host/rtsx_pci_sdmmc.c

+20-10
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ struct realtek_pci_sdmmc {
4949
bool double_clk;
5050
bool eject;
5151
bool initial_mode;
52-
int power_state;
53-
#define SDMMC_POWER_ON 1
54-
#define SDMMC_POWER_OFF 0
55-
52+
int prev_power_state;
5653
int sg_count;
5754
s32 cookie;
5855
int cookie_sg_count;
@@ -914,14 +911,21 @@ static int sd_set_bus_width(struct realtek_pci_sdmmc *host,
914911
return err;
915912
}
916913

917-
static int sd_power_on(struct realtek_pci_sdmmc *host)
914+
static int sd_power_on(struct realtek_pci_sdmmc *host, unsigned char power_mode)
918915
{
919916
struct rtsx_pcr *pcr = host->pcr;
920917
int err;
921918

922-
if (host->power_state == SDMMC_POWER_ON)
919+
if (host->prev_power_state == MMC_POWER_ON)
923920
return 0;
924921

922+
if (host->prev_power_state == MMC_POWER_UP) {
923+
rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, 0);
924+
goto finish;
925+
}
926+
927+
msleep(100);
928+
925929
rtsx_pci_init_cmd(pcr);
926930
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
927931
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
@@ -940,11 +944,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)
940944
if (err < 0)
941945
return err;
942946

947+
mdelay(1);
948+
943949
err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN);
944950
if (err < 0)
945951
return err;
946952

947-
host->power_state = SDMMC_POWER_ON;
953+
/* send at least 74 clocks */
954+
rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN);
955+
956+
finish:
957+
host->prev_power_state = power_mode;
948958
return 0;
949959
}
950960

@@ -953,7 +963,7 @@ static int sd_power_off(struct realtek_pci_sdmmc *host)
953963
struct rtsx_pcr *pcr = host->pcr;
954964
int err;
955965

956-
host->power_state = SDMMC_POWER_OFF;
966+
host->prev_power_state = MMC_POWER_OFF;
957967

958968
rtsx_pci_init_cmd(pcr);
959969

@@ -979,7 +989,7 @@ static int sd_set_power_mode(struct realtek_pci_sdmmc *host,
979989
if (power_mode == MMC_POWER_OFF)
980990
err = sd_power_off(host);
981991
else
982-
err = sd_power_on(host);
992+
err = sd_power_on(host, power_mode);
983993

984994
return err;
985995
}
@@ -1417,7 +1427,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
14171427
host->mmc = mmc;
14181428
host->pdev = pdev;
14191429
host->cookie = -1;
1420-
host->power_state = SDMMC_POWER_OFF;
1430+
host->prev_power_state = MMC_POWER_OFF;
14211431
INIT_WORK(&host->work, sd_request);
14221432
platform_set_drvdata(pdev, host);
14231433
pcr->slots[RTSX_SD_CARD].p_dev = pdev;

drivers/net/can/grcan.c

+18-20
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ struct grcan_device_config {
245245
.rxsize = GRCAN_DEFAULT_BUFFER_SIZE, \
246246
}
247247

248-
#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 0x4100
248+
#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 4100
249249
#define GRLIB_VERSION_MASK 0xffff
250250

251251
/* GRCAN private data structure */
@@ -1141,15 +1141,15 @@ static int grcan_close(struct net_device *dev)
11411141
return 0;
11421142
}
11431143

1144-
static int grcan_transmit_catch_up(struct net_device *dev, int budget)
1144+
static void grcan_transmit_catch_up(struct net_device *dev)
11451145
{
11461146
struct grcan_priv *priv = netdev_priv(dev);
11471147
unsigned long flags;
11481148
int work_done;
11491149

11501150
spin_lock_irqsave(&priv->lock, flags);
11511151

1152-
work_done = catch_up_echo_skb(dev, budget, true);
1152+
work_done = catch_up_echo_skb(dev, -1, true);
11531153
if (work_done) {
11541154
if (!priv->resetting && !priv->closing &&
11551155
!(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
@@ -1163,8 +1163,6 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget)
11631163
}
11641164

11651165
spin_unlock_irqrestore(&priv->lock, flags);
1166-
1167-
return work_done;
11681166
}
11691167

11701168
static int grcan_receive(struct net_device *dev, int budget)
@@ -1246,19 +1244,13 @@ static int grcan_poll(struct napi_struct *napi, int budget)
12461244
struct net_device *dev = priv->dev;
12471245
struct grcan_registers __iomem *regs = priv->regs;
12481246
unsigned long flags;
1249-
int tx_work_done, rx_work_done;
1250-
int rx_budget = budget / 2;
1251-
int tx_budget = budget - rx_budget;
1247+
int work_done;
12521248

1253-
/* Half of the budget for receiveing messages */
1254-
rx_work_done = grcan_receive(dev, rx_budget);
1249+
work_done = grcan_receive(dev, budget);
12551250

1256-
/* Half of the budget for transmitting messages as that can trigger echo
1257-
* frames being received
1258-
*/
1259-
tx_work_done = grcan_transmit_catch_up(dev, tx_budget);
1251+
grcan_transmit_catch_up(dev);
12601252

1261-
if (rx_work_done < rx_budget && tx_work_done < tx_budget) {
1253+
if (work_done < budget) {
12621254
napi_complete(napi);
12631255

12641256
/* Guarantee no interference with a running reset that otherwise
@@ -1275,7 +1267,7 @@ static int grcan_poll(struct napi_struct *napi, int budget)
12751267
spin_unlock_irqrestore(&priv->lock, flags);
12761268
}
12771269

1278-
return rx_work_done + tx_work_done;
1270+
return work_done;
12791271
}
12801272

12811273
/* Work tx bug by waiting while for the risky situation to clear. If that fails,
@@ -1665,6 +1657,7 @@ static int grcan_setup_netdev(struct platform_device *ofdev,
16651657
static int grcan_probe(struct platform_device *ofdev)
16661658
{
16671659
struct device_node *np = ofdev->dev.of_node;
1660+
struct device_node *sysid_parent;
16681661
struct resource *res;
16691662
u32 sysid, ambafreq;
16701663
int irq, err;
@@ -1674,10 +1667,15 @@ static int grcan_probe(struct platform_device *ofdev)
16741667
/* Compare GRLIB version number with the first that does not
16751668
* have the tx bug (see start_xmit)
16761669
*/
1677-
err = of_property_read_u32(np, "systemid", &sysid);
1678-
if (!err && ((sysid & GRLIB_VERSION_MASK)
1679-
>= GRCAN_TXBUG_SAFE_GRLIB_VERSION))
1680-
txbug = false;
1670+
sysid_parent = of_find_node_by_path("/ambapp0");
1671+
if (sysid_parent) {
1672+
of_node_get(sysid_parent);
1673+
err = of_property_read_u32(sysid_parent, "systemid", &sysid);
1674+
if (!err && ((sysid & GRLIB_VERSION_MASK) >=
1675+
GRCAN_TXBUG_SAFE_GRLIB_VERSION))
1676+
txbug = false;
1677+
of_node_put(sysid_parent);
1678+
}
16811679

16821680
err = of_property_read_u32(np, "freq", &ambafreq);
16831681
if (err) {

include/net/bluetooth/hci_core.h

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
/* HCI priority */
3333
#define HCI_PRIO_MAX 7
3434

35+
/* HCI maximum id value */
36+
#define HCI_MAX_ID 10000
37+
3538
/* HCI Core structures */
3639
struct inquiry_data {
3740
bdaddr_t bdaddr;

mm/userfaultfd.c

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm,
5050
/* don't free the page */
5151
goto out;
5252
}
53+
54+
flush_dcache_page(page);
5355
} else {
5456
page = *pagep;
5557
*pagep = NULL;
@@ -263,6 +265,7 @@ static __always_inline ssize_t __mcopy_atomic(struct mm_struct *dst_mm,
263265
err = -EFAULT;
264266
goto out;
265267
}
268+
flush_dcache_page(page);
266269
goto retry;
267270
} else
268271
BUG_ON(page);

net/bluetooth/hci_core.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3064,10 +3064,10 @@ int hci_register_dev(struct hci_dev *hdev)
30643064
*/
30653065
switch (hdev->dev_type) {
30663066
case HCI_PRIMARY:
3067-
id = ida_simple_get(&hci_index_ida, 0, 0, GFP_KERNEL);
3067+
id = ida_simple_get(&hci_index_ida, 0, HCI_MAX_ID, GFP_KERNEL);
30683068
break;
30693069
case HCI_AMP:
3070-
id = ida_simple_get(&hci_index_ida, 1, 0, GFP_KERNEL);
3070+
id = ida_simple_get(&hci_index_ida, 1, HCI_MAX_ID, GFP_KERNEL);
30713071
break;
30723072
default:
30733073
return -EINVAL;
@@ -3076,7 +3076,7 @@ int hci_register_dev(struct hci_dev *hdev)
30763076
if (id < 0)
30773077
return id;
30783078

3079-
sprintf(hdev->name, "hci%d", id);
3079+
snprintf(hdev->name, sizeof(hdev->name), "hci%d", id);
30803080
hdev->id = id;
30813081

30823082
BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);

0 commit comments

Comments
 (0)