staging: wfx: fix potential deadlock in wfx_tx_flush()
Subsystems (46)
Sasha Levin
maintainerPATCH 4/388 ASoC: tegra: tegra_wm8903: Support nvidia, headset property
In reply to Sasha LevinFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit 3ef9d5073b552d56bd6daf2af1e89b7e8d4df183 ]
The microphone-jack state needs to be masked in a case of a 4-pin jack when microphone and ground pins are shorted. Presence of nvidia,headset tells that WM8903 CODEC driver should mask microphone's status if short circuit is detected, i.e headphones are inserted.
--- sound/soc/tegra/tegra_wm8903.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra_wm8903.c +5 -1
@@ -177,6 +177,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)struct snd_soc_component *component = codec_dai->component;struct snd_soc_card *card = rtd->card;struct tegra_wm8903 *machine =snd_soc_card_get_drvdata (card); +int shrt =0 ;if (gpio_is_valid (machine->gpio_hp_det)) { tegra_wm8903_hp_jack_gpio.gpio = machine->gpio_hp_det;
@@ -189,12 +190,15 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) &tegra_wm8903_hp_jack_gpio); } +if (of_property_read_bool (card->dev->of_node,"nvidia,headset" )) + shrt =SND_JACK_MICROPHONE ; +snd_soc_card_jack_new (rtd->card,"Mic Jack" ,SND_JACK_MICROPHONE , &tegra_wm8903_mic_jack, tegra_wm8903_mic_jack_pins,ARRAY_SIZE (tegra_wm8903_mic_jack_pins));wm8903_mic_detect (component, &tegra_wm8903_mic_jack,SND_JACK_MICROPHONE , -0 ); + shrt);snd_soc_dapm_force_enable_pin (&card->dapm,"MICBIAS" );
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 14/388 backlight: lp855x: Ensure regulators are disabled on probe failure
In reply to Sasha LevinFrom: Jon Hunter <[email protected]>
[ Upstream commit d8207c155a7c6015eb7f43739baa7dfb1fa638af ]
If probing the LP885x backlight fails after the regulators have been enabled, then the following warning is seen when releasing the regulators ...
WARNING: CPU: 1 PID: 289 at drivers/regulator/core.c:2051 _regulator_put.part.28+0x158/0x160 Modules linked in: tegra_xudc lp855x_bl(+) host1x pwm_tegra ip_tables x_tables ipv6 nf_defrag_ipv6 CPU: 1 PID: 289 Comm: systemd-udevd Not tainted 5.6.0-rc2-next-20200224 #1 Hardware name: NVIDIA Jetson TX1 Developer Kit (DT)
...
Call trace: _regulator_put.part.28+0x158/0x160 regulator_put+0x34/0x50 devm_regulator_release+0x10/0x18 release_nodes+0x12c/0x230 devres_release_all+0x34/0x50 really_probe+0x1c0/0x370 driver_probe_device+0x58/0x100 device_driver_attach+0x6c/0x78 __driver_attach+0xb0/0xf0 bus_for_each_dev+0x68/0xc8 driver_attach+0x20/0x28 bus_add_driver+0x160/0x1f0 driver_register+0x60/0x110 i2c_register_driver+0x40/0x80 lp855x_driver_init+0x20/0x1000 [lp855x_bl] do_one_initcall+0x58/0x1a0 do_init_module+0x54/0x1d0 load_module+0x1d80/0x21c8 __do_sys_finit_module+0xe8/0x100 __arm64_sys_finit_module+0x18/0x20 el0_svc_common.constprop.3+0xb0/0x168 do_el0_svc+0x20/0x98 el0_sync_handler+0xf4/0x1b0 el0_sync+0x140/0x180
Fix this by ensuring that the regulators are disabled, if enabled, on probe failure.
Finally, ensure that the vddio regulator is disabled in the driver remove handler.
--- drivers/video/backlight/lp855x_bl.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/video/backlight/lp855x_bl.c +16 -4
@@ -456,7 +456,7 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) ret =regulator_enable (lp->enable);if (ret <0 ) {dev_err (lp->dev,"failed to enable vddio: %d\n" , ret); -return ret; + goto disable_supply; }/*
@@ -471,24 +471,34 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) ret =lp855x_configure (lp);if (ret) {dev_err (lp->dev,"device config err: %d" , ret); -return ret; + goto disable_vddio; } ret =lp855x_backlight_register (lp);if (ret) {dev_err (lp->dev,"failed to register backlight. err: %d\n" , ret); -return ret; + goto disable_vddio; } ret =sysfs_create_group (&lp->dev->kobj, &lp855x_attr_group);if (ret) {dev_err (lp->dev,"failed to register sysfs. err: %d\n" , ret); -return ret; + goto disable_vddio; }backlight_update_status (lp->bl); +return 0 ; + +disable_vddio: +if (lp->enable) +regulator_disable (lp->enable); +disable_supply: +if (lp->supply) +regulator_disable (lp->supply); + +return ret; }static int lp855x_remove (struct i2c_client *cl)
@@ -497,6 +507,8 @@ static int lp855x_remove(struct i2c_client *cl) lp->bl->props.brightness =0 ;backlight_update_status (lp->bl); +if (lp->enable) +regulator_disable (lp->enable);if (lp->supply)regulator_disable (lp->supply);sysfs_remove_group (&lp->dev->kobj, &lp855x_attr_group);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 47/388 dm mpath: switch paths in dm_blk_ioctl() code path
In reply to Sasha LevinFrom: Martin Wilck <[email protected]>
[ Upstream commit 2361ae595352dec015d14292f1b539242d8446d6 ]
SCSI LUN passthrough code such as qemu's "scsi-block" device model pass every IO to the host via SG_IO ioctls. Currently, dm-multipath calls choose_pgpath() only in the block IO code path, not in the ioctl code path (unless current_pgpath is NULL). This has the effect that no path switching and thus no load balancing is done for SCSI-passthrough IO, unless the active path fails.
Fix this by using the same logic in multipath_prepare_ioctl() as in multipath_clone_and_map().
Note: The allegedly best path selection algorithm, service-time, still wouldn't work perfectly, because the io size of the current request is always set to 0. Changing that for the IO passthrough case would require the ioctl cmd and arg to be passed to dm's prepare_ioctl() method.
--- drivers/md/dm-mpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-mpath.c +1 -1
@@ -1918,7 +1918,7 @@ static int multipath_prepare_ioctl(struct dm_target *ti,int r; current_pgpath =READ_ONCE (m->current_pgpath); -if (!current_pgpath) +if (!current_pgpath || !test_bit (MPATHF_QUEUE_IO , &m->flags)) current_pgpath =choose_pgpath (m,0 );if (current_pgpath) {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 52/388 RDMA/srpt: Fix disabling device management
In reply to Sasha LevinFrom: Kamal Heib <[email protected]>
[ Upstream commit 23bbd5818e2b0d265aa1835e66f5055f63a8fa4c ]
Avoid disabling device management for devices that don't support Management datagrams (MADs) by checking if the "mad_agent" pointer is initialized before calling ib_modify_port, also fix the error flow in srpt_refresh_port() to disable device management if ib_register_mad_agent() fail.
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +6 -2
@@ -610,6 +610,11 @@ static int srpt_refresh_port(struct srpt_port *sport)dev_name (&sport->sdev->device->dev), sport->port, PTR_ERR(sport->mad_agent)); sport->mad_agent =NULL ; +memset (&port_modify,0 ,sizeof (port_modify)); + port_modify.clr_port_cap_mask =IB_PORT_DEVICE_MGMT_SUP ; +ib_modify_port (sport->sdev->device, sport->port,0 , + &port_modify); + } }
@@ -633,9 +638,8 @@ static void srpt_unregister_mad_agent(struct srpt_device *sdev)for (i =1 ; i <= sdev->device->phys_port_cnt; i++) { sport = &sdev->port[i -1 ];WARN_ON (sport->port != i); -if (ib_modify_port (sdev->device, i,0 , &port_modify) <0 ) -pr_err ("disabling MAD processing failed.\n" );if (sport->mad_agent) { +ib_modify_port (sdev->device, i,0 , &port_modify);ib_unregister_mad_agent (sport->mad_agent); sport->mad_agent =NULL ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 77/388 scsi: vhost: Notify TCM about the maximum sg entries supported per command
In reply to Sasha LevinFrom: Sudhakar Panneerselvam <[email protected]>
[ Upstream commit 5ae6a6a915033bfee79e76e0c374d4f927909edc ]
vhost-scsi pre-allocates the maximum sg entries per command and if a command requires more than VHOST_SCSI_PREALLOC_SGLS entries, then that command is failed by it. This patch lets vhost communicate the max sg limit when it registers vhost_scsi_ops with TCM. With this change, TCM would report the max sg entries through "Block Limits" VPD page which will be typically queried by the SCSI initiator during device discovery. By knowing this limit, the initiator could ensure the maximum transfer length is less than or equal to what is reported by vhost-scsi.
--- drivers/vhost/scsi.c | 1 + 1 file changed, 1 insertion(+)
drivers/vhost/scsi.c +1 -0
@@ -2280,6 +2280,7 @@ static struct configfs_attribute *vhost_scsi_wwn_attrs[] = {static const struct target_core_fabric_ops vhost_scsi_ops = { .module =THIS_MODULE , .fabric_name ="vhost" , + .max_data_sg_nents =VHOST_SCSI_PREALLOC_SGLS , .tpg_get_wwn = vhost_scsi_get_fabric_wwn, .tpg_get_tag = vhost_scsi_get_tpgt, .tpg_check_demo_mode = vhost_scsi_check_true,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 87/388 pwm: img: Call pm_runtime_put() in pm_runtime_get_sync() failed case
In reply to Sasha LevinFrom: Navid Emamdoost <[email protected]>
[ Upstream commit ca162ce98110b98e7d97b7157328d34dcfdd40a9 ]
Even in failed case of pm_runtime_get_sync(), the usage_count is incremented. In order to keep the usage_count with correct value call appropriate pm_runtime_put().
--- drivers/pwm/pwm-img.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/pwm/pwm-img.c +6 -2
@@ -129,8 +129,10 @@ static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, duty =DIV_ROUND_UP (timebase * duty_ns, period_ns); ret =pm_runtime_get_sync (chip->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_autosuspend (chip->dev);return ret; + } val =img_pwm_readl (pwm_chip,PWM_CTRL_CFG ); val &= ~(PWM_CTRL_CFG_DIV_MASK <<PWM_CTRL_CFG_DIV_SHIFT (pwm->hwpwm));
@@ -331,8 +333,10 @@ static int img_pwm_remove(struct platform_device *pdev)int ret; ret =pm_runtime_get_sync (&pdev->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (&pdev->dev);return ret; + }for (i =0 ; i < pwm_chip->chip.npwm; i++) { val =img_pwm_readl (pwm_chip,PWM_CTRL_CFG );
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 88/388 sparc32: mm: Don't try to free page-table pages if ctor() fails
In reply to Sasha LevinFrom: Will Deacon <[email protected]>
[ Upstream commit 454b0289c6b5f2c66164654b80212d15fbef7a03 ]
The pages backing page-table allocations for SRMMU are allocated via memblock as part of the "nocache" region initialisation during srmmu_paging_init() and should not be freed even if a later call to pgtable_pte_page_ctor() fails.
Remove the broken call to __free_page().
--- arch/sparc/mm/srmmu.c | 1 - 1 file changed, 1 deletion(-)
arch/sparc/mm/srmmu.c +0 -1
@@ -383,7 +383,6 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)return NULL ; page =pfn_to_page (__nocache_pa (pte) >>PAGE_SHIFT );if (!pgtable_pte_page_ctor (page)) { -__free_page (page);return NULL ; }return page;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 90/388 drm/nouveau: gr/gk20a: Use firmware version 0
In reply to Sasha LevinFrom: Thierry Reding <[email protected]>
[ Upstream commit 21454fe697fde188ad6fb541f94b9838fa73ab38 ]
Tegra firmware doesn't actually use any version numbers and passing -1 causes the existing firmware binaries not to be found. Use version 0 to find the correct files.
--- drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c +1 -1
@@ -341,7 +341,7 @@ gk20a_gr_load(struct gf100_gr *gr, int ver, const struct gf100_gr_fwif *fwif)static const struct gf100_gr_fwif gk20a_gr_fwif[] = { - {-1 , gk20a_gr_load, &gk20a_gr }, + {0 , gk20a_gr_load, &gk20a_gr }, {} };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 92/388 yam: fix possible memory leak in yam_init_driver
In reply to Sasha LevinFrom: Wang Hai <[email protected]>
[ Upstream commit 98749b7188affbf2900c2aab704a8853901d1139 ]
If register_netdev(dev) fails, free_netdev(dev) needs to be called, otherwise a memory leak will occur.
--- drivers/net/hamradio/yam.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/hamradio/yam.c +1 -0
@@ -1133,6 +1133,7 @@ static int __init yam_init_driver(void) err =register_netdev (dev);if (err) {printk (KERN_WARNING "yam: cannot register net device %s\n" , dev->name); +free_netdev (dev); goto error; } yam_devs[i] = dev;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 131/388 virtiofs: schedule blocking async replies in separate worker
In reply to Sasha LevinFrom: Vivek Goyal <[email protected]>
[ Upstream commit bb737bbe48bea9854455cb61ea1dc06e92ce586c ]
In virtiofs (unlike in regular fuse) processing of async replies is serialized. This can result in a deadlock in rare corner cases when there's a circular dependency between the completion of two or more async replies.
Such a deadlock can be reproduced with xfstests:generic/503 if TEST_DIR == SCRATCH_MNT (which is a misconfiguration):
- Process A is waiting for page lock in worker thread context and blocked (virtio_fs_requests_done_work()).
- Process B is holding page lock and waiting for pending writes to finish (fuse_wait_on_page_writeback()).
- Write requests are waiting in virtqueue and can't complete because worker thread is blocked on page lock (process A).
Fix this by creating a unique work_struct for each async reply that can block (O_DIRECT read).
--- fs/fuse/file.c | 1 + fs/fuse/fuse_i.h | 1 + fs/fuse/virtio_fs.c | 106 +++++++++++++++++++++++++++++--------------- 3 files changed, 73 insertions(+), 35 deletions(-)
fs/fuse/file.c +1 -0
@@ -712,6 +712,7 @@ static ssize_t fuse_async_req_send(struct fuse_conn *fc,spin_unlock (&io->lock); ia->ap.args.end = fuse_aio_complete_req; + ia->ap.args.may_block = io->should_dirty; err =fuse_simple_background (fc, &ia->ap.args,GFP_KERNEL );if (err)fuse_aio_complete_req (fc, &ia->ap.args, err);
fs/fuse/fuse_i.h +1 -0
@@ -249,6 +249,7 @@ struct fuse_args { bool out_argvar:1; bool page_zeroing:1; bool page_replace:1; + bool may_block:1;struct fuse_in_arg in_args[3 ];struct fuse_arg out_args[2 ];void (*end)(struct fuse_conn *fc,struct fuse_args *args,int error);
fs/fuse/virtio_fs.c +71 -35
134 lines not on this page · raw message
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 141/388 s390/qdio: consistently restore the IRQ handler
In reply to Sasha LevinFrom: Julian Wiedmann <[email protected]>
[ Upstream commit 7b942b4be971d49cb185ce4690d7fbf94636e88a ]
For rolling back after an error, qdio_establish() calls qdio_shutdown(). If the error occurs early enough, then the qdio_irq's state still is QDIO_IRQ_STATE_INACTIVE and qdio_shutdown() does nothing.
But at _any_ point where qdio_establish() bails out in this way, qdio_setup_irq() will have already replaced the IRQ handler. This then won't be restored after an early error, and the device can end up being returned to the device driver with qdio's IRQ handler still installed.
Slightly reorder qdio_setup_irq() so we can be 100% sure that the IRQ handler was replaced. Then fix the bug in qdio_establish() by calling a helper that rolls back only the IRQ handler modification.
Also use the new helper in qdio_shutdown() to keep things in sync, and slightly clean up the locking while doing so.
This makes minor semantical changes, but holding setup_mutex gives us sufficient leeway to eg. pull qdio_shutdown_thinint() outside of the ccwdev lock's scope.
--- drivers/s390/cio/qdio.h | 1 + drivers/s390/cio/qdio_main.c | 18 +++++------------- drivers/s390/cio/qdio_setup.c | 20 ++++++++++++++++---- 3 files changed, 22 insertions(+), 17 deletions(-)
drivers/s390/cio/qdio.h +1 -0
@@ -389,6 +389,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,struct subchannel_id *schid, struct qdio_ssqd_desc *data);int qdio_setup_irq (struct qdio_irq *irq_ptr,struct qdio_initialize *init_data); +void qdio_shutdown_irq (struct qdio_irq *irq);void qdio_print_subchannel_info (struct qdio_irq *irq_ptr);void qdio_release_memory (struct qdio_irq *irq_ptr);int qdio_setup_init (void );
drivers/s390/cio/qdio_main.c +5 -13
@@ -1154,35 +1154,27 @@ int qdio_shutdown(struct ccw_device *cdev, int how)/* cleanup subchannel */ spin_lock_irq (get_ccwdev_lock (cdev)); - +qdio_set_state (irq_ptr,QDIO_IRQ_STATE_CLEANUP );if (how &QDIO_FLAG_CLEANUP_USING_CLEAR ) rc =ccw_device_clear (cdev,QDIO_DOING_CLEANUP );else /* default behaviour is halt */ rc =ccw_device_halt (cdev,QDIO_DOING_CLEANUP ); +spin_unlock_irq (get_ccwdev_lock (cdev));if (rc) {DBF_ERROR ("%4x SHUTD ERR" , irq_ptr->schid.sch_no);DBF_ERROR ("rc:%4d" , rc); goto no_cleanup; } -qdio_set_state (irq_ptr,QDIO_IRQ_STATE_CLEANUP ); -spin_unlock_irq (get_ccwdev_lock (cdev));wait_event_interruptible_timeout (cdev->private->wait_q, irq_ptr->state ==QDIO_IRQ_STATE_INACTIVE || irq_ptr->state ==QDIO_IRQ_STATE_ERR ,10 *HZ ); -spin_lock_irq (get_ccwdev_lock (cdev)); no_cleanup:qdio_shutdown_thinint (irq_ptr); - -/* restore interrupt handler */ -if ((void *)cdev->handler == (void *)qdio_int_handler) { - cdev->handler = irq_ptr->orig_handler; - cdev->private->intparm =0 ; - } -spin_unlock_irq (get_ccwdev_lock (cdev)); +qdio_shutdown_irq (irq_ptr);qdio_set_state (irq_ptr,QDIO_IRQ_STATE_INACTIVE );mutex_unlock (&irq_ptr->setup_mutex);
@@ -1352,8 +1344,8 @@ int qdio_establish(struct ccw_device *cdev, rc =qdio_establish_thinint (irq_ptr);if (rc) { +qdio_shutdown_irq (irq_ptr);mutex_unlock (&irq_ptr->setup_mutex); -qdio_shutdown (cdev,QDIO_FLAG_CLEANUP_USING_CLEAR );return rc; }
@@ -1371,8 +1363,8 @@ int qdio_establish(struct ccw_device *cdev,if (rc) {DBF_ERROR ("%4x est IO ERR" , irq_ptr->schid.sch_no);DBF_ERROR ("rc:%4x" , rc); +qdio_shutdown_irq (irq_ptr);mutex_unlock (&irq_ptr->setup_mutex); -qdio_shutdown (cdev,QDIO_FLAG_CLEANUP_USING_CLEAR );return rc; }
drivers/s390/cio/qdio_setup.c +16 -4
@@ -491,6 +491,12 @@ int qdio_setup_irq(struct qdio_irq *irq_ptr, struct qdio_initialize *init_data)/* qdr, qib, sls, slsbs, slibs, sbales are filled now */ +/* set our IRQ handler */ +spin_lock_irq (get_ccwdev_lock (cdev)); + irq_ptr->orig_handler = cdev->handler; + cdev->handler = qdio_int_handler; +spin_unlock_irq (get_ccwdev_lock (cdev)); +/* get qdio commands */ ciw =ccw_device_get_ciw (cdev,CIW_TYPE_EQUEUE );if (!ciw) {
@@ -506,12 +512,18 @@ int qdio_setup_irq(struct qdio_irq *irq_ptr, struct qdio_initialize *init_data) } irq_ptr->aqueue = *ciw; -/* set new interrupt handler */ +return 0 ; +} + +void qdio_shutdown_irq (struct qdio_irq *irq) +{ +struct ccw_device *cdev = irq->cdev; + +/* restore IRQ handler */ spin_lock_irq (get_ccwdev_lock (cdev)); - irq_ptr->orig_handler = cdev->handler; - cdev->handler = qdio_int_handler; + cdev->handler = irq->orig_handler; + cdev->private->intparm =0 ;spin_unlock_irq (get_ccwdev_lock (cdev)); -return 0 ; }void qdio_print_subchannel_info (struct qdio_irq *irq_ptr)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 164/388 ARM: dts: aspeed: ast2600: Set arch timer always-on
In reply to Sasha LevinFrom: Eddie James <[email protected]>
[ Upstream commit c998f40f2ae6a48e93206e2c1ea0691479989611 ]
According to ASPEED, FTTMR010 is not intended to be used in the AST2600. The arch timer should be used, but Linux doesn't enable high-res timers without being assured that the arch timer is always on, so set that property in the devicetree.
The FTTMR010 device is described by set to disabled.
This fixes highres timer support for AST2600.
--- arch/arm/boot/dts/aspeed-g6.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/aspeed-g6.dtsi +2 -0
@@ -65,6 +65,7 @@ timer { <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>; clocks = <&syscon ASPEED_CLK_HPLL>; arm,cpu-registers-not-fw-configured; + always-on; }; ahb {
@@ -368,6 +369,7 @@ timer: timer at 1e782000 { <&gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; clocks = <&syscon ASPEED_CLK_APB1>; clock-names = "PCLK"; + status = "disabled"; }; uart1: serial at 1e783000 {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 165/388 ARM: dts: aspeed: Change KCS nodes to v2 binding
In reply to Sasha LevinFrom: Andrew Jeffery <[email protected]>
[ Upstream commit fa4c8ec6feaa3237f5d44cb8c6d0aa0dff6e1bcc ]
Fixes the following warnings for both g5 and g6 SoCs:
arch/arm/boot/dts/aspeed-g5.dtsi:376.19-381.8: Warning
(unit_address_vs_reg): /ahb/apb/lpc at 1e789000/lpc-bmc at 0/kcs1 at 0: node
has a unit name, but no reg property--- .../dts/aspeed-bmc-facebook-tiogapass.dts | 4 ++-- arch/arm/boot/dts/aspeed-g5.dtsi | 24 +++++++++---------- arch/arm/boot/dts/aspeed-g6.dtsi | 23 +++++++++--------- 3 files changed, 26 insertions(+), 25 deletions(-)
arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts +2 -2
@@ -112,13 +112,13 @@ &uart5 { &kcs2 { // BMC KCS channel 2 status = "okay"; - kcs_addr = <0xca8>; + aspeed,lpc-io-reg = <0xca8>; }; &kcs3 { // BMC KCS channel 3 status = "okay"; - kcs_addr = <0xca2>; + aspeed,lpc-io-reg = <0xca2>; }; &mac0 {
arch/arm/boot/dts/aspeed-g5.dtsi +12 -12
@@ -426,22 +426,22 @@ lpc_bmc: lpc-bmc at 0 { #size-cells = <1>; ranges = <0x0 0x0 0x80>; - kcs1: kcs1 at 0 { - compatible = "aspeed,ast2500-kcs-bmc"; + kcs1: kcs at 24 { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; interrupts = <8>; - kcs_chan = <1>; status = "disabled"; }; - kcs2: kcs2 at 0 { - compatible = "aspeed,ast2500-kcs-bmc"; + kcs2: kcs at 28 { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; interrupts = <8>; - kcs_chan = <2>; status = "disabled"; }; - kcs3: kcs3 at 0 { - compatible = "aspeed,ast2500-kcs-bmc"; + kcs3: kcs at 2c { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; interrupts = <8>; - kcs_chan = <3>; status = "disabled"; }; };
@@ -455,10 +455,10 @@ lpc_host: lpc-host at 80 { #size-cells = <1>; ranges = <0x0 0x80 0x1e0>; - kcs4: kcs4 at 0 { - compatible = "aspeed,ast2500-kcs-bmc"; + kcs4: kcs at 94 { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x94 0x1>, <0x98 0x1>, <0x9c 0x1>; interrupts = <8>; - kcs_chan = <4>; status = "disabled"; };
arch/arm/boot/dts/aspeed-g6.dtsi +12 -11
@@ -435,22 +435,23 @@ lpc_bmc: lpc-bmc at 0 { #size-cells = <1>; ranges = <0x0 0x0 0x80>; - kcs1: kcs1 at 0 { - compatible = "aspeed,ast2600-kcs-bmc"; + kcs1: kcs at 24 { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>; kcs_chan = <1>; status = "disabled"; }; - kcs2: kcs2 at 0 { - compatible = "aspeed,ast2600-kcs-bmc"; + kcs2: kcs at 28 { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>; - kcs_chan = <2>; status = "disabled"; }; - kcs3: kcs3 at 0 { - compatible = "aspeed,ast2600-kcs-bmc"; + kcs3: kcs at 2c { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>; - kcs_chan = <3>; status = "disabled"; }; };
@@ -464,10 +465,10 @@ lpc_host: lpc-host at 80 { #size-cells = <1>; ranges = <0x0 0x80 0x1e0>; - kcs4: kcs4 at 0 { - compatible = "aspeed,ast2600-kcs-bmc"; + kcs4: kcs at 94 { + compatible = "aspeed,ast2500-kcs-bmc-v2"; + reg = <0x94 0x1>, <0x98 0x1>, <0x9c 0x1>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; - kcs_chan = <4>; status = "disabled"; };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 171/388 staging: sm750fb: add missing case while setting FB_VISUAL
In reply to Sasha LevinFrom: Matej Dujava <[email protected]>
[ Upstream commit fa90133377f4a7f15a937df6ad55133bb57c5665 ]
Switch statement does not contain all cases: 8, 16, 24, 32. This patch will add missing one (24)
--- drivers/staging/sm750fb/sm750.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/sm750fb/sm750.c +1 -0
@@ -898,6 +898,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) fix->visual =FB_VISUAL_PSEUDOCOLOR ;break ;case 16 : +case 24 :case 32 : fix->visual =FB_VISUAL_TRUECOLOR ;break ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 186/388 scsi: target: loopback: Fix READ with data and sensebytes
In reply to Sasha LevinFrom: Bodo Stroesser <[email protected]>
[ Upstream commit c68a56736c129f5dd1632856956f9c3e04bae200 ]
We use tcm_loop with tape emulations running on tcmu.
In case application reads a short tape block with a longer READ, or a long tape block with a short READ, according to SCC spec data has to be tranferred _and_ sensebytes with ILI set and information field containing the residual count. Similar problem also exists when using fixed block size in READ.
Up to now tcm_loop is not prepared to handle sensebytes if input data is provided, as in tcm_loop_queue_data_in() it only sets SAM_STAT_GOOD and, if necessary, the residual count.
To fix the bug, the same handling for sensebytes as present in tcm_loop_queue_status() must be done in tcm_loop_queue_data_in() also.
After adding this handling, the two function now are nearly identical, so I created a single function with two wrappers.
--- drivers/target/loopback/tcm_loop.c | 36 +++++++++++++----------------- 1 file changed, 15 insertions(+), 21 deletions(-)
drivers/target/loopback/tcm_loop.c +15 -21
@@ -545,32 +545,15 @@ static int tcm_loop_write_pending(struct se_cmd *se_cmd)return 0 ; } -static int tcm_loop_queue_data_in (struct se_cmd *se_cmd) +static int tcm_loop_queue_data_or_status (const char *func, +struct se_cmd *se_cmd,u8 scsi_status) {struct tcm_loop_cmd *tl_cmd =container_of (se_cmd, struct tcm_loop_cmd, tl_se_cmd);struct scsi_cmnd *sc = tl_cmd->sc;pr_debug ("%s() called for scsi_cmnd: %p cdb: 0x%02x\n" , - __func__, sc, sc->cmnd[0 ]); - - sc->result =SAM_STAT_GOOD ; -set_host_byte (sc,DID_OK ); -if ((se_cmd->se_cmd_flags &SCF_OVERFLOW_BIT ) || - (se_cmd->se_cmd_flags &SCF_UNDERFLOW_BIT )) -scsi_set_resid (sc, se_cmd->residual_count); - sc->scsi_done (sc); -return 0 ; -} - -static int tcm_loop_queue_status (struct se_cmd *se_cmd) -{ -struct tcm_loop_cmd *tl_cmd =container_of (se_cmd, - struct tcm_loop_cmd, tl_se_cmd); -struct scsi_cmnd *sc = tl_cmd->sc; - -pr_debug ("%s() called for scsi_cmnd: %p cdb: 0x%02x\n" , - __func__, sc, sc->cmnd[0 ]); + func, sc, sc->cmnd[0 ]); if (se_cmd->sense_buffer && ((se_cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) ||
@@ -581,7 +564,7 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd) sc->result =SAM_STAT_CHECK_CONDITION ;set_driver_byte (sc,DRIVER_SENSE ); }else - sc->result = se_cmd->scsi_status; + sc->result = scsi_status;set_host_byte (sc,DID_OK ); if ((se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) ||
@@ -591,6 +574,17 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd)return 0 ; } +static int tcm_loop_queue_data_in (struct se_cmd *se_cmd) +{ +return tcm_loop_queue_data_or_status (__func__, se_cmd,SAM_STAT_GOOD ); +} + +static int tcm_loop_queue_status (struct se_cmd *se_cmd) +{ +return tcm_loop_queue_data_or_status (__func__, + se_cmd, se_cmd->scsi_status); +} +static void tcm_loop_queue_tm_rsp (struct se_cmd *se_cmd) { struct tcm_loop_cmd *tl_cmd = container_of(se_cmd,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 196/388 pinctrl: rockchip: fix memleak in rockchip_dt_node_to_map
In reply to Sasha LevinFrom: Dafna Hirschfeld <[email protected]>
[ Upstream commit d7faa8ffb6be57bf8233a4b5a636d76b83c51ce7 ]
In function rockchip_dt_node_to_map, a new_map variable is allocated by:
new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map),
GFP_KERNEL);
This uses devres and attaches new_map to the pinctrl driver. This cause a leak since new_map is not released when the probed driver is removed. Fix it by using kcalloc to allocate new_map and free it in rockchip_dt_free_map
--- drivers/pinctrl/pinctrl-rockchip.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/pinctrl/pinctrl-rockchip.c +4 -3
@@ -508,8 +508,8 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev, } map_num += grp->npins; - new_map =devm_kcalloc (pctldev->dev, map_num,sizeof (*new_map), -GFP_KERNEL ); + + new_map =kcalloc (map_num,sizeof (*new_map),GFP_KERNEL );if (!new_map)return -ENOMEM ;
@@ -519,7 +519,7 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev,/* create mux map */ parent =of_get_parent (np);if (!parent) { -devm_kfree (pctldev->dev, new_map); +kfree (new_map);return -EINVAL ; } new_map[0 ].type =PIN_MAP_TYPE_MUX_GROUP ;
@@ -546,6 +546,7 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev,static void rockchip_dt_free_map (struct pinctrl_dev *pctldev,struct pinctrl_map *map,unsigned num_maps) { +kfree (map); }static const struct pinctrl_ops rockchip_pctrl_ops = {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 198/388 dlm: remove BUG() before panic()
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit fe204591cc9480347af7d2d6029b24a62e449486 ]
Building a kernel with clang sometimes fails with an objtool error in dlm:
fs/dlm/lock.o: warning: objtool: revert_lock_pc()+0xbd: can't find jump dest instruction at .text+0xd7fc
The problem is that BUG() never returns and the compiler knows that anything after it is unreachable, however the panic still emits some code that does not get fully eliminated.
Having both BUG() and panic() is really pointless as the BUG() kills the current process and the subsequent panic() never hits. In most cases, we probably don't really want either and should replace the DLM_ASSERT() statements with WARN_ON(), as has been done for some of them.
Remove the BUG() here so the user at least sees the panic message and we can reliably build randconfig kernels.
--- fs/dlm/dlm_internal.h | 1 - 1 file changed, 1 deletion(-)
fs/dlm/dlm_internal.h +0 -1
@@ -97,7 +97,6 @@ do { \ __LINE__, __FILE__, #x, jiffies); \ {do} \ printk("\n"); \ - BUG(); \ panic("DLM: Record message above and reboot.\n"); \ } \ }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 242/388 scsi: target: tcmu: Userspace must not complete queued commands
In reply to Sasha LevinFrom: Bodo Stroesser <[email protected]>
[ Upstream commit 61fb2482216679b9e1e797440c148bb143a5040a ]
When tcmu queues a new command - no matter whether in command ring or in qfull_queue - a cmd_id from IDR udev->commands is assigned to the command.
If userspace sends a wrong command completion containing the cmd_id of a command on the qfull_queue, tcmu_handle_completions() finds the command in the IDR and calls tcmu_handle_completion() for it. This might do some nasty things because commands in qfull_queue do not have a valid dbi list.
To fix this bug, we no longer add queued commands to the idr. Instead the cmd_id is assign when a command is written to the command ring.
Due to this change I had to adapt the source code at several places where up to now an idr_for_each had been done.
[mkp: fix checkpatch warnings]
--- drivers/target/target_core_user.c | 154 ++++++++++++++---------------- 1 file changed, 71 insertions(+), 83 deletions(-)
drivers/target/target_core_user.c +71 -83
@@ -882,41 +882,24 @@ static inline size_t tcmu_cmd_get_cmd_size(struct tcmu_cmd *tcmu_cmd,return command_size; } -static int tcmu_setup_cmd_timer (struct tcmu_cmd *tcmu_cmd,unsigned int tmo, -struct timer_list *timer) +static void tcmu_setup_cmd_timer (struct tcmu_cmd *tcmu_cmd,unsigned int tmo, +struct timer_list *timer) { -struct tcmu_dev *udev = tcmu_cmd->tcmu_dev; -int cmd_id; - -if (tcmu_cmd->cmd_id) - goto setup_timer; - - cmd_id =idr_alloc (&udev->commands, tcmu_cmd,1 ,USHRT_MAX ,GFP_NOWAIT ); -if (cmd_id <0 ) { -pr_err ("tcmu: Could not allocate cmd id.\n" ); -return cmd_id; - } - tcmu_cmd->cmd_id = cmd_id; - -pr_debug ("allocated cmd %u for dev %s tmo %lu\n" , tcmu_cmd->cmd_id, - udev->name, tmo /MSEC_PER_SEC ); - -setup_timer:if (!tmo) -return 0 ; +return ; tcmu_cmd->deadline =round_jiffies_up (jiffies +msecs_to_jiffies (tmo));if (!timer_pending (timer))mod_timer (timer, tcmu_cmd->deadline); -return 0 ; +pr_debug ("Timeout set up for cmd %p, dev = %s, tmo = %lu\n" , tcmu_cmd, + tcmu_cmd->tcmu_dev->name, tmo /MSEC_PER_SEC ); }static int add_to_qfull_queue (struct tcmu_cmd *tcmu_cmd) {struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;unsigned int tmo; -int ret;/* * For backwards compat if qfull_time_out is not set use
@@ -931,13 +914,11 @@ static int add_to_qfull_queue(struct tcmu_cmd *tcmu_cmd)else tmo =TCMU_TIME_OUT ; - ret =tcmu_setup_cmd_timer (tcmu_cmd, tmo, &udev->qfull_timer); -if (ret) -return ret; +tcmu_setup_cmd_timer (tcmu_cmd, tmo, &udev->qfull_timer);list_add_tail (&tcmu_cmd->queue_entry, &udev->qfull_queue); -pr_debug ("adding cmd %u on dev %s to ring space wait queue\n" , - tcmu_cmd->cmd_id, udev->name); +pr_debug ("adding cmd %p on dev %s to ring space wait queue\n" , + tcmu_cmd, udev->name);return 0 ; }
@@ -959,7 +940,7 @@ static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err)struct tcmu_mailbox *mb;struct tcmu_cmd_entry *entry;struct iovec *iov; -int iov_cnt, ret; +int iov_cnt, cmd_id;uint32_t cmd_head;uint64_t cdb_off;bool copy_to_data_area;
@@ -1060,14 +1041,21 @@ static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err) } entry->req.iov_bidi_cnt = iov_cnt; - ret =tcmu_setup_cmd_timer (tcmu_cmd, udev->cmd_time_out, - &udev->cmd_timer); -if (ret) { -tcmu_cmd_free_data (tcmu_cmd, tcmu_cmd->dbi_cnt); + cmd_id =idr_alloc (&udev->commands, tcmu_cmd,1 ,USHRT_MAX ,GFP_NOWAIT ); +if (cmd_id <0 ) { +pr_err ("tcmu: Could not allocate cmd id.\n" ); +tcmu_cmd_free_data (tcmu_cmd, tcmu_cmd->dbi_cnt); *scsi_err =TCM_OUT_OF_RESOURCES ;return -1 ; } + tcmu_cmd->cmd_id = cmd_id; + +pr_debug ("allocated cmd id %u for cmd %p dev %s\n" , tcmu_cmd->cmd_id, + tcmu_cmd, udev->name); + +tcmu_setup_cmd_timer (tcmu_cmd, udev->cmd_time_out, &udev->cmd_timer); + entry->hdr.cmd_id = tcmu_cmd->cmd_id;/*
@@ -1279,50 +1267,39 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev)return handled; } -static int tcmu_check_expired_cmd (int id,void *p,void *data) +static void tcmu_check_expired_ring_cmd (struct tcmu_cmd *cmd) { -struct tcmu_cmd *cmd = p; -struct tcmu_dev *udev = cmd->tcmu_dev; -u8 scsi_status;struct se_cmd *se_cmd; -bool is_running; - -if (test_bit (TCMU_CMD_BIT_EXPIRED , &cmd->flags)) -return 0 ;if (!time_after (jiffies, cmd->deadline)) -return 0 ; +return ; - is_running =test_bit (TCMU_CMD_BIT_INFLIGHT , &cmd->flags); +set_bit (TCMU_CMD_BIT_EXPIRED , &cmd->flags); +list_del_init (&cmd->queue_entry); se_cmd = cmd->se_cmd; + cmd->se_cmd =NULL ; -if (is_running) { -/* -* If cmd_time_out is disabled but qfull is set deadline -* will only reflect the qfull timeout. Ignore it. -*/ -if (!udev->cmd_time_out) -return 0 ; +pr_debug ("Timing out inflight cmd %u on dev %s.\n" , + cmd->cmd_id, cmd->tcmu_dev->name); -set_bit (TCMU_CMD_BIT_EXPIRED , &cmd->flags); -/* -* target_complete_cmd will translate this to LUN COMM FAILURE -*/ - scsi_status =SAM_STAT_CHECK_CONDITION ; -list_del_init (&cmd->queue_entry); - cmd->se_cmd =NULL ; - }else { -list_del_init (&cmd->queue_entry); -idr_remove (&udev->commands, id); -tcmu_free_cmd (cmd); - scsi_status =SAM_STAT_TASK_SET_FULL ; - } +target_complete_cmd (se_cmd,SAM_STAT_CHECK_CONDITION ); +} -pr_debug ("Timing out cmd %u on dev %s that is %s.\n" , - id, udev->name, is_running ?"inflight" :"queued" ); +static void tcmu_check_expired_queue_cmd (struct tcmu_cmd *cmd) +{ +struct se_cmd *se_cmd; -target_complete_cmd (se_cmd, scsi_status); -return 0 ; +if (!time_after (jiffies, cmd->deadline)) +return ; + +list_del_init (&cmd->queue_entry); + se_cmd = cmd->se_cmd; +tcmu_free_cmd (cmd); + +pr_debug ("Timing out queued cmd %p on dev %s.\n" , + cmd, cmd->tcmu_dev->name); + +target_complete_cmd (se_cmd,SAM_STAT_TASK_SET_FULL ); }static void tcmu_device_timedout (struct tcmu_dev *udev)
@@ -1407,16 +1384,15 @@ static struct se_device *tcmu_alloc_device(struct se_hba *hba, const char *name)return &udev->se_dev; } -static bool run_qfull_queue (struct tcmu_dev *udev,bool fail) +static void run_qfull_queue (struct tcmu_dev *udev,bool fail) {struct tcmu_cmd *tcmu_cmd, *tmp_cmd;LIST_HEAD (cmds); -bool drained = true;sense_reason_t scsi_ret;int ret;if (list_empty (&udev->qfull_queue)) -return true; +return ;pr_debug ("running %s's cmdr queue forcefail %d\n" , udev->name, fail);
@@ -1425,11 +1401,10 @@ static bool run_qfull_queue(struct tcmu_dev *udev, bool fail)list_for_each_entry_safe (tcmu_cmd, tmp_cmd, &cmds, queue_entry) {list_del_init (&tcmu_cmd->queue_entry); -pr_debug ("removing cmd %u on dev %s from queue\n" , - tcmu_cmd->cmd_id, udev->name); +pr_debug ("removing cmd %p on dev %s from queue\n" , + tcmu_cmd, udev->name);if (fail) { -idr_remove (&udev->commands, tcmu_cmd->cmd_id);/* * We were not able to even start the command, so * fail with busy to allow a retry in case runner
@@ -1444,10 +1419,8 @@ static bool run_qfull_queue(struct tcmu_dev *udev, bool fail) ret =queue_cmd_ring (tcmu_cmd, &scsi_ret);if (ret <0 ) { -pr_debug ("cmd %u on dev %s failed with %u\n" , - tcmu_cmd->cmd_id, udev->name, scsi_ret); - -idr_remove (&udev->commands, tcmu_cmd->cmd_id); +pr_debug ("cmd %p on dev %s failed with %u\n" , + tcmu_cmd, udev->name, scsi_ret);/* * Ignore scsi_ret for now. target_complete_cmd * drops it.
@@ -1462,13 +1435,11 @@ static bool run_qfull_queue(struct tcmu_dev *udev, bool fail)* the queue */ list_splice_tail (&cmds, &udev->qfull_queue); - drained = false;break ; } }tcmu_set_next_deadline (&udev->qfull_queue, &udev->qfull_timer); -return drained; }static int tcmu_irqcontrol (struct uio_info *info,s32 irq_on)
@@ -1652,6 +1623,8 @@ static void tcmu_dev_kref_release(struct kref *kref)if (tcmu_check_and_free_pending_cmd (cmd) !=0 ) all_expired = false; } +if (!list_empty (&udev->qfull_queue)) + all_expired = false;idr_destroy (&udev->commands);WARN_ON (!all_expired);
@@ -2037,9 +2010,6 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level)mutex_lock (&udev->cmdr_lock);idr_for_each_entry (&udev->commands, cmd, i) { -if (!test_bit (TCMU_CMD_BIT_INFLIGHT , &cmd->flags)) -continue ; -pr_debug ("removing cmd %u on dev %s from ring (is expired %d)\n" , cmd->cmd_id, udev->name,test_bit (TCMU_CMD_BIT_EXPIRED , &cmd->flags));
@@ -2077,6 +2047,8 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level)del_timer (&udev->cmd_timer); +run_qfull_queue (udev, false); +mutex_unlock (&udev->cmdr_lock); }
@@ -2698,6 +2670,7 @@ static void find_free_blocks(void)static void check_timedout_devices (void ) {struct tcmu_dev *udev, *tmp_dev; +struct tcmu_cmd *cmd, *tmp_cmd;LIST_HEAD (devs);spin_lock_bh (&timed_out_udevs_lock);
@@ -2708,9 +2681,24 @@ static void check_timedout_devices(void)spin_unlock_bh (&timed_out_udevs_lock);mutex_lock (&udev->cmdr_lock); -idr_for_each (&udev->commands, tcmu_check_expired_cmd,NULL ); -tcmu_set_next_deadline (&udev->inflight_queue, &udev->cmd_timer); +/* +* If cmd_time_out is disabled but qfull is set deadline +* will only reflect the qfull timeout. Ignore it. +*/ +if (udev->cmd_time_out) { +list_for_each_entry_safe (cmd, tmp_cmd, + &udev->inflight_queue, + queue_entry) { +tcmu_check_expired_ring_cmd (cmd); + } +tcmu_set_next_deadline (&udev->inflight_queue, + &udev->cmd_timer); + } +list_for_each_entry_safe (cmd, tmp_cmd, &udev->qfull_queue, + queue_entry) { +tcmu_check_expired_queue_cmd (cmd); + }tcmu_set_next_deadline (&udev->qfull_queue, &udev->qfull_timer);mutex_unlock (&udev->cmdr_lock);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 247/388 arm64: tegra: Fix ethernet phy-mode for Jetson Xavier
In reply to Sasha LevinFrom: Jon Hunter <[email protected]>
[ Upstream commit bba25915b172c72f6fa635f091624d799e3c9cae ]
The 'phy-mode' property is currently defined as 'rgmii' for Jetson Xavier. This indicates that the RGMII RX and TX delays are set by the MAC and the internal delays set by the PHY are not used.
If the Marvell PHY driver is enabled, such that it is used and not the generic PHY, ethernet failures are seen (DHCP is failing to obtain an IP address) and this is caused because the Marvell PHY driver is disabling the internal RX and TX delays. For Jetson Xavier the internal PHY RX and TX delay should be used and so fix this by setting the 'phy-mode' to 'rgmii-id' and not 'rgmii'.
--- arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi +1 -1
@@ -33,7 +33,7 @@ ethernet@2490000 { phy-reset-gpios = <&gpio TEGRA194_MAIN_GPIO(G, 5) GPIO_ACTIVE_LOW>; phy-handle = <&phy>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; mdio { #address-cells = <1>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 248/388 arm64: tegra: Fix flag for 64-bit resources in 'ranges' property
In reply to Sasha LevinFrom: Vidya Sagar <[email protected]>
[ Upstream commit 3482a7afb261e2de9269a7f9ad0f4a3a82a83a53 ]
Fix flag in PCIe controllers device-tree nodes 'ranges' property to correctly represent 64-bit resources.
--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +6 -6
@@ -1387,7 +1387,7 @@ pcie@14100000 { bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x30100000 0x0 0x30100000 0x0 0x00100000 /* downstream I/O (1MB) */ - 0xc2000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0xc3000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */ 0x82000000 0x0 0x40000000 0x12 0x30000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ };
@@ -1432,7 +1432,7 @@ pcie@14120000 { bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x32100000 0x0 0x32100000 0x0 0x00100000 /* downstream I/O (1MB) */ - 0xc2000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0xc3000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */ 0x82000000 0x0 0x40000000 0x12 0x70000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ };
@@ -1477,7 +1477,7 @@ pcie@14140000 { bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x34100000 0x0 0x34100000 0x0 0x00100000 /* downstream I/O (1MB) */ - 0xc2000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0xc3000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */ 0x82000000 0x0 0x40000000 0x12 0xb0000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ };
@@ -1522,7 +1522,7 @@ pcie@14160000 { bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x36100000 0x0 0x36100000 0x0 0x00100000 /* downstream I/O (1MB) */ - 0xc2000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0xc3000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ 0x82000000 0x0 0x40000000 0x17 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */ };
@@ -1567,7 +1567,7 @@ pcie@14180000 { bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ - 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0xc3000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ 0x82000000 0x0 0x40000000 0x1b 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */ };
@@ -1616,7 +1616,7 @@ pcie@141a0000 { bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x3a100000 0x0 0x3a100000 0x0 0x00100000 /* downstream I/O (1MB) */ - 0xc2000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0xc3000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */ };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 252/388 dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone
In reply to Sasha LevinFrom: Hannes Reinecke <[email protected]>
[ Upstream commit 489dc0f06a5837f87482c0ce61d830d24e17082e ]
The only case where dmz_get_zone_for_reclaim() cannot return a zone is if the respective lists are empty. So we should just return a simple NULL value here as we really don't have an error code which would make sense.
--- drivers/md/dm-zoned-metadata.c | 4 ++-- drivers/md/dm-zoned-reclaim.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/md/dm-zoned-metadata.c +2 -2
@@ -1554,7 +1554,7 @@ static struct dm_zone *dmz_get_rnd_zone_for_reclaim(struct dmz_metadata *zmd)return dzone; } -return ERR_PTR (-EBUSY ); +return NULL ; }/*
@@ -1574,7 +1574,7 @@ static struct dm_zone *dmz_get_seq_zone_for_reclaim(struct dmz_metadata *zmd)return zone; } -return ERR_PTR (-EBUSY ); +return NULL ; }/*
drivers/md/dm-zoned-reclaim.c +2 -2
@@ -349,8 +349,8 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc)/* Get a data zone */ dzone =dmz_get_zone_for_reclaim (zmd); -if (IS_ERR (dzone)) -return PTR_ERR (dzone); +if (!dzone) +return -EBUSY ; start = jiffies;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 281/388 scsi: target: tcmu: Fix a use after free in tcmu_check_expired_queue_cmd()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 9d7464b18892332e35ff37f0b024429a1a9835e6 ]
The pr_debug() dereferences "cmd" after we already freed it by calling tcmu_free_cmd(cmd). The debug printk needs to be done earlier.
--- drivers/target/target_core_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/target/target_core_user.c +3 -3
@@ -1292,13 +1292,13 @@ static void tcmu_check_expired_queue_cmd(struct tcmu_cmd *cmd)if (!time_after (jiffies, cmd->deadline))return ; +pr_debug ("Timing out queued cmd %p on dev %s.\n" , + cmd, cmd->tcmu_dev->name); +list_del_init (&cmd->queue_entry); se_cmd = cmd->se_cmd;tcmu_free_cmd (cmd); -pr_debug ("Timing out queued cmd %p on dev %s.\n" , - cmd, cmd->tcmu_dev->name); -target_complete_cmd (se_cmd,SAM_STAT_TASK_SET_FULL ); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 287/388 KVM: PPC: Book3S HV: Ignore kmemleak false positives
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit 0aca8a5575544bd21b3363058afb8f1e81505150 ]
kvmppc_pmd_alloc() and kvmppc_pte_alloc() allocate some memory but then pud_populate() and pmd_populate() will use __pa() to reference the newly allocated memory.
Since kmemleak is unable to track the physical memory resulting in false positives, silence those by using kmemleak_ignore().
unreferenced object 0xc000201c382a1000 (size 4096):
comm "qemu-kvm", pid 124828, jiffies 4295733767 (age 341.250s) hex dump (first 32 bytes):
c0 00 20 09 f4 60 03 87 c0 00 20 10 72 a0 03 87 .. ..`.... .r... c0 00 20 0e 13 a0 03 87 c0 00 20 1b dc c0 03 87 .. ....... .....
backtrace:
[<000000004cc2790f>] kvmppc_create_pte+0x838/0xd20 [kvm_hv] kvmppc_pmd_alloc at arch/powerpc/kvm/book3s_64_mmu_radix.c:366 (inlined by) kvmppc_create_pte at arch/powerpc/kvm/book3s_64_mmu_radix.c:590 [<00000000d123c49a>] kvmppc_book3s_instantiate_page+0x2e0/0x8c0 [kvm_hv] [<00000000bb549087>] kvmppc_book3s_radix_page_fault+0x1b4/0x2b0 [kvm_hv] [<0000000086dddc0e>] kvmppc_book3s_hv_page_fault+0x214/0x12a0 [kvm_hv] [<000000005ae9ccc2>] kvmppc_vcpu_run_hv+0xc5c/0x15f0 [kvm_hv] [<00000000d22162ff>] kvmppc_vcpu_run+0x34/0x48 [kvm] [<00000000d6953bc4>] kvm_arch_vcpu_ioctl_run+0x314/0x420 [kvm] [<000000002543dd54>] kvm_vcpu_ioctl+0x33c/0x950 [kvm] [<0000000048155cd6>] ksys_ioctl+0xd8/0x130 [<0000000041ffeaa7>] sys_ioctl+0x28/0x40 [<000000004afc4310>] system_call_exception+0x114/0x1e0 [<00000000fb70a873>] system_call_common+0xf0/0x278
unreferenced object 0xc0002001f0c03900 (size 256):
comm "qemu-kvm", pid 124830, jiffies 4295735235 (age 326.570s) hex dump (first 32 bytes):
c0 00 20 10 fa a0 03 87 c0 00 20 10 fa a1 03 87 .. ....... ..... c0 00 20 10 fa a2 03 87 c0 00 20 10 fa a3 03 87 .. ....... .....
backtrace:
[<0000000023f675b8>] kvmppc_create_pte+0x854/0xd20 [kvm_hv] kvmppc_pte_alloc at arch/powerpc/kvm/book3s_64_mmu_radix.c:356 (inlined by) kvmppc_create_pte at arch/powerpc/kvm/book3s_64_mmu_radix.c:593 [<00000000d123c49a>] kvmppc_book3s_instantiate_page+0x2e0/0x8c0 [kvm_hv] [<00000000bb549087>] kvmppc_book3s_radix_page_fault+0x1b4/0x2b0 [kvm_hv] [<0000000086dddc0e>] kvmppc_book3s_hv_page_fault+0x214/0x12a0 [kvm_hv] [<000000005ae9ccc2>] kvmppc_vcpu_run_hv+0xc5c/0x15f0 [kvm_hv] [<00000000d22162ff>] kvmppc_vcpu_run+0x34/0x48 [kvm] [<00000000d6953bc4>] kvm_arch_vcpu_ioctl_run+0x314/0x420 [kvm] [<000000002543dd54>] kvm_vcpu_ioctl+0x33c/0x950 [kvm] [<0000000048155cd6>] ksys_ioctl+0xd8/0x130 [<0000000041ffeaa7>] sys_ioctl+0x28/0x40 [<000000004afc4310>] system_call_exception+0x114/0x1e0 [<00000000fb70a873>] system_call_common+0xf0/0x278
--- arch/powerpc/kvm/book3s_64_mmu_radix.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_64_mmu_radix.c +14 -2
@@ -353,7 +353,13 @@ static struct kmem_cache *kvm_pmd_cache;static pte_t *kvmppc_pte_alloc (void ) { -return kmem_cache_alloc (kvm_pte_cache,GFP_KERNEL ); +pte_t *pte; + + pte =kmem_cache_alloc (kvm_pte_cache,GFP_KERNEL ); +/* pmd_populate() will only reference _pa(pte). */ +kmemleak_ignore (pte); + +return pte; }static void kvmppc_pte_free (pte_t *ptep)
@@ -363,7 +369,13 @@ static void kvmppc_pte_free(pte_t *ptep)static pmd_t *kvmppc_pmd_alloc (void ) { -return kmem_cache_alloc (kvm_pmd_cache,GFP_KERNEL ); +pmd_t *pmd; + + pmd =kmem_cache_alloc (kvm_pmd_cache,GFP_KERNEL ); +/* pud_populate() will only reference _pa(pmd). */ +kmemleak_ignore (pmd); + +return pmd; }static void kvmppc_pmd_free (pmd_t *pmdp)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 288/388 KVM: PPC: Book3S: Fix some RCU-list locks
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit ab8b65be183180c3eef405d449163964ecc4b571 ]
It is unsafe to traverse kvm->arch.spapr_tce_tables and stt->iommu_tables without the RCU read lock held. Also, add cond_resched_rcu() in places with the RCU read lock held that could take a while to finish.
arch/powerpc/kvm/book3s_64_vio.c:76 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
no locks held by qemu-kvm/4265.
stack backtrace: CPU: 96 PID: 4265 Comm: qemu-kvm Not tainted 5.7.0-rc4-next-20200508+ #2 Call Trace: [c000201a8690f720] [c000000000715948] dump_stack+0xfc/0x174 (unreliable) [c000201a8690f770] [c0000000001d9470] lockdep_rcu_suspicious+0x140/0x164 [c000201a8690f7f0] [c008000010b9fb48] kvm_spapr_tce_release_iommu_group+0x1f0/0x220 [kvm] [c000201a8690f870] [c008000010b8462c] kvm_spapr_tce_release_vfio_group+0x54/0xb0 [kvm] [c000201a8690f8a0] [c008000010b84710] kvm_vfio_destroy+0x88/0x140 [kvm] [c000201a8690f8f0] [c008000010b7d488] kvm_put_kvm+0x370/0x600 [kvm] [c000201a8690f990] [c008000010b7e3c0] kvm_vm_release+0x38/0x60 [kvm] [c000201a8690f9c0] [c0000000005223f4] __fput+0x124/0x330 [c000201a8690fa20] [c000000000151cd8] task_work_run+0xb8/0x130 [c000201a8690fa70] [c0000000001197e8] do_exit+0x4e8/0xfa0 [c000201a8690fb70] [c00000000011a374] do_group_exit+0x64/0xd0 [c000201a8690fbb0] [c000000000132c90] get_signal+0x1f0/0x1200 [c000201a8690fcc0] [c000000000020690] do_notify_resume+0x130/0x3c0 [c000201a8690fda0] [c000000000038d64] syscall_exit_prepare+0x1a4/0x280 [c000201a8690fe20] [c00000000000c8f8] system_call_common+0xf8/0x278
==
arch/powerpc/kvm/book3s_64_vio.c:368 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
2 locks held by qemu-kvm/4264:
#0: c000201ae2d000d8 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0xdc/0x950 [kvm] #1: c000200c9ed0c468 (&kvm->srcu){....}-{0:0}, at: kvmppc_h_put_tce+0x88/0x340 [kvm]
==
arch/powerpc/kvm/book3s_64_vio.c:108 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by qemu-kvm/4257:
#0: c000200b1b363a40 (&kv->lock){+.+.}-{3:3}, at: kvm_vfio_set_attr+0x598/0x6c0 [kvm]
==
arch/powerpc/kvm/book3s_64_vio.c:146 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by qemu-kvm/4257:
#0: c000200b1b363a40 (&kv->lock){+.+.}-{3:3}, at: kvm_vfio_set_attr+0x598/0x6c0 [kvm]
--- arch/powerpc/kvm/book3s_64_vio.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
arch/powerpc/kvm/book3s_64_vio.c +14 -4
@@ -73,6 +73,7 @@ extern void kvm_spapr_tce_release_iommu_group(struct kvm *kvm,struct kvmppc_spapr_tce_iommu_table *stit, *tmp;struct iommu_table_group *table_group =NULL ; +rcu_read_lock ();list_for_each_entry_rcu (stt, &kvm->arch.spapr_tce_tables, list) { table_group =iommu_group_get_iommudata (grp);
@@ -87,7 +88,9 @@ extern void kvm_spapr_tce_release_iommu_group(struct kvm *kvm,kref_put (&stit->kref, kvm_spapr_tce_liobn_put); } } +cond_resched_rcu (); } +rcu_read_unlock (); } extern long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd,
@@ -105,12 +108,14 @@ extern long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd,if (!f.file)return -EBADF ; +rcu_read_lock ();list_for_each_entry_rcu (stt, &kvm->arch.spapr_tce_tables, list) {if (stt = f.file->private_data) { found = true;break ; } } +rcu_read_unlock ();fdput (f);
@@ -143,6 +148,7 @@ extern long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd,if (!tbl)return -EINVAL ; +rcu_read_lock ();list_for_each_entry_rcu (stit, &stt->iommu_tables, next) {if (tbl != stit->tbl)continue ;
@@ -150,14 +156,17 @@ extern long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd,if (!kref_get_unless_zero (&stit->kref)) {/* stit is being destroyed */ iommu_tce_table_put (tbl); +rcu_read_unlock ();return -ENOTTY ; }/* * The table is already known to this KVM, we just increased * its KVM reference counter and can return. */ +rcu_read_unlock ();return 0 ; } +rcu_read_unlock (); stit =kzalloc (sizeof (*stit),GFP_KERNEL );if (!stit) {
@@ -365,18 +374,19 @@ static long kvmppc_tce_validate(struct kvmppc_spapr_tce_table *stt,if (kvmppc_tce_to_ua (stt->kvm, tce, &ua))return H_TOO_HARD ; +rcu_read_lock ();list_for_each_entry_rcu (stit, &stt->iommu_tables, next) {unsigned long hpa =0 ;struct mm_iommu_table_group_mem_t *mem;long shift = stit->tbl->it_page_shift; mem =mm_iommu_lookup (stt->kvm->mm, ua,1ULL << shift); -if (!mem) -return H_TOO_HARD ; - -if (mm_iommu_ua_to_hpa (mem, ua, shift, &hpa)) +if (!mem ||mm_iommu_ua_to_hpa (mem, ua, shift, &hpa)) { +rcu_read_unlock ();return H_TOO_HARD ; + } } +rcu_read_unlock ();return H_SUCCESS ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 289/388 KVM: PPC: Book3S HV: Relax check on H_SVM_INIT_ABORT
In reply to Sasha LevinFrom: Laurent Dufour <[email protected]>
[ Upstream commit e3326ae3d59e443a379367c6936941d6ab55d316 ]
The commit 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* Hcalls") added checks of secure bit of SRR1 to filter out the Hcall reserved to the Ultravisor.
However, the Hcall H_SVM_INIT_ABORT is made by the Ultravisor passing the context of the VM calling UV_ESM. This allows the Hypervisor to return to the guest without going through the Ultravisor. Thus the Secure bit of SRR1 is not set in that particular case.
In the case a regular VM is calling H_SVM_INIT_ABORT, this hcall will be filtered out in kvmppc_h_svm_init_abort() because kvm->arch.secure_guest is not set in that case.
--- arch/powerpc/kvm/book3s_hv.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
arch/powerpc/kvm/book3s_hv.c +8 -3
@@ -1099,9 +1099,14 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu) ret =kvmppc_h_svm_init_done (vcpu->kvm);break ;case H_SVM_INIT_ABORT : - ret =H_UNSUPPORTED ; -if (kvmppc_get_srr1 (vcpu) &MSR_S ) - ret =kvmppc_h_svm_init_abort (vcpu->kvm); +/* +* Even if that call is made by the Ultravisor, the SSR1 value +* is the guest context one, with the secure bit clear as it has +* not yet been secured. So we can't check it here. +* Instead the kvm->arch.secure_guest flag is checked inside +* kvmppc_h_svm_init_abort(). +*/ + ret =kvmppc_h_svm_init_abort (vcpu->kvm);break ;default :
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 313/388 openrisc: Fix issue with argument clobbering for clone/fork
In reply to Sasha LevinFrom: Stafford Horne <[email protected]>
[ Upstream commit 6bd140e14d9aaa734ec37985b8b20a96c0ece948 ]
Working on the OpenRISC glibc port I found that sometimes clone was working strange. That the tls data argument sent in r7 was always wrong. Further investigation revealed that the arguments were getting clobbered in the entry code. This patch removes the code that writes to the argument registers. This was likely due to some old code hanging around.
This patch fixes this up for clone and fork. This fork clobber is harmless but also useless so remove.
--- arch/openrisc/kernel/entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/openrisc/kernel/entry.S +2 -2
@@ -1166,13 +1166,13 @@ ENTRY(__sys_clone) l.movhi r29,hi(sys_clone) l.ori r29,r29,lo(sys_clone) l.j _fork_save_extra_regs_and_call - l.addi r7,r1,0 + l.nop ENTRY(__sys_fork) l.movhi r29,hi(sys_fork) l.ori r29,r29,lo(sys_fork) l.j _fork_save_extra_regs_and_call - l.addi r3,r1,0 + l.nop ENTRY(sys_rt_sigreturn) l.jal _sys_rt_sigreturn
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 314/388 drm/nouveau/disp/gm200-: fix NV_PDISP_SOR_HDMI2_CTRL(n) selection
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit a1ef8bad506e4ffa0c57ac5f8cb99ab5cbc3b1fc ]
This is a SOR register, and not indexed by the bound head.
Fixes display not coming up on high-bandwidth HDMI displays under a number of configurations.
--- drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmigm200.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmigm200.c +2 -2
@@ -27,10 +27,10 @@ void gm200_hdmi_scdc(struct nvkm_ior *ior, int head, u8 scdc) { struct nvkm_device *device = ior->disp->engine.subdev.device; -const u32 hoff = head *0x800 ; +const u32 soff =nv50_ior_base (ior);const u32 ctrl = scdc &0x3 ; -nvkm_mask (device,0x61c5bc + hoff,0x00000003 , ctrl); +nvkm_mask (device,0x61c5bc + soff,0x00000003 , ctrl); ior->tmds.high_speed = !!(scdc &0x2 ); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 315/388 ceph: don't return -ESTALE if there's still an open file
In reply to Sasha LevinFrom: Luis Henriques <[email protected]>
[ Upstream commit 878dabb64117406abd40977b87544d05bb3031fc ]
Similarly to commit 03f219041fdb ("ceph: check i_nlink while converting a file handle to dentry"), this fixes another corner case with name_to_handle_at/open_by_handle_at. The issue has been detected by xfstest generic/467, when doing:
- name_to_handle_at("/cephfs/myfile")
- open("/cephfs/myfile")
- unlink("/cephfs/myfile")
- sync; sync;
- drop caches
- open_by_handle_at()
The call to open_by_handle_at should not fail because the file hasn't been deleted yet (only unlinked) and we do have a valid handle to it. -ESTALE shall be returned only if i_nlink is 0 *and* i_count is 1.
This patch also makes sure we have LINK caps before checking i_nlink.
--- fs/ceph/export.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/ceph/export.c +8 -1
@@ -172,9 +172,16 @@ struct inode *ceph_lookup_inode(struct super_block *sb, u64 ino)static struct dentry *__fh_to_dentry (struct super_block *sb,u64 ino) {struct inode *inode =__lookup_inode (sb, ino); +int err; +if (IS_ERR (inode))return ERR_CAST (inode); -if (inode->i_nlink ==0 ) { +/* We need LINK caps to reliably check i_nlink */ + err =ceph_do_getattr (inode,CEPH_CAP_LINK_SHARED , false); +if (err) +return ERR_PTR (err); +/* -ESTALE if inode as been unlinked and no file is open */ +if ((inode->i_nlink ==0 ) && (atomic_read (&inode->i_count) ==1 )) {iput (inode);return ERR_PTR (-ESTALE ); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 317/388 pwm: imx27: Fix rounding behavior
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit aef1a3799b5cb3ba4841f6034497b179646ccc70 ]
To not trigger the warnings provided by CONFIG_PWM_DEBUG
- use up-rounding in .get_state()
- don't divide by the result of a division
- don't use the rounded counter value for the period length to calculate the counter value for the duty cycle
--- drivers/pwm/pwm-imx27.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/pwm/pwm-imx27.c +10 -10
@@ -150,13 +150,12 @@ static void pwm_imx27_get_state(struct pwm_chip *chip, prescaler =MX3_PWMCR_PRESCALER_GET (val); pwm_clk =clk_get_rate (imx->clk_per); - pwm_clk =DIV_ROUND_CLOSEST_ULL (pwm_clk, prescaler); val =readl (imx->mmio_base +MX3_PWMPR ); period = val >=MX3_PWMPR_MAX ?MX3_PWMPR_MAX : val;/* PWMOUT (Hz) = PWMCLK / (PWMPR + 2) */ - tmp =NSEC_PER_SEC * (u64)(period +2 ); - state->period =DIV_ROUND_CLOSEST_ULL (tmp, pwm_clk); + tmp =NSEC_PER_SEC * (u64)(period +2 ) * prescaler; + state->period =DIV_ROUND_UP_ULL (tmp, pwm_clk);/* * PWMSAR can be read only if PWM is enabled. If the PWM is disabled,
@@ -167,8 +166,8 @@ static void pwm_imx27_get_state(struct pwm_chip *chip,else val = imx->duty_cycle; - tmp =NSEC_PER_SEC * (u64)(val); - state->duty_cycle =DIV_ROUND_CLOSEST_ULL (tmp, pwm_clk); + tmp =NSEC_PER_SEC * (u64)(val) * prescaler; + state->duty_cycle =DIV_ROUND_UP_ULL (tmp, pwm_clk);pwm_imx27_clk_disable_unprepare (imx); }
@@ -220,22 +219,23 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm,struct pwm_imx27_chip *imx =to_pwm_imx27_chip (chip);struct pwm_state cstate;unsigned long long c; +unsigned long long clkrate;int ret;u32 cr;pwm_get_state (pwm, &cstate); - c =clk_get_rate (imx->clk_per); - c *= state->period; + clkrate =clk_get_rate (imx->clk_per); + c = clkrate * state->period; -do_div (c,1000000000 ); +do_div (c,NSEC_PER_SEC ); period_cycles = c; prescale = period_cycles /0x10000 +1 ; period_cycles /= prescale; - c = (unsigned long long )period_cycles * state->duty_cycle; -do_div (c, state->period); + c = clkrate * state->duty_cycle; +do_div (c,NSEC_PER_SEC * prescale); duty_cycles = c;/*
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 318/388 gfs2: Allow lock_nolock mount to specify jid=X
In reply to Sasha LevinFrom: Bob Peterson <[email protected]>
[ Upstream commit ea22eee4e6027d8927099de344f7fff43c507ef9 ]
Before this patch, a simple typo accidentally added \n to the jid= string for lock_nolock mounts. This made it impossible to mount a gfs2 file system with a journal other than journal0. Thus:
mount -tgfs2 -o hostdata="jid=1" <device> <mount pt>
Resulted in:
mount: wrong fs type, bad option, bad superblock on <device>
In most cases this is not a problem. However, for debugging and testing purposes we sometimes want to test the integrity of other journals. This patch removes the unnecessary \n and thus allows lock_nolock users to specify an alternate journal.
--- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/ops_fstype.c +1 -1
@@ -880,7 +880,7 @@ static int init_per_node(struct gfs2_sbd *sdp, int undo) }static const match_table_t nolock_tokens = { - { Opt_jid,"jid=%d\n" , }, + { Opt_jid,"jid=%d" , }, { Opt_err,NULL }, };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 343/388 gfs2: fix use-after-free on transaction ail lists
In reply to Sasha LevinFrom: Bob Peterson <[email protected]>
[ Upstream commit 83d060ca8d90fa1e3feac227f995c013100862d3 ]
Before this patch, transactions could be merged into the system transaction by function gfs2_merge_trans(), but the transaction ail lists were never merged. Because the ail flushing mechanism can run separately, bd elements can be attached to the transaction's buffer list during the transaction (trans_add_meta, etc) but quickly moved to its ail lists. Later, in function gfs2_trans_end, the transaction can be freed (by gfs2_trans_end) while it still has bd elements queued to its ail lists, which can cause it to either lose track of the bd elements altogether (memory leak) or worse, reference the bd elements after the parent transaction has been freed.
Although I've not seen any serious consequences, the problem becomes apparent with the previous patch's addition of:
gfs2_assert_warn(sdp, list_empty(&tr->tr_ail1_list));
to function gfs2_trans_free().
This patch adds logic into gfs2_merge_trans() to move the merged transaction's ail lists to the sdp transaction. This prevents the use-after-free. To do this properly, we need to hold the ail lock, so we pass sdp into the function instead of the transaction itself.
--- fs/gfs2/log.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
fs/gfs2/log.c +9 -2
@@ -1003,8 +1003,10 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)* @new: New transaction to be merged */ -static void gfs2_merge_trans (struct gfs2_trans *old,struct gfs2_trans *new) +static void gfs2_merge_trans (struct gfs2_sbd *sdp,struct gfs2_trans *new) { +struct gfs2_trans *old = sdp->sd_log_tr; +WARN_ON_ONCE (!test_bit (TR_ATTACHED , &old->tr_flags)); old->tr_num_buf_new += new->tr_num_buf_new;
@@ -1016,6 +1018,11 @@ static void gfs2_merge_trans(struct gfs2_trans *old, struct gfs2_trans *new)list_splice_tail_init (&new->tr_databuf, &old->tr_databuf);list_splice_tail_init (&new->tr_buf, &old->tr_buf); + +spin_lock (&sdp->sd_ail_lock); +list_splice_tail_init (&new->tr_ail1_list, &old->tr_ail1_list); +list_splice_tail_init (&new->tr_ail2_list, &old->tr_ail2_list); +spin_unlock (&sdp->sd_ail_lock); }static void log_refund (struct gfs2_sbd *sdp,struct gfs2_trans *tr)
@@ -1027,7 +1034,7 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr)gfs2_log_lock (sdp);if (sdp->sd_log_tr) { -gfs2_merge_trans (sdp->sd_log_tr, tr); +gfs2_merge_trans (sdp, tr); }else if (tr->tr_num_buf_new || tr->tr_num_databuf_new) {gfs2_assert_withdraw (sdp,test_bit (TR_ALLOCED , &tr->tr_flags)); sdp->sd_log_tr = tr;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 383/388 iavf: fix speed reporting over virtchnl
In reply to Sasha LevinFrom: Brett Creeley <[email protected]>
[ Upstream commit e0ef26fbe2b0c62f42ba7667076dc38b693b6fb8 ]
Link speeds are communicated over virtchnl using an enum virtchnl_link_speed. Currently, the highest link speed is 40Gbps which leaves us unable to reflect some speeds that an ice VF is capable of. This causes link speed to be misreported on the iavf driver.
Allow for communicating link speeds using Mbps so that the proper speed can be reported for an ice VF. Moving away from the enum allows us to communicate future speed changes without requiring a new enum to be added.
In order to support communicating link speeds over virtchnl in Mbps the following functionality was added:
- Added u32 link_speed_mbps in the iavf_adapter structure.
- Added the macro ADV_LINK_SUPPORT(_a) to determine if the VF driver supports communicating link speeds in Mbps.
- Added the function iavf_get_vpe_link_status() to fill the correct link_status in the event_data union based on the ADV_LINK_SUPPORT(_a) macro.
- Added the function iavf_set_adapter_link_speed_from_vpe() to determine whether or not to fill the u32 link_speed_mbps or enum virtchnl_link_speed link_speed field in the iavf_adapter structure based on the ADV_LINK_SUPPORT(_a) macro.
- Do not free vf_res in iavf_init_get_resources() as vf_res will be accessed in iavf_get_link_ksettings(); memset to 0 instead. This memory is subsequently freed in iavf_remove().
--- drivers/net/ethernet/intel/iavf/iavf.h | 14 +++ .../net/ethernet/intel/iavf/iavf_ethtool.c | 14 ++- drivers/net/ethernet/intel/iavf/iavf_main.c | 25 ++++-- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 88 ++++++++++++++++--- 4 files changed, 120 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +14 -0
@@ -87,6 +87,10 @@ struct iavf_vsi {#define IAVF_HLUT_ARRAY_SIZE ((IAVF_VFQF_HLUT_MAX_INDEX + 1) * 4)#define IAVF_MBPS_DIVISOR 125000/* divisor to convert to Mbps */ +#define IAVF_VIRTCHNL_VF_RESOURCE_SIZE (sizeof(struct virtchnl_vf_resource) + \ + (IAVF_MAX_VF_VSI * \ + sizeof(struct virtchnl_vsi_resource))) +/* MAX_MSIX_Q_VECTORS of these are allocated, * but we only use one per queue-specific vector. */
@@ -306,6 +310,14 @@ struct iavf_adapter {bool netdev_registered;bool link_up;enum virtchnl_link_speed link_speed; +/* This is only populated if the VIRTCHNL_VF_CAP_ADV_LINK_SPEED is set +* in vf_res->vf_cap_flags. Use ADV_LINK_SUPPORT macro to determine if +* this field is valid. This field should be used going forward and the +* enum virtchnl_link_speed above should be considered the legacy way of +* storing/communicating link speeds. +*/ +u32 link_speed_mbps; +enum virtchnl_ops current_op;#define CLIENT_ALLOWED (_a) ((_a)->vf_res ? \ (_a)->vf_res->vf_cap_flags & \
@@ -322,6 +334,8 @@ struct iavf_adapter { VIRTCHNL_VF_OFFLOAD_RSS_PF)))#define VLAN_ALLOWED (_a) ((_a)->vf_res->vf_cap_flags & \ VIRTCHNL_VF_OFFLOAD_VLAN) +#define ADV_LINK_SUPPORT (_a) ((_a)->vf_res->vf_cap_flags & \ + VIRTCHNL_VF_CAP_ADV_LINK_SPEED)struct virtchnl_vf_resource *vf_res;/* incl. all VSIs */ struct virtchnl_vsi_resource *vsi_res;/* our LAN VSI */ struct virtchnl_version_info pf_version;
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +12 -2
@@ -278,7 +278,18 @@ static int iavf_get_link_ksettings(struct net_device *netdev,ethtool_link_ksettings_zero_link_mode (cmd, supported); cmd->base.autoneg =AUTONEG_DISABLE ; cmd->base.port =PORT_NONE ; -/* Set speed and duplex */ + cmd->base.duplex =DUPLEX_FULL ; + +if (ADV_LINK_SUPPORT (adapter)) { +if (adapter->link_speed_mbps && + adapter->link_speed_mbps <U32_MAX ) + cmd->base.speed = adapter->link_speed_mbps; +else + cmd->base.speed =SPEED_UNKNOWN ; + +return 0 ; + } +switch (adapter->link_speed) {case IAVF_LINK_SPEED_40GB : cmd->base.speed =SPEED_40000 ;
@@ -306,7 +317,6 @@ static int iavf_get_link_ksettings(struct net_device *netdev,default :break ; } - cmd->base.duplex =DUPLEX_FULL ;return 0 ; }
drivers/net/ethernet/intel/iavf/iavf_main.c +18 -7
@@ -1756,17 +1756,17 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter)struct net_device *netdev = adapter->netdev;struct pci_dev *pdev = adapter->pdev;struct iavf_hw *hw = &adapter->hw; -int err =0 , bufsz; +int err;WARN_ON (adapter->state != __IAVF_INIT_GET_RESOURCES);/* aq msg sent, awaiting reply */ if (!adapter->vf_res) { - bufsz =sizeof (struct virtchnl_vf_resource ) + - (IAVF_MAX_VF_VSI * -sizeof (struct virtchnl_vsi_resource )); - adapter->vf_res =kzalloc (bufsz,GFP_KERNEL ); -if (!adapter->vf_res) + adapter->vf_res =kzalloc (IAVF_VIRTCHNL_VF_RESOURCE_SIZE , +GFP_KERNEL ); +if (!adapter->vf_res) { + err = -ENOMEM ; goto err; + } } err =iavf_get_vf_config (adapter);if (err ==IAVF_ERR_ADMIN_QUEUE_NO_WORK ) {
@@ -2036,7 +2036,7 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)iavf_reset_interrupt_capability (adapter);iavf_free_queues (adapter);iavf_free_q_vectors (adapter); -kfree (adapter->vf_res); +memset (adapter->vf_res,0 ,IAVF_VIRTCHNL_VF_RESOURCE_SIZE );iavf_shutdown_adminq (&adapter->hw); adapter->netdev->flags &= ~IFF_UP ;clear_bit (__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);
@@ -2487,6 +2487,16 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter, {int speed =0 , ret =0 ; +if (ADV_LINK_SUPPORT (adapter)) { +if (adapter->link_speed_mbps <U32_MAX ) { + speed = adapter->link_speed_mbps; + goto validate_bw; + }else { +dev_err (&adapter->pdev->dev,"Unknown link speed\n" ); +return -EINVAL ; + } + } +switch (adapter->link_speed) {case IAVF_LINK_SPEED_40GB : speed =40000 ;
@@ -2510,6 +2520,7 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter,break ; } +validate_bw:if (max_tx_rate > speed) {dev_err (&adapter->pdev->dev,"Invalid tx rate specified\n" );
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +76 -12
138 lines not on this page · raw message
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 1/388 staging: wfx: fix potential deadlock in wfx_tx_flush()
From: Jérôme Pouiller <[email protected]>
[ Upstream commit a39e761aa4fefa2a8aaf549217329933b91da7c9 ]
wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames.
Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current code is more restrictive that it should.
Note that wfx_tx_flush() release the lock before to return while wfx_tx_lock_flush() keep the lock.
--- drivers/staging/wfx/queue.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/wfx/queue.c +2 -0
@@ -35,6 +35,7 @@ void wfx_tx_flush(struct wfx_dev *wdev)if (wdev->chip_frozen)return ; +wfx_tx_lock (wdev);mutex_lock (&wdev->hif_cmd.lock); ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used,
@@ -47,6 +48,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) wdev->chip_frozen =1 ; }mutex_unlock (&wdev->hif_cmd.lock); +wfx_tx_unlock (wdev); }void wfx_tx_lock_flush (struct wfx_dev *wdev)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 2/388 power: supply: bq24257_charger: Replace depends on REGMAP_I2C with select
From: Enric Balletbo i Serra <[email protected]>
[ Upstream commit 87c3d579c8ed0eaea6b1567d529a8daa85a2bc6c ]
regmap is a library function that gets selected by drivers that need it. No driver modules should depend on it. Depending on REGMAP_I2C makes this driver only build if another driver already selected REGMAP_I2C, as the symbol can't be selected through the menu kernel configuration.
--- drivers/power/supply/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/Kconfig +1 -1
@@ -577,7 +577,7 @@ config CHARGER_BQ24257 tristate "TI BQ24250/24251/24257 battery charger driver" depends on I2C depends on GPIOLIB || COMPILE_TEST - depends on REGMAP_I2C + select REGMAP_I2C help Say Y to enable support for the TI BQ24250, BQ24251, and BQ24257 battery chargers.
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 5/388 rtc: rc5t619: Fix an ERR_PTR vs NULL check
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 11ddbdfb68e4f9791e4bd4f8d7c87d3f19670967 ]
The devm_kzalloc() function returns NULL on error, it doesn't return error pointers so this check doesn't work.
--- drivers/rtc/rtc-rc5t619.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/rtc/rtc-rc5t619.c +1 -3
@@ -356,10 +356,8 @@ static int rc5t619_rtc_probe(struct platform_device *pdev)int err; rtc =devm_kzalloc (dev,sizeof (*rtc),GFP_KERNEL ); -if (IS_ERR (rtc)) { - err =PTR_ERR (rtc); +if (!rtc)return -ENOMEM ; - } rtc->rn5t618 = rn5t618;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 9/388 iio: light: isl29125: fix iio_triggered_buffer_{predisable,postenable} positions
In reply to Sasha LevinFrom: Alexandru Ardelean <[email protected]>
[ Upstream commit 9b7a12c3e090cf3fba6f66f1f23abbc6e0e86021 ]
The iio_triggered_buffer_{predisable,postenable} functions attach/detach the poll functions.
For the predisable hook, the disable code should occur before detaching the poll func, and for the postenable hook, the poll func should be attached before the enable code.
This change reworks the predisable/postenable hooks so that the pollfunc is attached/detached in the correct position.
It also balances the calls a bit, by grouping the preenable and the iio_triggered_buffer_postenable() into a single isl29125_buffer_postenable() function.
--- drivers/iio/light/isl29125.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/iio/light/isl29125.c +19 -9
@@ -213,13 +213,24 @@ static const struct iio_info isl29125_info = { .attrs = &isl29125_attribute_group, }; -static int isl29125_buffer_preenable (struct iio_dev *indio_dev) +static int isl29125_buffer_postenable (struct iio_dev *indio_dev) {struct isl29125_data *data =iio_priv (indio_dev); +int err; + + err =iio_triggered_buffer_postenable (indio_dev); +if (err) +return err; data->conf1 |=ISL29125_MODE_RGB ; -return i2c_smbus_write_byte_data (data->client,ISL29125_CONF1 , + err =i2c_smbus_write_byte_data (data->client,ISL29125_CONF1 , data->conf1); +if (err) { +iio_triggered_buffer_predisable (indio_dev); +return err; + } + +return 0 ; }static int isl29125_buffer_predisable (struct iio_dev *indio_dev)
@@ -227,19 +238,18 @@ static int isl29125_buffer_predisable(struct iio_dev *indio_dev)struct isl29125_data *data =iio_priv (indio_dev);int ret; - ret =iio_triggered_buffer_predisable (indio_dev); -if (ret <0 ) -return ret; - data->conf1 &= ~ISL29125_MODE_MASK ; data->conf1 |=ISL29125_MODE_PD ; -return i2c_smbus_write_byte_data (data->client,ISL29125_CONF1 , + ret =i2c_smbus_write_byte_data (data->client,ISL29125_CONF1 , data->conf1); + +iio_triggered_buffer_predisable (indio_dev); + +return ret; }static const struct iio_buffer_setup_ops isl29125_buffer_setup_ops = { - .preenable = isl29125_buffer_preenable, - .postenable = &iio_triggered_buffer_postenable, + .postenable = isl29125_buffer_postenable, .predisable = isl29125_buffer_predisable, };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 10/388 remoteproc: Fix IDR initialisation in rproc_alloc()
In reply to Sasha LevinFrom: Alex Elder <[email protected]>
[ Upstream commit 6442df49400b466431979e7634849a464a5f1861 ]
If ida_simple_get() returns an error when called in rproc_alloc(), put_device() is called to clean things up. By this time the rproc device type has been assigned, with rproc_type_release() as the release function.
The first thing rproc_type_release() does is call:
idr_destroy(&rproc->notifyids);
But at the time the ida_simple_get() call is made, the notifyids field in the remoteproc structure has not been initialized.
I'm not actually sure this case causes an observable problem, but it's incorrect. Fix this by initializing the notifyids field before calling ida_simple_get() in rproc_alloc().
--- drivers/remoteproc/remoteproc_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/remoteproc/remoteproc_core.c +1 -2
@@ -2053,6 +2053,7 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->dev.type = &rproc_type; rproc->dev.class = &rproc_class; rproc->dev.driver_data = rproc; +idr_init (&rproc->notifyids);/* Assign a unique device index and name */ rproc->index =ida_simple_get (&rproc_dev_index,0 ,0 ,GFP_KERNEL );
@@ -2078,8 +2079,6 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,mutex_init (&rproc->lock); -idr_init (&rproc->notifyids); -INIT_LIST_HEAD (&rproc->carveouts);INIT_LIST_HEAD (&rproc->mappings);INIT_LIST_HEAD (&rproc->traces);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 13/388 ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet
In reply to Sasha LevinFrom: Shengjiu Wang <[email protected]>
[ Upstream commit 1fecbb71fe0e46b886f84e3b6decca6643c3af6d ]
Disable exception interrupt before scheduling tasklet, otherwise if the tasklet isn't handled immediately, there will be endless xrun interrupt.
--- sound/soc/fsl/fsl_esai.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/fsl/fsl_esai.c +4 -0
@@ -87,6 +87,10 @@ static irqreturn_t esai_isr(int irq, void *devid)if ((saisr & (ESAI_SAISR_TUE |ESAI_SAISR_ROE )) && esai_priv->reset_at_xrun) {dev_dbg (&pdev->dev,"reset module for xrun\n" ); +regmap_update_bits (esai_priv->regmap,REG_ESAI_TCR , + ESAI_xCR_xEIE_MASK,0 ); +regmap_update_bits (esai_priv->regmap,REG_ESAI_RCR , + ESAI_xCR_xEIE_MASK,0 );tasklet_schedule (&esai_priv->task); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 16/388 ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type
In reply to Sasha LevinFrom: Xiyu Yang <[email protected]>
[ Upstream commit a697ae6ea56e23397341b027098c1b11d9ab13da ]
davinci_mcasp_get_dma_type() invokes dma_request_chan(), which returns a reference of the specified dma_chan object to "chan" with increased refcnt.
When davinci_mcasp_get_dma_type() returns, local variable "chan" becomes invalid, so the refcount should be decreased to keep refcount balanced.
The reference counting issue happens in one exception handling path of davinci_mcasp_get_dma_type(). When chan device is NULL, the function forgets to decrease the refcnt increased by dma_request_chan(), causing a refcnt leak.
Fix this issue by calling dma_release_channel() when chan device is NULL.
--- sound/soc/ti/davinci-mcasp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/ti/davinci-mcasp.c +3 -1
@@ -1896,8 +1896,10 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp) PTR_ERR(chan));return PTR_ERR (chan); } -if (WARN_ON (!chan->device || !chan->device->dev)) +if (WARN_ON (!chan->device || !chan->device->dev)) { +dma_release_channel (chan);return -EINVAL ; + }if (chan->device->dev->of_node) ret = of_property_read_string(chan->device->dev->of_node,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 20/388 ASoC: codecs: wm97xx: fix ac97 dependency
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit ee2cbe06935bfa58f1fe07dc2a2283945f4b97dc ]
A recent build fix got the dependency slightly wrong, breaking builds with CONFIG_AC97_BUS_NEW:
WARNING: unmet direct dependencies detected for SND_SOC_WM9713
Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n]
Selected by [m]:
- SND_SOC_ZYLONITE [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && MACH_ZYLONITE [=y] && AC97_BUS [=n]=n
WARNING: unmet direct dependencies detected for SND_SOC_WM9712
Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n]
Selected by [m]:
- SND_PXA2XX_SOC_EM_X270 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && (MACH_EM_X270 [=n] || MACH_EXEDA [=n] || MACH_CM_X300 [=y]) && AC97_BUS [=n]=n
Change the dependency to allow either version of the AC97 library code.
--- sound/soc/codecs/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/Kconfig +3 -3
@@ -1620,19 +1620,19 @@ config SND_SOC_WM9090 config SND_SOC_WM9705 tristate - depends on SND_SOC_AC97_BUS + depends on SND_SOC_AC97_BUS || AC97_BUS_NEW select REGMAP_AC97 select AC97_BUS_COMPAT if AC97_BUS_NEW config SND_SOC_WM9712 tristate - depends on SND_SOC_AC97_BUS + depends on SND_SOC_AC97_BUS || AC97_BUS_NEW select REGMAP_AC97 select AC97_BUS_COMPAT if AC97_BUS_NEW config SND_SOC_WM9713 tristate - depends on SND_SOC_AC97_BUS + depends on SND_SOC_AC97_BUS || AC97_BUS_NEW select REGMAP_AC97 select AC97_BUS_COMPAT if AC97_BUS_NEW
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 17/388 ARM: integrator: Add some Kconfig selections
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit d2854bbe5f5c4b4bec8061caf4f2e603d8819446 ]
The CMA and DMA_CMA Kconfig options need to be selected by the Integrator in order to produce boot console on some Integrator systems.
The REGULATOR and REGULATOR_FIXED_VOLTAGE need to be selected in order to boot the system from an external MMC card when using MMCI/PL181 from the device tree probe path.
Select these things directly from the Kconfig so we are sure to be able to bring the systems up with console from any device tree.
--- arch/arm/mach-integrator/Kconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-integrator/Kconfig +4 -3
@@ -4,6 +4,8 @@ menuconfig ARCH_INTEGRATOR depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6 select ARM_AMBA select COMMON_CLK_VERSATILE + select CMA + select DMA_CMA select HAVE_TCM select ICST select MFD_SYSCON
@@ -35,14 +37,13 @@ config INTEGRATOR_IMPD1 select ARM_VIC select GPIO_PL061 select GPIOLIB + select REGULATOR + select REGULATOR_FIXED_VOLTAGE help The IM-PD1 is an add-on logic module for the Integrator which allows ARM(R) Ltd PrimeCells to be developed and evaluated. The IM-PD1 can be found on the Integrator/PP2 platform. - To compile this driver as a module, choose M here: the - module will be called impd1. - config INTEGRATOR_CM7TDMI bool "Integrator/CM7TDMI core module" depends on ARCH_INTEGRATOR_AP
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 22/388 scsi: core: free sgtables in case command setup fails
In reply to Sasha LevinFrom: Johannes Thumshirn <[email protected]>
[ Upstream commit 20a66f2bf280277ab5bb22e27445153b4eb0ac88 ]
In case scsi_setup_fs_cmnd() fails we're not freeing the sgtables allocated by scsi_init_io(), thus we leak the allocated memory.
Free the sgtables allocated by scsi_init_io() in case scsi_setup_fs_cmnd() fails.
Technically scsi_setup_scsi_cmnd() does not suffer from this problem as it can only fail if scsi_init_io() fails, so it does not have sgtables allocated. But to maintain symmetry and as a measure of defensive programming, free the sgtables on scsi_setup_scsi_cmnd() failure as well. scsi_mq_free_sgtables() has safeguards against double-freeing of memory so this is safe to do.
While we're at it, rename scsi_mq_free_sgtables() to scsi_free_sgtables().
--- drivers/scsi/scsi_lib.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/scsi/scsi_lib.c +11 -5
@@ -548,7 +548,7 @@ static void scsi_uninit_cmd(struct scsi_cmnd *cmd) } } -static void scsi_mq_free_sgtables (struct scsi_cmnd *cmd) +static void scsi_free_sgtables (struct scsi_cmnd *cmd) {if (cmd->sdb.table.nents) sg_free_table_chained(&cmd->sdb.table,
@@ -560,7 +560,7 @@ static void scsi_mq_free_sgtables(struct scsi_cmnd *cmd)static void scsi_mq_uninit_cmd (struct scsi_cmnd *cmd) { -scsi_mq_free_sgtables (cmd); +scsi_free_sgtables (cmd);scsi_uninit_cmd (cmd); }
@@ -1059,7 +1059,7 @@ blk_status_t scsi_init_io(struct scsi_cmnd *cmd)return BLK_STS_OK ; out_free_sgtables: -scsi_mq_free_sgtables (cmd); +scsi_free_sgtables (cmd);return ret; }EXPORT_SYMBOL (scsi_init_io);
@@ -1190,6 +1190,7 @@ static blk_status_t scsi_setup_cmnd(struct scsi_device *sdev, struct request *req) {struct scsi_cmnd *cmd =blk_mq_rq_to_pdu (req); +blk_status_t ret;if (!blk_rq_bytes (req)) cmd->sc_data_direction =DMA_NONE ;
@@ -1199,9 +1200,14 @@ static blk_status_t scsi_setup_cmnd(struct scsi_device *sdev, cmd->sc_data_direction =DMA_FROM_DEVICE ;if (blk_rq_is_scsi (req)) -return scsi_setup_scsi_cmnd (sdev, req); + ret =scsi_setup_scsi_cmnd (sdev, req);else -return scsi_setup_fs_cmnd (sdev, req); + ret =scsi_setup_fs_cmnd (sdev, req); + +if (ret !=BLK_STS_OK ) +scsi_free_sgtables (cmd); + +return ret; } static blk_status_t
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 7/388 ASoC: SOF: imx8: Fix randbuild error
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit fe17e6cdc0fefca96ba9659be4b2b07487cbf0c5 ]
when do randconfig like this:CONFIG_SND_SOC_SOF_IMX8_SUPPORT=yCONFIG_SND_SOC_SOF_IMX8=yCONFIG_SND_SOC_SOF_OF=yCONFIG_IMX_DSP=mCONFIG_IMX_SCU=y
there is a link error:
sound/soc/sof/imx/imx8.o: In function 'imx8_send_msg':
imx8.c:(.text+0x380): undefined reference to 'imx_dsp_ring_doorbell'
Select IMX_DSP in SND_SOC_SOF_IMX8_SUPPORT to fix this
--- sound/soc/sof/imx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/imx/Kconfig +1 -1
@@ -14,7 +14,7 @@ if SND_SOC_SOF_IMX_TOPLEVEL config SND_SOC_SOF_IMX8_SUPPORT bool "SOF support for i.MX8" depends on IMX_SCU - depends on IMX_DSP + select IMX_DSP help This adds support for Sound Open Firmware for NXP i.MX8 platforms Say Y if you have such a device.
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 15/388 ARM: dts: renesas: Fix IOMMU device node names
In reply to Sasha LevinFrom: Yoshihiro Shimoda <[email protected]>
[ Upstream commit ae990a1de014396ffc8d0fcc31b6888c9b0ce59a ]
Fix IOMMU device node names as "iommu@".
--- arch/arm/boot/dts/r8a7743.dtsi | 12 ++++++------ arch/arm/boot/dts/r8a7744.dtsi | 12 ++++++------ arch/arm/boot/dts/r8a7745.dtsi | 12 ++++++------ arch/arm/boot/dts/r8a7790.dtsi | 12 ++++++------ arch/arm/boot/dts/r8a7791.dtsi | 14 +++++++------- arch/arm/boot/dts/r8a7793.dtsi | 14 +++++++------- arch/arm/boot/dts/r8a7794.dtsi | 12 ++++++------ 7 files changed, 44 insertions(+), 44 deletions(-)
arch/arm/boot/dts/r8a7743.dtsi +6 -6
@@ -338,7 +338,7 @@ thermal: thermal@e61f0000 { #thermal-sensor-cells = <0>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7743", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -348,7 +348,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7743", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -357,7 +357,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7743", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -367,7 +367,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7743", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -376,7 +376,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7743", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -386,7 +386,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_gp: mmu@e62a0000 { + ipmmu_gp: iommu@e62a0000 { compatible = "renesas,ipmmu-r8a7743", "renesas,ipmmu-vmsa"; reg = <0 0xe62a0000 0 0x1000>;
arch/arm/boot/dts/r8a7744.dtsi +6 -6
@@ -338,7 +338,7 @@ thermal: thermal@e61f0000 { #thermal-sensor-cells = <0>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7744", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -348,7 +348,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7744", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -357,7 +357,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7744", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -367,7 +367,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7744", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -376,7 +376,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7744", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -386,7 +386,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_gp: mmu@e62a0000 { + ipmmu_gp: iommu@e62a0000 { compatible = "renesas,ipmmu-r8a7744", "renesas,ipmmu-vmsa"; reg = <0 0xe62a0000 0 0x1000>;
arch/arm/boot/dts/r8a7745.dtsi +6 -6
@@ -302,7 +302,7 @@ irqc: interrupt-controller@e61c0000 { resets = <&cpg 407>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7745", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -312,7 +312,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7745", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -321,7 +321,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7745", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -331,7 +331,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7745", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -340,7 +340,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7745", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -350,7 +350,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_gp: mmu@e62a0000 { + ipmmu_gp: iommu@e62a0000 { compatible = "renesas,ipmmu-r8a7745", "renesas,ipmmu-vmsa"; reg = <0 0xe62a0000 0 0x1000>;
arch/arm/boot/dts/r8a7790.dtsi +6 -6
@@ -427,7 +427,7 @@ thermal: thermal@e61f0000 { #thermal-sensor-cells = <0>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -437,7 +437,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -446,7 +446,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -456,7 +456,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -465,7 +465,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -475,7 +475,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_rt: mmu@ffc80000 { + ipmmu_rt: iommu@ffc80000 { compatible = "renesas,ipmmu-r8a7790", "renesas,ipmmu-vmsa"; reg = <0 0xffc80000 0 0x1000>;
arch/arm/boot/dts/r8a7791.dtsi +7 -7
@@ -350,7 +350,7 @@ thermal: thermal@e61f0000 { #thermal-sensor-cells = <0>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -360,7 +360,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -369,7 +369,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -379,7 +379,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -388,7 +388,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -398,7 +398,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_rt: mmu@ffc80000 { + ipmmu_rt: iommu@ffc80000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xffc80000 0 0x1000>;
@@ -407,7 +407,7 @@ ipmmu_rt: mmu@ffc80000 { status = "disabled"; }; - ipmmu_gp: mmu@e62a0000 { + ipmmu_gp: iommu@e62a0000 { compatible = "renesas,ipmmu-r8a7791", "renesas,ipmmu-vmsa"; reg = <0 0xe62a0000 0 0x1000>;
arch/arm/boot/dts/r8a7793.dtsi +7 -7
@@ -336,7 +336,7 @@ thermal: thermal@e61f0000 { #thermal-sensor-cells = <0>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -346,7 +346,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -355,7 +355,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -365,7 +365,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -374,7 +374,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -384,7 +384,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_rt: mmu@ffc80000 { + ipmmu_rt: iommu@ffc80000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xffc80000 0 0x1000>;
@@ -393,7 +393,7 @@ ipmmu_rt: mmu@ffc80000 { status = "disabled"; }; - ipmmu_gp: mmu@e62a0000 { + ipmmu_gp: iommu@e62a0000 { compatible = "renesas,ipmmu-r8a7793", "renesas,ipmmu-vmsa"; reg = <0 0xe62a0000 0 0x1000>;
arch/arm/boot/dts/r8a7794.dtsi +6 -6
@@ -290,7 +290,7 @@ irqc0: interrupt-controller@e61c0000 { resets = <&cpg 407>; }; - ipmmu_sy0: mmu@e6280000 { + ipmmu_sy0: iommu@e6280000 { compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; reg = <0 0xe6280000 0 0x1000>;
@@ -300,7 +300,7 @@ ipmmu_sy0: mmu@e6280000 { status = "disabled"; }; - ipmmu_sy1: mmu@e6290000 { + ipmmu_sy1: iommu@e6290000 { compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; reg = <0 0xe6290000 0 0x1000>;
@@ -309,7 +309,7 @@ ipmmu_sy1: mmu@e6290000 { status = "disabled"; }; - ipmmu_ds: mmu@e6740000 { + ipmmu_ds: iommu@e6740000 { compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; reg = <0 0xe6740000 0 0x1000>;
@@ -319,7 +319,7 @@ ipmmu_ds: mmu@e6740000 { status = "disabled"; }; - ipmmu_mp: mmu@ec680000 { + ipmmu_mp: iommu@ec680000 { compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; reg = <0 0xec680000 0 0x1000>;
@@ -328,7 +328,7 @@ ipmmu_mp: mmu@ec680000 { status = "disabled"; }; - ipmmu_mx: mmu@fe951000 { + ipmmu_mx: iommu@fe951000 { compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; reg = <0 0xfe951000 0 0x1000>;
@@ -338,7 +338,7 @@ ipmmu_mx: mmu@fe951000 { status = "disabled"; }; - ipmmu_gp: mmu@e62a0000 { + ipmmu_gp: iommu@e62a0000 { compatible = "renesas,ipmmu-r8a7794", "renesas,ipmmu-vmsa"; reg = <0 0xe62a0000 0 0x1000>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 3/388 clk: sunxi: Fix incorrect usage of round_down()
In reply to Sasha LevinFrom: Rikard Falkeborn <[email protected]>
[ Upstream commit ee25d9742dabed3fd18158b518f846abeb70f319 ]
round_down() can only round to powers of 2. If round_down() is asked to round to something that is not a power of 2, incorrect results are produced. The incorrect results can be both too large and too small.
Instead, use rounddown() which can round to any number.
--- drivers/clk/sunxi/clk-sunxi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi/clk-sunxi.c +1 -1
@@ -90,7 +90,7 @@ static void sun6i_a31_get_pll1_factors(struct factors_request *req)* Round down the frequency to the closest multiple of either * 6 or 16 */ -u32 round_freq_6 =round_down (freq_mhz,6 ); +u32 round_freq_6 =rounddown (freq_mhz,6 );u32 round_freq_16 =round_down (freq_mhz,16 );if (round_freq_6 > round_freq_16)
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 27/388 PCI: Allow pci_resize_resource() for devices on root bus
In reply to Sasha LevinFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit d09ddd8190fbdc07696bf34b548ae15aa1816714 ]
When resizing a BAR, pci_reassign_bridge_resources() is invoked to bring the bridge windows of parent bridges in line with the new BAR assignment.
This assumes the device whose BAR is being resized lives on a subordinate bus, but this is not necessarily the case. A device may live on the root bus, in which case dev->bus->self is NULL, and passing a NULL pci_dev pointer to pci_reassign_bridge_resources() will cause it to crash.
So let's make the call to pci_reassign_bridge_resources() conditional on whether dev->bus->self is non-NULL in the first place.
--- drivers/pci/setup-res.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/pci/setup-res.c +5 -4
@@ -439,10 +439,11 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size) res->end = res->start +pci_rebar_size_to_bytes (size) -1 ;/* Check if the new config works by trying to assign everything. */ - ret =pci_reassign_bridge_resources (dev->bus->self, res->flags); -if (ret) - goto error_resize; - +if (dev->bus->self) { + ret =pci_reassign_bridge_resources (dev->bus->self, res->flags); +if (ret) + goto error_resize; + }return 0 ; error_resize:
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 29/388 scsi: qla2xxx: Fix issue with adapter's stopping state
In reply to Sasha LevinFrom: Viacheslav Dubeyko <[email protected]>
[ Upstream commit 803e45550b11c8e43d89812356fe6f105adebdf9 ]
The goal of the following command sequence is to restart the adapter. However, the tgt_stop flag remains set, indicating that the adapter is still in stopping state even after re-enabling it.
echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging modprobe target_core_mod
modprobe tcm_qla2xxx
mkdir /sys/kernel/config/target/qla2xxx
mkdir /sys/kernel/config/target/qla2xxx/<port-name>
mkdir /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1 echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable echo 0 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
kernel: PID 1396:qla_target.c:1555 qlt_stop_phase1(): tgt_stop 0x0, tgt_stopped 0x0
kernel: qla2xxx [0001:00:02.0]-e803:1: PID 1396:qla_target.c:1567: Stopping target for host 1(c0000000033557e8)
kernel: PID 1396:qla_target.c:1579 qlt_stop_phase1(): tgt_stop 0x1, tgt_stopped 0x0
kernel: PID 1396:qla_target.c:1266 qlt_schedule_sess_for_deletion(): tgt_stop 0x1, tgt_stopped 0x0
kernel: qla2xxx [0001:00:02.0]-e801:1: PID 1396:qla_target.c:1316: Scheduling sess c00000002d5cd800 for deletion 21:00:00:24:ff:7f:35:c7 <skipped>
kernel: qla2xxx [0001:00:02.0]-290a:1: PID 340:qla_target.c:1187: qlt_unreg_sess sess c00000002d5cd800 for deletion 21:00:00:24:ff:7f:35:c7 <skipped>
kernel: qla2xxx [0001:00:02.0]-f801:1: PID 340:qla_target.c:1145: Unregistration of sess c00000002d5cd800 21:00:00:24:ff:7f:35:c7 finished fcp_cnt 0
kernel: PID 340:qla_target.c:1155 qlt_free_session_done(): tgt_stop 0x1, tgt_stopped 0x0
kernel: qla2xxx [0001:00:02.0]-4807:1: PID 346:qla_os.c:6329: ISP abort scheduled.
<skipped>
kernel: qla2xxx [0001:00:02.0]-28f1:1: PID 346:qla_os.c:3956: Mark all dev lost
kernel: PID 346:qla_target.c:1266 qlt_schedule_sess_for_deletion(): tgt_stop 0x1, tgt_stopped 0x0
kernel: qla2xxx [0001:00:02.0]-4808:1: PID 346:qla_os.c:6338: ISP abort end.
<skipped>
kernel: PID 1396:qla_target.c:6812 qlt_enable_vha(): tgt_stop 0x1, tgt_stopped 0x0
<skipped>
kernel: qla2xxx [0001:00:02.0]-4807:1: PID 346:qla_os.c:6329: ISP abort scheduled.
<skipped>
kernel: qla2xxx [0001:00:02.0]-4808:1: PID 346:qla_os.c:6338: ISP abort end.
qlt_handle_cmd_for_atio() rejects the request to send commands because the adapter is in the stopping state:
kernel: PID 0:qla_target.c:4442 qlt_handle_cmd_for_atio(): tgt_stop 0x1, tgt_stopped 0x0
kernel: qla2xxx [0001:00:02.0]-3861:1: PID 0:qla_target.c:4447: New command while device c000000005314600 is shutting down
kernel: qla2xxx [0001:00:02.0]-e85f:1: PID 0:qla_target.c:5728: qla_target: Unable to send command to target
This patch calls qla_stop_phase2() in addition to qlt_stop_phase1() in tcm_qla2xxx_tpg_enable_store() and tcm_qla2xxx_npiv_tpg_enable_store(). The qlt_stop_phase1() marks adapter as stopping (tgt_stop == 0x1, tgt_stopped == 0x0) but qlt_stop_phase2() marks adapter as stopped (tgt_stop == 0x0, tgt_stopped == 0x1).
--- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/qla2xxx/tcm_qla2xxx.c +2 -0
@@ -949,6 +949,7 @@ static ssize_t tcm_qla2xxx_tpg_enable_store(struct config_item *item,atomic_set (&tpg->lport_tpg_enabled,0 );qlt_stop_phase1 (vha->vha_tgt.qla_tgt); +qlt_stop_phase2 (vha->vha_tgt.qla_tgt); }return count;
@@ -1111,6 +1112,7 @@ static ssize_t tcm_qla2xxx_npiv_tpg_enable_store(struct config_item *item,atomic_set (&tpg->lport_tpg_enabled,0 );qlt_stop_phase1 (vha->vha_tgt.qla_tgt); +qlt_stop_phase2 (vha->vha_tgt.qla_tgt); }return count;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 35/388 f2fs: compress: let lz4 compressor handle output buffer budget properly
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit f6644143c63f2eac88973f7fea087582579b0189 ]
Commonly, in order to handle lz4 worst compress case, caller should allocate buffer with size of LZ4_compressBound(inputsize) for target compressed data storing, however in this case, if caller didn't allocate enough space, lz4 compressor still can handle output buffer budget properly, and end up compressing when left space in output buffer is not enough.
So we don't have to allocate buffer with size for worst case, then we can avoid 2 * 4KB size intermediate buffer allocation when log_cluster_size is 2, and avoid unnecessary compressing work of compressor if we can not save at least 4KB space.
--- fs/f2fs/compress.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
fs/f2fs/compress.c +9 -6
@@ -236,7 +236,12 @@ static int lz4_init_compress_ctx(struct compress_ctx *cc)if (!cc->private)return -ENOMEM ; - cc->clen =LZ4_compressBound (PAGE_SIZE << cc->log_cluster_size); +/* +* we do not change cc->clen to LZ4_compressBound(inputsize) to +* adapt worst compress case, because lz4 compressor can handle +* output budget properly. +*/ + cc->clen = cc->rlen -PAGE_SIZE -COMPRESS_HEADER_SIZE ;return 0 ; }
@@ -252,11 +257,9 @@ static int lz4_compress_pages(struct compress_ctx *cc) len =LZ4_compress_default (cc->rbuf, cc->cbuf->cdata, cc->rlen, cc->clen, cc->private); -if (!len) { -printk_ratelimited ("%sF2FS-fs (%s): lz4 compress failed\n" , -KERN_ERR ,F2FS_I_SB (cc->inode)->sb->s_id); -return -EIO ; - } +if (!len) +return -EAGAIN ; + cc->clen = len;return 0 ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 39/388 clk: samsung: Mark top ISP and CAM clocks on Exynos542x as critical
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit e47bd937e602bb4379546095d1bd0b9871fa60c2 ]
The TOP 'aclk*_isp', 'aclk550_cam', 'gscl_wa' and 'gscl_wb' clocks must be kept enabled all the time to allow proper access to power management control for the ISP and CAM power domains. The last two clocks, although related to GScaler device and GSCL power domain, provides also the I_WRAP_CLK signal to MIPI CSIS0/1 devices, which are a part of CAM power domain and are needed for proper power on/off sequence.
Currently there are no drivers for the devices, which are part of CAM and ISP power domains yet. This patch only fixes the race between disabling the unused power domains and disabling unused clocks, which randomly resulted in the following error during boot:
Power domain CAM disable failed
Power domain ISP disable failed
--- drivers/clk/samsung/clk-exynos5420.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/clk/samsung/clk-exynos5420.c +9 -7
@@ -540,7 +540,7 @@ static const struct samsung_div_clock exynos5800_div_clks[] __initconst = {static const struct samsung_gate_clock exynos5800_gate_clks[]__initconst = {GATE (CLK_ACLK550_CAM ,"aclk550_cam" ,"mout_user_aclk550_cam" , -GATE_BUS_TOP ,24 ,0 ,0 ), +GATE_BUS_TOP ,24 ,CLK_IS_CRITICAL ,0 ),GATE (CLK_ACLK432_SCALER ,"aclk432_scaler" ,"mout_user_aclk432_scaler" ,GATE_BUS_TOP ,27 ,CLK_IS_CRITICAL ,0 ), };
@@ -943,25 +943,25 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = {GATE (0 ,"aclk300_jpeg" ,"mout_user_aclk300_jpeg" ,GATE_BUS_TOP ,4 ,CLK_IGNORE_UNUSED ,0 ),GATE (0 ,"aclk333_432_isp0" ,"mout_user_aclk333_432_isp0" , -GATE_BUS_TOP ,5 ,0 ,0 ), +GATE_BUS_TOP ,5 ,CLK_IS_CRITICAL ,0 ),GATE (0 ,"aclk300_gscl" ,"mout_user_aclk300_gscl" ,GATE_BUS_TOP ,6 ,CLK_IS_CRITICAL ,0 ),GATE (0 ,"aclk333_432_gscl" ,"mout_user_aclk333_432_gscl" ,GATE_BUS_TOP ,7 ,CLK_IGNORE_UNUSED ,0 ),GATE (0 ,"aclk333_432_isp" ,"mout_user_aclk333_432_isp" , -GATE_BUS_TOP ,8 ,0 ,0 ), +GATE_BUS_TOP ,8 ,CLK_IS_CRITICAL ,0 ),GATE (CLK_PCLK66_GPIO ,"pclk66_gpio" ,"mout_user_pclk66_gpio" ,GATE_BUS_TOP ,9 ,CLK_IGNORE_UNUSED ,0 ),GATE (0 ,"aclk66_psgen" ,"mout_user_aclk66_psgen" ,GATE_BUS_TOP ,10 ,CLK_IGNORE_UNUSED ,0 ),GATE (0 ,"aclk266_isp" ,"mout_user_aclk266_isp" , -GATE_BUS_TOP ,13 ,0 ,0 ), +GATE_BUS_TOP ,13 ,CLK_IS_CRITICAL ,0 ),GATE (0 ,"aclk166" ,"mout_user_aclk166" ,GATE_BUS_TOP ,14 ,CLK_IGNORE_UNUSED ,0 ),GATE (CLK_ACLK333 ,"aclk333" ,"mout_user_aclk333" ,GATE_BUS_TOP ,15 ,CLK_IS_CRITICAL ,0 ),GATE (0 ,"aclk400_isp" ,"mout_user_aclk400_isp" , -GATE_BUS_TOP ,16 ,0 ,0 ), +GATE_BUS_TOP ,16 ,CLK_IS_CRITICAL ,0 ),GATE (0 ,"aclk400_mscl" ,"mout_user_aclk400_mscl" ,GATE_BUS_TOP ,17 ,CLK_IS_CRITICAL ,0 ), GATE(0, "aclk200_disp1", "mout_user_aclk200_disp1",
@@ -1161,8 +1161,10 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = { GATE_IP_GSCL1, 3, 0, 0),GATE (CLK_SMMU_FIMCL1 ,"smmu_fimcl1" ,"dout_gscl_blk_333" ,GATE_IP_GSCL1 ,4 ,0 ,0 ), -GATE (CLK_GSCL_WA ,"gscl_wa" ,"sclk_gscl_wa" ,GATE_IP_GSCL1 ,12 ,0 ,0 ), -GATE (CLK_GSCL_WB ,"gscl_wb" ,"sclk_gscl_wb" ,GATE_IP_GSCL1 ,13 ,0 ,0 ), +GATE (CLK_GSCL_WA ,"gscl_wa" ,"sclk_gscl_wa" ,GATE_IP_GSCL1 ,12 , +CLK_IS_CRITICAL ,0 ), +GATE (CLK_GSCL_WB ,"gscl_wb" ,"sclk_gscl_wb" ,GATE_IP_GSCL1 ,13 , +CLK_IS_CRITICAL ,0 ),GATE (CLK_SMMU_FIMCL3 ,"smmu_fimcl3," ,"dout_gscl_blk_333" ,GATE_IP_GSCL1 ,16 ,0 ,0 ), GATE(CLK_FIMC_LITE3, "fimc_lite3", "aclk333_432_gscl",
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 32/388 powerpc/kasan: Fix stack overflow by increasing THREAD_SHIFT
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit edbadaf0671072298e506074128b64e003c5812c ]
When CONFIG_KASAN is selected, the stack usage is increased.
In the same way as x86 and arm64 architectures, increase THREAD_SHIFT when CONFIG_KASAN is selected.
--- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/Kconfig +1 -0
@@ -773,6 +773,7 @@ config THREAD_SHIFT range 13 15 default "15" if PPC_256K_PAGES default "14" if PPC64 + default "14" if KASAN default "13" help Used to define the stack size. The default is almost always what you
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 42/388 usb: roles: Switch on role-switch uevent reporting
In reply to Sasha LevinFrom: Bryan O'Donoghue <[email protected]>
[ Upstream commit 3e63cff384e625f09758ce8f4d01ae3033402b63 ]
Right now we don't report to user-space a role switch when doing a usb_role_switch_set_role() despite having registered the uevent callbacks.
This patch switches on the notifications allowing user-space to see role-switch change notifications and subsequently determine the current controller data-role.
example:
PFX=/devices/platform/soc/78d9000.usb/ci_hdrc.0
root@somebox# udevadm monitor -p
KERNEL[49.894994] change $PFX/usb_role/ci_hdrc.0-role-switch (usb_role) ACTION=change
DEVPATH=$PFX/usb_role/ci_hdrc.0-role-switch SUBSYSTEM=usb_role
DEVTYPE=usb_role_switch USB_ROLE_SWITCH=ci_hdrc.0-role-switch
SEQNUM=2432
--- drivers/usb/roles/class.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/roles/class.c +3 -1
@@ -49,8 +49,10 @@ int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role)mutex_lock (&sw->lock); ret = sw->set (sw, role); -if (!ret) +if (!ret) { sw->role = role; +kobject_uevent (&sw->dev.kobj,KOBJ_CHANGE ); + }mutex_unlock (&sw->lock);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 34/388 iio: bmp280: fix compensation of humidity
In reply to Sasha LevinFrom: Andreas Klinger <[email protected]>
[ Upstream commit dee2dabc0e4115b80945fe2c91603e634f4b4686 ]
Limit the output of humidity compensation to the range between 0 and 100 percent.
Depending on the calibration parameters of the individual sensor it happens, that a humidity above 100 percent or below 0 percent is calculated, which don't make sense in terms of relative humidity.
Add a clamp to the compensation formula as described in the datasheet of the sensor in chapter 4.2.3.
Although this clamp is documented, it was never in the driver of the kernel.
It depends on the circumstances (calibration parameters, temperature, humidity) if one can see a value above 100 percent without the clamp. The writer of this patch was working with this type of sensor without noting this error. So it seems to be a rare event when this bug occures.
--- drivers/iio/pressure/bmp280-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/iio/pressure/bmp280-core.c +2 -0
@@ -271,6 +271,8 @@ static u32 bmp280_compensate_humidity(struct bmp280_data *data, + (s32)2097152) * calib->H2 + 8192) >> 14); var -= ((((var >>15 ) * (var >>15 )) >>7 ) * (s32 )calib->H1) >>4 ; + var =clamp_val (var,0 ,419430400 ); +return var >>12 ; };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 36/388 f2fs: report delalloc reserve as non-free in statfs for project quota
In reply to Sasha LevinFrom: Konstantin Khlebnikov <[email protected]>
[ Upstream commit baaa7ebf25c78c5cb712fac16b7f549100beddd3 ]
This reserved space isn't committed yet but cannot be used for allocations. For userspace it has no difference from used space.
See the same fix in ext4 commit f06925c73942 ("ext4: report delalloc reserve as non-free in statfs for project quota").
--- fs/f2fs/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/super.c +2 -1
@@ -1292,7 +1292,8 @@ static int f2fs_statfs_project(struct super_block *sb, limit >>= sb->s_blocksize_bits;if (limit && buf->f_blocks > limit) { - curblock = dquot->dq_dqb.dqb_curspace >> sb->s_blocksize_bits; + curblock = (dquot->dq_dqb.dqb_curspace + + dquot->dq_dqb.dqb_rsvspace) >> sb->s_blocksize_bits; buf->f_blocks = limit; buf->f_bfree = buf->f_bavail = (buf->f_blocks > curblock) ?
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 37/388 i2c: pxa: clear all master action bits in i2c_pxa_stop_message()
In reply to Sasha LevinFrom: Russell King <[email protected]>
[ Upstream commit e81c979f4e071d516aa27cf5a0c3939da00dc1ca ]
If we timeout during a message transfer, the control register may contain bits that cause an action to be set. Read-modify-writing the register leaving these bits set may trigger the hardware to attempt one of these actions unintentionally.
Always clear these bits when cleaning up after a message or after a timeout.
--- drivers/i2c/busses/i2c-pxa.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-pxa.c +2 -4
@@ -747,11 +747,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c) {u32 icr; -/* -* Clear the STOP and ACK flags -*/ +/* Clear the START, STOP, ACK, TB and MA flags */ icr =readl (_ICR (i2c)); - icr &= ~(ICR_STOP |ICR_ACKNAK ); + icr &= ~(ICR_START |ICR_STOP |ICR_ACKNAK |ICR_TB |ICR_MA );writel (icr,_ICR (i2c)); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 18/388 ARM: dts: stm32: Add missing ethernet PHY reset on AV96
In reply to Sasha LevinFrom: Marek Vasut <[email protected]>
[ Upstream commit 010ca9fe500bfe365860b50220ff80541c18f0e1 ]
Add PHY reset GPIO on AV96 ethernet PHY.
--- arch/arm/boot/dts/stm32mp157a-avenger96.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/stm32mp157a-avenger96.dts +3 -0
@@ -92,6 +92,9 @@ mdio0 { #address-cells = <1>; #size-cells = <0>; compatible = "snps,dwmac-mdio"; + reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>; + reset-delay-us = <1000>; + phy0: ethernet-phy@7 { reg = <7>; };
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 53/388 pinctrl: ocelot: Fix GPIO interrupt decoding on Jaguar2
In reply to Sasha LevinFrom: Lars Povlsen <[email protected]>
[ Upstream commit 0b47afc65453a70bc521e251138418056f65793f ]
This fixes a problem with using the GPIO as an interrupt on Jaguar2 (and similar), as the register layout of the platforms with 64 GPIO's are pairwise, such that the original offset must be multiplied with the platform stride.
--- drivers/pinctrl/pinctrl-ocelot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-ocelot.c +2 -1
@@ -714,11 +714,12 @@ static void ocelot_irq_handler(struct irq_desc *desc)struct irq_chip *parent_chip =irq_desc_get_chip (desc);struct gpio_chip *chip =irq_desc_get_handler_data (desc);struct ocelot_pinctrl *info =gpiochip_get_data (chip); +unsigned int id_reg =OCELOT_GPIO_INTR_IDENT * info->stride;unsigned int reg =0 , irq, i;unsigned long irqs;for (i =0 ; i < info->stride; i++) { -regmap_read (info->map,OCELOT_GPIO_INTR_IDENT +4 * i, ®); +regmap_read (info->map, id_reg +4 * i, ®);if (!reg)continue ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 49/388 arm64: dts: armada-3720-turris-mox: fix SFP binding
In reply to Sasha LevinFrom: Marek Behún <[email protected]>
[ Upstream commit c2671acbbbd822ef077cc168991e0a7dbe2172c9 ]
The sfp compatible should be 'sff,sfp', not 'sff,sfp+'. We used patched kernel where the latter was working.
--- arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +1 -1
@@ -95,7 +95,7 @@ sdhci1_pwrseq: sdhci1-pwrseq { }; sfp: sfp { - compatible = "sff,sfp+"; + compatible = "sff,sfp"; i2c-bus = <&i2c0>; los-gpio = <&moxtet_sfp 0 GPIO_ACTIVE_HIGH>; tx-fault-gpio = <&moxtet_sfp 1 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 54/388 clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit ace342097768e35fd41934285604fa97da1e235a ]
On SoCs with Standby Control Registers (STBCRs) instead of Module Stop Control Registers (MSTPCRs), the suspend handler saves the wrong registers, and the resume handler prints the wrong register in an error message.
Fortunately this cannot happen yet, as the suspend/resume code is used on PSCI systems only, and systems with STBCRs (RZ/A1 and RZ/A2) do not use PSCI. Still, it is better to fix this, to avoid this becoming a problem in the future.
Distinguish between STBCRs and MSTPCRs where needed. Replace the useless printing of the virtual register address in the resume error message by printing the register index.
--- drivers/clk/renesas/renesas-cpg-mssr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/clk/renesas/renesas-cpg-mssr.c +5 -3
@@ -812,7 +812,8 @@ static int cpg_mssr_suspend_noirq(struct device *dev)/* Save module registers with bits under our control */ for (reg =0 ; reg <ARRAY_SIZE (priv->smstpcr_saved); reg++) {if (priv->smstpcr_saved[reg].mask) - priv->smstpcr_saved[reg].val = + priv->smstpcr_saved[reg].val = priv->stbyctrl ? +readb (priv->base +STBCR (reg)) :readl (priv->base +SMSTPCR (reg)); }
@@ -872,8 +873,9 @@ static int cpg_mssr_resume_noirq(struct device *dev) }if (!i) -dev_warn (dev,"Failed to enable SMSTP %p[0x%x]\n" , - priv->base +SMSTPCR (reg), oldval & mask); +dev_warn (dev,"Failed to enable %s%u[0x%x]\n" , + priv->stbyctrl ?"STB" :"SMSTP" , reg, + oldval & mask); }return 0 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 57/388 PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register
In reply to Sasha LevinFrom: Pali Rohár <[email protected]>
[ Upstream commit 90c6cb4a355e7befcb557d217d1d8b8bd5875a05 ]
Trying to change Link Status register does not have any effect as this is a read-only register. Trying to overwrite bits for Negotiated Link Width does not make sense.
In future proper change of link width can be done via Lane Count Select bits in PCIe Control 0 register.
Trying to unconditionally enable ASPM L0s via ASPM Control bits in Link Control register is wrong. There should be at least some detection if endpoint supports L0s as isn't mandatory.
Moreover ASPM Control bits in Link Control register are controlled by pcie/aspm.c code which sets it according to system ASPM settings, immediately after aardvark driver probes. So setting these bits by aardvark driver has no long running effect.
Remove code which touches ASPM L0s bits from this driver and let kernel's ASPM implementation to set ASPM state properly.
Some users are reporting issues that this code is problematic for some Intel wifi cards and removing it fixes them, see e.g.:
https://bugzilla.kernel.org/show_bug.cgi?id=196339
If problems with Intel wifi cards occur even after this commit, then pcie/aspm.c code could be modified / hooked to not enable ASPM L0s state for affected problematic cards.
--- drivers/pci/controller/pci-aardvark.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/pci/controller/pci-aardvark.c +0 -4
@@ -353,10 +353,6 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)advk_pcie_wait_for_link (pcie); - reg =PCIE_CORE_LINK_L0S_ENTRY | - (1 <<PCIE_CORE_LINK_WIDTH_SHIFT ); -advk_writel (pcie, reg,PCIE_CORE_LINK_CTRL_STAT_REG ); - reg =advk_readl (pcie,PCIE_CORE_CMD_STATUS_REG ); reg |=PCIE_CORE_CMD_MEM_ACCESS_EN | PCIE_CORE_CMD_IO_ACCESS_EN |
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 60/388 vfio/pci: fix memory leaks in alloc_perm_bits()
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit 3e63b94b6274324ff2e7d8615df31586de827c4e ]
vfio_pci_disable() calls vfio_config_free() but forgets to call free_perm_bits() resulting in memory leaks,
unreferenced object 0xc000000c4db2dee0 (size 16):
comm "qemu-kvm", pid 4305, jiffies 4295020272 (age 3463.780s) hex dump (first 16 bytes):
00 00 ff 00 ff ff ff ff ff ff ff ff ff ff 00 00 ................
backtrace:
[<00000000a6a4552d>] alloc_perm_bits+0x58/0xe0 [vfio_pci]
[<00000000ac990549>] vfio_config_init+0xdf0/0x11b0 [vfio_pci]
init_pci_cap_msi_perm at drivers/vfio/pci/vfio_pci_config.c:1125
(inlined by) vfio_msi_cap_len at drivers/vfio/pci/vfio_pci_config.c:1180
(inlined by) vfio_cap_len at drivers/vfio/pci/vfio_pci_config.c:1241
(inlined by) vfio_cap_init at drivers/vfio/pci/vfio_pci_config.c:1468
(inlined by) vfio_config_init at drivers/vfio/pci/vfio_pci_config.c:1707
[<000000006db873a1>] vfio_pci_open+0x234/0x700 [vfio_pci]
[<00000000630e1906>] vfio_group_fops_unl_ioctl+0x8e0/0xb84 [vfio]
[<000000009e34c54f>] ksys_ioctl+0xd8/0x130
[<000000006577923d>] sys_ioctl+0x28/0x40
[<000000006d7b1cf2>] system_call_exception+0x114/0x1e0
[<0000000008ea7dd5>] system_call_common+0xf0/0x278
unreferenced object 0xc000000c4db2e330 (size 16):
comm "qemu-kvm", pid 4305, jiffies 4295020272 (age 3463.780s)
hex dump (first 16 bytes):
00 ff ff 00 ff ff ff ff ff ff ff ff ff ff 00 00 ................
backtrace:
[<000000004c71914f>] alloc_perm_bits+0x44/0xe0 [vfio_pci]
[<00000000ac990549>] vfio_config_init+0xdf0/0x11b0 [vfio_pci]
[<000000006db873a1>] vfio_pci_open+0x234/0x700 [vfio_pci]
[<00000000630e1906>] vfio_group_fops_unl_ioctl+0x8e0/0xb84 [vfio]
[<000000009e34c54f>] ksys_ioctl+0xd8/0x130
[<000000006577923d>] sys_ioctl+0x28/0x40
[<000000006d7b1cf2>] system_call_exception+0x114/0x1e0
[<0000000008ea7dd5>] system_call_common+0xf0/0x278--- drivers/vfio/pci/vfio_pci_config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/vfio/pci/vfio_pci_config.c +5 -2
@@ -1728,8 +1728,11 @@ void vfio_config_free(struct vfio_pci_device *vdev) vdev->vconfig =NULL ;kfree (vdev->pci_config_map); vdev->pci_config_map =NULL ; -kfree (vdev->msi_perm); - vdev->msi_perm =NULL ; +if (vdev->msi_perm) { +free_perm_bits (vdev->msi_perm); +kfree (vdev->msi_perm); + vdev->msi_perm =NULL ; + } }/*
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 62/388 coresight: tmc: Fix TMC mode read in tmc_read_prepare_etb()
In reply to Sasha LevinFrom: Sai Prakash Ranjan <[email protected]>
[ Upstream commit 347adb0d6385c3220dc01ab61807a5b1892901cc ]
On some QCOM platforms like SC7180, SDM845 and SM8150, reading TMC mode register without proper coresight power management can lead to async exceptions like the one in the call trace below in tmc_read_prepare_etb(). This can happen if the user tries to read the TMC etf data via device node without setting up source and the sink first. Fix this by having a check for coresight sysfs mode before reading TMC mode management register.
Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 7 PID: 2605 Comm: hexdump Tainted: G S 5.4.30 #122 Call trace: dump_backtrace+0x0/0x188 show_stack+0x20/0x2c dump_stack+0xdc/0x144 panic+0x168/0x36c panic+0x0/0x36c arm64_serror_panic+0x78/0x84 do_serror+0x130/0x138 el1_error+0x84/0xf8 tmc_read_prepare_etb+0x88/0xb8 tmc_open+0x40/0xd8 misc_open+0x120/0x158 chrdev_open+0xb8/0x1a4 do_dentry_open+0x268/0x3a0 vfs_open+0x34/0x40 path_openat+0x39c/0xdf4 do_filp_open+0x90/0x10c do_sys_open+0x150/0x3e8 __arm64_compat_sys_openat+0x28/0x34 el0_svc_common+0xa8/0x160 el0_svc_compat_handler+0x2c/0x38 el0_svc_compat+0x8/0x10
--- drivers/hwtracing/coresight/coresight-tmc-etf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/hwtracing/coresight/coresight-tmc-etf.c +8 -8
@@ -596,13 +596,6 @@ int tmc_read_prepare_etb(struct tmc_drvdata *drvdata) goto out; } -/* There is no point in reading a TMC in HW FIFO mode */ - mode =readl_relaxed (drvdata->base +TMC_MODE ); -if (mode !=TMC_MODE_CIRCULAR_BUFFER ) { - ret = -EINVAL ; - goto out; - } -/* Don't interfere if operated from Perf */ if (drvdata->mode ==CS_MODE_PERF ) { ret = -EINVAL ;
@@ -616,8 +609,15 @@ int tmc_read_prepare_etb(struct tmc_drvdata *drvdata) }/* Disable the TMC if need be */ -if (drvdata->mode ==CS_MODE_SYSFS ) +if (drvdata->mode ==CS_MODE_SYSFS ) { +/* There is no point in reading a TMC in HW FIFO mode */ + mode =readl_relaxed (drvdata->base +TMC_MODE ); +if (mode !=TMC_MODE_CIRCULAR_BUFFER ) { + ret = -EINVAL ; + goto out; + }__tmc_etb_disable_hw (drvdata); + } drvdata->reading = true; out:
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 61/388 arm64: dts: qcom: sc7180: Correct the pdc interrupt ranges
In reply to Sasha LevinFrom: Maulik Shah <[email protected]>
[ Upstream commit 7d2f29e49477aa51339e719cf73f0945c39c8a9e ]
Few PDC interrupts do not map to respective parent GIC interrupt. Fix this by correcting the pdc interrupt map.
--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7180.dtsi +1 -2
@@ -1657,8 +1657,7 @@ dispcc: clock-controller@af00000 { pdc: interrupt-controller@b220000 { compatible = "qcom,sc7180-pdc", "qcom,pdc"; reg = <0 0x0b220000 0 0x30000>; - qcom,pdc-ranges = <0 480 15>, <17 497 98>, - <119 634 4>, <124 639 1>; + qcom,pdc-ranges = <0 480 94>, <94 609 31>, <125 63 1>; #interrupt-cells = <2>; interrupt-parent = <&intc>; interrupt-controller;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 65/388 powerpc/book3s64/radix/tlb: Determine hugepage flush correctly
In reply to Sasha LevinFrom: "Aneesh Kumar K.V" <[email protected]>
[ Upstream commit 8f53f9c0f68ab2168f637494b9e24034899c1310 ]
With a 64K page size flush with start and end:
(start, end) = (721f680d0000, 721f680e0000)
results in:
(hstart, hend) = (721f68200000, 721f68000000)
ie. hstart is above hend, which indicates no huge page flush is needed.
However the current logic incorrectly sets hflush = true in this case, because hstart != hend.
That causes us to call __tlbie_va_range() passing hstart/hend, to do a huge page flush even though we don't need to. __tlbie_va_range() will skip the actual tlbie operation for start > end. But it will still end up calling fixup_tlbie_va_range() and doing the TLB fixups in there, which is harmless but unnecessary work.
--- arch/powerpc/mm/book3s64/radix_tlb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/mm/book3s64/radix_tlb.c +1 -3
@@ -884,9 +884,7 @@ static inline void __radix__flush_tlb_range(struct mm_struct *mm,if (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE )) { hstart = (start +PMD_SIZE -1 ) &PMD_MASK ; hend = end &PMD_MASK ; -if (hstart == hend) - hflush = false; -else +if (hstart < hend) hflush = true; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 68/388 habanalabs: don't allow hard reset with open processes
In reply to Sasha LevinFrom: Omer Shpigelman <[email protected]>
[ Upstream commit 36fafe87edd636292a4ed6a3af9608f2c7d0d0fb ]
When the MMU is heavily used by the engines, unmapping might take a lot of time due to a full MMU cache invalidation done as part of the unmap flow. Hence we might not be able to kill all open processes before going to hard reset the device, as it involves unmapping of all user memory. In case of a failure in killing all open processes, we should stop the hard reset flow as it might lead to a kernel crash - one thread (killing of a process) is updating MMU structures that other thread (hard reset) is freeing.
Stopping a hard reset flow leaves the device as nonoperational and the user can then initiate a hard reset via sysfs to reinitialize the device.
--- drivers/misc/habanalabs/device.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/misc/habanalabs/device.c +11 -6
@@ -718,7 +718,7 @@ int hl_device_resume(struct hl_device *hdev)return rc; } -static void device_kill_open_processes (struct hl_device *hdev) +static int device_kill_open_processes (struct hl_device *hdev) {u16 pending_total, pending_cnt;struct hl_fpriv *hpriv;
@@ -771,9 +771,7 @@ static void device_kill_open_processes(struct hl_device *hdev)ssleep (1 ); } -if (!list_empty (&hdev->fpriv_list)) -dev_crit (hdev->dev, -"Going to hard reset with open user contexts\n" ); +return list_empty (&hdev->fpriv_list) ?0 : -EBUSY ; }static void device_hard_reset_pending (struct work_struct *work)
@@ -894,7 +892,12 @@ int hl_device_reset(struct hl_device *hdev, bool hard_reset,* process can't really exit until all its CSs are done, which * is what we do in cs rollback */ -device_kill_open_processes (hdev); + rc =device_kill_open_processes (hdev); +if (rc) { +dev_crit (hdev->dev, +"Failed to kill all open processes, stopping hard reset\n" ); + goto out_err; + }/* Flush the Event queue workers to make sure no other thread is * reading or writing to registers during the reset
@@ -1375,7 +1378,9 @@ void hl_device_fini(struct hl_device *hdev)* can't really exit until all its CSs are done, which is what we * do in cs rollback */ -device_kill_open_processes (hdev); + rc =device_kill_open_processes (hdev); +if (rc) +dev_crit (hdev->dev,"Failed to kill all open processes\n" );hl_cb_pool_fini (hdev);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 70/388 gpio: dwapb: Call acpi_gpiochip_free_interrupts() on GPIO chip de-registration
In reply to Sasha LevinFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 494a94e38dcf62543a32a4424d646ff80b4b28bd ]
Add missed acpi_gpiochip_free_interrupts() call when unregistering ports.
While at it, drop extra check to call acpi_gpiochip_request_interrupts(). There is no need to have an additional check to call acpi_gpiochip_request_interrupts(). Even without any interrupts available the registered ACPI Event handlers can be useful for debugging purposes.
--- drivers/gpio/gpio-dwapb.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)
drivers/gpio/gpio-dwapb.c +16 -9
@@ -533,26 +533,33 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,dwapb_configure_irqs (gpio, port, pp); err =gpiochip_add_data (&port->gc, port); -if (err) +if (err) {dev_err (gpio->dev,"failed to register gpiochip for port%d\n" , port->idx); -else - port->is_registered = true; +return err; + }/* Add GPIO-signaled ACPI event support */ -if (pp->has_irq) -acpi_gpiochip_request_interrupts (&port->gc); +acpi_gpiochip_request_interrupts (&port->gc); -return err; + port->is_registered = true; + +return 0 ; }static void dwapb_gpio_unregister (struct dwapb_gpio *gpio) {unsigned int m; -for (m =0 ; m < gpio->nr_ports; ++m) -if (gpio->ports[m].is_registered) -gpiochip_remove (&gpio->ports[m].gc); +for (m =0 ; m < gpio->nr_ports; ++m) { +struct dwapb_gpio_port *port = &gpio->ports[m]; + +if (!port->is_registered) +continue ; + +acpi_gpiochip_free_interrupts (&port->gc); +gpiochip_remove (&port->gc); + } } static struct dwapb_platform_data *
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 21/388 arm64: dts: meson-gxbb-kii-pro: fix board compatible
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit d120b5f98031eefc22164ae8c6ea3711e7a04c19 ]
Remove the uneeded "amlogic,p201", "amlogic,s905" in the board compatible list.
It fixes:meson-gxbb-kii-pro.dt.yaml: /: compatible: ['videostrong,kii-pro', 'amlogic,p201', 'amlogic,s905', 'amlogic,meson-gxbb'] is not valid under any of the given schemas
--- arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts +1 -1
@@ -11,7 +11,7 @@ #include <dt-bindings/input/input.h> #include <dt-bindings/leds/common.h> / { - compatible = "videostrong,kii-pro", "amlogic,p201", "amlogic,s905", "amlogic,meson-gxbb"; + compatible = "videostrong,kii-pro", "amlogic,meson-gxbb"; model = "Videostrong KII Pro"; leds {
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 71/388 usb: gadget: core: sync interrupt before unbind the udc
In reply to Sasha LevinFrom: Peter Chen <[email protected]>
[ Upstream commit 3c73bc52195def14165c3a7d91bdbb33b51725f5 ]
The threaded interrupt handler may still be called after the usb_gadget_disconnect is called, it causes the structures used at interrupt handler was freed before it uses, eg the usb_request. This issue usually occurs we remove the udc function during the transfer. Below is the example when doing stress test for android switch function, the EP0's request is freed by .unbind (configfs_composite_unbind -> composite_dev_cleanup), but the threaded handler accesses this request during handling setup packet request.
In fact, there is no protection between unbind the udc and udc interrupt handling, so we have to avoid the interrupt handler is occurred or scheduled during the .unbind flow.
init: Sending signal 9 to service 'adbd' (pid 18077) process group...android_work: did not send uevent (0 0 000000007bec2039)
libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 6ms
init: Service 'adbd' (pid 18077) received signal 9
init: Sending signal 9 to service 'adbd' (pid 18077) process group...
libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 0ms
init: processing action (init.svc.adbd=stopped) from (/init.usb.configfs.rc:14)
init: Received control message 'start' for 'adbd' from pid: 399 (/vendor/bin/hw/android.hardware.usb@1.
init: starting service 'adbd'...
read descriptors
read strings
Unable to handle kernel read from unreadable memory at virtual address 000000000000002a
android_work: sent uevent USB_STATE=CONNECTED Mem abort info:
ESR = 0x96000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=00000000e97f1000 using random self ethernet address [000000000000002a] pgd=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 232 Comm: irq/68-5b110000 Not tainted 5.4.24-06075-g94a6b52b5815 #92 Hardware name: Freescale i.MX8QXP MEK (DT) pstate: 00400085 (nzcv daIf +PAN -UAO) using random host ethernet address pc : composite_setup+0x5c/0x1730 lr : android_setup+0xc0/0x148
sp : ffff80001349bba0
x29: ffff80001349bba0 x28: ffff00083a50da00
x27: ffff8000124e6000 x26: ffff800010177950
x25: 0000000000000040 x24: ffff000834e18010
x23: 0000000000000000 x22: 0000000000000000
x21: ffff00083a50da00 x20: ffff00082e75ec40
x19: 0000000000000000 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: 0000000000000000 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000000001
x11: ffff80001180fb58 x10: 0000000000000040
x9 : ffff8000120fc980 x8 : 0000000000000000
x7 : ffff00083f98df50 x6 : 0000000000000100
x5 : 00000307e8978431 x4 : ffff800011386788
x3 : 0000000000000000 x2 : ffff800012342000
x1 : 0000000000000000 x0 : ffff800010c6d3a0
Call trace: composite_setup+0x5c/0x1730 android_setup+0xc0/0x148 cdns3_ep0_delegate_req+0x64/0x90 cdns3_check_ep0_interrupt_proceed+0x384/0x738 cdns3_device_thread_irq_handler+0x124/0x6e0 cdns3_thread_irq+0x94/0xa0 irq_thread_fn+0x30/0xa0 irq_thread+0x150/0x248 kthread+0xfc/0x128 ret_from_fork+0x10/0x18 Code: 910e8000 f9400693 12001ed7 79400f79 (3940aa61) ---[ end trace c685db37f8773fba ]--- Kernel panic - not syncing: Fatal exception
SMP: stopping secondary CPUs
Kernel Offset: disabled
CPU features: 0x0002,20002008
Memory Limit: none
Rebooting in 5 seconds..
--- drivers/usb/gadget/udc/core.c | 2 ++ include/linux/usb/gadget.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/usb/gadget/udc/core.c +2 -0
@@ -1297,6 +1297,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)kobject_uevent (&udc->dev.kobj,KOBJ_CHANGE );usb_gadget_disconnect (udc->gadget); +if (udc->gadget->irq) +synchronize_irq (udc->gadget->irq); udc->driver->unbind (udc->gadget);usb_gadget_udc_stop (udc);
include/linux/usb/gadget.h +2 -0
@@ -373,6 +373,7 @@ struct usb_gadget_ops {* @connected: True if gadget is connected. * @lpm_capable: If the gadget max_speed is FULL or HIGH, this flag * indicates that it supports LPM as per the LPM ECN & errata. +* @irq: the interrupt number for device controller. * * Gadgets have a mostly-portable "gadget driver" implementing device * functions, handling all usb configurations and interfaces. Gadget
@@ -427,6 +428,7 @@ struct usb_gadget { unsigned deactivated:1; unsigned connected:1; unsigned lpm_capable:1; +int irq; };#define work_to_gadget (w) (container_of((w), struct usb_gadget, work))
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 73/388 mfd: wm8994: Fix driver operation if loaded as modules
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit d4f9b5428b53dd67f49ee8deed8d4366ed6b1933 ]
WM8994 chip has built-in regulators, which might be used for chip operation. They are controlled by a separate wm8994-regulator driver, which should be loaded before this driver calls regulator_get(), because that driver also provides consumer-supply mapping for the them. If that driver is not yet loaded, regulator core substitute them with dummy regulator, what breaks chip operation, because the built-in regulators are never enabled. Fix this by annotating this driver with MODULE_SOFTDEP() "pre" dependency to "wm8994_regulator" module.
--- drivers/mfd/wm8994-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/wm8994-core.c +1 -0
@@ -690,3 +690,4 @@ module_i2c_driver(wm8994_i2c_driver);MODULE_DESCRIPTION ("Core support for the WM8994 audio CODEC" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Mark Brown <[email protected]>" ); +MODULE_SOFTDEP ("pre: wm8994_regulator" );
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 81/388 nfsd: Fix svc_xprt refcnt leak when setup callback client failed
In reply to Sasha LevinFrom: Xiyu Yang <[email protected]>
[ Upstream commit a4abc6b12eb1f7a533c2e7484cfa555454ff0977 ]
nfsd4_process_cb_update() invokes svc_xprt_get(), which increases the refcount of the "c->cn_xprt".
The reference counting issue happens in one exception handling path of nfsd4_process_cb_update(). When setup callback client failed, the function forgets to decrease the refcnt increased by svc_xprt_get(), causing a refcnt leak.
Fix this issue by calling svc_xprt_put() when setup callback client failed.
--- fs/nfsd/nfs4callback.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfsd/nfs4callback.c +2 -0
@@ -1301,6 +1301,8 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) err =setup_callback_client (clp, &conn, ses);if (err) {nfsd4_mark_cb_down (clp, err); +if (c) +svc_xprt_put (c->cn_xprt);return ; } }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 84/388 cifs: set up next DFS target before generic_ip_connect()
In reply to Sasha LevinFrom: Paulo Alcantara <[email protected]>
[ Upstream commit aaa3aef34d3ab9499a5c7633823429f7a24e6dff ]
If we mount a very specific DFS link
\\FS0.FOO.COM\dfs\link -> \FS0\share1, \FS1\share2
where its target list contains NB names ("FS0" & "FS1") rather than FQDN ones ("FS0.FOO.COM" & "FS1.FOO.COM"), we end up connecting to \FOO\share1 but server->hostname will have "FOO.COM". The reason is because both "FS0" and "FS0.FOO.COM" resolve to same IP address and they share same TCP server connection, but "FS0.FOO.COM" was the first hostname set -- which is OK.
However, if the echo thread timeouts and we still have a good connection to "FS0", in cifs_reconnect()
rc = generic_ip_connect(server) -> success
if (rc) {
...
reconn_inval_dfs_target(server, cifs_sb, &tgt_list,
&tgt_it);
...
}
...it successfully reconnects to "FS0" server but does not set up next DFS target - which should be the same target server "\FS0\share1" - and server->hostname remains set to "FS0.FOO.COM" rather than "FS0", as reconn_inval_dfs_target() would have it set to "FS0" if called earlier.
Finally, in __smb2_reconnect(), the reconnect of tcons would fail because tcon->ses->server->hostname (FS0.FOO.COM) does not match DFS target's hostname (FS0).
Fix that by calling reconn_inval_dfs_target() before generic_ip_connect() so server->hostname will get updated correctly prior to reconnecting its tcons in __smb2_reconnect().
With "cifs: handle hostnames that resolve to same ip in failover" patch
- The above problem would not occur.
- We could save an DNS query to find out that they both resolve to the same ip address.
--- fs/cifs/connect.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/cifs/connect.c +9 -9
@@ -572,26 +572,26 @@ cifs_reconnect(struct TCP_Server_Info *server)try_to_freeze ();mutex_lock (&server->srv_mutex); +#ifdef CONFIG_CIFS_DFS_UPCALL /* * Set up next DFS target server (if any) for reconnect. If DFS * feature is disabled, then we will retry last server we * connected to before. */ +reconn_inval_dfs_target (server, cifs_sb, &tgt_list, &tgt_it); +#endif + rc =reconn_set_ipaddr (server); +if (rc) { +cifs_dbg (FYI ,"%s: failed to resolve hostname: %d\n" , + __func__, rc); + } +if (cifs_rdma_enabled (server)) rc =smbd_reconnect (server);else rc =generic_ip_connect (server);if (rc) {cifs_dbg (FYI ,"reconnect error %d\n" , rc); -#ifdef CONFIG_CIFS_DFS_UPCALL -reconn_inval_dfs_target (server, cifs_sb, &tgt_list, - &tgt_it); -#endif - rc =reconn_set_ipaddr (server); -if (rc) { -cifs_dbg (FYI ,"%s: failed to resolve hostname: %d\n" , - __func__, rc); - }mutex_unlock (&server->srv_mutex);msleep (3000 ); }else {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 83/388 RDMA/core: Fix several reference count leaks.
In reply to Sasha LevinFrom: Qiushi Wu <[email protected]>
[ Upstream commit 0b8e125e213204508e1b3c4bdfe69713280b7abd ]
kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous
commit b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject") fixed a similar problem.
--- drivers/infiniband/core/sysfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/infiniband/core/sysfs.c +5 -5
@@ -1058,8 +1058,7 @@ static int add_port(struct ib_core_device *coredev, int port_num) coredev->ports_kobj, "%d", port_num);if (ret) { -kfree (p); -return ret; + goto err_put; } p->gid_attr_group =kzalloc (sizeof (*p->gid_attr_group),GFP_KERNEL );
@@ -1072,8 +1071,7 @@ static int add_port(struct ib_core_device *coredev, int port_num) ret =kobject_init_and_add (&p->gid_attr_group->kobj, &gid_attr_type, &p->kobj,"gid_attrs" );if (ret) { -kfree (p->gid_attr_group); - goto err_put; + goto err_put_gid_attrs; }if (device->ops.process_mad && is_full_dev) {
@@ -1404,8 +1402,10 @@ int ib_port_register_module_stat(struct ib_device *device, u8 port_num, ret =kobject_init_and_add (kobj, ktype, &port->kobj,"%s" , name); -if (ret) +if (ret) { +kobject_put (kobj);return ret; + } }return 0 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 91/388 crypto: omap-sham - huge buffer access fixes
In reply to Sasha LevinFrom: Tero Kristo <[email protected]>
[ Upstream commit 6395166d7a19019d5e9574eb9ecdaf0028abb887 ]
The ctx internal buffer can only hold buflen amount of data, don't try to copy over more than that. Also, initialize the context sg pointer if we only have data in the context internal buffer, this can happen when closing a hash with certain data amounts.
--- drivers/crypto/omap-sham.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/crypto/omap-sham.c +9 -2
@@ -751,8 +751,15 @@ static int omap_sham_align_sgs(struct scatterlist *sg,int offset = rctx->offset;int bufcnt = rctx->bufcnt; -if (!sg || !sg->length || !nbytes) +if (!sg || !sg->length || !nbytes) { +if (bufcnt) { +sg_init_table (rctx->sgl,1 ); +sg_set_buf (rctx->sgl, rctx->dd->xmit_buf, bufcnt); + rctx->sg = rctx->sgl; + } +return 0 ; + } new_len = nbytes;
@@ -896,7 +903,7 @@ static int omap_sham_prepare_request(struct ahash_request *req, bool update)if (hash_later <0 ) hash_later =0 ; -if (hash_later) { +if (hash_later && hash_later <= rctx->buflen) { scatterwalk_map_and_copy(rctx->buffer, req->src, req->nbytes - hash_later,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 24/388 arm64: dts: meson: fixup SCP sram nodes
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit 9ecded10b4b6af238da0c86197b0418912e7513e ]
The GX and AXG SCP sram nodes were using invalid compatible and node names for the sram entries.
Fixup the sram entries node names, and use proper compatible for them.
It notably fixes:
sram@c8000000: 'scp-shmem@0', 'scp-shmem@200' do not match any of the regexes: '^([a-z]*-)?sram(-section)?@[a-f0-9]+$', 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 6 +++--- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +3 -3
@@ -1735,18 +1735,18 @@ sd_emmc_c: mmc@7000 { }; sram: sram@fffc0000 { - compatible = "amlogic,meson-axg-sram", "mmio-sram"; + compatible = "mmio-sram"; reg = <0x0 0xfffc0000 0x0 0x20000>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x0 0xfffc0000 0x20000>; - cpu_scp_lpri: scp-shmem@13000 { + cpu_scp_lpri: scp-sram@13000 { compatible = "amlogic,meson-axg-scp-shmem"; reg = <0x13000 0x400>; }; - cpu_scp_hpri: scp-shmem@13400 { + cpu_scp_hpri: scp-sram@13400 { compatible = "amlogic,meson-axg-scp-shmem"; reg = <0x13400 0x400>; };
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +5 -5
@@ -398,20 +398,20 @@ gic: interrupt-controller@c4301000 { }; sram: sram@c8000000 { - compatible = "amlogic,meson-gx-sram", "amlogic,meson-gxbb-sram", "mmio-sram"; + compatible = "mmio-sram"; reg = <0x0 0xc8000000 0x0 0x14000>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x0 0xc8000000 0x14000>; - cpu_scp_lpri: scp-shmem@0 { - compatible = "amlogic,meson-gx-scp-shmem", "amlogic,meson-gxbb-scp-shmem"; + cpu_scp_lpri: scp-sram@0 { + compatible = "amlogic,meson-gxbb-scp-shmem"; reg = <0x13000 0x400>; }; - cpu_scp_hpri: scp-shmem@200 { - compatible = "amlogic,meson-gx-scp-shmem", "amlogic,meson-gxbb-scp-shmem"; + cpu_scp_hpri: scp-sram@200 { + compatible = "amlogic,meson-gxbb-scp-shmem"; reg = <0x13400 0x400>; }; };
Signature · 7 lines
2.25.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Sasha Levin
maintainerPATCH 94/388 ASoC: meson: fix memory leak of links if allocation of ldata fails
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit 6e801dc411329aff592fbd48fb116183d0acdb00 ]
Currently if the allocation of ldata fails the error return path does not kfree the allocated links object. Fix this by adding an error exit return path that performs the necessary kfree'ing.
Addresses-Coverity: ("Resource leak")
--- sound/soc/meson/meson-card-utils.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
sound/soc/meson/meson-card-utils.c +12 -5
@@ -49,19 +49,26 @@ int meson_card_reallocate_links(struct snd_soc_card *card, links =krealloc (priv->card.dai_link, num_links *sizeof (*priv->card.dai_link),GFP_KERNEL | __GFP_ZERO); +if (!links) + goto err_links; + ldata =krealloc (priv->link_data, num_links *sizeof (*priv->link_data),GFP_KERNEL | __GFP_ZERO); - -if (!links || !ldata) { -dev_err (priv->card.dev,"failed to allocate links\n" ); -return -ENOMEM ; - } +if (!ldata) + goto err_ldata; priv->card.dai_link = links; priv->link_data = ldata; priv->card.num_links = num_links;return 0 ; + +err_ldata: +kfree (links); +err_links: +dev_err (priv->card.dev,"failed to allocate links\n" ); +return -ENOMEM ; + }EXPORT_SYMBOL_GPL (meson_card_reallocate_links);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 95/388 NTB: ntb_pingpong: Choose doorbells based on port number
In reply to Sasha LevinFrom: Logan Gunthorpe <[email protected]>
[ Upstream commit ca93c45755da98302c93abdd788fc09113baf9e0 ]
This commit fixes pingpong support for existing drivers that do not implement ntb_default_port_number() and ntb_default_peer_port_number(). This is required for hardware (like the crosslink topology of switchtec) which cannot assign reasonable port numbers to each port due to its perfect symmetry.
Instead of picking the doorbell to use based on the the index of the peer, we use the peer's port number. This is a bit clearer and easier to understand.
--- drivers/ntb/test/ntb_pingpong.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/ntb/test/ntb_pingpong.c +6 -8
@@ -121,15 +121,14 @@ static int pp_find_next_peer(struct pp_ctx *pp) link =ntb_link_is_up (pp->ntb,NULL ,NULL );/* Find next available peer */ -if (link & pp->nmask) { +if (link & pp->nmask) pidx =__ffs64 (link & pp->nmask); - out_db =BIT_ULL (pidx +1 ); - }else if (link & pp->pmask) { +else if (link & pp->pmask) pidx =__ffs64 (link & pp->pmask); - out_db =BIT_ULL (pidx); - }else { +else return -ENODEV ; - } + + out_db =BIT_ULL (ntb_peer_port_number (pp->ntb, pidx));spin_lock (&pp->lock); pp->out_pidx = pidx;
@@ -303,7 +302,7 @@ static void pp_init_flds(struct pp_ctx *pp)break ; } - pp->in_db =BIT_ULL (pidx); + pp->in_db =BIT_ULL (lport); pp->pmask =GENMASK_ULL (pidx,0 ) >>1 ; pp->nmask =GENMASK_ULL (pcnt -1 , pidx);
@@ -432,4 +431,3 @@ static void __exit pp_exit(void)debugfs_remove_recursive (pp_dbgfs_topdir); }module_exit (pp_exit); -
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 96/388 NTB: Fix the default port and peer numbers for legacy drivers
In reply to Sasha LevinFrom: Logan Gunthorpe <[email protected]>
[ Upstream commit fc8b086d9dbd57458d136c4fa70ee26f832c3a2e ]
When the commit adding ntb_default_port_number() and ntb_default_peer_port_number() entered the kernel there was no users of it so it was impossible to tell what the API needed.
When a user finally landed a year later (ntb_pingpong) there were more NTB topologies were created and no consideration was considered to how other drivers had changed.
Now that there is a user it can be fixed to provide a sensible default for the legacy drivers that do not implement ntb_{peer_}port_number(). Seeing ntb_pingpong doesn't check error codes returning EINVAL was also not sensible.
Patches for ntb_pingpong and ntb_perf follow (which are broken otherwise) to support hardware that doesn't have port numbers. This is important not only to not break support with existing drivers but for the cross link topology which, due to its perfect symmetry, cannot assign unique port numbers to each side.
--- drivers/ntb/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/ntb/core.c +2 -6
@@ -214,10 +214,8 @@ int ntb_default_port_number(struct ntb_dev *ntb)case NTB_TOPO_B2B_DSD :return NTB_PORT_SEC_DSD ;default : -break ; +return 0 ; } - -return -EINVAL ; }EXPORT_SYMBOL (ntb_default_port_number);
@@ -240,10 +238,8 @@ int ntb_default_peer_port_number(struct ntb_dev *ntb, int pidx)case NTB_TOPO_B2B_DSD :return NTB_PORT_PRI_USD ;default : -break ; +return 0 ; } - -return -EINVAL ; }EXPORT_SYMBOL (ntb_default_peer_port_number);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 97/388 mksysmap: Fix the mismatch of '.L' symbols in System.map
In reply to Sasha LevinFrom: ashimida <[email protected]>
[ Upstream commit 72d24accf02add25e08733f0ecc93cf10fcbd88c ]
When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.
For example:
ashimida@ubuntu:~/linux$ cat System.map |grep ' .L' ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L' ffff0000088028e0 t bLength_show ...... ffff0000092e0408 b PLLP_OUTC_lock ffff0000092e0410 b PLLP_OUTA_lock
The original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped.
--- scripts/mksysmap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mksysmap +1 -1
@@ -41,4 +41,4 @@ # so we just ignore them to let readprofile continue to work. # (At least sparc64 has __crc_ in the middle). -$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( .L\)' > $2 +$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)' > $2
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 103/388 ASoC: meson: add missing free_irq() in error path
In reply to Sasha LevinFrom: "Pavel Machek (CIP)" <[email protected]>
[ Upstream commit 3b8a299a58b2afce464ae11324b59dcf0f1d10a7 ]
free_irq() is missing in case of error, fix that.
--- sound/soc/meson/axg-fifo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/meson/axg-fifo.c +8 -2
@@ -249,7 +249,7 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,/* Enable pclk to access registers and clock the fifo ip */ ret =clk_prepare_enable (fifo->pclk);if (ret) -return ret; + goto free_irq;/* Setup status2 so it reports the memory pointer */ regmap_update_bits(fifo->map, FIFO_CTRL1,
@@ -269,8 +269,14 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,/* Take memory arbitror out of reset */ ret =reset_control_deassert (fifo->arb);if (ret) -clk_disable_unprepare (fifo->pclk); + goto free_clk; + +return 0 ; +free_clk: +clk_disable_unprepare (fifo->pclk); +free_irq: +free_irq (fifo->irq, ss);return ret; }EXPORT_SYMBOL_GPL (axg_fifo_pcm_open);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 106/388 scsi: sr: Fix sr_probe() missing deallocate of device minor
In reply to Sasha LevinFrom: Simon Arlott <[email protected]>
[ Upstream commit 6555781b3fdec5e94e6914511496144241df7dee ]
If the cdrom fails to be registered then the device minor should be deallocated.
--- drivers/scsi/sr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/scsi/sr.c +5 -1
@@ -797,7 +797,7 @@ static int sr_probe(struct device *dev) cd->cdi.disk = disk;if (register_cdrom (&cd->cdi)) - goto fail_put; + goto fail_minor;/* * Initialize block layer runtime PM stuffs before the
@@ -815,6 +815,10 @@ static int sr_probe(struct device *dev)return 0 ; +fail_minor: +spin_lock (&sr_index_lock); +clear_bit (minor, sr_index_bits); +spin_unlock (&sr_index_lock); fail_put:put_disk (disk);mutex_destroy (&cd->lock);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 101/388 f2fs: handle readonly filesystem in f2fs_ioc_shutdown()
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit 8626441f05dc45a2f4693ee6863d02456ce39e60 ]
If mountpoint is readonly, we should allow shutdowning filesystem successfully, this fixes issue found by generic/599 testcase of xfstest.
--- fs/f2fs/file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/f2fs/file.c +8 -1
@@ -2219,8 +2219,15 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)if (in !=F2FS_GOING_DOWN_FULLSYNC ) { ret =mnt_want_write_file (filp); -if (ret) +if (ret) { +if (ret == -EROFS ) { + ret =0 ; +f2fs_stop_checkpoint (sbi, false); +set_sbi_flag (sbi,SBI_IS_SHUTDOWN ); +trace_f2fs_shutdown (sbi, in, ret); + }return ret; + } }switch (in) {
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 108/388 media: s5p-mfc: Properly handle dma_parms for the allocated devices
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit cc8c0363ddce6308168d8223378ca884c213f280 ]
Commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") in v5.7-rc5 added allocation of dma_parms structure to all platform devices. Then vb2_dma_contig_set_max_seg_size() have been changed not to allocate dma_parms structure and rely on the one allocated by the device core. Lets allocate the needed structure also for the devices created for the 2 MFC device memory ports.
--- drivers/media/platform/s5p-mfc/s5p_mfc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/media/platform/s5p-mfc/s5p_mfc.c +5 -1
@@ -1089,6 +1089,10 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, child->coherent_dma_mask = dev->coherent_dma_mask; child->dma_mask = dev->dma_mask; child->release = s5p_mfc_memdev_release; + child->dma_parms =devm_kzalloc (dev,sizeof (*child->dma_parms), +GFP_KERNEL ); +if (!child->dma_parms) + goto err;/* * The memdevs are not proper OF platform devices, so in order for them
@@ -1104,7 +1108,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,return child;device_del (child); } - +err:put_device (child);return NULL ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 107/388 scsi: ibmvscsi: Don't send host info in adapter info MAD after LPM
In reply to Sasha LevinFrom: Tyrel Datwyler <[email protected]>
[ Upstream commit 4919b33b63c8b69d8dcf2b867431d0e3b6dc6d28 ]
The adapter info MAD is used to send the client info and receive the host info as a response. A persistent buffer is used and as such the client info is overwritten after the response. During the course of a normal adapter reset the client info is refreshed in the buffer in preparation for sending the adapter info MAD.
However, in the special case of LPM where we reenable the CRQ instead of a full CRQ teardown and reset we fail to refresh the client info in the adapter info buffer. As a result, after Live Partition Migration (LPM) we erroneously report the host's info as our own.
[mkp: typos]
--- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/ibmvscsi/ibmvscsi.c +2 -0
@@ -415,6 +415,8 @@ static int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,int rc =0 ;struct vio_dev *vdev =to_vio_dev (hostdata->dev); +set_adapter_info (hostdata); +/* Re-enable the CRQ */ do { if (rc)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 110/388 ibmvnic: Flush existing work items before device removal
In reply to Sasha LevinFrom: Thomas Falcon <[email protected]>
[ Upstream commit 6954a9e4192b86d778fb52b525fd7b62d51b1147 ]
Ensure that all scheduled work items have completed before continuing with device removal and after further event scheduling has been halted. This patch fixes a bug where a scheduled driver reset event is processed following device removal.
--- drivers/net/ethernet/ibm/ibmvnic.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/ibm/ibmvnic.c +3 -0
@@ -5184,6 +5184,9 @@ static int ibmvnic_remove(struct vio_dev *dev) adapter->state =VNIC_REMOVING ;spin_unlock_irqrestore (&adapter->state_lock, flags); +flush_work (&adapter->ibmvnic_reset); +flush_delayed_work (&adapter->ibmvnic_delayed_reset); +rtnl_lock ();unregister_netdevice (netdev);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 31/388 PCI: brcmstb: Fix window register offset from 4 to 8
In reply to Sasha LevinFrom: Jim Quinlan <[email protected]>
[ Upstream commit 077a4fa92a615a4d0f86eae68d777b9dd5e5a95b ]
The outbound memory window registers were being referenced with an incorrect stride offset. This probably wasn't noticed previously as there was likely only one such window employed.
--- drivers/pci/controller/pcie-brcmstb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/pcie-brcmstb.c +2 -2
@@ -54,11 +54,11 @@#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LO 0x400c#define PCIE_MEM_WIN0_LO (win) \ - PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LO + ((win) * 4) + PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LO + ((win) * 8)#define PCIE_MISC_CPU_2_PCIE_MEM_WIN0_HI 0x4010#define PCIE_MEM_WIN0_HI (win) \ - PCIE_MISC_CPU_2_PCIE_MEM_WIN0_HI + ((win) * 4) + PCIE_MISC_CPU_2_PCIE_MEM_WIN0_HI + ((win) * 8)#define PCIE_MISC_RC_BAR1_CONFIG_LO 0x402c#define PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK 0x1f
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 113/388 x86/purgatory: Disable various profiling and sanitizing options
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit e2ac07c06058ae2d58b45bbf2a2a352771d76fcb ]
Since the purgatory is a special stand-alone binary, various profiling and sanitizing options must be disabled. Having these options enabled typically will cause dependencies on various special symbols exported by special libs / stubs used by these frameworks. Since the purgatory is special, it is not linked against these stubs causing missing symbols in the purgatory if these options are not disabled.
Sync the set of disabled profiling and sanitizing options with that from drivers/firmware/efi/libstub/Makefile, adding -DDISABLE_BRANCH_PROFILING to the CFLAGS and setting:
GCOV_PROFILE := n
UBSAN_SANITIZE := n
This fixes broken references to ftrace_likely_update() when CONFIG_TRACE_BRANCH_PROFILING is enabled and to __gcov_init() and __gcov_exit() when CONFIG_GCOV_KERNEL is enabled.
--- arch/x86/purgatory/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/purgatory/Makefile +4 -1
@@ -17,7 +17,10 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib targets += purgatory.ro +# Sanitizer, etc. runtimes are unavailable and cannot be linked here. +GCOV_PROFILE := n KASAN_SANITIZE := n +UBSAN_SANITIZE := n KCOV_INSTRUMENT := n # These are adjustments to the compiler flags used for objects that
@@ -25,7 +28,7 @@ KCOV_INSTRUMENT := n PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) +PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That # in turn leaves some undefined symbols like __fentry__ in purgatory and not
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 114/388 ARM: dts: bcm283x: Use firmware PM driver for V3D
In reply to Sasha LevinFrom: Nicolas Saenz Julienne <[email protected]>
[ Upstream commit 3ac395a5b3f3b678663fbb58381fdae2b1b57588 ]
The register based driver turned out to be unstable, specially on RPi3a+ but not limited to it. While a fix is being worked on, we roll back to using firmware based scheme.
--- arch/arm/boot/dts/bcm2835-common.dtsi | 1 - arch/arm/boot/dts/bcm2835-rpi-common.dtsi | 12 ++++++++++++ arch/arm/boot/dts/bcm2835.dtsi | 1 + arch/arm/boot/dts/bcm2836.dtsi | 1 + arch/arm/boot/dts/bcm2837.dtsi | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/bcm2835-rpi-common.dtsi
arch/arm/boot/dts/bcm2835-common.dtsi +0 -1
@@ -130,7 +130,6 @@ v3d: v3d@7ec00000 { compatible = "brcm,bcm2835-v3d"; reg = <0x7ec00000 0x1000>; interrupts = <1 10>; - power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>; }; vc4: gpu {
arch/arm/boot/dts/bcm2835-rpi-common.dtsi new file +12 -0
@@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This include file covers the common peripherals and configuration between + * bcm2835, bcm2836 and bcm2837 implementations that interact with RPi's + * firmware interface. + */ + +#include <dt-bindings/power/raspberrypi-power.h> + +&v3d { + power-domains = <&power RPI_POWER_DOMAIN_V3D>; +};
arch/arm/boot/dts/bcm2835.dtsi +1 -0
@@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" #include "bcm2835-common.dtsi" +#include "bcm2835-rpi-common.dtsi" / { compatible = "brcm,bcm2835";
arch/arm/boot/dts/bcm2836.dtsi +1 -0
@@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" #include "bcm2835-common.dtsi" +#include "bcm2835-rpi-common.dtsi" / { compatible = "brcm,bcm2836";
arch/arm/boot/dts/bcm2837.dtsi +1 -0
@@ -1,5 +1,6 @@ #include "bcm283x.dtsi" #include "bcm2835-common.dtsi" +#include "bcm2835-rpi-common.dtsi" / { compatible = "brcm,bcm2837";
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 115/388 arm64: dts: realtek: rtd129x: Fix GIC CPU masks for RTD1293
In reply to Sasha LevinFrom: Andreas Färber <[email protected]>
[ Upstream commit 31888c8be1486daf2c34ba6c58129635e49d564a ]
Convert from GIC_CPU_MASK_RAW() to GIC_CPU_MASK_SIMPLE().
In case of RTD1293 adjust the arch timer and VGIC interrupts' CPU masks to its smaller number of CPUs.
--- arch/arm64/boot/dts/realtek/rtd1293.dtsi | 12 ++++++++---- arch/arm64/boot/dts/realtek/rtd1295.dtsi | 8 ++++---- arch/arm64/boot/dts/realtek/rtd1296.dtsi | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/realtek/rtd1293.dtsi +8 -4
@@ -36,16 +36,20 @@ l2: l2-cache { timer { compatible = "arm,armv8-timer"; interrupts = <GIC_PPI 13 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 14 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 11 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 10 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>; + (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>; }; }; &arm_pmu { interrupt-affinity = <&cpu0>, <&cpu1>; }; + +&gic { + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>; +};
arch/arm64/boot/dts/realtek/rtd1295.dtsi +4 -4
@@ -61,13 +61,13 @@ tee@10100000 { timer { compatible = "arm,armv8-timer"; interrupts = <GIC_PPI 13 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 14 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 11 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 10 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>; + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; }; };
arch/arm64/boot/dts/realtek/rtd1296.dtsi +4 -4
@@ -50,13 +50,13 @@ l2: l2-cache { timer { compatible = "arm,armv8-timer"; interrupts = <GIC_PPI 13 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 14 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 11 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>, + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, <GIC_PPI 10 - (GIC_CPU_MASK_RAW(0xf) | IRQ_TYPE_LEVEL_LOW)>; + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; }; };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 116/388 staging: greybus: fix a missing-check bug in gb_lights_light_config()
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit 9bb086e5ba9495ac150fbbcc5c8c2bccc06261dd ]
In gb_lights_light_config(), 'light->name' is allocated by kstrndup(). It returns NULL when fails, add check for it.
--- drivers/staging/greybus/light.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/light.c +2 -1
@@ -1026,7 +1026,8 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) light->channels_count = conf.channel_count; light->name =kstrndup (conf.name,NAMES_MAX ,GFP_KERNEL ); - +if (!light->name) +return -ENOMEM ; light->channels =kcalloc (light->channels_count,sizeof (struct gb_channel ),GFP_KERNEL );if (!light->channels)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 119/388 arm64: dts: mt8173: fix unit name warnings
In reply to Sasha LevinFrom: Hsin-Yi Wang <[email protected]>
[ Upstream commit 72b29215aced394d01ca25e432963b619daa0098 ]
Fixing several unit name warnings:
Warning (unit_address_vs_reg): /oscillator@0: node has a unit name, but no reg property
Warning (unit_address_vs_reg): /oscillator@1: node has a unit name, but no reg property
Warning (unit_address_vs_reg): /oscillator@2: node has a unit name, but no reg property
Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/trips/trip-point@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/trips/trip-point@1: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/trips/cpu_crit@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/cooling-maps/map@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /thermal-zones/cpu_thermal/cooling-maps/map@1: node has a unit name, but no reg property Warning (unit_address_vs_reg): /reserved-memory/vpu_dma_mem_region: node has a reg or ranges property, but no unit name Warning (simple_bus_reg): /soc/pinctrl@10005000: simple-bus unit address format error, expected "1000b000" Warning (simple_bus_reg): /soc/interrupt-controller@10220000: simple-bus unit address format error, expected "10221000"
--- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173.dtsi +11 -11
@@ -242,21 +242,21 @@ psci { cpu_on = <0x84000003>; }; - clk26m: oscillator@0 { + clk26m: oscillator0 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <26000000>; clock-output-names = "clk26m"; }; - clk32k: oscillator@1 { + clk32k: oscillator1 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <32000>; clock-output-names = "clk32k"; }; - cpum_ck: oscillator@2 { + cpum_ck: oscillator2 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <0>;
@@ -272,19 +272,19 @@ cpu_thermal: cpu_thermal { sustainable-power = <1500>; /* milliwatts */ trips { - threshold: trip-point@0 { + threshold: trip-point0 { temperature = <68000>; hysteresis = <2000>; type = "passive"; }; - target: trip-point@1 { + target: trip-point1 { temperature = <85000>; hysteresis = <2000>; type = "passive"; }; - cpu_crit: cpu_crit@0 { + cpu_crit: cpu_crit0 { temperature = <115000>; hysteresis = <2000>; type = "critical";
@@ -292,13 +292,13 @@ cpu_crit: cpu_crit@0 { }; cooling-maps { - map@0 { + map0 { trip = <&target>; cooling-device = <&cpu0 0 0>, <&cpu1 0 0>; contribution = <3072>; }; - map@1 { + map1 { trip = <&target>; cooling-device = <&cpu2 0 0>, <&cpu3 0 0>;
@@ -312,7 +312,7 @@ reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; - vpu_dma_reserved: vpu_dma_mem_region { + vpu_dma_reserved: vpu_dma_mem_region@b7000000 { compatible = "shared-dma-pool"; reg = <0 0xb7000000 0 0x500000>; alignment = <0x1000>;
@@ -365,7 +365,7 @@ syscfg_pctl_a: syscfg_pctl_a@10005000 { reg = <0 0x10005000 0 0x1000>; }; - pio: pinctrl@10005000 { + pio: pinctrl@1000b000 { compatible = "mediatek,mt8173-pinctrl"; reg = <0 0x1000b000 0 0x1000>; mediatek,pctl-regmap = <&syscfg_pctl_a>;
@@ -572,7 +572,7 @@ mipi_tx1: mipi-dphy@10216000 { status = "disabled"; }; - gic: interrupt-controller@10220000 { + gic: interrupt-controller@10221000 { compatible = "arm,gic-400"; #interrupt-cells = <3>; interrupt-parent = <&gic>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 121/388 arm64: dts: qcom: msm8916: remove unit name for thermal trip points
In reply to Sasha LevinFrom: Amit Kucheria <[email protected]>
[ Upstream commit fe2aff0c574d206f34f1864d5a0b093694c27142 ]
The thermal trip points have unit name but no reg property, so we can remove them. It also fixes the following warnings from 'make dtbs_check' after adding the thermal yaml bindings.
arch/arm64/boot/dts/qcom/apq8016-sbc.dt.yaml: thermal-zones:
gpu-thermal:trips: 'trip-point@0' does not match any of the regexes:
'^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8016-sbc.dt.yaml: thermal-zones:
camera-thermal:trips: 'trip-point@0' does not match any of the regexes:
'^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/apq8016-sbc.dt.yaml: thermal-zones:
modem-thermal:trips: 'trip-point@0' does not match any of the regexes:
'^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+'
arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: thermal-zones:
gpu-thermal:trips: 'trip-point@0' does not match any of the regexes:
'^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: thermal-zones:
camera-thermal:trips: 'trip-point@0' does not match any of the regexes:
'^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+' arch/arm64/boot/dts/qcom/msm8916-mtp.dt.yaml: thermal-zones:
modem-thermal:trips: 'trip-point@0' does not match any of the regexes:
'^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$', 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +4 -4
@@ -261,7 +261,7 @@ cpu2_3-thermal { thermal-sensors = <&tsens 4>; trips { - cpu2_3_alert0: trip-point@0 { + cpu2_3_alert0: trip-point0 { temperature = <75000>; hysteresis = <2000>; type = "passive";
@@ -291,7 +291,7 @@ gpu-thermal { thermal-sensors = <&tsens 2>; trips { - gpu_alert0: trip-point@0 { + gpu_alert0: trip-point0 { temperature = <75000>; hysteresis = <2000>; type = "passive";
@@ -311,7 +311,7 @@ camera-thermal { thermal-sensors = <&tsens 1>; trips { - cam_alert0: trip-point@0 { + cam_alert0: trip-point0 { temperature = <75000>; hysteresis = <2000>; type = "hot";
@@ -326,7 +326,7 @@ modem-thermal { thermal-sensors = <&tsens 0>; trips { - modem_alert0: trip-point@0 { + modem_alert0: trip-point0 { temperature = <85000>; hysteresis = <2000>; type = "hot";
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 123/388 RDMA/mlx5: Fix udata response upon SRQ creation
In reply to Sasha LevinFrom: Yishai Hadas <[email protected]>
[ Upstream commit cf26deff9036cd3270af562dbec545239e5c7f07 ]
Fix udata response upon SRQ creation to use the UAPI structure (i.e. mlx5_ib_create_srq_resp). It did not zero the reserved field in userspace.
--- drivers/infiniband/hw/mlx5/srq.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/srq.c +8 -2
@@ -310,12 +310,18 @@ int mlx5_ib_create_srq(struct ib_srq *ib_srq, srq->msrq.event = mlx5_ib_srq_event; srq->ibsrq.ext.xrc.srq_num = srq->msrq.srqn; -if (udata) -if (ib_copy_to_udata (udata, &srq->msrq.srqn,sizeof (__u32))) { +if (udata) { +struct mlx5_ib_create_srq_resp resp = { + .srqn = srq->msrq.srqn, + }; + +if (ib_copy_to_udata (udata, &resp,min (udata->outlen, +sizeof (resp)))) {mlx5_ib_dbg (dev,"copy to user failed\n" ); err = -EFAULT ; goto err_core; } + } init_attr->attr.max_wr = srq->msrq.max -1 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 125/388 gpio: dwapb: Append MODULE_ALIAS for platform driver
In reply to Sasha LevinFrom: Andy Shevchenko <[email protected]>
[ Upstream commit c58220cba2e03618659fa7d5dfae31f5ad4ae9d0 ]
The commit 3d2613c4289f
("GPIO: gpio-dwapb: Enable platform driver binding to MFD driver")
introduced a use of the platform driver but missed to add the following line to it:
MODULE_ALIAS("platform:gpio-dwapb");
Add this to get driver loaded automatically if platform device is registered.
--- drivers/gpio/gpio-dwapb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpio/gpio-dwapb.c +6 -3
@@ -49,7 +49,9 @@#define GPIO_EXT_PORTC 0x58#define GPIO_EXT_PORTD 0x5c +#define DWAPB_DRIVER_NAME "gpio-dwapb"#define DWAPB_MAX_PORTS 4 +#define GPIO_EXT_PORT_STRIDE 0x04/* register stride 32 bits */ #define GPIO_SWPORT_DR_STRIDE 0x0c/* register stride 3*32 bits */ #define GPIO_SWPORT_DDR_STRIDE 0x0c/* register stride 3*32 bits */
@@ -398,7 +400,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,return ; err =irq_alloc_domain_generic_chips (gpio->domain, ngpio,2 , -"gpio-dwapb" , handle_level_irq, +DWAPB_DRIVER_NAME , handle_level_irq,IRQ_NOREQUEST ,0 ,IRQ_GC_INIT_NESTED_LOCK );if (err) {
@@ -455,7 +457,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,*/ err =devm_request_irq (gpio->dev, pp->irq[0 ], dwapb_irq_handler_mfd, -IRQF_SHARED ,"gpio-dwapb-mfd" , gpio); +IRQF_SHARED ,DWAPB_DRIVER_NAME , gpio);if (err) {dev_err (gpio->dev,"error requesting IRQ\n" );irq_domain_remove (gpio->domain);
@@ -843,7 +845,7 @@ static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend,static struct platform_driver dwapb_gpio_driver = { .driver = { - .name ="gpio-dwapb" , + .name =DWAPB_DRIVER_NAME , .pm = &dwapb_gpio_pm_ops, .of_match_table =of_match_ptr (dwapb_of_match), .acpi_match_table =ACPI_PTR (dwapb_acpi_match),
@@ -857,3 +859,4 @@ module_platform_driver(dwapb_gpio_driver);MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Jamie Iles" );MODULE_DESCRIPTION ("Synopsys DesignWare APB GPIO driver" ); +MODULE_ALIAS ("platform:" DWAPB_DRIVER_NAME );
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 126/388 scsi: qedf: Fix crash when MFW calls for protocol stats while function is still probing
In reply to Sasha LevinFrom: Chad Dupuis <[email protected]>
[ Upstream commit ad40f5256095c68dc17c991eb976261d5ea2daaa ]
The MFW may make a call to qed and then to qedf for protocol statistics while the function is still probing. If this happens it's possible that some members of the struct qedf_ctx may not be fully initialized which can result in a NULL pointer dereference or general protection fault.
To prevent this, add a new flag call QEDF_PROBING and set it when the __qedf_probe() function is active. Then in the qedf_get_protocol_tlv_data() function we can check if the function is still probing and return immediantely before any uninitialized structures can be touched.
--- drivers/scsi/qedf/qedf.h | 1 + drivers/scsi/qedf/qedf_main.c | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-)
drivers/scsi/qedf/qedf.h +1 -0
@@ -355,6 +355,7 @@ struct qedf_ctx {#define QEDF_GRCDUMP_CAPTURE 4#define QEDF_IN_RECOVERY 5#define QEDF_DBG_STOP_IO 6 +#define QEDF_PROBING 8unsigned long flags;/* Miscellaneous state flags */ int fipvlan_retries;u8 num_queues;
drivers/scsi/qedf/qedf_main.c +31 -4
@@ -3153,7 +3153,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) {int rc = -EINVAL ;struct fc_lport *lport; -struct qedf_ctx *qedf; +struct qedf_ctx *qedf =NULL ;struct Scsi_Host *host;bool is_vf = false;struct qed_ll2_params params;
@@ -3183,6 +3183,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)/* Initialize qedf_ctx */ qedf =lport_priv (lport); +set_bit (QEDF_PROBING , &qedf->flags); qedf->lport = lport; qedf->ctlr.lp = lport; qedf->pdev = pdev;
@@ -3206,9 +3207,12 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) }else {/* Init pointers during recovery */ qedf =pci_get_drvdata (pdev); +set_bit (QEDF_PROBING , &qedf->flags); lport = qedf->lport; } +QEDF_INFO (&qedf->dbg_ctx,QEDF_LOG_DISC ,"Probe started.\n" ); + host = lport->host;/* Allocate mempool for qedf_io_work structs */
@@ -3513,6 +3517,10 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)else fc_fabric_login (lport); +QEDF_INFO (&qedf->dbg_ctx,QEDF_LOG_DISC ,"Probe done.\n" ); + +clear_bit (QEDF_PROBING , &qedf->flags); +/* All good */ return 0 ;
@@ -3538,6 +3546,11 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) err1:scsi_host_put (lport->host); err0: +if (qedf) { +QEDF_INFO (&qedf->dbg_ctx,QEDF_LOG_DISC ,"Probe done.\n" ); + +clear_bit (QEDF_PROBING , &qedf->flags); + }return rc; }
@@ -3687,11 +3700,25 @@ void qedf_get_protocol_tlv_data(void *dev, void *data) {struct qedf_ctx *qedf = dev;struct qed_mfw_tlv_fcoe *fcoe = data; -struct fc_lport *lport = qedf->lport; -struct Scsi_Host *host = lport->host; -struct fc_host_attrs *fc_host =shost_to_fc_host (host); +struct fc_lport *lport; +struct Scsi_Host *host; +struct fc_host_attrs *fc_host;struct fc_host_statistics *hst; +if (!qedf) { +QEDF_ERR (NULL ,"qedf is null.\n" ); +return ; + } + +if (test_bit (QEDF_PROBING , &qedf->flags)) { +QEDF_ERR (&qedf->dbg_ctx,"Function is still probing.\n" ); +return ; + } + + lport = qedf->lport; + host = lport->host; + fc_host =shost_to_fc_host (host); +/* Force a refresh of the fc_host stats including offload stats */ hst =qedf_fc_get_host_stats (host);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 128/388 iio: buffer-dmaengine: use %zu specifier for sprintf(align)
In reply to Sasha LevinFrom: Alexandru Ardelean <[email protected]>
[ Upstream commit 6eb3b8acfd079104571c207d4524743b6acc6550 ]
The 'size_t' type behaves differently on 64-bit architectures, and causes compiler a warning of the sort "format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t {aka long unsigned int}'".
This change adds the correct specifier for the 'align' field.
--- drivers/iio/buffer/industrialio-buffer-dmaengine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/buffer/industrialio-buffer-dmaengine.c +1 -1
@@ -134,7 +134,7 @@ static ssize_t iio_dmaengine_buffer_get_length_align(struct device *dev,struct dmaengine_buffer *dmaengine_buffer =iio_buffer_to_dmaengine_buffer (indio_dev->buffer); -return sprintf (buf,"%u\n" , dmaengine_buffer->align); +return sprintf (buf,"%zu\n" , dmaengine_buffer->align); } static IIO_DEVICE_ATTR(length_align_bytes, 0444,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 130/388 ASoC: Fix wrong dependency of da7210 and wm8983
In reply to Sasha LevinFrom: Wei Li <[email protected]>
[ Upstream commit c1c050ee74d67aeb879fd38e3a07139d7fdb79f4 ]
As these two drivers support I2C and SPI, we should add the SND_SOC_I2C_AND_SPI dependency instead.
--- sound/soc/codecs/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/Kconfig +2 -2
@@ -717,7 +717,7 @@ config SND_SOC_L3 config SND_SOC_DA7210 tristate - depends on I2C + depends on SND_SOC_I2C_AND_SPI config SND_SOC_DA7213 tristate "Dialog DA7213 CODEC"
@@ -1569,7 +1569,7 @@ config SND_SOC_WM8978 config SND_SOC_WM8983 tristate - depends on I2C + depends on SND_SOC_I2C_AND_SPI config SND_SOC_WM8985 tristate "Wolfson Microelectronics WM8985 and WM8758 codec driver"
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 135/388 arm64: dts: qcom: sm8250: Fix PDC compatible and reg
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 240031967ac4c63713c6e0c3249d734e23c913aa ]
The pdc node suffers from both too narrow compatible and insufficient cells in the reg, fix these.
--- arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +2 -2
@@ -314,8 +314,8 @@ intc: interrupt-controller@17a00000 { }; pdc: interrupt-controller@b220000 { - compatible = "qcom,sm8250-pdc"; - reg = <0x0b220000 0x30000>, <0x17c000f0 0x60>; + compatible = "qcom,sm8250-pdc", "qcom,pdc"; + reg = <0 0x0b220000 0 0x30000>, <0 0x17c000f0 0 0x60>; qcom,pdc-ranges = <0 480 94>, <94 609 31>, <125 63 1>, <126 716 12>; #interrupt-cells = <2>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 142/388 s390/qdio: tear down thinint indicator after early error
In reply to Sasha LevinFrom: Julian Wiedmann <[email protected]>
[ Upstream commit 68a381746f20e5435206173e22d0a011ef78790e ]
qdio_establish() calls qdio_establish_thinint(), but later has an error exit path that doesn't roll this call back. Fix it.
--- drivers/s390/cio/qdio_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/cio/qdio_main.c +1 -0
@@ -1363,6 +1363,7 @@ int qdio_establish(struct ccw_device *cdev,if (rc) {DBF_ERROR ("%4x est IO ERR" , irq_ptr->schid.sch_no);DBF_ERROR ("rc:%4x" , rc); +qdio_shutdown_thinint (irq_ptr);qdio_shutdown_irq (irq_ptr);mutex_unlock (&irq_ptr->setup_mutex);return rc;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 143/388 s390/qdio: put thinint indicator after early error
In reply to Sasha LevinFrom: Julian Wiedmann <[email protected]>
[ Upstream commit 75e82bec6b2622c6f455b7a543fb5476a5d0eed7 ]
qdio_establish() calls qdio_setup_thinint() via qdio_setup_irq(). If the subsequent qdio_establish_thinint() fails, we miss to put the DSCI again. Thus the DSCI isn't available for re-use. Given enough of such errors, we could end up with having only the shared DSCI available.
Merge qdio_setup_thinint() into qdio_establish_thinint(), and deal with such an error internally.
--- drivers/s390/cio/qdio.h | 1 - drivers/s390/cio/qdio_setup.c | 1 - drivers/s390/cio/qdio_thinint.c | 14 ++++++++------ 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/s390/cio/qdio.h +0 -1
@@ -364,7 +364,6 @@ static inline int multicast_outbound(struct qdio_q *q)extern u64 last_ai_time;/* prototypes for thin interrupt */ -void qdio_setup_thinint (struct qdio_irq *irq_ptr);int qdio_establish_thinint (struct qdio_irq *irq_ptr);void qdio_shutdown_thinint (struct qdio_irq *irq_ptr);void tiqdio_add_device (struct qdio_irq *irq_ptr);
drivers/s390/cio/qdio_setup.c +0 -1
@@ -480,7 +480,6 @@ int qdio_setup_irq(struct qdio_irq *irq_ptr, struct qdio_initialize *init_data) }setup_qib (irq_ptr, init_data); -qdio_setup_thinint (irq_ptr); set_impl_params(irq_ptr, init_data->qib_param_field_format, init_data->qib_param_field, init_data->input_slib_elements,
drivers/s390/cio/qdio_thinint.c +8 -6
@@ -227,17 +227,19 @@ int __init tiqdio_register_thinints(void)int qdio_establish_thinint (struct qdio_irq *irq_ptr) { +int rc; +if (!is_thinint_irq (irq_ptr))return 0 ; -return set_subchannel_ind (irq_ptr,0 ); -} -void qdio_setup_thinint (struct qdio_irq *irq_ptr) -{ -if (!is_thinint_irq (irq_ptr)) -return ; irq_ptr->dsci =get_indicator ();DBF_HEX (&irq_ptr->dsci,sizeof (void *)); + + rc =set_subchannel_ind (irq_ptr,0 ); +if (rc) +put_indicator (irq_ptr->dsci); + +return rc; }void qdio_shutdown_thinint (struct qdio_irq *irq_ptr)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 140/388 Input: mms114 - add extra compatible for mms345l
In reply to Sasha LevinFrom: Stephan Gerhold <[email protected]>
[ Upstream commit 7842087b0196d674ed877d768de8f2a34d7fdc53 ]
MMS345L is another first generation touch screen from Melfas, which uses mostly the same registers as MMS152.
However, there is some garbage printed during initialization. Apparently MMS345L does not have the MMS152_COMPAT_GROUP register that is read+printed during initialization.
TSP FW Rev: bootloader 0x6 / core 0x26 / config 0x26, Compat group: \x06
On earlier kernel versions the compat group was actually printed as an ASCII control character, seems like it gets escaped now.
But we probably shouldn't print something from a random register.
Add a separate "melfas,mms345l" compatible that avoids reading from the MMS152_COMPAT_GROUP register. This might also help in case there is some other device-specific quirk in the future.
--- drivers/input/touchscreen/mms114.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/input/touchscreen/mms114.c +15 -2
@@ -54,6 +54,7 @@enum mms_type {TYPE_MMS114 =114 ,TYPE_MMS152 =152 , +TYPE_MMS345L =345 , };struct mms114_data {
@@ -250,6 +251,15 @@ static int mms114_get_version(struct mms114_data *data)int error;switch (data->type) { +case TYPE_MMS345L : + error =__mms114_read_reg (data,MMS152_FW_REV ,3 , buf); +if (error) +return error; + +dev_info (dev,"TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n" , + buf[0 ], buf[1 ], buf[2 ]); +break ; +case TYPE_MMS152 : error =__mms114_read_reg (data,MMS152_FW_REV ,3 , buf);if (error)
@@ -287,8 +297,8 @@ static int mms114_setup_regs(struct mms114_data *data)if (error <0 )return error; -/* MMS152 has no configuration or power on registers */ -if (data->type ==TYPE_MMS152 ) +/* Only MMS114 has configuration and power on registers */ +if (data->type !=TYPE_MMS114 )return 0 ; error =mms114_set_active (data, true);
@@ -597,6 +607,9 @@ static const struct of_device_id mms114_dt_match[] = { }, { .compatible = "melfas,mms152", .data = (void *)TYPE_MMS152, + }, { + .compatible = "melfas,mms345l", + .data = (void *)TYPE_MMS345L, }, { } };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 43/388 serial: 8250: Fix max baud limit in generic 8250 port
In reply to Sasha LevinFrom: Serge Semin <[email protected]>
[ Upstream commit 7b668c064ec33f3d687c3a413d05e355172e6c92 ]
Standard 8250 UART ports are designed in a way so they can communicate with baud rates up to 1/16 of a reference frequency. It's expected from most of the currently supported UART controllers. That's why the former version of serial8250_get_baud_rate() method called uart_get_baud_rate() with min and max baud rates passed as (port->uartclk / 16 / UART_DIV_MAX) and ((port->uartclk + tolerance) / 16) respectively. Doing otherwise, like it was suggested in commit ("serial: 8250_mtk: support big baud rate."), caused acceptance of bauds, which was higher than the normal UART controllers actually supported. As a result if some user-space program requested to set a baud greater than (uartclk / 16) it would have been permitted without truncation, but then serial8250_get_divisor(baud) (which calls uart_get_divisor() to get the reference clock divisor) would have returned a zero divisor. Setting zero divisor will cause an unpredictable effect varying from chip to chip. In case of DW APB UART the communications just stop.
Lets fix this problem by getting back the limitation of (uartclk + tolerance) / 16 maximum baud supported by the generic 8250 port. Mediatek 8250 UART ports driver developer shouldn't have touched it in the first place notably seeing he already provided a custom version of set_termios() callback in that glue-driver which took into account the extended baud rate values and accordingly updated the standard and vendor-specific divisor latch registers anyway.
--- drivers/tty/serial/8250/8250_port.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +3 -1
@@ -2615,6 +2615,8 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,struct ktermios *termios, struct ktermios *old) { + unsigned int tolerance = port->uartclk / 100; +/* * Ask the core to calculate the divisor for us. * Allow 1% tolerance at the upper limit so uart clks marginally
@@ -2623,7 +2625,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,*/ return uart_get_baud_rate (port, termios, old, port->uartclk /16 /UART_DIV_MAX , - port->uartclk); + (port->uartclk + tolerance) /16 ); }void
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 145/388 staging: wfx: fix double init of tx_policy_upload_work
In reply to Sasha LevinFrom: Jérôme Pouiller <[email protected]>
[ Upstream commit 6ae0878b4800c7042d35c0fb4c6baabb62621ecc ]
The work_struct tx_policy_upload_work was initialized twice.
--- drivers/staging/wfx/sta.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/wfx/sta.c +0 -1
@@ -1049,7 +1049,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)init_completion (&wvif->scan_complete);INIT_WORK (&wvif->scan_work, wfx_hw_scan_work); -INIT_WORK (&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work);mutex_unlock (&wdev->conf_mutex);hif_set_macaddr (wvif, vif->addr);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 147/388 slimbus: ngd: get drvdata from correct device
In reply to Sasha LevinFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit b58c663059b484f7ff547d076a34cf6d7a302e56 ]
Get drvdata directly from parent instead of ngd dev, as ngd dev can probe defer and previously set drvdata will become null.
--- drivers/slimbus/qcom-ngd-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +2 -2
@@ -1361,7 +1361,6 @@ static int of_qcom_slim_ngd_register(struct device *parent, ngd->pdev->driver_override =QCOM_SLIM_NGD_DRV_NAME ; ngd->pdev->dev.of_node = node; ctrl->ngd = ngd; -platform_set_drvdata (ngd->pdev, ctrl);platform_device_add (ngd->pdev); ngd->base = ctrl->base + ngd->id * data->offset +
@@ -1376,12 +1375,13 @@ static int of_qcom_slim_ngd_register(struct device *parent,static int qcom_slim_ngd_probe (struct platform_device *pdev) { -struct qcom_slim_ngd_ctrl *ctrl =platform_get_drvdata (pdev);struct device *dev = &pdev->dev; +struct qcom_slim_ngd_ctrl *ctrl =dev_get_drvdata (dev->parent);int ret; ctrl->ctrl.dev = dev; +platform_set_drvdata (pdev, ctrl);pm_runtime_use_autosuspend (dev);pm_runtime_set_autosuspend_delay (dev,QCOM_SLIM_NGD_AUTOSUSPEND );pm_runtime_set_suspended (dev);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 148/388 gpio: mlxbf2: fix return value check in mlxbf2_gpio_get_lock_res()
In reply to Sasha LevinFrom: Wei Yongjun <[email protected]>
[ Upstream commit 66d8ad67aab3bc6f55e7de81565cd0d4875bd851 ]
In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.
--- drivers/gpio/gpio-mlxbf2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-mlxbf2.c +2 -2
@@ -110,8 +110,8 @@ static int mlxbf2_gpio_get_lock_res(struct platform_device *pdev) } yu_arm_gpio_lock_param.io =devm_ioremap (dev, res->start, size); -if (IS_ERR (yu_arm_gpio_lock_param.io)) - ret =PTR_ERR (yu_arm_gpio_lock_param.io); +if (!yu_arm_gpio_lock_param.io) + ret = -ENOMEM ; exit:mutex_unlock (yu_arm_gpio_lock_param.lock);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 136/388 staging: gasket: Fix mapping refcnt leak when put attribute fails
In reply to Sasha LevinFrom: Xiyu Yang <[email protected]>
[ Upstream commit 57a66838e1494cd881b7f4e110ec685736e8e3ca ]
gasket_sysfs_put_attr() invokes get_mapping(), which returns a reference of the specified gasket_sysfs_mapping object to "mapping" with increased refcnt.
When gasket_sysfs_put_attr() returns, local variable "mapping" becomes invalid, so the refcount should be decreased to keep refcount balanced.
The reference counting issue happens in one path of gasket_sysfs_put_attr(). When mapping attribute is unknown, the function forgets to decrease the refcnt increased by get_mapping(), causing a refcnt leak.
Fix this issue by calling put_mapping() when put attribute fails due to unknown attribute.
--- drivers/staging/gasket/gasket_sysfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/gasket/gasket_sysfs.c +1 -0
@@ -339,6 +339,7 @@ void gasket_sysfs_put_attr(struct device *device,dev_err (device,"Unable to put unknown attribute: %s\n" , attr->attr.attr.name); +put_mapping (mapping); }EXPORT_SYMBOL (gasket_sysfs_put_attr);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 152/388 clk: meson: meson8b: Fix the polarity of the RESET_N lines
In reply to Sasha LevinFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 0d3051c790ed2ef6bd91b92b07220313f06b95b3 ]
CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_POST and CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_PRE are active low. This means:
- asserting them requires setting the register value to 0
- de-asserting them requires setting the register value to 1
Set the register value accordingly for these two reset lines by setting the inverted the register value compared to all other reset lines.
--- drivers/clk/meson/meson8b.c | 79 ++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 23 deletions(-)
drivers/clk/meson/meson8b.c +56 -23
@@ -3506,54 +3506,87 @@ static struct clk_regmap *const meson8b_clk_regmaps[] = {static const struct meson8b_clk_reset_line {u32 reg;u8 bit_idx; +bool active_low; } meson8b_clk_reset_bits[] = { [CLKC_RESET_L2_CACHE_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =30 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =30 , + .active_low = false, }, [CLKC_RESET_AXI_64_TO_128_BRIDGE_A5_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =29 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =29 , + .active_low = false, }, [CLKC_RESET_SCU_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =28 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =28 , + .active_low = false, }, [CLKC_RESET_CPU3_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =27 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =27 , + .active_low = false, }, [CLKC_RESET_CPU2_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =26 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =26 , + .active_low = false, }, [CLKC_RESET_CPU1_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =25 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =25 , + .active_low = false, }, [CLKC_RESET_CPU0_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =24 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =24 , + .active_low = false, }, [CLKC_RESET_A5_GLOBAL_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =18 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =18 , + .active_low = false, }, [CLKC_RESET_A5_AXI_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =17 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =17 , + .active_low = false, }, [CLKC_RESET_A5_ABP_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL0 , .bit_idx =16 + .reg =HHI_SYS_CPU_CLK_CNTL0 , + .bit_idx =16 , + .active_low = false, }, [CLKC_RESET_AXI_64_TO_128_BRIDGE_MMC_SOFT_RESET ] = { - .reg =HHI_SYS_CPU_CLK_CNTL1 , .bit_idx =30 + .reg =HHI_SYS_CPU_CLK_CNTL1 , + .bit_idx =30 , + .active_low = false, }, [CLKC_RESET_VID_CLK_CNTL_SOFT_RESET ] = { - .reg =HHI_VID_CLK_CNTL , .bit_idx =15 + .reg =HHI_VID_CLK_CNTL , + .bit_idx =15 , + .active_low = false, }, [CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_POST ] = { - .reg =HHI_VID_DIVIDER_CNTL , .bit_idx =7 + .reg =HHI_VID_DIVIDER_CNTL , + .bit_idx =7 , + .active_low = false, }, [CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_PRE ] = { - .reg =HHI_VID_DIVIDER_CNTL , .bit_idx =3 + .reg =HHI_VID_DIVIDER_CNTL , + .bit_idx =3 , + .active_low = false, }, [CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_POST ] = { - .reg =HHI_VID_DIVIDER_CNTL , .bit_idx =1 + .reg =HHI_VID_DIVIDER_CNTL , + .bit_idx =1 , + .active_low = true, }, [CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_PRE ] = { - .reg =HHI_VID_DIVIDER_CNTL , .bit_idx =0 + .reg =HHI_VID_DIVIDER_CNTL , + .bit_idx =0 , + .active_low = true, }, };
@@ -3562,22 +3595,22 @@ static int meson8b_clk_reset_update(struct reset_controller_dev *rcdev, {struct meson8b_clk_reset *meson8b_clk_reset = container_of(rcdev, struct meson8b_clk_reset, reset); -unsigned long flags;const struct meson8b_clk_reset_line *reset; +unsigned int value =0 ; +unsigned long flags;if (id >=ARRAY_SIZE (meson8b_clk_reset_bits))return -EINVAL ; reset = &meson8b_clk_reset_bits[id]; +if (assert != reset->active_low) + value =BIT (reset->bit_idx); +spin_lock_irqsave (&meson_clk_lock, flags); -if (assert) -regmap_update_bits (meson8b_clk_reset->regmap, reset->reg, -BIT (reset->bit_idx),BIT (reset->bit_idx)); -else -regmap_update_bits (meson8b_clk_reset->regmap, reset->reg, -BIT (reset->bit_idx),0 ); +regmap_update_bits (meson8b_clk_reset->regmap, reset->reg, +BIT (reset->bit_idx), value);spin_unlock_irqrestore (&meson_clk_lock, flags);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 158/388 arm64: dts: meson-g12b-ugoos-am6: fix board compatible
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit 5c28dcbb3a1be167c07784b5f710ec602a57bea2 ]
Add missing amlogic,s922x in the board compatible list.
It fixes:meson-g12b-ugoos-am6.dt.yaml: /: compatible: ['ugoos,am6', 'amlogic,g12b'] is not valid under any of the given schemas
--- arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-g12b-ugoos-am6.dts +1 -1
@@ -14,7 +14,7 @@ #include <dt-bindings/sound/meson-g12a-tohdmitx.h> / { - compatible = "ugoos,am6", "amlogic,g12b"; + compatible = "ugoos,am6", "amlogic,s922x", "amlogic,g12b"; model = "Ugoos AM6"; aliases {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 160/388 ASoC: SOF: Update correct LED status at the first time usage of update_mute_led()
In reply to Sasha LevinFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit 49c22696348d6e7c8a2ecfd7e60fddfe188ded82 ]
At the first time update_mute_led() gets called, if channels are already muted, the temp value equals to led_value as 0, skipping the following LED setting.
So set led_value to -1 as an uninitialized state, to update the correct LED status at first time usage.
--- sound/soc/sof/control.c | 4 ++-- sound/soc/sof/sof-audio.h | 2 +- sound/soc/sof/topology.c | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-)
sound/soc/sof/control.c +2 -2
@@ -19,8 +19,8 @@ static void update_mute_led(struct snd_sof_control *scontrol,struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - unsigned int temp = 0; -unsigned int mask; + int temp = 0; +int mask;int i; mask =1U <<snd_ctl_get_ioffidx (kcontrol, &ucontrol->id);
sound/soc/sof/sof-audio.h +1 -1
@@ -56,7 +56,7 @@ struct snd_sof_pcm {struct snd_sof_led_control {unsigned int use_led;unsigned int direction; -unsigned int led_value; +int led_value; };/* ALSA SOF Kcontrol device */
sound/soc/sof/topology.c +2 -0
@@ -1203,6 +1203,8 @@ static int sof_control_load(struct snd_soc_component *scomp, int index,return ret; } + scontrol->led_ctl.led_value =-1 ; + dobj->private = scontrol;list_add (&scontrol->list, &sdev->kcontrol_list);return ret;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 166/388 HID: intel-ish-hid: avoid bogus uninitialized-variable warning
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 0b66fb3e6b7a53688f8e20945ac78cd3d832c65f ]
Older compilers like gcc-4.8 don't see that the variable is initialized when it is used:
In file included from include/linux/compiler_types.h:68:0,
from <command-line>:0:
drivers/hid/intel-ish-hid/ishtp-fw-loader.c: In function 'load_fw_from_host':
include/linux/compiler-gcc.h:75:45: warning: 'fw_info.ldr_capability.max_dma_buf_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
^
drivers/hid/intel-ish-hid/ishtp-fw-loader.c:770:22: note: 'fw_info.ldr_capability.max_dma_buf_size' was declared here
struct shim_fw_info fw_info;
^Make sure to initialize it before returning an error from ish_query_loader_prop().
--- drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/intel-ish-hid/ishtp-fw-loader.c +2 -0
@@ -480,6 +480,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data, sizeof(ldr_xfer_query_resp));if (rv <0 ) { client_data->flag_retry = true; + *fw_info = (struct shim_fw_info ){};return rv; }
@@ -489,6 +490,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data,"data size %d is not equal to size of loader_xfer_query_response %zu\n" , rv, sizeof(struct loader_xfer_query_response)); client_data->flag_retry = true; + *fw_info = (struct shim_fw_info ){};return -EMSGSIZE ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 174/388 i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output
In reply to Sasha LevinFrom: Russell King <[email protected]>
[ Upstream commit 88b73ee7ca4c90baf136ed5a8377fc5a9b73ac08 ]
The IRQ log output is supposed to appear on a single line. However, commit 3a2dc1677b60 ("i2c: pxa: Update debug function to dump more info on error") resulted in it being printed one-entry-per-line, which is excessively long.
Fixing this is not a trivial matter; using pr_cont() doesn't work as the previous dev_dbg() may not have been compiled in, or may be dynamic.
Since the rest of this function output is at error level, and is also debug output, promote this to error level as well to avoid this problem.
Reduce the number of always zero prefix digits to save screen real- estate.
--- drivers/i2c/busses/i2c-pxa.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-pxa.c +3 -4
@@ -311,11 +311,10 @@ static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why)dev_err (dev,"IBMR: %08x IDBR: %08x ICR: %08x ISR: %08x\n" ,readl (_IBMR (i2c)),readl (_IDBR (i2c)),readl (_ICR (i2c)),readl (_ISR (i2c))); -dev_dbg (dev,"log: " ); +dev_err (dev,"log:" );for (i =0 ; i < i2c->irqlogidx; i++) -pr_debug ("[%08x:%08x] " , i2c->isrlog[i], i2c->icrlog[i]); - - pr_debug("\n"); +pr_cont (" [%03x:%05x]" , i2c->isrlog[i], i2c->icrlog[i]); + pr_cont("\n"); }#else /* ifdef DEBUG */
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 177/388 PCI/ASPM: Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges
In reply to Sasha LevinFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit 66ff14e59e8a30690755b08bc3042359703fb07a ]
7d715a6c1ae5 ("PCI: add PCI Express ASPM support") added the ability for Linux to enable ASPM, but for some undocumented reason, it didn't enable ASPM on links where the downstream component is a PCIe-to-PCI/PCI-X Bridge.
Remove this exclusion so we can enable ASPM on these links.
The Dell OptiPlex 7080 mentioned in the bugzilla has a TI XIO2001 PCIe-to-PCI Bridge. Enabling ASPM on the link leading to it allows the Intel SoC to enter deeper Package C-states, which is a significant power savings.
[bhelgaas: commit log]
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207571
--- drivers/pci/pcie/aspm.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/pci/pcie/aspm.c +0 -10
@@ -628,16 +628,6 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)/* Setup initial capable state. Will be updated later */ link->aspm_capable = link->aspm_support; -/* -* If the downstream component has pci bridge function, don't -* do ASPM for now. -*/ -list_for_each_entry (child, &linkbus->devices, bus_list) { -if (pci_pcie_type (child) ==PCI_EXP_TYPE_PCI_BRIDGE ) { - link->aspm_disable =ASPM_STATE_ALL ; -break ; - } - }/* Get and check endpoint acceptable latencies */ list_for_each_entry (child, &linkbus->devices, bus_list) {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 178/388 scsi: qla2xxx: Fix warning after FC target reset
In reply to Sasha LevinFrom: Viacheslav Dubeyko <[email protected]>
[ Upstream commit f839544ccff60cbe534282aac68858fc3fb278ca ]
Currently, FC target reset finishes with the warning message:
[84010.596893] ------------[ cut here ]------------
[84010.596917] WARNING: CPU: 238 PID: 279973 at ../drivers/scsi/qla2xxx/qla_target.c:6644 qlt_enable_vha+0x1d0/0x260 [qla2xxx]
[84010.596918] Modules linked in: vrf af_packet 8021q garp mrp stp llc netlink_diag target_tatlin_tblock(OEX) dm_ec(OEX) ttln_rdma(OEX) dm_frontend(OEX) nvme_rdma nvmet tcm_qla2xxx iscsi_target_mod target_core_mod at24 nvmem_core pnv_php ipmi_watchdog ipmi_ssif vmx_crypto gf128mul crct10dif_vpmsum qla2xxx rpcrdma nvme_fc powernv_flash(X) nvme_fabrics uio_pdrv_genirq mtd rtc_opal(X) ibmpowernv(X) opal_prd(X) uio scsi_transport_fc i2c_opal(X) ses enclosure ipmi_poweroff ast i2c_algo_bit ttm bmc_mcu(OEX) drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm drm_panel_orientation_quirks agpgart nfsd auth_rpcgss nfs_acl ipmi_powernv(X) lockd ipmi_devintf ipmi_msghandler grace dummy ext4 crc16 jbd2 mbcache sd_mod rdma_ucm ib_iser rdma_cm ib_umad iw_cm ib_ipoib libiscsi scsi_transport_iscsi ib_cm
[84010.596975] configfs mlx5_ib ib_uverbs ib_core mlx5_core crc32c_vpmsum xhci_pci xhci_hcd mpt3sas(OEX) tg3 usbcore mlxfw tls raid_class libphy scsi_transport_sas devlink ptp pps_core nvme nvme_core sunrpc dm_mirror dm_region_hash dm_log sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua scsi_mod autofs4
[84010.597001] Supported: Yes, External
[84010.597004] CPU: 238 PID: 279973 Comm: bash Tainted: G OE 4.12.14-197.29-default #1 SLE15-SP1
[84010.597006] task: c000000a104c0000 task.stack: c000000b52188000
[84010.597007] NIP: d00000001ffd7f78 LR: d00000001ffd7f6c CTR: c0000000001676c0
[84010.597008] REGS: c000000b5218b910 TRAP: 0700 Tainted: G OE (4.12.14-197.29-default)
[84010.597008] MSR: 900000010282b033 <SF,HV,VEC,VSX,EE,FP,ME,IR,DR,RI,LE,TM[E]>
[84010.597015] CR: 48242424 XER: 00000000
[84010.597016] CFAR: d00000001ff45d08 SOFTE: 1
GPR00: d00000001ffd7f6c c000000b5218bb90 d00000002001b228 0000000000000102
GPR04: 0000000000000001 0000000000000001 00013d91ed0a5e2d 0000000000000000
GPR08: c000000007793300 0000000000000000 0000000000000000 c000000a086e7818
GPR12: 0000000000002200 c000000007793300 0000000000000000 000000012bc937c0
GPR16: 000000012bbf7ed0 0000000000000000 000000012bc3dd10 0000000000000000
GPR20: 000000012bc4db28 0000010036442810 000000012bc97828 000000012bc96c70
GPR24: 00000100365b1550 0000000000000000 00000100363f3d80 c000000be20d3080
GPR28: c000000bda7eae00 c000000be20db7e8 c000000be20d3778 c000000be20db7e8
[84010.597042] NIP [d00000001ffd7f78] qlt_enable_vha+0x1d0/0x260 [qla2xxx]
[84010.597051] LR [d00000001ffd7f6c] qlt_enable_vha+0x1c4/0x260 [qla2xxx]
[84010.597051] Call Trace:
[84010.597061] [c000000b5218bb90] [d00000001ffd7f6c] qlt_enable_vha+0x1c4/0x260 [qla2xxx] (unreliable)
[84010.597064] [c000000b5218bc20] [d000000009820b6c] tcm_qla2xxx_tpg_enable_store+0xc4/0x130 [tcm_qla2xxx]
[84010.597067] [c000000b5218bcb0] [d0000000185d0e68] configfs_write_file+0xd0/0x190 [configfs]
[84010.597072] [c000000b5218bd00] [c0000000003d0edc] __vfs_write+0x3c/0x1e0
[84010.597074] [c000000b5218bd90] [c0000000003d2ea8] vfs_write+0xd8/0x220
[84010.597076] [c000000b5218bde0] [c0000000003d4ddc] SyS_write+0x6c/0x110
[84010.597079] [c000000b5218be30] [c00000000000b188] system_call+0x3c/0x130
[84010.597080] Instruction dump:
[84010.597082] 7d0050a8 7d084b78 7d0051ad 40c2fff4 7fa3eb78 4bf73965 60000000 7fa3eb78
[84010.597086] 4bf6dcd9 60000000 2fa30000 419eff40 <0fe00000> 4bffff38 e95f0058 a12a0180
[84010.597090] ---[ end trace e32abaf6e6fee826 ]---To reproduce:
echo 0x7fffffff > /sys/module/qla2xxx/parameters/logging modprobe target_core_mod
modprobe tcm_qla2xxx
mkdir /sys/kernel/config/target/qla2xxx
mkdir /sys/kernel/config/target/qla2xxx/<port-name>
mkdir /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1 echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable echo 0 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable echo 1 > /sys/kernel/config/target/qla2xxx/<port-name>/tpgt_1/enable
SYSTEM START
kernel: pid 327:drivers/scsi/qla2xxx/qla_init.c:2174 qla2x00_initialize_adapter(): vha->flags.online 0x0 <...>
kernel: pid 327:drivers/scsi/qla2xxx/qla_os.c:3444 qla2x00_probe_one(): vha->flags.online 0x1
echo 1 > /sys/kernel/config/target/qla2xxx/21:00:00:24:ff:86:a6:2a/tpgt_1/enable
kernel: pid 348:drivers/scsi/qla2xxx/qla_init.c:6641 qla2x00_abort_isp_cleanup(): vha->flags.online 0x0, ISP_ABORT_NEEDED 0x0 <...>
kernel: pid 348:drivers/scsi/qla2xxx/qla_init.c:6998 qla2x00_restart_isp(): vha->flags.online 0x0
echo 0 > /sys/kernel/config/target/qla2xxx/21:00:00:24:ff:86:a6:2a/tpgt_1/enable
kernel: pid 348:drivers/scsi/qla2xxx/qla_init.c:6641 qla2x00_abort_isp_cleanup(): vha->flags.online 0x0, ISP_ABORT_NEEDED 0x0 <...>
kernel: pid 1404:drivers/scsi/qla2xxx/qla_os.c:1107 qla2x00_wait_for_hba_online(): base_vha->flags.online 0x0
echo 1 > /sys/kernel/config/target/qla2xxx/21:00:00:24:ff:86:a6:2a/tpgt_1/enable
kernel: pid 1404:drivers/scsi/qla2xxx/qla_os.c:1107 qla2x00_wait_for_hba_online(): base_vha->flags.online 0x0
kernel: -----------[ cut here ]-----------
kernel: WARNING: CPU: 1 PID: 1404 at drivers/scsi/qla2xxx/qla_target.c:6654 qlt_enable_vha+0x1e0/0x280 [qla2xxx]
The issue happens because no real ISP reset is executed. The qla2x00_abort_isp(scsi_qla_host_t *vha) function expects that vha->flags.online will be not zero for ISP reset procedure. This patch sets vha->flags.online to 1 before calling ->abort_isp() for starting the ISP reset.
--- drivers/scsi/qla2xxx/qla_os.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/qla2xxx/qla_os.c +1 -0
@@ -6871,6 +6871,7 @@ qla2x00_do_dpc(void *data)if (do_reset && !(test_and_set_bit (ABORT_ISP_ACTIVE , &base_vha->dpc_flags))) { + base_vha->flags.online =1 ;ql_dbg (ql_dbg_dpc, base_vha,0x4007 ,"ISP abort scheduled.\n" );if (ha->isp_ops->abort_isp (base_vha)) {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 191/388 um: do not evaluate compiler's library path when cleaning
In reply to Sasha LevinFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 7e49afc03212010d0ee27532a75cfeb0125bd868 ]
Since commit a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than="), 'make ARCH=um clean' emits an error message as follows:
$ make ARCH=um clean gcc: error: missing argument to '-Wframe-larger-than='
We do not care compiler flags when cleaning.
Use the '=' operator for lazy expansion because we do not use LDFLAGS_pcap.o or LDFLAGS_vde.o when cleaning.
While I was here, I removed the redundant -r option because it already exists in the recipe.
--- arch/um/drivers/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/um/drivers/Makefile +2 -2
@@ -18,9 +18,9 @@ ubd-objs := ubd_kern.o ubd_user.o port-objs := port_kern.o port_user.o harddog-objs := harddog_kern.o harddog_user.o -LDFLAGS_pcap.o := -r $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a) +LDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a) -LDFLAGS_vde.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a) +LDFLAGS_vde.o = $(shell $(CC) $(CFLAGS) -print-file-name=libvdeplug.a) targets := pcap_kern.o pcap_user.o vde_kern.o vde_user.o
Signature · 7 lines
2.25.1 _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Sasha Levin
maintainerPATCH 192/388 unicore32: do not evaluate compiler's library path when cleaning
In reply to Sasha LevinFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 081b4b54ff6c58be2ffcf09d42e5df8f031eacd0 ]
Since commit a83e4ca26af8 ("kbuild: remove cc-option switch from -Wframe-larger-than="), 'make ARCH=unicore32 clean' emits error messages as follows:
$ make ARCH=unicore32 clean gcc: error: missing argument to '-Wframe-larger-than=' gcc: error: missing argument to '-Wframe-larger-than='
We do not care compiler flags when cleaning.
Use the '=' operator for lazy expansion because we do not use GNU_LIBC_A or GNU_LIBGCC_A when cleaning.
--- arch/unicore32/lib/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/unicore32/lib/Makefile +2 -2
@@ -10,12 +10,12 @@ lib-y += strncpy_from_user.o strnlen_user.o lib-y += clear_user.o copy_page.o lib-y += copy_from_user.o copy_to_user.o -GNU_LIBC_A := $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libc.a) +GNU_LIBC_A = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libc.a) GNU_LIBC_A_OBJS := memchr.o memcpy.o memmove.o memset.o GNU_LIBC_A_OBJS += strchr.o strrchr.o GNU_LIBC_A_OBJS += rawmemchr.o # needed by strrchr.o -GNU_LIBGCC_A := $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) +GNU_LIBGCC_A = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) GNU_LIBGCC_A_OBJS := _ashldi3.o _ashrdi3.o _lshrdi3.o GNU_LIBGCC_A_OBJS += _divsi3.o _modsi3.o _ucmpdi2.o _umodsi3.o _udivsi3.o
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 194/388 ASoC: ux500: mop500: Fix some refcounted resources issues
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 4e8748fcaeec073e3ba794871ce86c545e4f961f ]
There are 2 issues here:
- if one of the 'of_parse_phandle' fails, calling 'mop500_of_node_put()' is a no-op because the 'mop500_dai_links' structure has not been initialized yet, so the referenced are not decremented
- The reference stored in 'mop500_dai_links[i].codecs' is refcounted only once in the probe and must be decremented only once.
--- sound/soc/ux500/mop500.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
sound/soc/ux500/mop500.c +7 -4
@@ -63,10 +63,11 @@ static void mop500_of_node_put(void) {int i; -for (i =0 ; i <2 ; i++) { +for (i =0 ; i <2 ; i++)of_node_put (mop500_dai_links[i].cpus->of_node); -of_node_put (mop500_dai_links[i].codecs->of_node); - } + +/* Both links use the same codec, which is refcounted only once */ +of_node_put (mop500_dai_links[0 ].codecs->of_node); } static int mop500_of_probe(struct platform_device *pdev,
@@ -81,7 +82,9 @@ static int mop500_of_probe(struct platform_device *pdev,if (!(msp_np[0 ] && msp_np[1 ] && codec_np)) {dev_err (&pdev->dev,"Phandle missing or invalid\n" ); -mop500_of_node_put (); +for (i =0 ; i <2 ; i++) +of_node_put (msp_np[i]); +of_node_put (codec_np);return -EINVAL ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 189/388 f2fs: fix potential use-after-free issue
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit f3494345ce9999624b36109252a4bf5f00e51a46 ]
In error path of f2fs_read_multi_pages(), it should let last referrer release decompress io context memory, otherwise, other referrer will cause use-after-free issue.
--- fs/f2fs/data.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/f2fs/data.c +4 -4
@@ -2130,16 +2130,16 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret, page->index, for_write);if (IS_ERR (bio)) { ret =PTR_ERR (bio); - bio =NULL ; dic->failed = true;if (refcount_sub_and_test (dic->nr_cpages - i, - &dic->ref)) + &dic->ref)) {f2fs_decompress_end_io (dic->rpages, cc->cluster_size, true, false); -f2fs_free_dic (dic); +f2fs_free_dic (dic); + }f2fs_put_dnode (&dn); - *bio_ret = bio; + *bio_ret =NULL ;return ret; } }
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 190/388 f2fs: compress: fix zstd data corruption
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit 1454c978efbb57b052670d50023f48c759d704ce ]
During zstd compression, ZSTD_endStream() may return non-zero value because distination buffer is full, but there is still compressed data remained in intermediate buffer, it means that zstd algorithm can not save at last one block space, let's just writeback raw data instead of compressed one, this can fix data corruption when decompressing incomplete stored compression data.
--- fs/f2fs/compress.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/f2fs/compress.c +7 -0
@@ -369,6 +369,13 @@ static int zstd_compress_pages(struct compress_ctx *cc)return -EIO ; } +/* +* there is compressed data remained in intermediate buffer due to +* no more space in cbuf.cdata +*/ +if (ret) +return -EAGAIN ; + cc->clen = outbuf.pos;return 0 ; }
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 188/388 f2fs: Fix wrong stub helper update_sit_info
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 48abe91ac1ad27cd5a5709f983dcf58f2b9a6b70 ]
update_sit_info should be f2fs_update_sit_info, otherwise build fails while no CONFIG_F2FS_STAT_FS.
--- fs/f2fs/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/f2fs.h +1 -1
@@ -3655,7 +3655,7 @@ static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }static inline void f2fs_destroy_stats (struct f2fs_sb_info *sbi) { }static inline void __init f2fs_create_root_stats (void ) { }static inline void f2fs_destroy_root_stats (void ) { } -static inline void update_sit_info (struct f2fs_sb_info *sbi) {} +static inline void f2fs_update_sit_info (struct f2fs_sb_info *sbi) {}#endif extern const struct file_operations f2fs_dir_operations;
Signature · 8 lines
2.25.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 48/388 arm64: dts: armada-3720-turris-mox: forbid SDR104 on SDIO for FCC purposes
In reply to Sasha LevinFrom: Marek Behún <[email protected]>
[ Upstream commit 7a2c36b039d2343cc29fec6102da839477b8dc60 ]
Use sdhci-caps-mask to forbid SDR104 mode on the SDIO capable SDHCI controller. Without this the device cannot pass electromagnetic interference certifications.
--- arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +2 -0
@@ -179,6 +179,8 @@ &sdhci1 { marvell,pad-type = "sd"; vqmmc-supply = <&vsdio_reg>; mmc-pwrseq = <&sdhci1_pwrseq>; + /* forbid SDR104 for FCC purposes */ + sdhci-caps-mask = <0x2 0x0>; status = "okay"; };
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 199/388 phy: ti: j721e-wiz: Fix some error return code in wiz_probe()
In reply to Sasha LevinFrom: Wei Yongjun <[email protected]>
[ Upstream commit e2ae8bca494481a9f38fcd1d52943ac04e654745 ]
Fix to return negative error code from some error handling cases instead of 0, as done elsewhere in this function.
--- drivers/phy/ti/phy-j721e-wiz.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/phy/ti/phy-j721e-wiz.c +5 -1
@@ -794,8 +794,10 @@ static int wiz_probe(struct platform_device *pdev) } base =devm_ioremap (dev, res.start,resource_size (&res)); -if (!base) +if (!base) { + ret = -ENOMEM ; goto err_addr_to_resource; + } regmap =devm_regmap_init_mmio (dev, base, &wiz_regmap_config);if (IS_ERR (regmap)) {
@@ -812,6 +814,7 @@ static int wiz_probe(struct platform_device *pdev)if (num_lanes >WIZ_MAX_LANES ) {dev_err (dev,"Cannot support %d lanes\n" , num_lanes); + ret = -ENODEV ; goto err_addr_to_resource; }
@@ -897,6 +900,7 @@ static int wiz_probe(struct platform_device *pdev) serdes_pdev =of_platform_device_create (child_node,NULL , dev);if (!serdes_pdev) {dev_WARN (dev,"Unable to create SERDES platform device\n" ); + ret = -ENOMEM ; goto err_pdev_create; } wiz->serdes_pdev = serdes_pdev;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 200/388 USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe()
In reply to Sasha LevinFrom: Wei Yongjun <[email protected]>
[ Upstream commit b919e077cccfbb77beb98809568b2fb0b4d113ec ]
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/usb/host/ohci-sm501.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-sm501.c +4 -3
@@ -157,9 +157,10 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)* the call to usb_hcd_setup_local_mem() below does just that. */ -if (usb_hcd_setup_local_mem (hcd, mem->start, - mem->start - mem->parent->start, -resource_size (mem)) <0 ) + retval =usb_hcd_setup_local_mem (hcd, mem->start, + mem->start - mem->parent->start, +resource_size (mem)); +if (retval <0 ) goto err5; retval =usb_add_hcd (hcd, irq,IRQF_SHARED );if (retval)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 204/388 PCI: Fix pci_register_host_bridge() device_register() error handling
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 1b54ae8327a4d630111c8d88ba7906483ec6010b ]
If device_register() has an error, we should bail out of pci_register_host_bridge() rather than continuing on.
--- drivers/pci/probe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/pci/probe.c +3 -2
@@ -909,9 +909,10 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) goto free; err =device_register (&bridge->dev); -if (err) +if (err) {put_device (&bridge->dev); - + goto free; + } bus->bridge =get_device (&bridge->dev);device_enable_async_suspend (bus->bridge);pci_set_bus_of_node (bus);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 25/388 ALSA: hda/realtek - Introduce polarity for micmute LED GPIO
In reply to Sasha LevinFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit dbd13179780555ecd3c992dea1222ca31920e892 ]
Currently mute LED and micmute LED share the same GPIO polarity.
So split the polarity for mute and micmute, in case they have different polarities.
--- sound/pci/hda/patch_realtek.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
sound/pci/hda/patch_realtek.c +8 -6
@@ -81,6 +81,7 @@ struct alc_spec {/* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ int mute_led_polarity; +int micmute_led_polarity;hda_nid_t mute_led_nid;hda_nid_t cap_mute_led_nid;
@@ -4080,11 +4081,9 @@ static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,/* update LED status via GPIO */ static void alc_update_gpio_led (struct hda_codec *codec,unsigned int mask, -bool enabled) +int polarity,bool enabled) { -struct alc_spec *spec = codec->spec; - -if (spec->mute_led_polarity) +if (polarity) enabled = !enabled;alc_update_gpio_data (codec, mask, !enabled);/* muted -> LED on */ }
@@ -4095,7 +4094,8 @@ static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)struct hda_codec *codec = private_data;struct alc_spec *spec = codec->spec; -alc_update_gpio_led (codec, spec->gpio_mute_led_mask, enabled); +alc_update_gpio_led (codec, spec->gpio_mute_led_mask, + spec->mute_led_polarity, enabled); }/* turn on/off mic-mute LED via GPIO per capture hook */
@@ -4104,6 +4104,7 @@ static void alc_gpio_micmute_update(struct hda_codec *codec)struct alc_spec *spec = codec->spec;alc_update_gpio_led (codec, spec->gpio_mic_led_mask, + spec->micmute_led_polarity, spec->gen.micmute_led.led_value); }
@@ -5808,7 +5809,8 @@ static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,snd_hda_gen_hp_automute (codec, jack);/* mute_led_polarity is set to 0, so we pass inverted value here */ -alc_update_gpio_led (codec,0x10 , !spec->gen.hp_jack_present); +alc_update_gpio_led (codec,0x10 , spec->mute_led_polarity, + !spec->gen.hp_jack_present); }/* Manage GPIOs for HP EliteBook Folio 9480m.
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 213/388 habanalabs: increase timeout during reset
In reply to Sasha LevinFrom: Oded Gabbay <[email protected]>
[ Upstream commit 7a65ee046b2238e053f6ebb610e1a082cfc49490 ]
When doing training, the DL framework (e.g. tensorflow) performs hundreds of thousands of memory allocations and mappings. In case the driver needs to perform hard-reset during training, the driver kills the application and unmaps all those memory allocations. Unfortunately, because of that large amount of mappings, the driver isn't able to do that in the current timeout (5 seconds). Therefore, increase the timeout significantly to 30 seconds to avoid situation where the driver resets the device with active mappings, which sometime can cause a kernel bug.
BTW, it doesn't mean we will spend all the 30 seconds because the reset thread checks every one second if the unmap operation is done.
--- drivers/misc/habanalabs/habanalabs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/habanalabs/habanalabs.h +1 -1
@@ -23,7 +23,7 @@#define HL_MMAP_CB_MASK (0x8000000000000000ull >> PAGE_SHIFT) -#define HL_PENDING_RESET_PER_SEC 5 +#define HL_PENDING_RESET_PER_SEC 30#define HL_DEVICE_TIMEOUT_USEC 1000000/* 1 s */
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 50/388 arm64: dts: juno: Fix GIC child nodes
In reply to Sasha LevinFrom: Andre Przywara <[email protected]>
[ Upstream commit a78aee9e434932a500db36cc6d88daeff3745e9f ]
The GIC DT nodes for the Juno boards were not fully compliant with the DT binding, which has certain expectations about child nodes and their size and address cells values.
Use smaller #address-cells and #size-cells values, as the binding requests, and adjust the reg properties accordingly.
This requires adjusting the interrupt nexus nodes as well, as one field of the interrupt-map property depends on the GIC's address-size.
--- arch/arm64/boot/dts/arm/juno-base.dtsi | 50 +++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-)
arch/arm64/boot/dts/arm/juno-base.dtsi +25 -25
@@ -74,35 +74,35 @@ gic: interrupt-controller@2c010000 { <0x0 0x2c02f000 0 0x2000>, <0x0 0x2c04f000 0 0x2000>, <0x0 0x2c06f000 0 0x2000>; - #address-cells = <2>; + #address-cells = <1>; #interrupt-cells = <3>; - #size-cells = <2>; + #size-cells = <1>; interrupt-controller; interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>; - ranges = <0 0 0 0x2c1c0000 0 0x40000>; + ranges = <0 0 0x2c1c0000 0x40000>; v2m_0: v2m@0 { compatible = "arm,gic-v2m-frame"; msi-controller; - reg = <0 0 0 0x10000>; + reg = <0 0x10000>; }; v2m@10000 { compatible = "arm,gic-v2m-frame"; msi-controller; - reg = <0 0x10000 0 0x10000>; + reg = <0x10000 0x10000>; }; v2m@20000 { compatible = "arm,gic-v2m-frame"; msi-controller; - reg = <0 0x20000 0 0x10000>; + reg = <0x20000 0x10000>; }; v2m@30000 { compatible = "arm,gic-v2m-frame"; msi-controller; - reg = <0 0x30000 0 0x10000>; + reg = <0x30000 0x10000>; }; };
@@ -546,10 +546,10 @@ pcie_ctlr: pcie@40000000 { <0x42000000 0x40 0x00000000 0x40 0x00000000 0x1 0x00000000>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; - interrupt-map = <0 0 0 1 &gic 0 0 GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 2 &gic 0 0 GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 3 &gic 0 0 GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 4 &gic 0 0 GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 1 &gic 0 GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 2 &gic 0 GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 3 &gic 0 GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 4 &gic 0 GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>; msi-parent = <&v2m_0>; status = "disabled"; iommu-map-mask = <0x0>; /* RC has no means to output PCI RID */
@@ -813,19 +813,19 @@ bus@8000000 { #interrupt-cells = <1>; interrupt-map-mask = <0 0 15>; - interrupt-map = <0 0 0 &gic 0 0 GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, - <0 0 1 &gic 0 0 GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>, - <0 0 2 &gic 0 0 GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, - <0 0 3 &gic 0 0 GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, - <0 0 4 &gic 0 0 GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, - <0 0 5 &gic 0 0 GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>, - <0 0 6 &gic 0 0 GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>, - <0 0 7 &gic 0 0 GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>, - <0 0 8 &gic 0 0 GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>, - <0 0 9 &gic 0 0 GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>, - <0 0 10 &gic 0 0 GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>, - <0 0 11 &gic 0 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>, - <0 0 12 &gic 0 0 GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 &gic 0 GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, + <0 0 1 &gic 0 GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>, + <0 0 2 &gic 0 GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>, + <0 0 3 &gic 0 GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>, + <0 0 4 &gic 0 GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>, + <0 0 5 &gic 0 GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>, + <0 0 6 &gic 0 GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>, + <0 0 7 &gic 0 GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>, + <0 0 8 &gic 0 GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>, + <0 0 9 &gic 0 GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>, + <0 0 10 &gic 0 GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>, + <0 0 11 &gic 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>, + <0 0 12 &gic 0 GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; }; site2: tlx@60000000 {
@@ -835,6 +835,6 @@ site2: tlx@60000000 { ranges = <0 0 0x60000000 0x10000000>; #interrupt-cells = <1>; interrupt-map-mask = <0 0>; - interrupt-map = <0 0 &gic 0 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 &gic 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; }; };
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 176/388 PCI: rcar: Fix incorrect programming of OB windows
In reply to Sasha LevinFrom: Andrew Murray <[email protected]>
[ Upstream commit 2b9f217433e31d125fb697ca7974d3de3ecc3e92 ]
The outbound windows (PCIEPAUR(x), PCIEPALR(x)) describe a mapping between a CPU address (which is determined by the window number 'x') and a programmed PCI address - Thus allowing the controller to translate CPU accesses into PCI accesses.
However the existing code incorrectly writes the CPU address - lets fix this by writing the PCI address instead.
For memory transactions, existing DT users describe a 1:1 identity mapping and thus this change should have no effect. However the same isn't true for I/O.
--- drivers/pci/controller/pcie-rcar.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/pci/controller/pcie-rcar.c +5 -4
@@ -333,11 +333,12 @@ static struct pci_ops rcar_pcie_ops = { };static void rcar_pcie_setup_window (int win,struct rcar_pcie *pcie, -struct resource *res) +struct resource_entry *window) {/* Setup PCIe address space mappings for each resource */ resource_size_t size;resource_size_t res_start; +struct resource *res = window->res;u32 mask;rcar_pci_write_reg (pcie,0x00000000 ,PCIEPTCTLR (win));
@@ -351,9 +352,9 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie,rcar_pci_write_reg (pcie, mask <<7 ,PCIEPAMR (win));if (res->flags &IORESOURCE_IO ) - res_start =pci_pio_to_address (res->start); + res_start =pci_pio_to_address (res->start) - window->offset;else - res_start = res->start; + res_start = res->start - window->offset;rcar_pci_write_reg (pcie,upper_32_bits (res_start),PCIEPAUR (win)); rcar_pci_write_reg(pcie, lower_32_bits(res_start) & ~0x7F,
@@ -382,7 +383,7 @@ static int rcar_pcie_setup(struct list_head *resource, struct rcar_pcie *pci)switch (resource_type (res)) {case IORESOURCE_IO :case IORESOURCE_MEM : -rcar_pcie_setup_window (i, pci, res); +rcar_pcie_setup_window (i, pci, win); i++;break ;case IORESOURCE_BUS :
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 219/388 powerpc/64s/exceptions: Machine check reconcile irq state
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit f0fd9dd3c213c947dfb5bc2cad3ef5e30d3258ec ]
pseries fwnmi machine check code pops the soft-irq checks in rtas_call (after the next patch to remove rtas_token from this call path). Rather than play whack a mole with these and forever having fragile code, it seems better to have the early machine check handler perform the same kind of reconcile as the other NMI interrupts.
WARNING: CPU: 0 PID: 493 at arch/powerpc/kernel/irq.c:343
CPU: 0 PID: 493 Comm: a Tainted: G W
NIP: c00000000001ed2c LR: c000000000042c40 CTR: 0000000000000000
REGS: c0000001fffd38b0 TRAP: 0700 Tainted: G W
MSR: 8000000000021003 <SF,ME,RI,LE> CR: 28000488 XER: 00000000
CFAR: c00000000001ec90 IRQMASK: 0
GPR00: c000000000043820 c0000001fffd3b40 c0000000012ba300 0000000000000000
GPR04: 0000000048000488 0000000000000000 0000000000000000 00000000deadbeef
GPR08: 0000000000000080 0000000000000000 0000000000000000 0000000000001001
GPR12: 0000000000000000 c0000000014a0000 0000000000000000 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR28: 0000000000000000 0000000000000001 c000000001360810 0000000000000000
NIP [c00000000001ed2c] arch_local_irq_restore.part.0+0xac/0x100
LR [c000000000042c40] unlock_rtas+0x30/0x90
Call Trace:
[c0000001fffd3b40] [c000000001360810] 0xc000000001360810 (unreliable)
[c0000001fffd3b60] [c000000000043820] rtas_call+0x1c0/0x280
[c0000001fffd3bb0] [c0000000000dc328] fwnmi_release_errinfo+0x38/0x70
[c0000001fffd3c10] [c0000000000dcd8c] pseries_machine_check_realmode+0x1dc/0x540
[c0000001fffd3cd0] [c00000000003fe04] machine_check_early+0x54/0x70
[c0000001fffd3d00] [c000000000008384] machine_check_early_common+0x134/0x1f0
--- interrupt: 200 at 0x13f1307c8
LR = 0x7fff888b8528
Instruction dump:
60000000 7d2000a6 71298000 41820068 39200002 7d210164 4bffff9c 60000000
60000000 7d2000a6 71298000 4c820020 <0fe00000> 4e800020 60000000 60000000--- arch/powerpc/kernel/exceptions-64s.S | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/powerpc/kernel/exceptions-64s.S +19 -0
@@ -1117,11 +1117,30 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) li r10,MSR_RI mtmsrd r10,1 + /* + * Set IRQS_ALL_DISABLED and save PACAIRQHAPPENED (see + * system_reset_common) + */ + li r10,IRQS_ALL_DISABLED + stb r10,PACAIRQSOFTMASK(r13) + lbz r10,PACAIRQHAPPENED(r13) + std r10,RESULT(r1) + ori r10,r10,PACA_IRQ_HARD_DIS + stb r10,PACAIRQHAPPENED(r13) + addi r3,r1,STACK_FRAME_OVERHEAD bl machine_check_early std r3,RESULT(r1) /* Save result */ ld r12,_MSR(r1) + /* + * Restore soft mask settings. + */ + ld r10,RESULT(r1) + stb r10,PACAIRQHAPPENED(r13) + ld r10,SOFTE(r1) + stb r10,PACAIRQSOFTMASK(r13) + #ifdef CONFIG_PPC_P7_NAP /* * Check if thread was in power saving mode. We come here when any
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 181/388 power: supply: smb347-charger: IRQSTAT_D is volatile
In reply to Sasha LevinFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit c32ea07a30630ace950e07ffe7a18bdcc25898e1 ]
Fix failure when USB cable is connected:
smb347 2-006a: reading IRQSTAT_D failed
--- drivers/power/supply/smb347-charger.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/supply/smb347-charger.c +1 -0
@@ -1138,6 +1138,7 @@ static bool smb347_volatile_reg(struct device *dev, unsigned int reg)switch (reg) {case IRQSTAT_A :case IRQSTAT_C : +case IRQSTAT_D :case IRQSTAT_E :case IRQSTAT_F :case STAT_A :
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 223/388 PCI: aardvark: Issue PERST via GPIO
In reply to Sasha LevinFrom: Pali Rohár <[email protected]>
[ Upstream commit 5169a9851daaa2782a7bd2bb83d5b1bd224b2879 ]
Add support for issuing PERST via GPIO specified in 'reset-gpios' property (as described in PCI device tree bindings).
Some buggy cards (e.g. Compex WLE900VX or WLE1216) are not detected after reboot when PERST is not issued during driver initialization.
If bootloader already enabled link training then issuing PERST has no effect for some buggy cards (e.g. Compex WLE900VX) and these cards are not detected. We therefore clear the LINK_TRAINING_EN register before.
It was observed that Compex WLE900VX card needs to be in PERST reset for at least 10ms if bootloader enabled link training.
Tested on Turris MOX.
--- drivers/pci/controller/pci-aardvark.c | 43 ++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)
drivers/pci/controller/pci-aardvark.c +42 -1
@@ -9,6 +9,7 @@*/ #include <linux/delay.h> +#include <linux/gpio.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/irqdomain.h>
@@ -18,6 +19,7 @@#include <linux/platform_device.h> #include <linux/msi.h> #include <linux/of_address.h> +#include <linux/of_gpio.h> #include <linux/of_pci.h> #include "../pci.h"
@@ -204,6 +206,7 @@ struct advk_pcie {int root_bus_nr;int link_gen;struct pci_bridge_emul bridge; +struct gpio_desc *reset_gpio; };static inline void advk_writel (struct advk_pcie *pcie,u32 val,u64 reg)
@@ -330,10 +333,31 @@ static void advk_pcie_train_link(struct advk_pcie *pcie)dev_err (dev,"link never came up\n" ); } +static void advk_pcie_issue_perst (struct advk_pcie *pcie) +{ +u32 reg; + +if (!pcie->reset_gpio) +return ; + +/* PERST does not work for some cards when link training is enabled */ + reg =advk_readl (pcie,PCIE_CORE_CTRL0_REG ); + reg &= ~LINK_TRAINING_EN ; +advk_writel (pcie, reg,PCIE_CORE_CTRL0_REG ); + +/* 10ms delay is needed for some cards */ +dev_info (&pcie->pdev->dev,"issuing PERST via reset GPIO for 10ms\n" ); +gpiod_set_value_cansleep (pcie->reset_gpio,1 ); +usleep_range (10000 ,11000 ); +gpiod_set_value_cansleep (pcie->reset_gpio,0 ); +} +static void advk_pcie_setup_hw (struct advk_pcie *pcie) {u32 reg; +advk_pcie_issue_perst (pcie); +/* Set to Direct mode */ reg =advk_readl (pcie,CTRL_CONFIG_REG ); reg &= ~(CTRL_MODE_MASK <<CTRL_MODE_SHIFT );
@@ -406,7 +430,8 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)/* * PERST# signal could have been asserted by pinctrl subsystem before -* probe() callback has been called, making the endpoint going into +* probe() callback has been called or issued explicitly by reset gpio +* function advk_pcie_issue_perst(), making the endpoint going into * fundamental reset. As required by PCI Express spec a delay for at * least 100ms after such a reset before link training is needed. */
@@ -1046,6 +1071,22 @@ static int advk_pcie_probe(struct platform_device *pdev) } pcie->root_bus_nr = bus->start; + pcie->reset_gpio =devm_gpiod_get_from_of_node (dev, dev->of_node, +"reset-gpios" ,0 , +GPIOD_OUT_LOW , +"pcie1-reset" ); + ret =PTR_ERR_OR_ZERO (pcie->reset_gpio); +if (ret) { +if (ret == -ENOENT ) { + pcie->reset_gpio =NULL ; + }else { +if (ret != -EPROBE_DEFER ) +dev_err (dev,"Failed to get reset-gpio: %i\n" , + ret); +return ret; + } + } + ret =of_pci_get_max_link_speed (dev->of_node);if (ret <=0 || ret >3 ) pcie->link_gen =3 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 56/388 arm64: dts: fvp: Fix GIC child nodes
In reply to Sasha LevinFrom: Andre Przywara <[email protected]>
[ Upstream commit 78631aecc52c4b2adcf611769df2ff9c67ac16d0 ]
The GIC DT nodes for the fastmodels were not fully compliant with the DT binding, which has certain expectations about child nodes and their size and address cells values.
Use smaller #address-cells and #size-cells values, as the binding requests, and adjust the reg properties accordingly.
This requires adjusting the interrupt nexus nodes as well, as one field of the interrupt-map property depends on the GIC's address-size.
Since the .dts files share interrupt nexus nodes across different interrupt controllers (GICv2 vs. GICv3), we need to use the only commonly allowed #address-size value of <1> for both.
--- .../boot/dts/arm/foundation-v8-gicv2.dtsi | 2 +- .../boot/dts/arm/foundation-v8-gicv3.dtsi | 8 +- arch/arm64/boot/dts/arm/foundation-v8.dtsi | 86 +++++++++---------- 3 files changed, 48 insertions(+), 48 deletions(-)
arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi +1 -1
@@ -8,7 +8,7 @@ / { gic: interrupt-controller@2c001000 { compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; #interrupt-cells = <3>; - #address-cells = <2>; + #address-cells = <1>; interrupt-controller; reg = <0x0 0x2c001000 0 0x1000>, <0x0 0x2c002000 0 0x2000>,
arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi +4 -4
@@ -8,9 +8,9 @@ / { gic: interrupt-controller@2f000000 { compatible = "arm,gic-v3"; #interrupt-cells = <3>; - #address-cells = <2>; - #size-cells = <2>; - ranges; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x2f000000 0x100000>; interrupt-controller; reg = <0x0 0x2f000000 0x0 0x10000>, <0x0 0x2f100000 0x0 0x200000>,
@@ -22,7 +22,7 @@ gic: interrupt-controller@2f000000 { its: its@2f020000 { compatible = "arm,gic-v3-its"; msi-controller; - reg = <0x0 0x2f020000 0x0 0x20000>; + reg = <0x20000 0x20000>; }; }; };
arch/arm64/boot/dts/arm/foundation-v8.dtsi +43 -43
92 lines not on this page · raw message
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 227/388 iommu/arm-smmu-v3: Don't reserve implementation defined register space
In reply to Sasha LevinFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 52f3fab0067d6fa9e99c1b7f63265dd48ca76046 ]
Some SMMUv3 implementation embed the Perf Monitor Group Registers (PMCG) inside the first 64kB region of the SMMU. Since PMCG are managed by a separate driver, this layout causes resource reservation conflicts during boot.
To avoid this conflict, don't reserve the MMIO regions that are implementation defined. Although devm_ioremap_resource() still works on full pages under the hood, this way we benefit from resource conflict checks.
--- drivers/iommu/arm-smmu-v3.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-)
drivers/iommu/arm-smmu-v3.c +31 -4
@@ -171,6 +171,8 @@#define ARM_SMMU_PRIQ_IRQ_CFG1 0xd8#define ARM_SMMU_PRIQ_IRQ_CFG2 0xdc +#define ARM_SMMU_REG_SZ 0xe00 +/* Common MSI config fields */ #define MSI_CFG0_ADDR_MASK GENMASK_ULL(51, 2)#define MSI_CFG2_SH GENMASK(5, 4)
@@ -628,6 +630,7 @@ struct arm_smmu_strtab_cfg {struct arm_smmu_device {struct device *dev;void __iomem *base; +void __iomem *page1;#define ARM_SMMU_FEAT_2_LVL_STRTAB (1 << 0)#define ARM_SMMU_FEAT_2_LVL_CDTAB (1 << 1)
@@ -733,9 +736,8 @@ static struct arm_smmu_option_prop arm_smmu_options[] = {static inline void __iomem *arm_smmu_page1_fixup (unsigned long offset,struct arm_smmu_device *smmu) { -if ((offset >SZ_64K ) && - (smmu->options &ARM_SMMU_OPT_PAGE0_REGS_ONLY )) - offset -=SZ_64K ; +if (offset >SZ_64K ) +return smmu->page1 + offset -SZ_64K ;return smmu->base + offset; }
@@ -4021,6 +4023,18 @@ err_reset_pci_ops: __maybe_unused;return err; } +static void __iomem *arm_smmu_ioremap (struct device *dev,resource_size_t start, +resource_size_t size) +{ +struct resource res = { + .flags =IORESOURCE_MEM , + .start = start, + .end = start + size -1 , + }; + +return devm_ioremap_resource (dev, &res); +} +static int arm_smmu_device_probe (struct platform_device *pdev) {int irq, ret;
@@ -4056,10 +4070,23 @@ static int arm_smmu_device_probe(struct platform_device *pdev) } ioaddr = res->start; - smmu->base =devm_ioremap_resource (dev, res); +/* +* Don't map the IMPLEMENTATION DEFINED regions, since they may contain +* the PMCG registers which are reserved by the PMU driver. +*/ + smmu->base =arm_smmu_ioremap (dev, ioaddr,ARM_SMMU_REG_SZ );if (IS_ERR (smmu->base))return PTR_ERR (smmu->base); +if (arm_smmu_resource_size (smmu) >SZ_64K ) { + smmu->page1 =arm_smmu_ioremap (dev, ioaddr +SZ_64K , +ARM_SMMU_REG_SZ ); +if (IS_ERR (smmu->page1)) +return PTR_ERR (smmu->page1); + }else { + smmu->page1 = smmu->base; + } +/* Interrupt lines */ irq =platform_get_irq_byname_optional (pdev,"combined" );
Signature · 6 lines
2.25.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 230/388 drm/msm: Fix undefined "rd_full" link error
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 20aebe83698feb107d5a66b6cfd1d54459ccdfcf ]
rd_full should be defined outside the CONFIG_DEBUG_FS region, in order to be able to link the msm driver even when CONFIG_DEBUG_FS is disabled.
--- drivers/gpu/drm/msm/msm_rd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_rd.c +2 -2
@@ -29,8 +29,6 @@* or shader programs (if not emitted inline in cmdstream). */ -#ifdef CONFIG_DEBUG_FS -#include <linux/circ_buf.h> #include <linux/debugfs.h> #include <linux/kfifo.h>
@@ -47,6 +45,8 @@ bool rd_full = false;MODULE_PARM_DESC (rd_full,"If true, $debugfs/.../rd will snapshot all buffer contents" );module_param_named (rd_full, rd_full, bool,0600 ); +#ifdef CONFIG_DEBUG_FS +enum rd_sect_type {RD_NONE , RD_TEST, /* ascii text */
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 229/388 usb/ohci-platform: Fix a warning when hibernating
In reply to Sasha LevinFrom: Qais Yousef <[email protected]>
[ Upstream commit 1cb3b0095c3d0bb96912bfbbce4fc006d41f367c ]
The following warning was observed when attempting to suspend to disk using a USB flash as a swap device.
[ 111.779649] ------------[ cut here ]------------ [ 111.788382] URB (____ptrval____) submitted while active [ 111.796646] WARNING: CPU: 3 PID: 365 at drivers/usb/core/urb.c:363 usb_submit_urb+0x3d8/0x590 [ 111.805417] Modules linked in: [ 111.808584] CPU: 3 PID: 365 Comm: kworker/3:2 Not tainted 5.6.0-rc6-00002-gdfd1731f9a3e-dirty #545 [ 111.817796] Hardware name: ARM Juno development board (r2) (DT) [ 111.823896] Workqueue: usb_hub_wq hub_event [ 111.828217] pstate: 60000005 (nZCv daif -PAN -UAO) [ 111.833156] pc : usb_submit_urb+0x3d8/0x590 [ 111.837471] lr : usb_submit_urb+0x3d8/0x590 [ 111.841783] sp : ffff800018de38b0 [ 111.845205] x29: ffff800018de38b0 x28: 0000000000000003 [ 111.850682] x27: ffff000970530b20 x26: ffff8000133fd000 [ 111.856159] x25: ffff8000133fd000 x24: ffff800018de3b38 [ 111.861635] x23: 0000000000000004 x22: 0000000000000c00 [ 111.867112] x21: 0000000000000000 x20: 00000000fffffff0 [ 111.872589] x19: ffff0009704e7a00 x18: ffffffffffffffff [ 111.878065] x17: 00000000a7c8f4bc x16: 000000002af33de8 [ 111.883542] x15: ffff8000133fda88 x14: 0720072007200720 [ 111.889019] x13: 0720072007200720 x12: 0720072007200720 [ 111.894496] x11: 0000000000000000 x10: 00000000a5286134 [ 111.899973] x9 : 0000000000000002 x8 : ffff000970c837a0 [ 111.905449] x7 : 0000000000000000 x6 : ffff800018de3570 [ 111.910926] x5 : 0000000000000001 x4 : 0000000000000003 [ 111.916401] x3 : 0000000000000000 x2 : ffff800013427118 [ 111.921879] x1 : 9d4e965b4b7d7c00 x0 : 0000000000000000 [ 111.927356] Call trace: [ 111.929892] usb_submit_urb+0x3d8/0x590 [ 111.933852] hub_activate+0x108/0x7f0 [ 111.937633] hub_resume+0xac/0x148 [ 111.941149] usb_resume_interface.isra.10+0x60/0x138 [ 111.946265] usb_resume_both+0xe4/0x140 [ 111.950225] usb_runtime_resume+0x24/0x30 [ 111.954365] __rpm_callback+0xdc/0x138 [ 111.958236] rpm_callback+0x34/0x98 [ 111.961841] rpm_resume+0x4a8/0x720 [ 111.965445] rpm_resume+0x50c/0x720 [ 111.969049] __pm_runtime_resume+0x4c/0xb8 [ 111.973276] usb_autopm_get_interface+0x28/0x60 [ 111.977948] hub_event+0x80/0x16d8 [ 111.981466] process_one_work+0x2a4/0x748 [ 111.985604] worker_thread+0x48/0x498 [ 111.989387] kthread+0x13c/0x140 [ 111.992725] ret_from_fork+0x10/0x18 [ 111.996415] irq event stamp: 354 [ 111.999756] hardirqs last enabled at (353): [<ffff80001019ea1c>] console_unlock+0x504/0x5b8 [ 112.008441] hardirqs last disabled at (354): [<ffff8000100a95d0>] do_debug_exception+0x1a8/0x258 [ 112.017479] softirqs last enabled at (350): [<ffff8000100818a4>] __do_softirq+0x4bc/0x568 [ 112.025984] softirqs last disabled at (343): [<ffff8000101145a4>] irq_exit+0x144/0x150 [ 112.034129] ---[ end trace dc96030b9cf6c8a3 ]---
The problem was tracked down to a missing call to pm_runtime_set_active() on resume in ohci-platform.
--- drivers/usb/host/ohci-platform.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/host/ohci-platform.c +5 -0
@@ -299,6 +299,11 @@ static int ohci_platform_resume(struct device *dev) }ohci_resume (hcd, false); + +pm_runtime_disable (dev); +pm_runtime_set_active (dev); +pm_runtime_enable (dev); +return 0 ; }#endif /* CONFIG_PM_SLEEP */
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 183/388 ASoC: SOF: core: fix error return code in sof_probe_continue()
In reply to Sasha LevinFrom: Wei Yongjun <[email protected]>
[ Upstream commit 7d8785bc7adbb4dc5ba8ee06994107637848ded8 ]
Fix to return negative error code -ENOMEM from the IPC init error handling case instead of 0, as done elsewhere in this function.
--- sound/soc/sof/core.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sof/core.c +1 -0
@@ -176,6 +176,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)/* init the IPC */ sdev->ipc =snd_sof_ipc_init (sdev);if (!sdev->ipc) { + ret = -ENOMEM ;dev_err (sdev->dev,"error: failed to init DSP IPC %d\n" , ret); goto ipc_err; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 231/388 drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation
In reply to Sasha LevinFrom: Roy Spliet <[email protected]>
[ Upstream commit e4337877c5d578722c0716f131fb774522013cf5 ]
When allocation for mdp5_kms fails, calling mdp5_destroy() leads to undefined behaviour, likely a nullptr exception or use-after-free troubles.
--- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +2 -1
@@ -943,7 +943,8 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)return 0 ; fail: -mdp5_destroy (pdev); +if (mdp5_kms) +mdp5_destroy (pdev);return ret; }
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 233/388 USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe()
In reply to Sasha LevinFrom: Tang Bin <[email protected]>
[ Upstream commit d49292025f79693d3348f8e2029a8b4703be0f0a ]
The function ehci_mxc_drv_probe() does not perform sufficient error checking after executing platform_get_irq(), thus fix it.
--- drivers/usb/host/ehci-mxc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/ehci-mxc.c +2 -0
@@ -50,6 +50,8 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) } irq =platform_get_irq (pdev,0 ); +if (irq <0 ) +return irq; hcd =usb_create_hcd (&ehci_mxc_hc_driver, dev,dev_name (dev));if (!hcd)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 237/388 fpga: dfl: afu: Corrected error handling levels
In reply to Sasha LevinFrom: Souptick Joarder <[email protected]>
[ Upstream commit c9d7e3da1f3c4cf5dddfc5d7ce4d76d013aba1cc ]
Corrected error handling goto sequnece. Level put_pages should be called when pinned pages >= 0 && pinned != npages. Level free_pages should be called when pinned pages < 0.
--- drivers/fpga/dfl-afu-dma-region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fpga/dfl-afu-dma-region.c +2 -2
@@ -61,10 +61,10 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata, region->pages);if (pinned <0 ) { ret = pinned; - goto put_pages; + goto free_pages; }else if (pinned != npages) { ret = -EFAULT ; - goto free_pages; + goto put_pages; }dev_dbg (dev,"%d pages pinned\n" , pinned);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 26/388 ALSA: isa/wavefront: prevent out of bounds write in ioctl
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 7f0d5053c5a9d23fe5c2d337495a9d79038d267b ]
The "header->number" comes from the ioctl and it needs to be clamped to prevent out of bounds writes.
--- sound/isa/wavefront/wavefront_synth.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/isa/wavefront/wavefront_synth.c +7 -1
@@ -1171,7 +1171,10 @@ wavefront_send_alias (snd_wavefront_t *dev, wavefront_patch_info *header)"alias for %d\n" , header->number, header->hdr.a.OriginalSample); - + +if (header->number >=WF_MAX_SAMPLE ) +return -EINVAL ; +munge_int32 (header->number, &alias_hdr[0 ],2 );munge_int32 (header->hdr.a.OriginalSample, &alias_hdr[2 ],2 ); munge_int32 (*((unsigned int *)&header->hdr.a.sampleStartOffset),
@@ -1202,6 +1205,9 @@ wavefront_send_multisample (snd_wavefront_t *dev, wavefront_patch_info *header)int num_samples;unsigned char *msample_hdr; +if (header->number >=WF_MAX_SAMPLE ) +return -EINVAL ; + msample_hdr =kmalloc (WF_MSAMPLE_BYTES ,GFP_KERNEL );if (! msample_hdr)return -ENOMEM ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 238/388 clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit 25bdae0f1c6609ceaf55fe6700654f0be2253d8e ]
Mark the SCLK clock for Exynos5433 I2S1 device with IGNORE_UNUSED flag to match its behaviour with SCLK clock for AUD_I2S (I2S0) device until a proper fix for Exynos I2S driver is ready.
This fixes the following synchronous abort issue revealed by the probe order change caused by the commit 93d2e4322aa7 ("of: platform: Batch fwnode parsing when adding all top level devices")
Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 50 Comm: kworker/0:1 Not tainted 5.7.0-rc5+ #701 Hardware name: Samsung TM2E board (DT) Workqueue: events deferred_probe_work_func pstate: 60000005 (nZCv daif -PAN -UAO) pc : samsung_i2s_probe+0x768/0x8f0 lr : samsung_i2s_probe+0x688/0x8f0 ... Call trace: samsung_i2s_probe+0x768/0x8f0 platform_drv_probe+0x50/0xa8 really_probe+0x108/0x370 driver_probe_device+0x54/0xb8 __device_attach_driver+0x90/0xc0 bus_for_each_drv+0x70/0xc8 __device_attach+0xdc/0x140 device_initial_probe+0x10/0x18 bus_probe_device+0x94/0xa0 deferred_probe_work_func+0x70/0xa8 process_one_work+0x2a8/0x718 worker_thread+0x48/0x470 kthread+0x134/0x160 ret_from_fork+0x10/0x1c Code: 17ffffaf d503201f f94086c0 91003000 (88dffc00) ---[ end trace ccf721c9400ddbd6 ]---
--- drivers/clk/samsung/clk-exynos5433.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/samsung/clk-exynos5433.c +2 -1
@@ -1706,7 +1706,8 @@ static const struct samsung_gate_clock peric_gate_clks[] __initconst = {GATE (CLK_SCLK_PCM1 ,"sclk_pcm1" ,"sclk_pcm1_peric" ,ENABLE_SCLK_PERIC ,7 ,CLK_SET_RATE_PARENT ,0 ),GATE (CLK_SCLK_I2S1 ,"sclk_i2s1" ,"sclk_i2s1_peric" , -ENABLE_SCLK_PERIC ,6 ,CLK_SET_RATE_PARENT ,0 ), +ENABLE_SCLK_PERIC ,6 , +CLK_SET_RATE_PARENT |CLK_IGNORE_UNUSED ,0 ),GATE (CLK_SCLK_SPI2 ,"sclk_spi2" ,"sclk_spi2_peric" ,ENABLE_SCLK_PERIC ,5 ,CLK_SET_RATE_PARENT ,0 ), GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_PERIC,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 239/388 ARM: dts: meson: Switch existing boards with RGMII PHY to "rgmii-id"
In reply to Sasha LevinFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 005231128e9e97461e81fa32421957a7664317ca ]
Let the PHY generate the RX and TX delay on the Odroid-C1 and MXIII Plus.
Previously we did not know that these boards used an RX delay. We assumed that setting the TX delay on the MAC side It turns out that these boards also require an RX delay of 2ns (verified on Odroid-C1, but the u-boot code uses the same setup on both boards). Ethernet only worked because u-boot added this RX delay on the MAC side.
The 4ns TX delay was also wrong and the result of using an unsupported RGMII TX clock divider setting. This has been fixed in the driver with commit bd6f48546b9cb7 ("net: stmmac: dwmac-meson8b: Fix the RGMII TX delay on Meson8b/8m2 SoCs").
Switch to phy-mode "rgmii-id" to let the PHY side handle all the delays, (as recommended by the Ethernet maintainers anyways) to correctly describe the need for a 2ns RX as well as 2ns TX delay on these boards. This fixes the Ethernet performance on Odroid-C1 where there was a huge amount of packet loss when transmitting data due to the incorrect TX delay.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 3 +-- arch/arm/boot/dts/meson8m2-mxiii-plus.dts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-)
arch/arm/boot/dts/meson8b-odroidc1.dts +1 -2
@@ -202,9 +202,8 @@ ðmac { pinctrl-0 = <ð_rgmii_pins>; pinctrl-names = "default"; - phy-mode = "rgmii"; phy-handle = <ð_phy>; - amlogic,tx-delay-ns = <4>; + phy-mode = "rgmii-id"; nvmem-cells = <ðernet_mac_address>; nvmem-cell-names = "mac-address";
arch/arm/boot/dts/meson8m2-mxiii-plus.dts +1 -3
@@ -69,9 +69,7 @@ ðmac { pinctrl-names = "default"; phy-handle = <ð_phy0>; - phy-mode = "rgmii"; - - amlogic,tx-delay-ns = <4>; + phy-mode = "rgmii-id"; mdio { compatible = "snps,dwmac-mdio";
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 195/388 ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 03990fd58d2b7c8f7d53e514ba9b8749fac260f9 ]
If an error occurs after the call to 'omap_mcbsp_init()', the reference to 'mcbsp->fclk' must be decremented, as already done in the remove function.
This can be achieved easily by using the devm_ variant of 'clk_get()' when the reference is taken in 'omap_mcbsp_init()'
This fixes the leak in the probe and has the side effect to simplify both the error handling path of 'omap_mcbsp_init()' and the remove function.
--- sound/soc/ti/omap-mcbsp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
sound/soc/ti/omap-mcbsp.c +2 -6
@@ -686,7 +686,7 @@ static int omap_mcbsp_init(struct platform_device *pdev) mcbsp->dma_data[1 ].addr =omap_mcbsp_dma_reg_params (mcbsp,SNDRV_PCM_STREAM_CAPTURE ); - mcbsp->fclk =clk_get (&pdev->dev,"fck" ); + mcbsp->fclk =devm_clk_get (&pdev->dev,"fck" );if (IS_ERR (mcbsp->fclk)) { ret =PTR_ERR (mcbsp->fclk);dev_err (mcbsp->dev,"unable to get fck: %d\n" , ret);
@@ -711,7 +711,7 @@ static int omap_mcbsp_init(struct platform_device *pdev)if (ret) {dev_err (mcbsp->dev,"Unable to create additional controls\n" ); - goto err_thres; +return ret; } }
@@ -724,8 +724,6 @@ static int omap_mcbsp_init(struct platform_device *pdev) err_st:if (mcbsp->pdata->buffer_size)sysfs_remove_group (&mcbsp->dev->kobj, &additional_attr_group); -err_thres: -clk_put (mcbsp->fclk);return ret; }
@@ -1442,8 +1440,6 @@ static int asoc_mcbsp_remove(struct platform_device *pdev)omap_mcbsp_st_cleanup (pdev); -clk_put (mcbsp->fclk); -return 0 ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 249/388 powerpc/powernv: add NULL check after kzalloc
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit ceffa63acce7165c442395b7d64a11ab8b5c5dca ]
Fixes coccicheck warning:
./arch/powerpc/platforms/powernv/opal.c:813:1-5:
alloc with no test, possible model on line 814
Add NULL check after kzalloc.
--- arch/powerpc/platforms/powernv/opal.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/powerpc/platforms/powernv/opal.c +4 -0
@@ -811,6 +811,10 @@ static int opal_add_one_export(struct kobject *parent, const char *export_name, goto out; attr =kzalloc (sizeof (*attr),GFP_KERNEL ); +if (!attr) { + rc = -ENOMEM ; + goto out; + } name =kstrdup (export_name,GFP_KERNEL );if (!name) { rc = -ENOMEM ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 250/388 powerpc/64s/pgtable: fix an undefined behaviour
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit c2e929b18cea6cbf71364f22d742d9aad7f4677a ]
Booting a power9 server with hash MMU could trigger an undefined behaviour because pud_offset(p4d, 0) will do,
0 >> (PAGE_SHIFT:16 + PTE_INDEX_SIZE:8 + H_PMD_INDEX_SIZE:10)
Fix it by converting pud_index() and friends to static inline functions.
UBSAN: shift-out-of-bounds in arch/powerpc/mm/ptdump/ptdump.c:282:15 shift exponent 34 is too large for 32-bit type 'int' CPU: 6 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc4-next-20200303+ #13 Call Trace: dump_stack+0xf4/0x164 (unreliable) ubsan_epilogue+0x18/0x78 __ubsan_handle_shift_out_of_bounds+0x160/0x21c walk_pagetables+0x2cc/0x700 walk_pud at arch/powerpc/mm/ptdump/ptdump.c:282 (inlined by) walk_pagetables at arch/powerpc/mm/ptdump/ptdump.c:311 ptdump_check_wx+0x8c/0xf0 mark_rodata_ro+0x48/0x80 kernel_init+0x74/0x194 ret_from_kernel_thread+0x5c/0x74
--- arch/powerpc/include/asm/book3s/64/pgtable.h | 23 ++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/book3s/64/pgtable.h +19 -4
@@ -998,10 +998,25 @@ extern struct page *pgd_page(pgd_t pgd);#define pud_page_vaddr (pud) __va(pud_val(pud) & ~PUD_MASKED_BITS)#define pgd_page_vaddr (pgd) __va(pgd_val(pgd) & ~PGD_MASKED_BITS) -#define pgd_index (address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1)) -#define pud_index (address) (((address) >> (PUD_SHIFT)) & (PTRS_PER_PUD - 1)) -#define pmd_index (address) (((address) >> (PMD_SHIFT)) & (PTRS_PER_PMD - 1)) -#define pte_index (address) (((address) >> (PAGE_SHIFT)) & (PTRS_PER_PTE - 1)) +static inline unsigned long pgd_index (unsigned long address) +{ +return (address >>PGDIR_SHIFT ) & (PTRS_PER_PGD -1 ); +} + +static inline unsigned long pud_index (unsigned long address) +{ +return (address >>PUD_SHIFT ) & (PTRS_PER_PUD -1 ); +} + +static inline unsigned long pmd_index (unsigned long address) +{ +return (address >>PMD_SHIFT ) & (PTRS_PER_PMD -1 ); +} + +static inline unsigned long pte_index (unsigned long address) +{ +return (address >>PAGE_SHIFT ) & (PTRS_PER_PTE -1 ); +}/* * Find an entry in a page-table-directory. We combine the address region
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 55/388 ASoC: SOF: Do nothing when DSP PM callbacks are not set
In reply to Sasha LevinFrom: Daniel Baluta <[email protected]>
[ Upstream commit c26fde3b15ed41f5f452f1da727795f787833287 ]
This provides a better separation between runtime and PM sleep callbacks.
Only do nothing if given runtime flag is set and calback is not set.
With the current implementation, if PM sleep callback is set but runtime callback is not set then at runtime resume we reload the firmware even if we do not support runtime resume callback.
--- sound/soc/sof/pm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/sof/pm.c +8 -2
@@ -90,7 +90,10 @@ static int sof_resume(struct device *dev, bool runtime_resume)int ret;/* do nothing if dsp resume callbacks are not set */ -if (!sof_ops (sdev)->resume || !sof_ops (sdev)->runtime_resume) +if (!runtime_resume && !sof_ops (sdev)->resume) +return 0 ; + +if (runtime_resume && !sof_ops (sdev)->runtime_resume)return 0 ;/* DSP was never successfully started, nothing to resume */
@@ -175,7 +178,10 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)int ret;/* do nothing if dsp suspend callback is not set */ -if (!sof_ops (sdev)->suspend) +if (!runtime_suspend && !sof_ops (sdev)->suspend) +return 0 ; + +if (runtime_suspend && !sof_ops (sdev)->runtime_suspend)return 0 ;if (sdev->fw_state !=SOF_FW_BOOT_COMPLETE )
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 257/388 PCI: dwc: pci-dra7xx: Use devm_platform_ioremap_resource_byname()
In reply to Sasha LevinFrom: Wei Yongjun <[email protected]>
[ Upstream commit c8a119779f5609de8dcd98630f71cc7f1b2e4e8c ]
platform_get_resource() may fail and return NULL, so we had better check its return value to avoid a NULL pointer dereference a bit later in the code. Fix it to use devm_platform_ioremap_resource_byname() instead of calling platform_get_resource_byname() and devm_ioremap().
--- drivers/pci/controller/dwc/pci-dra7xx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/controller/dwc/pci-dra7xx.c +3 -5
@@ -840,7 +840,6 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)struct phy **phy;struct device_link **link;void __iomem *base; -struct resource *res;struct dw_pcie *pci;struct dra7xx_pcie *dra7xx;struct device *dev = &pdev->dev;
@@ -877,10 +876,9 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)return irq; } - res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"ti_conf" ); - base =devm_ioremap (dev, res->start,resource_size (res)); -if (!base) -return -ENOMEM ; + base =devm_platform_ioremap_resource_byname (pdev,"ti_conf" ); +if (IS_ERR (base)) +return PTR_ERR (base); phy_count =of_property_count_strings (np,"phy-names" );if (phy_count <0 ) {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 202/388 arm64: dts: qcom: c630: Add WiFi node
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 3fb298d0b2f2a1d47d53806d4ddf8f4ae83353cc ]
Specify regulators and enable the &wifi node. The firmware uses the 8 bit version of the host capability message, so specify this quirk.
--- arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts +11 -0
@@ -577,3 +577,14 @@ right_spkr: wsa8810-right{ }; }; }; + +&wifi { + status = "okay"; + + vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>; + vdd-1.8-xo-supply = <&vreg_l7a_1p8>; + vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; + vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; + + qcom,snoc-host-cap-8bit-quirk; +};
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 59/388 arm64: dts: fvp/juno: Fix node address fields
In reply to Sasha LevinFrom: Andre Przywara <[email protected]>
[ Upstream commit bb5cce12ac717c7462217cd493ed701d12d6dbce ]
The Arm Ltd. boards were using an outdated address convention in the DT node names, by separating the high from the low 32-bits of an address by a comma.
Remove the comma from the node name suffix to be DT spec compliant.
--- arch/arm/boot/dts/vexpress-v2m-rs1.dtsi | 10 +++++----- arch/arm64/boot/dts/arm/foundation-v8.dtsi | 4 ++-- arch/arm64/boot/dts/arm/juno-motherboard.dtsi | 6 +++--- arch/arm64/boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi | 2 +- arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-)
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi +5 -5
@@ -31,7 +31,7 @@ motherboard { #interrupt-cells = <1>; ranges; - nor_flash: flash@0,00000000 { + nor_flash: flash@0 { compatible = "arm,vexpress-flash", "cfi-flash"; reg = <0 0x00000000 0x04000000>, <4 0x00000000 0x04000000>;
@@ -41,13 +41,13 @@ partitions { }; }; - psram@1,00000000 { + psram@100000000 { compatible = "arm,vexpress-psram", "mtd-ram"; reg = <1 0x00000000 0x02000000>; bank-width = <4>; }; - ethernet@2,02000000 { + ethernet@202000000 { compatible = "smsc,lan9118", "smsc,lan9115"; reg = <2 0x02000000 0x10000>; interrupts = <15>;
@@ -59,14 +59,14 @@ ethernet@2,02000000 { vddvario-supply = <&v2m_fixed_3v3>; }; - usb@2,03000000 { + usb@203000000 { compatible = "nxp,usb-isp1761"; reg = <2 0x03000000 0x20000>; interrupts = <16>; port1-otg; }; - iofpga@3,00000000 { + iofpga@300000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>;
arch/arm64/boot/dts/arm/foundation-v8.dtsi +2 -2
@@ -151,7 +151,7 @@ bus@8000000 { <0 0 41 &gic 0 GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, <0 0 42 &gic 0 GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; - ethernet@2,02000000 { + ethernet@202000000 { compatible = "smsc,lan91c111"; reg = <2 0x02000000 0x10000>; interrupts = <15>;
@@ -178,7 +178,7 @@ v2m_refclk32khz: refclk32khz { clock-output-names = "v2m:refclk32khz"; }; - iofpga@3,00000000 { + iofpga@300000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>;
arch/arm64/boot/dts/arm/juno-motherboard.dtsi +3 -3
@@ -103,7 +103,7 @@ nmi-button { }; }; - flash@0,00000000 { + flash@0 { /* 2 * 32MiB NOR Flash memory mounted on CS0 */ compatible = "arm,vexpress-flash", "cfi-flash"; reg = <0 0x00000000 0x04000000>;
@@ -120,7 +120,7 @@ partitions { }; }; - ethernet@2,00000000 { + ethernet@200000000 { compatible = "smsc,lan9118", "smsc,lan9115"; reg = <2 0x00000000 0x10000>; interrupts = <3>;
@@ -133,7 +133,7 @@ ethernet@2,00000000 { vddvario-supply = <&mb_fixed_3v3>; }; - iofpga@3,00000000 { + iofpga@300000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>;
arch/arm64/boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi +1 -1
@@ -9,7 +9,7 @@ bus@8000000 { motherboard { arm,v2m-memory-map = "rs2"; - iofpga@3,00000000 { + iofpga@300000000 { virtio-p9@140000 { compatible = "virtio,mmio"; reg = <0x140000 0x200>;
arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi +3 -3
@@ -17,14 +17,14 @@ motherboard { #interrupt-cells = <1>; ranges; - flash@0,00000000 { + flash@0 { compatible = "arm,vexpress-flash", "cfi-flash"; reg = <0 0x00000000 0x04000000>, <4 0x00000000 0x04000000>; bank-width = <4>; }; - ethernet@2,02000000 { + ethernet@202000000 { compatible = "smsc,lan91c111"; reg = <2 0x02000000 0x10000>; interrupts = <15>;
@@ -51,7 +51,7 @@ v2m_refclk32khz: refclk32khz { clock-output-names = "v2m:refclk32khz"; }; - iofpga@3,00000000 { + iofpga@300000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>;
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 211/388 HID: Add quirks for Trust Panora Graphic Tablet
In reply to Sasha LevinFrom: Cristian Klein <[email protected]>
[ Upstream commit fb68ada81e65d593b51544fa43c284322107a742 ]
The Trust Panora Graphic Tablet has two interfaces. Interface zero reports pen movement, pen pressure and pen buttons. Interface one reports tablet buttons and tablet scroll. Both use the mouse protocol.
Without these quirks, libinput gets confused about what device it talks to.
For completeness, here is the usbhid-dump:
``` $ sudo usbhid-dump -d 145f:0212 003:013:001:DESCRIPTOR 1588949402.559961 05 0D 09 01 A1 01 85 07 A1 02 09 00 75 08 95 07 81 02 C0 C0 09 0E A1 01 85 05 09 23 A1 02 09 52 09 53 25 0A 75 08 95 02 B1 02 C0 C0 05 0C 09 36 A1 00 85 06 05 09 19 01 29 20 15 00 25 01 95 20 75 01 81 02 C0 003:013:000:DESCRIPTOR 1588949402.563942 05 01 09 02 A1 01 85 08 09 01 A1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 05 81 01 05 01 09 30 09 31 09 38 09 00 15 81 25 7F 75 08 95 04 81 06 C0 C0 05 01 09 02 A1 01 85 09 09 01 A1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 05 81 01 05 01 09 30 09 31 26 FF 7F 95 02 75 10 81 02 05 0D 09 30 26 FF 03 95 01 75 10 81 02 C0 C0 05 01 09 00 A1 01 85 04 A1 00 26 FF 00 09 00 75 08 95 07 B1 02 C0 C0 ```
--- drivers/hid/hid-ids.h | 3 +++ drivers/hid/hid-quirks.c | 1 + 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +3 -0
@@ -1157,6 +1157,9 @@#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882 0x8882#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883 0x8883 +#define USB_VENDOR_ID_TRUST 0x145f +#define USB_DEVICE_ID_TRUST_PANORA_TABLET 0x0212 +#define USB_VENDOR_ID_TURBOX 0x062a#define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201#define USB_DEVICE_ID_ASUS_MD_5110 0x5110
drivers/hid/hid-quirks.c +1 -0
@@ -168,6 +168,7 @@ static const struct hid_device_id hid_quirks[] = { { HID_USB_DEVICE(USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883), HID_QUIRK_NOGET }, + { HID_USB_DEVICE(USB_VENDOR_ID_TRUST, USB_DEVICE_ID_TRUST_PANORA_TABLET), HID_QUIRK_MULTI_INPUT | HID_QUIRK_HIDINPUT_FORCE }, { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60), HID_QUIRK_MULTI_INPUT },
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 267/388 usb: gadget: fix potential double-free in m66592_probe.
In reply to Sasha LevinFrom: Qiushi Wu <[email protected]>
[ Upstream commit 44734a594196bf1d474212f38fe3a0d37a73278b ]
m66592_free_request() is called under label "err_add_udc" and "clean_up", and m66592->ep0_req is not set to NULL after first free, leading to a double-free. Fix this issue by setting m66592->ep0_req to NULL after the first free.
--- drivers/usb/gadget/udc/m66592-udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/m66592-udc.c +1 -1
@@ -1667,7 +1667,7 @@ static int m66592_probe(struct platform_device *pdev) err_add_udc:m66592_free_request (&m66592->ep[0 ].ep, m66592->ep0_req); - + m66592->ep0_req =NULL ; clean_up3:if (m66592->pdata->on_chip) {clk_disable (m66592->clk);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 254/388 xen/cpuhotplug: Fix initial CPU offlining for PV(H) guests
In reply to Sasha LevinFrom: Boris Ostrovsky <[email protected]>
[ Upstream commit c54b071c192dfe8061336f650ceaf358e6386e0b ]
Commit a926f81d2f6c ("xen/cpuhotplug: Replace cpu_up/down() with device_online/offline()") replaced cpu_down() with device_offline() call which requires that the CPU has been registered before. This registration, however, happens later from topology_init() which is called as subsys_initcall(). setup_vcpu_hotplug_event(), on the other hand, is invoked earlier, during arch_initcall().
As result, booting a PV(H) guest with vcpus < maxvcpus causes a crash.
Move setup_vcpu_hotplug_event() (and therefore setup_cpu_watcher()) to late_initcall(). In addition, instead of performing all offlining steps in setup_cpu_watcher() simply call disable_hotplug_cpu().
--- drivers/xen/cpu_hotplug.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/xen/cpu_hotplug.c +3 -5
@@ -93,10 +93,8 @@ static int setup_cpu_watcher(struct notifier_block *notifier, (void )register_xenbus_watch (&cpu_watch);for_each_possible_cpu (cpu) { -if (vcpu_online (cpu) ==0 ) { -device_offline (get_cpu_device (cpu)); -set_cpu_present (cpu, false); - } +if (vcpu_online (cpu) ==0 ) +disable_hotplug_cpu (cpu); }return NOTIFY_DONE ;
@@ -119,5 +117,5 @@ static int __init setup_vcpu_hotplug_event(void)return 0 ; } -arch_initcall (setup_vcpu_hotplug_event); +late_initcall (setup_vcpu_hotplug_event);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 218/388 powerpc/64s/exception: Fix machine check no-loss idle wakeup
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 8a5054d8cbbe03c68dcb0957c291c942132e4101 ]
The architecture allows for machine check exceptions to cause idle wakeups which resume at the 0x200 address which has to return via the idle wakeup code, but the early machine check handler is run first.
The case of a no state-loss sleep is broken because the early handler uses non-volatile register r1 , which is needed for the wakeup protocol, but it is not restored.
Fix this by loading r1 from the MCE exception frame before returning to the idle wakeup code. Also update the comment which has become stale since the idle rewrite in C.
This crash was found and fix confirmed with a machine check injection test in qemu powernv model (which is not upstream in qemu yet).
--- arch/powerpc/kernel/exceptions-64s.S | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
arch/powerpc/kernel/exceptions-64s.S +8 -6
@@ -1225,17 +1225,19 @@ EXC_COMMON_BEGIN(machine_check_idle_common) bl machine_check_queue_event /* - * We have not used any non-volatile GPRs here, and as a rule - * most exception code including machine check does not. - * Therefore PACA_NAPSTATELOST does not need to be set. Idle - * wakeup will restore volatile registers. + * GPR-loss wakeups are relatively straightforward, because the + * idle sleep code has saved all non-volatile registers on its + * own stack, and r1 in PACAR1. * - * Load the original SRR1 into r3 for pnv_powersave_wakeup_mce. + * For no-loss wakeups the r1 and lr registers used by the + * early machine check handler have to be restored first. r2 is + * the kernel TOC, so no need to restore it. * * Then decrement MCE nesting after finishing with the stack. */ ld r3,_MSR(r1) ld r4,_LINK(r1) + ld r1,GPR1(r1) lhz r11,PACA_IN_MCE(r13) subi r11,r11,1
@@ -1244,7 +1246,7 @@ EXC_COMMON_BEGIN(machine_check_idle_common) mtlr r4 rlwinm r10,r3,47-31,30,31 cmpwi cr1,r10,2 - bltlr cr1 /* no state loss, return to idle caller */ + bltlr cr1 /* no state loss, return to idle caller with r3=SRR1 */ b idle_return_gpr_loss #endif
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 274/388 mfd: stmfx: Fix stmfx_irq_init error path
In reply to Sasha LevinFrom: Amelie Delaunay <[email protected]>
[ Upstream commit 60c2c4bcb9202acad4cc26af20b44b6bd7874f7b ]
In case the interrupt signal can't be configured, IRQ domain needs to be removed.
--- drivers/mfd/stmfx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mfd/stmfx.c +7 -2
@@ -287,14 +287,19 @@ static int stmfx_irq_init(struct i2c_client *client) ret =regmap_write (stmfx->map,STMFX_REG_IRQ_OUT_PIN , irqoutpin);if (ret) -return ret; + goto irq_exit; ret =devm_request_threaded_irq (stmfx->dev, client->irq,NULL , stmfx_irq_handler, irqtrigger |IRQF_ONESHOT ,"stmfx" , stmfx);if (ret) -stmfx_irq_exit (client); + goto irq_exit; + +return 0 ; + +irq_exit: +stmfx_irq_exit (client);return ret; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 277/388 powerpc/32s: Don't warn when mapping RO data ROX.
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit 4b19f96a81bceaf0bcf44d79c0855c61158065ec ]
Mapping RO data as ROX is not an issue since that data cannot be modified to introduce an exploit.
PPC64 accepts to have RO data mapped ROX, as a trade off between kernel size and strictness of protection.
On PPC32, kernel size is even more critical as amount of memory is usually small.
Depending on the number of available IBATs, the last IBATs might overflow the end of text. Only warn if it crosses the end of RO data.
--- arch/powerpc/mm/book3s32/mmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/mm/book3s32/mmu.c +4 -2
@@ -187,6 +187,7 @@ void mmu_mark_initmem_nx(void)int i;unsigned long base = (unsigned long )_stext -PAGE_OFFSET ;unsigned long top = (unsigned long )_etext -PAGE_OFFSET ; +unsigned long border = (unsigned long )__init_begin -PAGE_OFFSET ;unsigned long size;if (IS_ENABLED (CONFIG_PPC_BOOK3S_601 ))
@@ -201,9 +202,10 @@ void mmu_mark_initmem_nx(void) size =block_size (base, top); size =max (size,128UL <<10 );if ((top - base) > size) { -if (strict_kernel_rwx_enabled ()) -pr_warn ("Kernel _etext not properly aligned\n" ); size <<=1 ; +if (strict_kernel_rwx_enabled () && base + size > border) +pr_warn ("Some RW data is getting mapped X. " +"Adjust CONFIG_DATA_SHIFT to avoid that.\n" ); }setibat (i++,PAGE_OFFSET + base, base, size,PAGE_KERNEL_TEXT ); base += size;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 282/388 clk: bcm2835: Fix return type of bcm2835_register_gate
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit f376c43bec4f8ee8d1ba5c5c4cfbd6e84fb279cb ]
bcm2835_register_gate is used as a callback for the clk_register member of bcm2835_clk_desc, which expects a struct clk_hw * return type but bcm2835_register_gate returns a struct clk *.
This discrepancy is hidden by the fact that bcm2835_register_gate is cast to the typedef bcm2835_clk_register by the _REGISTER macro. This turns out to be a control flow integrity violation, which is how this was noticed.
Change the return type of bcm2835_register_gate to be struct clk_hw * and use clk_hw_register_gate to do so. This should be a non-functional change as clk_register_gate calls clk_hw_register_gate anyways but this is needed to avoid issues with further changes.
--- drivers/clk/bcm/clk-bcm2835.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/clk/bcm/clk-bcm2835.c +5 -5
@@ -1448,13 +1448,13 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman,return &clock->hw; } -static struct clk *bcm2835_register_gate (struct bcm2835_cprman *cprman, +static struct clk_hw *bcm2835_register_gate (struct bcm2835_cprman *cprman,const struct bcm2835_gate_data *data) { -return clk_register_gate (cprman->dev, data->name, data->parent, -CLK_IGNORE_UNUSED |CLK_SET_RATE_GATE , - cprman->regs + data->ctl_reg, -CM_GATE_BIT ,0 , &cprman->regs_lock); +return clk_hw_register_gate (cprman->dev, data->name, data->parent, +CLK_IGNORE_UNUSED |CLK_SET_RATE_GATE , + cprman->regs + data->ctl_reg, +CM_GATE_BIT ,0 , &cprman->regs_lock); } typedef struct clk_hw *(*bcm2835_clk_register)(struct bcm2835_cprman *cprman,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 226/388 powerpc/ps3: Fix kexec shutdown hang
In reply to Sasha LevinFrom: Geoff Levand <[email protected]>
[ Upstream commit 126554465d93b10662742128918a5fc338cda4aa ]
The ps3_mm_region_destroy() and ps3_mm_vas_destroy() routines are called very late in the shutdown via kexec's mmu_cleanup_all routine. By the time mmu_cleanup_all runs it is too late to use udbg_printf, and calling it will cause PS3 systems to hang.
Remove all debugging statements from ps3_mm_region_destroy() and ps3_mm_vas_destroy() and replace any error reporting with calls to lv1_panic.
With this change builds with 'DEBUG' defined will not cause kexec reboots to hang, and builds with 'DEBUG' defined or not will end in lv1_panic if an error is encountered.
--- arch/powerpc/platforms/ps3/mm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
arch/powerpc/platforms/ps3/mm.c +12 -10
@@ -200,13 +200,14 @@ void ps3_mm_vas_destroy(void) {int result; -DBG ("%s:%d: map.vas_id = %llu\n" , __func__, __LINE__, map.vas_id); -if (map.vas_id) { result =lv1_select_virtual_address_space (0 ); -BUG_ON (result); - result =lv1_destruct_virtual_address_space (map.vas_id); -BUG_ON (result); + result +=lv1_destruct_virtual_address_space (map.vas_id); + +if (result) { +lv1_panic (0 ); + } + map.vas_id =0 ; } }
@@ -304,19 +305,20 @@ static void ps3_mm_region_destroy(struct mem_region *r)int result;if (!r->destroy) { -pr_info ("%s:%d: Not destroying high region: %llxh %llxh\n" , - __func__, __LINE__, r->base, r->size);return ; } -DBG ("%s:%d: r->base = %llxh\n" , __func__, __LINE__, r->base); -if (r->base) { result =lv1_release_memory (r->base); -BUG_ON (result); + +if (result) { +lv1_panic (0 ); + } + r->size = r->base = r->offset =0 ; map.total = map.rm.size; } +ps3_mm_set_repository_highmem (NULL ); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 284/388 clk: zynqmp: Fix divider2 calculation
In reply to Sasha LevinFrom: Tejas Patel <[email protected]>
[ Upstream commit b8c1049c68d634a412ed5980ae666ed7c8839305 ]
zynqmp_get_divider2_val() calculates, divider value of type DIV2 clock, considering best possible combination of DIV1 and DIV2.
To find best possible values of DIV1 and DIV2, DIV1's parent rate should be consider and not DIV2's parent rate since it would rate of div1 clock. Consider a below topology,
out_clk->div2_clk->div1_clk->fixed_parent
where out_clk = (fixed_parent/div1_clk) / div2_clk, so parent clock of div1_clk (i.e. out_clk) should be divided by div1_clk and div2_clk.
Existing code divides parent rate of div2_clk's clock instead of div1_clk's parent rate, which is wrong.
Fix the same by considering div1's parent clock rate.
--- drivers/clk/zynqmp/divider.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/clk/zynqmp/divider.c +12 -5
@@ -111,23 +111,30 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,static void zynqmp_get_divider2_val (struct clk_hw *hw,unsigned long rate, -unsigned long parent_rate,struct zynqmp_clk_divider *divider,int *bestdiv) {int div1;int div2;long error =LONG_MAX ; -struct clk_hw *parent_hw =clk_hw_get_parent (hw); -struct zynqmp_clk_divider *pdivider =to_zynqmp_clk_divider (parent_hw); +unsigned long div1_prate; +struct clk_hw *div1_parent_hw; +struct clk_hw *div2_parent_hw =clk_hw_get_parent (hw); +struct zynqmp_clk_divider *pdivider = +to_zynqmp_clk_divider (div2_parent_hw);if (!pdivider)return ; + div1_parent_hw =clk_hw_get_parent (div2_parent_hw); +if (!div1_parent_hw) +return ; + + div1_prate =clk_hw_get_rate (div1_parent_hw); *bestdiv =1 ;for (div1 =1 ; div1 <= pdivider->max_div;) {for (div2 =1 ; div2 <= divider->max_div;) { -long new_error = ((parent_rate / div1) / div2) - rate; +long new_error = ((div1_prate / div1) / div2) - rate;if (abs (new_error) <abs (error)) { *bestdiv = div2;
@@ -192,7 +199,7 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,*/ if (div_type ==TYPE_DIV2 && (clk_hw_get_flags (hw) &CLK_SET_RATE_PARENT )) { -zynqmp_get_divider2_val (hw, rate, *prate, divider, &bestdiv); +zynqmp_get_divider2_val (hw, rate, divider, &bestdiv); }if ((clk_hw_get_flags (hw) &CLK_SET_RATE_PARENT ) && divider->is_frac)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 225/388 phy: cadence: sierra: Fix for USB3 U1/U2 state
In reply to Sasha LevinFrom: Sanket Parmar <[email protected]>
[ Upstream commit 2bcf14ca1a2f3202954f812f380c7fa8127fbd7f ]
Updated values of USB3 related Sierra PHY registers. This change fixes USB3 device disconnect issue observed while enternig U1/U2 state.
--- drivers/phy/cadence/phy-cadence-sierra.c | 27 ++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/phy/cadence/phy-cadence-sierra.c +14 -13
@@ -685,10 +685,10 @@ static struct cdns_reg_pairs cdns_usb_cmn_regs_ext_ssc[] = {static struct cdns_reg_pairs cdns_usb_ln_regs_ext_ssc[] = { {0xFE0A ,SIERRA_DET_STANDEC_A_PREG }, {0x000F ,SIERRA_DET_STANDEC_B_PREG }, - {0x00A5 ,SIERRA_DET_STANDEC_C_PREG }, + {0x55A5 ,SIERRA_DET_STANDEC_C_PREG }, {0x69ad ,SIERRA_DET_STANDEC_D_PREG }, {0x0241 ,SIERRA_DET_STANDEC_E_PREG }, - {0x0010 ,SIERRA_PSM_LANECAL_DLY_A1_RESETS_PREG }, + {0x0110 ,SIERRA_PSM_LANECAL_DLY_A1_RESETS_PREG }, {0x0014 ,SIERRA_PSM_A0IN_TMR_PREG }, {0xCF00 ,SIERRA_PSM_DIAG_PREG }, {0x001F ,SIERRA_PSC_TX_A0_PREG },
@@ -696,7 +696,7 @@ static struct cdns_reg_pairs cdns_usb_ln_regs_ext_ssc[] = { {0x0003, SIERRA_PSC_TX_A2_PREG}, {0x0003, SIERRA_PSC_TX_A3_PREG}, {0x0FFF, SIERRA_PSC_RX_A0_PREG}, - {0x0619, SIERRA_PSC_RX_A1_PREG}, + {0x0003, SIERRA_PSC_RX_A1_PREG}, {0x0003, SIERRA_PSC_RX_A2_PREG}, {0x0001, SIERRA_PSC_RX_A3_PREG}, {0x0001, SIERRA_PLLCTRL_SUBRATE_PREG},
@@ -705,19 +705,19 @@ static struct cdns_reg_pairs cdns_usb_ln_regs_ext_ssc[] = { {0x00CA, SIERRA_CLKPATH_BIASTRIM_PREG}, {0x2512, SIERRA_DFE_BIASTRIM_PREG}, {0x0000, SIERRA_DRVCTRL_ATTEN_PREG}, - {0x873E, SIERRA_CLKPATHCTRL_TMR_PREG}, - {0x03CF, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, - {0x01CE, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, + {0x823E, SIERRA_CLKPATHCTRL_TMR_PREG}, + {0x078F, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, + {0x078F, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, {0x7B3C, SIERRA_CREQ_CCLKDET_MODE01_PREG}, - {0x033F, SIERRA_RX_CTLE_MAINTENANCE_PREG}, + {0x023C, SIERRA_RX_CTLE_MAINTENANCE_PREG}, {0x3232, SIERRA_CREQ_FSMCLK_SEL_PREG}, {0x0000, SIERRA_CREQ_EQ_CTRL_PREG}, - {0x8000, SIERRA_CREQ_SPARE_PREG}, + {0x0000, SIERRA_CREQ_SPARE_PREG}, {0xCC44, SIERRA_CREQ_EQ_OPEN_EYE_THRESH_PREG}, - {0x8453, SIERRA_CTLELUT_CTRL_PREG}, - {0x4110, SIERRA_DFE_ECMP_RATESEL_PREG}, - {0x4110, SIERRA_DFE_SMP_RATESEL_PREG}, - {0x0002, SIERRA_DEQ_PHALIGN_CTRL}, + {0x8452, SIERRA_CTLELUT_CTRL_PREG}, + {0x4121, SIERRA_DFE_ECMP_RATESEL_PREG}, + {0x4121, SIERRA_DFE_SMP_RATESEL_PREG}, + {0x0003, SIERRA_DEQ_PHALIGN_CTRL}, {0x3200, SIERRA_DEQ_CONCUR_CTRL1_PREG}, {0x5064, SIERRA_DEQ_CONCUR_CTRL2_PREG}, {0x0030, SIERRA_DEQ_EPIPWR_CTRL2_PREG},
@@ -725,7 +725,7 @@ static struct cdns_reg_pairs cdns_usb_ln_regs_ext_ssc[] = { {0x5A5A, SIERRA_DEQ_ERRCMP_CTRL_PREG}, {0x02F5, SIERRA_DEQ_OFFSET_CTRL_PREG}, {0x02F5, SIERRA_DEQ_GAIN_CTRL_PREG}, - {0x9A8A, SIERRA_DEQ_VGATUNE_CTRL_PREG}, + {0x9999, SIERRA_DEQ_VGATUNE_CTRL_PREG}, {0x0014, SIERRA_DEQ_GLUT0}, {0x0014, SIERRA_DEQ_GLUT1}, {0x0014, SIERRA_DEQ_GLUT2},
@@ -772,6 +772,7 @@ static struct cdns_reg_pairs cdns_usb_ln_regs_ext_ssc[] = { {0x000F, SIERRA_LFPSFILT_NS_PREG}, {0x0009, SIERRA_LFPSFILT_RD_PREG}, {0x0001, SIERRA_LFPSFILT_MP_PREG}, + {0x6013, SIERRA_SIGDET_SUPPORT_PREG}, {0x8013, SIERRA_SDFILT_H2L_A_PREG}, {0x8009, SIERRA_SDFILT_L2H_PREG}, {0x0024, SIERRA_RXBUFFER_CTLECTRL_PREG},
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 85/388 ASoC: qcom: q6asm-dai: kCFI fix
In reply to Sasha LevinFrom: John Stultz <[email protected]>
[ Upstream commit a6b675a89e51a1cdad0481b809b7840d3f86e4b5 ]
Fixes the following kCFI crash seen on db845c, caused by the function prototypes not matching the callback function prototype.
[ 82.585661] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000001 [ 82.595387] Mem abort info: [ 82.599463] ESR = 0x96000005 [ 82.602658] EC = 0x25: DABT (current EL), IL = 32 bits [ 82.608177] SET = 0, FnV = 0 [ 82.611829] EA = 0, S1PTW = 0 [ 82.615369] Data abort info: [ 82.618751] ISV = 0, ISS = 0x00000005 [ 82.622641] CM = 0, WnR = 0 [ 82.625774] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000174259000 [ 82.632292] [0000000000000001] pgd=0000000000000000, pud=0000000000000000 [ 82.639167] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 82.644795] Modules linked in: hci_uart btqca xhci_plat_hcd xhci_pci_renesas xhci_pci xhci_hcd wcn36xx wcnss_ctrl wcd934x vctrl_regulator ufs_qcom syscon_reboot_e [ 82.644927] qcom_apcs_ipc_mailbox q6asm_dai q6routing q6asm q6afe_dai q6adm q6afe q6core q6dsp_common pm8941_pwrkey pm8916_wdt platform_mhu pinctrl_spmi_mpp pine [ 82.812982] CPU: 3 PID: 240 Comm: kworker/u16:4 Tainted: G W 5.6.0-rc7-mainline-00960-g0c34353d11b9-dirty #1 [ 82.824201] Hardware name: Thundercomm Dragonboard 845c (DT) [ 82.829937] Workqueue: qcom_apr_rx apr_rxwq [apr] [ 82.834698] pstate: 80c00005 (Nzcv daif +PAN +UAO) [ 82.839553] pc : __cfi_check_fail+0x4/0x1c [q6asm_dai] [ 82.844754] lr : __cfi_check+0x3a8/0x3b0 [q6asm_dai] [ 82.849767] sp : ffffffc0105f3c20 [ 82.853123] x29: ffffffc0105f3c30 x28: 0000000000000020 [ 82.858489] x27: ffffff80f4588400 x26: ffffff80f458ec94 [ 82.863854] x25: ffffff80f458ece8 x24: ffffffe3670c7000 [ 82.869220] x23: ffffff8094bb7b34 x22: ffffffe367137000 [ 82.874585] x21: bd07909b332eada6 x20: 0000000000000001 [ 82.879950] x19: ffffffe36713863c x18: ffffff80f8df4430 [ 82.885316] x17: 0000000000000001 x16: ffffffe39d15e660 [ 82.890681] x15: 0000000000000001 x14: 0000000000000027 [ 82.896047] x13: 0000000000000000 x12: ffffffe39e6465a0 [ 82.901413] x11: 0000000000000051 x10: 000000000000ffff [ 82.906779] x9 : 000ffffffe366c19 x8 : c3c5f18762d1ceef [ 82.912145] x7 : 0000000000000000 x6 : ffffffc010877698 [ 82.917511] x5 : ffffffc0105f3c00 x4 : 0000000000000000 [ 82.922877] x3 : 0000000000000000 x2 : 0000000000000001 [ 82.928243] x1 : ffffffe36713863c x0 : 0000000000000001 [ 82.933610] Call trace: [ 82.936099] __cfi_check_fail+0x4/0x1c [q6asm_dai] [ 82.940955] q6asm_srvc_callback+0x22c/0x618 [q6asm] [ 82.945973] apr_rxwq+0x1a8/0x27c [apr] [ 82.949861] process_one_work+0x2e8/0x54c [ 82.953919] worker_thread+0x27c/0x4d4 [ 82.957715] kthread+0x144/0x154 [ 82.960985] ret_from_fork+0x10/0x18 [ 82.964603] Code: a8c37bfd f85f8e5e d65f03c0 b40000a0 (39400008) [ 82.970762] ---[ end trace 410accb839617143 ]--- [ 82.975429] Kernel panic - not syncing: Fatal exception
--- sound/soc/qcom/qdsp6/q6asm-dai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/qcom/qdsp6/q6asm-dai.c +2 -2
@@ -176,7 +176,7 @@ static const struct snd_compr_codec_caps q6asm_compr_caps = { };static void event_handler (uint32_t opcode,uint32_t token, -uint32_t *payload,void *priv) +void *payload,void *priv) {struct q6asm_dai_rtd *prtd = priv;struct snd_pcm_substream *substream = prtd->substream;
@@ -490,7 +490,7 @@ static int q6asm_dai_hw_params(struct snd_soc_component *component, }static void compress_event_handler (uint32_t opcode,uint32_t token, -uint32_t *payload,void *priv) +void *payload,void *priv) {struct q6asm_dai_rtd *prtd = priv;struct snd_compr_stream *substream = prtd->cstream;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 294/388 ASoC: dapm: Move dai_link widgets to runtime to fix use after free
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit f4aa5e214eeaf7f1c7f157526a5aa29784cb6a1f ]
The newly added CODEC to CODEC DAI link widget pointers in snd_soc_dai_link are better placed in snd_soc_pcm_runtime. snd_soc_dai_link is really intended for static configuration of the DAI, and the runtime for dynamic data. The snd_soc_dai_link structures are not destroyed if the card is unbound. The widgets are cleared up on unbind, however if the card is rebound as the snd_soc_dai_link structures are reused these pointers will be left at their old values, causing access to freed memory.
--- include/sound/soc.h | 6 +++--- sound/soc/soc-dapm.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-)
include/sound/soc.h +3 -3
@@ -790,9 +790,6 @@ struct snd_soc_dai_link {const struct snd_soc_pcm_stream *params;unsigned int num_params; -struct snd_soc_dapm_widget *playback_widget; -struct snd_soc_dapm_widget *capture_widget; -unsigned int dai_fmt;/* format to set on init */ enum snd_soc_dpcm_trigger trigger[2 ];/* trigger type for DPCM */
@@ -1156,6 +1153,9 @@ struct snd_soc_pcm_runtime {struct snd_soc_dai **cpu_dais;unsigned int num_cpus; +struct snd_soc_dapm_widget *playback_widget; +struct snd_soc_dapm_widget *capture_widget; +struct delayed_work delayed_work;void (*close_delayed_work_func)(struct snd_soc_pcm_runtime *rtd);#ifdef CONFIG_DEBUG_FS
sound/soc/soc-dapm.c +6 -6
@@ -4340,16 +4340,16 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card, codec = codec_dai->playback_widget;if (playback_cpu && codec) { -if (dai_link->params && !dai_link->playback_widget) { +if (dai_link->params && !rtd->playback_widget) { substream = streams[SNDRV_PCM_STREAM_PLAYBACK ].substream; dai =snd_soc_dapm_new_dai (card, substream,"playback" );if (IS_ERR (dai)) goto capture; - dai_link->playback_widget = dai; + rtd->playback_widget = dai; }dapm_connect_dai_routes (&card->dapm, cpu_dai, playback_cpu, - dai_link->playback_widget, + rtd->playback_widget, codec_dai, codec); }
@@ -4358,16 +4358,16 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card, codec = codec_dai->capture_widget;if (codec && capture_cpu) { -if (dai_link->params && !dai_link->capture_widget) { +if (dai_link->params && !rtd->capture_widget) { substream = streams[SNDRV_PCM_STREAM_CAPTURE ].substream; dai =snd_soc_dapm_new_dai (card, substream,"capture" );if (IS_ERR (dai))return ; - dai_link->capture_widget = dai; + rtd->capture_widget = dai; }dapm_connect_dai_routes (&card->dapm, codec_dai, codec, - dai_link->capture_widget, + rtd->capture_widget, cpu_dai, capture_cpu); } }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 296/388 NFSv4.1 fix rpc_call_done assignment for BIND_CONN_TO_SESSION
In reply to Sasha LevinFrom: Olga Kornievskaia <[email protected]>
[ Upstream commit 1c709b766e73e54d64b1dde1b7cfbcf25bcb15b9 ]
--- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4proc.c +1 -1
@@ -7909,7 +7909,7 @@ nfs4_bind_one_conn_to_session_done(struct rpc_task *task, void *calldata) }static const struct rpc_call_ops nfs4_bind_one_conn_to_session_ops = { - .rpc_call_done = &nfs4_bind_one_conn_to_session_done, + .rpc_call_done = nfs4_bind_one_conn_to_session_done, };/*
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 298/388 PCI: Avoid FLR for AMD Starship USB 3.0
In reply to Sasha LevinFrom: Kevin Buettner <[email protected]>
[ Upstream commit 5727043c73fdfe04597971b5f3f4850d879c1f4f ]
The AMD Starship USB 3.0 host controller advertises Function Level Reset support, but it apparently doesn't work. Add a quirk to prevent use of FLR on this device.
Without this quirk, when attempting to assign (pass through) an AMD Starship USB 3.0 host controller to a guest OS, the system becomes increasingly unresponsive over the course of several minutes, eventually requiring a hard reset. Shortly after attempting to start the guest, I see these messages:
vfio-pci 0000:05:00.3: not ready 1023ms after FLR; waiting vfio-pci 0000:05:00.3: not ready 2047ms after FLR; waiting vfio-pci 0000:05:00.3: not ready 4095ms after FLR; waiting vfio-pci 0000:05:00.3: not ready 8191ms after FLR; waiting
And then eventually:
vfio-pci 0000:05:00.3: not ready 65535ms after FLR; giving up
INFO: NMI handler (perf_event_nmi_handler) took too long to run: 0.000 msecs
perf: interrupt took too long (642744 > 2500), lowering kernel.perf_event_max_sample_rate to 1000
INFO: NMI handler (perf_event_nmi_handler) took too long to run: 82.270 msecs
INFO: NMI handler (perf_event_nmi_handler) took too long to run: 680.608 msecs
INFO: NMI handler (perf_event_nmi_handler) took too long to run: 100.952 msecs
...
watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [qemu-system-x86:7487]
Tested on a Micro-Star International Co., Ltd. MS-7C59/Creator TRX40 motherboard with an AMD Ryzen Threadripper 3970X.
--- drivers/pci/quirks.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/quirks.c +2 -0
@@ -5133,6 +5133,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x443, quirk_intel_qat_vf_cap);* FLR may cause the following to devices to hang: * * AMD Starship/Matisse HD Audio Controller 0x1487 +* AMD Starship USB 3.0 Host Controller 0x148c * AMD Matisse USB 3.0 Host Controller 0x149c * Intel 82579LM Gigabit Ethernet Controller 0x1502 * Intel 82579V Gigabit Ethernet Controller 0x1503
@@ -5143,6 +5144,7 @@ static void quirk_no_flr(struct pci_dev *dev) dev->dev_flags |=PCI_DEV_FLAGS_NO_FLR_RESET ; }DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x1487 , quirk_no_flr); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x148c , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_AMD ,0x149c , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x1502 , quirk_no_flr);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x1503 , quirk_no_flr);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 75/388 clk: zynqmp: fix memory leak in zynqmp_register_clocks
In reply to Sasha LevinFrom: Quanyang Wang <[email protected]>
[ Upstream commit 58b0fb86260063f86afecaebf4056c876fff2a19 ]
This is detected by kmemleak running on zcu102 board:
unreferenced object 0xffffffc877e48180 (size 128):
comm "swapper/0", pid 1, jiffies 4294892909 (age 315.436s) hex dump (first 32 bytes):
64 70 5f 76 69 64 65 6f 5f 72 65 66 5f 64 69 76 dp_video_ref_div 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1............... backtrace:
[<00000000c9be883b>] __kmalloc_track_caller+0x200/0x380 [<00000000f02c3809>] kvasprintf+0x7c/0x100 [<00000000e51dde4d>] kasprintf+0x60/0x80 [<0000000092298b05>] zynqmp_register_clocks+0x29c/0x398 [<00000000faaff182>] zynqmp_clock_probe+0x3cc/0x4c0 [<000000005f5986f0>] platform_drv_probe+0x58/0xa8 [<00000000d5810136>] really_probe+0xd8/0x2a8 [<00000000f5b671be>] driver_probe_device+0x5c/0x100 [<0000000038f91fcf>] __device_attach_driver+0x98/0xb8 [<000000008a3f2ac2>] bus_for_each_drv+0x74/0xd8 [<000000001cb2783d>] __device_attach+0xe0/0x140 [<00000000c268031b>] device_initial_probe+0x24/0x30 [<000000006998de4b>] bus_probe_device+0x9c/0xa8 [<00000000647ae6ff>] device_add+0x3c0/0x610 [<0000000071c14bb8>] of_device_add+0x40/0x50 [<000000004bb5d132>] of_platform_device_create_pdata+0xbc/0x138
This is because that when num_nodes is larger than 1, clk_out is allocated using kasprintf for these nodes but only the last node's clk_out is freed.
--- drivers/clk/zynqmp/clkc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/clk/zynqmp/clkc.c +9 -6
@@ -558,7 +558,7 @@ static struct clk_hw *zynqmp_register_clk_topology(int clk_id, char *clk_name, {int j;u32 num_nodes, clk_dev_id; -char *clk_out =NULL ; +char *clk_out[MAX_NODES ];struct clock_topology *nodes;struct clk_hw *hw =NULL ;
@@ -572,16 +572,16 @@ static struct clk_hw *zynqmp_register_clk_topology(int clk_id, char *clk_name,* Intermediate clock names are postfixed with type of clock. */ if (j != (num_nodes -1 )) { - clk_out =kasprintf (GFP_KERNEL ,"%s%s" , clk_name, + clk_out[j] =kasprintf (GFP_KERNEL ,"%s%s" , clk_name, clk_type_postfix[nodes[j].type]); }else { - clk_out =kasprintf (GFP_KERNEL ,"%s" , clk_name); + clk_out[j] =kasprintf (GFP_KERNEL ,"%s" , clk_name); }if (!clk_topology[nodes[j].type])continue ; - hw = (*clk_topology[nodes[j].type])(clk_out, clk_dev_id, + hw = (*clk_topology[nodes[j].type])(clk_out[j], clk_dev_id, parent_names, num_parents, &nodes[j]);
@@ -590,9 +590,12 @@ static struct clk_hw *zynqmp_register_clk_topology(int clk_id, char *clk_name, __func__, clk_dev_id, clk_name, PTR_ERR(hw)); - parent_names[0 ] = clk_out; + parent_names[0 ] = clk_out[j]; } -kfree (clk_out); + +for (j =0 ; j < num_nodes; j++) +kfree (clk_out[j]); +return hw; }
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 304/388 extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit bc84cff2c92ae5ccb2c37da73756e7174b1b430f ]
In some error handling paths, a call to 'iio_channel_get()' is not balanced by a corresponding call to 'iio_channel_release()'.
This can be achieved easily by using the devm_ variant of 'iio_channel_get()'.
This has the extra benefit to simplify the remove function.
--- drivers/extcon/extcon-adc-jack.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/extcon/extcon-adc-jack.c +1 -2
@@ -124,7 +124,7 @@ static int adc_jack_probe(struct platform_device *pdev)for (i =0 ; data->adc_conditions[i].id !=EXTCON_NONE ; i++); data->num_conditions = i; - data->chan =iio_channel_get (&pdev->dev, pdata->consumer_channel); + data->chan =devm_iio_channel_get (&pdev->dev, pdata->consumer_channel);if (IS_ERR (data->chan))return PTR_ERR (data->chan);
@@ -164,7 +164,6 @@ static int adc_jack_remove(struct platform_device *pdev)free_irq (data->irq, data);cancel_work_sync (&data->handler.work); -iio_channel_release (data->chan);return 0 ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 306/388 ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed
In reply to Sasha LevinFrom: Xiyu Yang <[email protected]>
[ Upstream commit 36124fb19f1ae68a500cd76a76d40c6e81bee346 ]
fsl_asrc_dma_hw_params() invokes dma_request_channel() or fsl_asrc_get_dma_channel(), which returns a reference of the specified dma_chan object to "pair->dma_chan[dir]" with increased refcnt.
The reference counting issue happens in one exception handling path of fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End, the function forgets to decrease the refcnt increased by dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt leak.
Fix this issue by calling dma_release_channel() when config DMA channel failed.
--- sound/soc/fsl/fsl_asrc_dma.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/fsl/fsl_asrc_dma.c +1 -0
@@ -252,6 +252,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, ret =dmaengine_slave_config (pair->dma_chan[dir], &config_be);if (ret) {dev_err (dev,"failed to config DMA channel for Back-End\n" ); +dma_release_channel (pair->dma_chan[dir]);return ret; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 309/388 rtc: rv3028: Add missed check for devm_regmap_init_i2c()
In reply to Sasha LevinFrom: Chuhong Yuan <[email protected]>
[ Upstream commit c3b29bf6f166f6ed5f04f9c125477358e0e25df8 ]
rv3028_probe() misses a check for devm_regmap_init_i2c(). Add the missed check to fix it.
--- drivers/rtc/rtc-rv3028.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/rtc/rtc-rv3028.c +2 -0
@@ -755,6 +755,8 @@ static int rv3028_probe(struct i2c_client *client)return -ENOMEM ; rv3028->regmap =devm_regmap_init_i2c (client, ®map_config); +if (IS_ERR (rv3028->regmap)) +return PTR_ERR (rv3028->regmap);i2c_set_clientdata (client, rv3028);
Signature · 1 line
2.25.1