This is the 4.9.270 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmCuFX4ACgkQONu9yGCS aT6VwhAAmKzj8xR0GmKsTNXTaUkaRM3iyWu//Rag89WKGVjYKvlJ9u6abnPvkXnP kkmbzNLXhek96nx3LZ8kCSV3ROFDPHYtJFcfGBzlDs+11FpJLzZ4XYe6HiuboM6k 2fWYvV+pth/+94GJhXIpU1qKJLYGlv0sYMfxjmNodz80+KgYvHvfwFNcEepCBd5b M9Qmn8J4wL9AIuFQfAbOt2fW7LpL3YYMNWjNuKV4AkN1ZNsZwWYD+bKKIZGKgNaz uAzGfcDLO0H2j64hMwuw/Zurtya540wH6c9ADKSbPOztMsXgL4NTuMSZaVmhhVp3 ABKQ59wL4XBPhz0dvuBGxo7PpwFVtRalDis9DwQY17SknOrc8QcpAbKU8PhS8gcr CHQWj6kzKCYg+inQz4mLVgZtKYohT8zs0bgshKFeiPtZIb8WKJt+wMcqOq6e3egS NXy0DzqawIeIUbNSzmpG3K5gIuZla5gqaA66xilfo5YxtFB304IUweRra+dNz688 L8nNGh7bZWhEMpG6MtKDYrKI4K/QO2E+F0mSgRzCOD4NqvxpZ2YxbKwATFSmBOOV pQ2bN/X/4rgZOraaNN7SP2q2j0VFbbdLW1MS6MCo6JaQXmjtt4dfyJtLSeCMs2t3 AQ2/1JZ8u/Pb4KcnBy8p0CJQWXJEKiH1qDxoriOFGN2g1ygxE0o= =pWf6 -----END PGP SIGNATURE----- Merge 4.9.270 into android-4.9-q Changes in 4.9.270 openrisc: Fix a memory leak RDMA/rxe: Clear all QP fields if creation failed scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword() ptrace: make ptrace() fail if the tracee changed its pid unexpectedly cifs: fix memory leak in smb2_copychunk_range ALSA: line6: Fix racy initialization of LINE6 MIDI ALSA: usb-audio: Validate MS endpoint descriptors ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro Revert "ALSA: sb8: add a check for request_region" Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" rapidio: handle create_workqueue() failure xen-pciback: reconfigure also from backend watch handler dm snapshot: fix crash with transient storage and zero chunk size Revert "video: hgafb: fix potential NULL pointer dereference" Revert "net: stmicro: fix a missing check of clk_prepare" Revert "leds: lp5523: fix a missing check of return value of lp55xx_read" Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe" Revert "video: imsttfb: fix potential NULL pointer dereferences" Revert "ecryptfs: replace BUG_ON with error handling code" Revert "gdrom: fix a memory leak bug" cdrom: gdrom: deallocate struct gdrom_unit fields in remove_gdrom cdrom: gdrom: initialize global variable at init time Revert "rtlwifi: fix a potential NULL pointer dereference" Revert "qlcnic: Avoid potential NULL pointer dereference" Revert "niu: fix missing checks of niu_pci_eeprom_read" ethernet: sun: niu: fix missing checks of niu_pci_eeprom_read() net: stmicro: handle clk_prepare() failure during init net: rtlwifi: properly check for alloc_workqueue() failure leds: lp5523: check return value of lp5xx_read and jump to cleanup code qlcnic: Add null check after calling netdev_alloc_skb video: hgafb: fix potential NULL pointer dereference vgacon: Record video mode changes with VT_RESIZEX vt: Fix character height handling with VT_RESIZEX tty: vt: always invoke vc->vc_sw->con_resize callback iio: tsl2583: Fix division by a zero lux_val video: hgafb: correctly handle card detect failure during probe Bluetooth: SMP: Fail if remote and local public keys are identical Linux 4.9.270 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I18503de7fead3b4759390f5eac09fc3ce5722a50
This commit is contained in:
commit
c2bf9d3f61
34 changed files with 186 additions and 123 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 269
|
||||
SUBLEVEL = 270
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -278,6 +278,8 @@ void calibrate_delay(void)
|
|||
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
|
||||
loops_per_jiffy / (500000 / HZ),
|
||||
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
|
||||
|
||||
of_node_put(cpu);
|
||||
}
|
||||
|
||||
void __init setup_arch(char **cmdline_p)
|
||||
|
|
|
|||
|
|
@ -773,6 +773,13 @@ static int probe_gdrom_setupqueue(void)
|
|||
static int probe_gdrom(struct platform_device *devptr)
|
||||
{
|
||||
int err;
|
||||
|
||||
/*
|
||||
* Ensure our "one" device is initialized properly in case of previous
|
||||
* usages of it
|
||||
*/
|
||||
memset(&gd, 0, sizeof(gd));
|
||||
|
||||
/* Start the device */
|
||||
if (gdrom_execute_diagnostic() != 1) {
|
||||
pr_warning("ATA Probe for GDROM failed\n");
|
||||
|
|
@ -850,6 +857,8 @@ static int remove_gdrom(struct platform_device *devptr)
|
|||
if (gdrom_major)
|
||||
unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
|
||||
unregister_cdrom(gd.cd_info);
|
||||
kfree(gd.cd_info);
|
||||
kfree(gd.toc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -865,7 +874,7 @@ static struct platform_driver gdrom_driver = {
|
|||
static int __init init_gdrom(void)
|
||||
{
|
||||
int rc;
|
||||
gd.toc = NULL;
|
||||
|
||||
rc = platform_driver_register(&gdrom_driver);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
|
@ -881,8 +890,6 @@ static void __exit exit_gdrom(void)
|
|||
{
|
||||
platform_device_unregister(pd);
|
||||
platform_driver_unregister(&gdrom_driver);
|
||||
kfree(gd.toc);
|
||||
kfree(gd.cd_info);
|
||||
}
|
||||
|
||||
module_init(init_gdrom);
|
||||
|
|
|
|||
|
|
@ -630,7 +630,6 @@ static int lm80_probe(struct i2c_client *client,
|
|||
struct device *dev = &client->dev;
|
||||
struct device *hwmon_dev;
|
||||
struct lm80_data *data;
|
||||
int rv;
|
||||
|
||||
data = devm_kzalloc(dev, sizeof(struct lm80_data), GFP_KERNEL);
|
||||
if (!data)
|
||||
|
|
@ -643,14 +642,8 @@ static int lm80_probe(struct i2c_client *client,
|
|||
lm80_init_client(client);
|
||||
|
||||
/* A few vars need to be filled upon startup */
|
||||
rv = lm80_read_value(client, LM80_REG_FAN_MIN(1));
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
data->fan[f_min][0] = rv;
|
||||
rv = lm80_read_value(client, LM80_REG_FAN_MIN(2));
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
data->fan[f_min][1] = rv;
|
||||
data->fan[f_min][0] = lm80_read_value(client, LM80_REG_FAN_MIN(1));
|
||||
data->fan[f_min][1] = lm80_read_value(client, LM80_REG_FAN_MIN(2));
|
||||
|
||||
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
|
||||
data, lm80_groups);
|
||||
|
|
|
|||
|
|
@ -258,6 +258,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
if (err) {
|
||||
vfree(qp->sq.queue->buf);
|
||||
kfree(qp->sq.queue);
|
||||
qp->sq.queue = NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -315,6 +316,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
if (err) {
|
||||
vfree(qp->rq.queue->buf);
|
||||
kfree(qp->rq.queue);
|
||||
qp->rq.queue = NULL;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
@ -374,6 +376,11 @@ int rxe_qp_from_init(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_pd *pd,
|
|||
err2:
|
||||
rxe_queue_cleanup(qp->sq.queue);
|
||||
err1:
|
||||
qp->pd = NULL;
|
||||
qp->rcq = NULL;
|
||||
qp->scq = NULL;
|
||||
qp->srq = NULL;
|
||||
|
||||
if (srq)
|
||||
rxe_drop_ref(srq);
|
||||
rxe_drop_ref(scq);
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip)
|
|||
usleep_range(3000, 6000);
|
||||
ret = lp55xx_read(chip, LP5523_REG_STATUS, &status);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
status &= LP5523_ENG_STATUS_MASK;
|
||||
|
||||
if (status != LP5523_ENG_STATUS_MASK) {
|
||||
|
|
|
|||
|
|
@ -1264,6 +1264,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
|
|||
|
||||
if (!s->store->chunk_size) {
|
||||
ti->error = "Chunk size not set";
|
||||
r = -EINVAL;
|
||||
goto bad_read_metadata;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,7 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
|
|||
for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
|
||||
skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
|
||||
if (!skb)
|
||||
break;
|
||||
goto error;
|
||||
qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
|
||||
skb_put(skb, QLCNIC_ILB_PKT_SIZE);
|
||||
adapter->ahw->diag_cnt = 0;
|
||||
|
|
@ -1063,6 +1063,7 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
|
|||
cnt++;
|
||||
}
|
||||
if (cnt != i) {
|
||||
error:
|
||||
dev_err(&adapter->pdev->dev,
|
||||
"LB Test: failed, TX[%d], RX[%d]\n", i, cnt);
|
||||
if (mode != QLCNIC_ILB_MODE)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ struct sunxi_priv_data {
|
|||
static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
|
||||
{
|
||||
struct sunxi_priv_data *gmac = priv;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (gmac->regulator) {
|
||||
ret = regulator_enable(gmac->regulator);
|
||||
|
|
@ -60,11 +60,11 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
|
|||
} else {
|
||||
clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE);
|
||||
ret = clk_prepare(gmac->tx_clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (ret && gmac->regulator)
|
||||
regulator_disable(gmac->regulator);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void sun7i_gmac_exit(struct platform_device *pdev, void *priv)
|
||||
|
|
|
|||
|
|
@ -8166,10 +8166,10 @@ static int niu_pci_vpd_scan_props(struct niu *np, u32 start, u32 end)
|
|||
"VPD_SCAN: Reading in property [%s] len[%d]\n",
|
||||
namebuf, prop_len);
|
||||
for (i = 0; i < prop_len; i++) {
|
||||
err = niu_pci_eeprom_read(np, off + i);
|
||||
if (err >= 0)
|
||||
*prop_buf = err;
|
||||
++prop_buf;
|
||||
err = niu_pci_eeprom_read(np, off + i);
|
||||
if (err < 0)
|
||||
return err;
|
||||
*prop_buf++ = err;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8180,14 +8180,14 @@ static int niu_pci_vpd_scan_props(struct niu *np, u32 start, u32 end)
|
|||
}
|
||||
|
||||
/* ESPC_PIO_EN_ENABLE must be set */
|
||||
static void niu_pci_vpd_fetch(struct niu *np, u32 start)
|
||||
static int niu_pci_vpd_fetch(struct niu *np, u32 start)
|
||||
{
|
||||
u32 offset;
|
||||
int err;
|
||||
|
||||
err = niu_pci_eeprom_read16_swp(np, start + 1);
|
||||
if (err < 0)
|
||||
return;
|
||||
return err;
|
||||
|
||||
offset = err + 3;
|
||||
|
||||
|
|
@ -8196,12 +8196,14 @@ static void niu_pci_vpd_fetch(struct niu *np, u32 start)
|
|||
u32 end;
|
||||
|
||||
err = niu_pci_eeprom_read(np, here);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (err != 0x90)
|
||||
return;
|
||||
return -EINVAL;
|
||||
|
||||
err = niu_pci_eeprom_read16_swp(np, here + 1);
|
||||
if (err < 0)
|
||||
return;
|
||||
return err;
|
||||
|
||||
here = start + offset + 3;
|
||||
end = start + offset + err;
|
||||
|
|
@ -8209,9 +8211,12 @@ static void niu_pci_vpd_fetch(struct niu *np, u32 start)
|
|||
offset += err;
|
||||
|
||||
err = niu_pci_vpd_scan_props(np, here, end);
|
||||
if (err < 0 || err == 1)
|
||||
return;
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (err == 1)
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ESPC_PIO_EN_ENABLE must be set */
|
||||
|
|
@ -9304,8 +9309,11 @@ static int niu_get_invariants(struct niu *np)
|
|||
offset = niu_pci_vpd_offset(np);
|
||||
netif_printk(np, probe, KERN_DEBUG, np->dev,
|
||||
"%s() VPD offset [%08x]\n", __func__, offset);
|
||||
if (offset)
|
||||
niu_pci_vpd_fetch(np, offset);
|
||||
if (offset) {
|
||||
err = niu_pci_vpd_fetch(np, offset);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
nw64(ESPC_PIO_EN, 0);
|
||||
|
||||
if (np->flags & NIU_FLAGS_VPD_VALID) {
|
||||
|
|
|
|||
|
|
@ -454,9 +454,14 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
|
|||
}
|
||||
}
|
||||
|
||||
static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
||||
static int _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct workqueue_struct *wq;
|
||||
|
||||
wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
|
||||
if (!wq)
|
||||
return -ENOMEM;
|
||||
|
||||
/* <1> timer */
|
||||
setup_timer(&rtlpriv->works.watchdog_timer,
|
||||
|
|
@ -465,11 +470,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
|||
rtl_easy_concurrent_retrytimer_callback, (unsigned long)hw);
|
||||
/* <2> work queue */
|
||||
rtlpriv->works.hw = hw;
|
||||
rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name);
|
||||
if (unlikely(!rtlpriv->works.rtl_wq)) {
|
||||
pr_err("Failed to allocate work queue\n");
|
||||
return;
|
||||
}
|
||||
rtlpriv->works.rtl_wq = wq;
|
||||
|
||||
INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq,
|
||||
(void *)rtl_watchdog_wq_callback);
|
||||
|
|
@ -481,7 +482,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw)
|
|||
(void *)rtl_swlps_rfon_wq_callback);
|
||||
INIT_DELAYED_WORK(&rtlpriv->works.fwevt_wq,
|
||||
(void *)rtl_fwevt_wq_callback);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rtl_deinit_deferred_work(struct ieee80211_hw *hw)
|
||||
|
|
@ -573,9 +574,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
|
|||
rtlmac->link_state = MAC80211_NOLINK;
|
||||
|
||||
/* <6> init deferred work */
|
||||
_rtl_init_deferred_work(hw);
|
||||
|
||||
return 0;
|
||||
return _rtl_init_deferred_work(hw);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rtl_init_core);
|
||||
|
||||
|
|
|
|||
|
|
@ -2136,6 +2136,14 @@ static int riocm_add_mport(struct device *dev,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
|
||||
if (!cm->rx_wq) {
|
||||
rio_release_inb_mbox(mport, cmbox);
|
||||
rio_release_outb_mbox(mport, cmbox);
|
||||
kfree(cm);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate and register inbound messaging buffers to be ready
|
||||
* to receive channel and system management requests
|
||||
|
|
@ -2146,15 +2154,6 @@ static int riocm_add_mport(struct device *dev,
|
|||
cm->rx_slots = RIOCM_RX_RING_SIZE;
|
||||
mutex_init(&cm->rx_lock);
|
||||
riocm_rx_fill(cm, RIOCM_RX_RING_SIZE);
|
||||
cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
|
||||
if (!cm->rx_wq) {
|
||||
riocm_error("failed to allocate IBMBOX_%d on %s",
|
||||
cmbox, mport->name);
|
||||
rio_release_outb_mbox(mport, cmbox);
|
||||
kfree(cm);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
INIT_WORK(&cm->rx_work, rio_ibmsg_handler);
|
||||
|
||||
cm->tx_slot = 0;
|
||||
|
|
|
|||
|
|
@ -1102,7 +1102,8 @@ qla82xx_write_flash_dword(struct qla_hw_data *ha, uint32_t flashaddr,
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (qla82xx_flash_set_write_enable(ha))
|
||||
ret = qla82xx_flash_set_write_enable(ha);
|
||||
if (ret < 0)
|
||||
goto done_write;
|
||||
|
||||
qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_WDATA, data);
|
||||
|
|
|
|||
|
|
@ -382,6 +382,15 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
|
|||
dev_err(&chip->client->dev, "taos_als_calibrate failed to get lux\n");
|
||||
return lux_val;
|
||||
}
|
||||
|
||||
/* Avoid division by zero of lux_value later on */
|
||||
if (lux_val == 0) {
|
||||
dev_err(&chip->client->dev,
|
||||
"%s: lux_val of 0 will produce out of range trim_value\n",
|
||||
__func__);
|
||||
return -ENODATA;
|
||||
}
|
||||
|
||||
gain_trim_val = (unsigned int)(((chip->taos_settings.als_cal_target)
|
||||
* chip->taos_settings.als_gain_trim) / lux_val);
|
||||
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ static inline int resize_screen(struct vc_data *vc, int width, int height,
|
|||
/* Resizes the resolution of the display adapater */
|
||||
int err = 0;
|
||||
|
||||
if (vc->vc_mode != KD_GRAPHICS && vc->vc_sw->con_resize)
|
||||
if (vc->vc_sw->con_resize)
|
||||
err = vc->vc_sw->con_resize(vc, width, height, user);
|
||||
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -898,17 +898,17 @@ int vt_ioctl(struct tty_struct *tty,
|
|||
if (vcp) {
|
||||
int ret;
|
||||
int save_scan_lines = vcp->vc_scan_lines;
|
||||
int save_font_height = vcp->vc_font.height;
|
||||
int save_cell_height = vcp->vc_cell_height;
|
||||
|
||||
if (v.v_vlin)
|
||||
vcp->vc_scan_lines = v.v_vlin;
|
||||
if (v.v_clin)
|
||||
vcp->vc_font.height = v.v_clin;
|
||||
vcp->vc_cell_height = v.v_clin;
|
||||
vcp->vc_resize_user = 1;
|
||||
ret = vc_resize(vcp, v.v_cols, v.v_rows);
|
||||
if (ret) {
|
||||
vcp->vc_scan_lines = save_scan_lines;
|
||||
vcp->vc_font.height = save_font_height;
|
||||
vcp->vc_cell_height = save_cell_height;
|
||||
console_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1986,7 +1986,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
|
|||
return -EINVAL;
|
||||
|
||||
DPRINTK("resize now %ix%i\n", var.xres, var.yres);
|
||||
if (con_is_visible(vc)) {
|
||||
if (con_is_visible(vc) && vc->vc_mode == KD_TEXT) {
|
||||
var.activate = FB_ACTIVATE_NOW |
|
||||
FB_ACTIVATE_FORCE;
|
||||
fb_set_var(info, &var);
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ static void vgacon_init(struct vc_data *c, int init)
|
|||
vc_resize(c, vga_video_num_columns, vga_video_num_lines);
|
||||
|
||||
c->vc_scan_lines = vga_scan_lines;
|
||||
c->vc_font.height = vga_video_font_height;
|
||||
c->vc_font.height = c->vc_cell_height = vga_video_font_height;
|
||||
c->vc_complement_mask = 0x7700;
|
||||
if (vga_512_chars)
|
||||
c->vc_hi_font_mask = 0x0800;
|
||||
|
|
@ -572,32 +572,32 @@ static void vgacon_cursor(struct vc_data *c, int mode)
|
|||
switch (c->vc_cursor_type & 0x0f) {
|
||||
case CUR_UNDERLINE:
|
||||
vgacon_set_cursor_size(c->vc_x,
|
||||
c->vc_font.height -
|
||||
(c->vc_font.height <
|
||||
c->vc_cell_height -
|
||||
(c->vc_cell_height <
|
||||
10 ? 2 : 3),
|
||||
c->vc_font.height -
|
||||
(c->vc_font.height <
|
||||
c->vc_cell_height -
|
||||
(c->vc_cell_height <
|
||||
10 ? 1 : 2));
|
||||
break;
|
||||
case CUR_TWO_THIRDS:
|
||||
vgacon_set_cursor_size(c->vc_x,
|
||||
c->vc_font.height / 3,
|
||||
c->vc_font.height -
|
||||
(c->vc_font.height <
|
||||
c->vc_cell_height / 3,
|
||||
c->vc_cell_height -
|
||||
(c->vc_cell_height <
|
||||
10 ? 1 : 2));
|
||||
break;
|
||||
case CUR_LOWER_THIRD:
|
||||
vgacon_set_cursor_size(c->vc_x,
|
||||
(c->vc_font.height * 2) / 3,
|
||||
c->vc_font.height -
|
||||
(c->vc_font.height <
|
||||
(c->vc_cell_height * 2) / 3,
|
||||
c->vc_cell_height -
|
||||
(c->vc_cell_height <
|
||||
10 ? 1 : 2));
|
||||
break;
|
||||
case CUR_LOWER_HALF:
|
||||
vgacon_set_cursor_size(c->vc_x,
|
||||
c->vc_font.height / 2,
|
||||
c->vc_font.height -
|
||||
(c->vc_font.height <
|
||||
c->vc_cell_height / 2,
|
||||
c->vc_cell_height -
|
||||
(c->vc_cell_height <
|
||||
10 ? 1 : 2));
|
||||
break;
|
||||
case CUR_NONE:
|
||||
|
|
@ -608,7 +608,7 @@ static void vgacon_cursor(struct vc_data *c, int mode)
|
|||
break;
|
||||
default:
|
||||
vgacon_set_cursor_size(c->vc_x, 1,
|
||||
c->vc_font.height);
|
||||
c->vc_cell_height);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
@ -619,13 +619,13 @@ static int vgacon_doresize(struct vc_data *c,
|
|||
unsigned int width, unsigned int height)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int scanlines = height * c->vc_font.height;
|
||||
unsigned int scanlines = height * c->vc_cell_height;
|
||||
u8 scanlines_lo = 0, r7 = 0, vsync_end = 0, mode, max_scan;
|
||||
|
||||
raw_spin_lock_irqsave(&vga_lock, flags);
|
||||
|
||||
vgacon_xres = width * VGA_FONTWIDTH;
|
||||
vgacon_yres = height * c->vc_font.height;
|
||||
vgacon_yres = height * c->vc_cell_height;
|
||||
if (vga_video_type >= VIDEO_TYPE_VGAC) {
|
||||
outb_p(VGA_CRTC_MAX_SCAN, vga_video_port_reg);
|
||||
max_scan = inb_p(vga_video_port_val);
|
||||
|
|
@ -680,9 +680,9 @@ static int vgacon_doresize(struct vc_data *c,
|
|||
static int vgacon_switch(struct vc_data *c)
|
||||
{
|
||||
int x = c->vc_cols * VGA_FONTWIDTH;
|
||||
int y = c->vc_rows * c->vc_font.height;
|
||||
int y = c->vc_rows * c->vc_cell_height;
|
||||
int rows = screen_info.orig_video_lines * vga_default_font_height/
|
||||
c->vc_font.height;
|
||||
c->vc_cell_height;
|
||||
/*
|
||||
* We need to save screen size here as it's the only way
|
||||
* we can spot the screen has been resized and we need to
|
||||
|
|
@ -1120,7 +1120,7 @@ static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight)
|
|||
cursor_size_lastto = 0;
|
||||
c->vc_sw->con_cursor(c, CM_DRAW);
|
||||
}
|
||||
c->vc_font.height = fontheight;
|
||||
c->vc_font.height = c->vc_cell_height = fontheight;
|
||||
vc_resize(c, 0, rows); /* Adjust console size */
|
||||
}
|
||||
}
|
||||
|
|
@ -1174,12 +1174,20 @@ static int vgacon_resize(struct vc_data *c, unsigned int width,
|
|||
if ((width << 1) * height > vga_vram_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (user) {
|
||||
/*
|
||||
* Ho ho! Someone (svgatextmode, eh?) may have reprogrammed
|
||||
* the video mode! Set the new defaults then and go away.
|
||||
*/
|
||||
screen_info.orig_video_cols = width;
|
||||
screen_info.orig_video_lines = height;
|
||||
vga_default_font_height = c->vc_cell_height;
|
||||
return 0;
|
||||
}
|
||||
if (width % 2 || width > screen_info.orig_video_cols ||
|
||||
height > (screen_info.orig_video_lines * vga_default_font_height)/
|
||||
c->vc_font.height)
|
||||
/* let svgatextmode tinker with video timings and
|
||||
return success */
|
||||
return (user) ? 0 : -EINVAL;
|
||||
c->vc_cell_height)
|
||||
return -EINVAL;
|
||||
|
||||
if (con_is_visible(c) && !vga_is_gfx) /* who knows */
|
||||
vgacon_doresize(c, width, height);
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ static int hga_card_detect(void)
|
|||
|
||||
hga_vram = ioremap(0xb0000, hga_vram_len);
|
||||
if (!hga_vram)
|
||||
goto error;
|
||||
return -ENOMEM;
|
||||
|
||||
if (request_region(0x3b0, 12, "hgafb"))
|
||||
release_io_ports = 1;
|
||||
|
|
@ -346,13 +346,18 @@ static int hga_card_detect(void)
|
|||
hga_type_name = "Hercules";
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
return 0;
|
||||
error:
|
||||
if (release_io_ports)
|
||||
release_region(0x3b0, 12);
|
||||
if (release_io_port)
|
||||
release_region(0x3bf, 1);
|
||||
return 0;
|
||||
|
||||
iounmap(hga_vram);
|
||||
|
||||
pr_err("hgafb: HGA card not detected.\n");
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -550,13 +555,11 @@ static struct fb_ops hgafb_ops = {
|
|||
static int hgafb_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct fb_info *info;
|
||||
int ret;
|
||||
|
||||
if (! hga_card_detect()) {
|
||||
printk(KERN_INFO "hgafb: HGA card not detected.\n");
|
||||
if (hga_vram)
|
||||
iounmap(hga_vram);
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = hga_card_detect();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n",
|
||||
hga_type_name, hga_vram_len/1024);
|
||||
|
|
|
|||
|
|
@ -1516,11 +1516,6 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
info->fix.smem_start = addr;
|
||||
info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
|
||||
0x400000 : 0x800000);
|
||||
if (!info->screen_base) {
|
||||
release_mem_region(addr, size);
|
||||
framebuffer_release(info);
|
||||
return -ENOMEM;
|
||||
}
|
||||
info->fix.mmio_start = addr + 0x800000;
|
||||
par->dc_regs = ioremap(addr + 0x800000, 0x1000);
|
||||
par->cmap_regs_phys = addr + 0x840000;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue