[PATCH] regulator: show state for GPIO-controlled regulators

2013-02-01 Thread Michał Mirosław
Signed-off-by: Michał Mirosław --- patch against https://github.com/torvalds/linux.git master drivers/regulator/core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 2785843..6b3550a 100644 --- a/drivers

Re: [PATCH 04/27] mmc: cb710: Move away from using deprecated APIs

2013-09-27 Thread Michał Mirosław
> use of the deprecated APIs. > > Cc: Michał Mirosław > Signed-off-by: Ulf Hansson Patch looks consistent with commit message. I can't test it on HW, though. Acked-by: Michał Mirosław -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of

Re: [PATCH] mmc: cb710: drop free_irq for devm_request_irq allocated irq

2013-09-30 Thread Michał Mirosław
On Tue, Sep 24, 2013 at 10:40:57AM +0800, Wei Yongjun wrote: > From: Wei Yongjun > > irq allocated with devm_request_irq should not be freed using > free_irq, because doing so causes a dangling pointer, and a > subsequent double free. > > Signed-off-by: Wei Yongjun Acke

Re: [GIT] Networking

2013-05-02 Thread Michał Mirosław
> application bug. This is certainly a bug in NM, and a fresh one: commit b636ea86b1c0a28b77eda311c84d3b2417cad22e from 2013-04-10 14:40:58 (GMT). Userspace is expected to use ETHTOOL_GSTRINGS for ETH_SS_FEATURES and find a corresponding bit position by feature name ("vlan-challenged&qu

Re: [GIT] Networking

2013-05-02 Thread Michał Mirosław
thing cares about the .../eth0/flags value because with the bit > ordering different for bits 10 and above things break. Are you sure it's "flags"? /sys/class/net/*/features were removed some time ago, and flags don't depend on NETIF_F_*. Best Regards, Michał Mirosław -- To

Re: [PATCH 1/1] eventfd: implementation of EFD_MASK flag

2013-02-14 Thread Michał Mirosław
sk.ptr = NULL; > + } else { > + ctx->count = count; > + } > ctx->flags = flags; > > file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, Since EFD_MASK is a persistent flag for a fd's lifetime, maybe

[PATCH 2.6.20 06/10] nfnetlink_log: micro-optimization: don't modify destroyed instance

2007-02-12 Thread Michał Mirosław
Simple micro-optimization: Don't change any options if the instance is being destroyed. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.42007-02-11 20:46:26.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-

[PATCH 2.6.20 10/10] nfnetlink_log: enable packet timestamps

2007-02-12 Thread Michał Mirosław
It's nice to log packet arrival time of those little filthy packets. ;) Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.82007-02-11 23:59:01.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02-12 00:19:1

[PATCH 2.6.20 02/10] nfnetlink_log: stop reference leak

2007-02-12 Thread Michał Mirosław
Stop reference leaking in nfulnl_log_packet(). If we start a timer we are already taking another reference. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.02007-02-11 20:20:27.0 +0100 +++ linux-2.6.20/net/net

[PATCH 2.6.20 05/10] nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config()

2007-02-12 Thread Michał Mirosław
Simple micro-optimization: don't call instance_put() on known NULL pointers. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.32007-02-11 20:46:33.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-

[PATCH 2.6.20 00/10] nfnetlink_log: patch series introduction

2007-02-12 Thread Michał Mirosław
Dear list, After meeting a faint-hearted Linux kernel lately I decided to try myself at persuading it to not be afraid of NFLOG. This chat gave a series of ten commandments I present today. Take a look and agree or comment. Here's the list: 1. nfulnl_log_packet() - don't count the same thing t

[PATCH 2.6.20 04/10] nfnetlink_log: fix possible use-after-free

2007-02-12 Thread Michał Mirosław
Paranoia: instance_put() might have freed the inst pointer when we spin_unlock_bh(). Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.22007-02-11 20:43:24.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02-11

[PATCH 2.6.20 09/10] nfnetlink_log: fix NULL pointer dereference

2007-02-12 Thread Michał Mirosław
4/0x51 [nfnetlink_log] SS:ESP 0068:c03f5f30 <0>Kernel panic - not syncing: Fatal exception in interrupt <0>Rebooting in 5 seconds.. Panic no more! Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.72007-02-11 22:41:18.

[PATCH 2.6.20 01/10] nfnetlink_log: don't count max(a,b) twice

2007-02-12 Thread Michał Mirosław
We don't need local nlbufsiz (skb size) as nfulnl_alloc_skb() takes the maximum anyway. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.orig 2007-02-10 18:25:14.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-

[PATCH 2.6.20 03/10] nfnetlink_log: kill duplicate code

2007-02-12 Thread Michał Mirosław
Kill some duplicate code in nfulnl_log_packet(). Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.12007-02-11 20:51:57.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02-11 20:43:24.0 +0100 @@ -666,30 +

[PATCH 2.6.20 08/10] nfnetlink_log: shorten instances_lock holding time

2007-02-12 Thread Michał Mirosław
Shorten instances_lock window at the cost of doing unnecessary work on the failure case. I don't know if it makes sense actually. ;> Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.62007-02-11 22:31:19.0 +0100 ++

[PATCH 2.6.20 07/10] nfnetlink_log: fix module reference counting

2007-02-12 Thread Michał Mirosław
Count module references correctly: after instance_destroy() there might be timer pending and holding a reference for this netlink instance. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.52007-02-11 22:24:56.0 +0100 +++

Re: [PATCH 2.6.20 +0/14] nfnetlink_log: patch series season 2

2007-02-12 Thread Michał Mirosław
Dear list, As it turned out, not all worms eating nfnetlink_log have been exterminated by my last patch series. I'll append next four patches to the end of the series and I hope that it doesn't make your patching scripts unhappy. Those patches fix two bugs and make two other code beautifications:

[PATCH 2.6.20 11/14] nfnetlink_log: iterator functions need iter_state * only

2007-02-12 Thread Michał Mirosław
get_*() don't need access to seq_file - iter_state is enough for them. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.92007-02-12 00:19:16.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02-12 17:05:1

[PATCH 2.6.20 12/14] nfnetlink_log: possible NULL pointer dereference in nfulnl_recv_config()

2007-02-12 Thread Michał Mirosław
Eliminate possible NULL pointer dereference in nfulnl_recv_config(). Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.10 2007-02-12 17:05:14.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02-12 17:35:50.000

[PATCH 2.6.20 13/14] nfnetlink_log: fix reference counting

2007-02-12 Thread Michał Mirosław
Fix reference counting (memory leak) problem in __nfulnl_send() and callers related to packet queueing. Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.11 2007-02-12 17:35:50.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink

[PATCH 2.6.20 14/14] nfnetlink_log: micro-optimization: inst->skb != NULL in __nfulnl_send()

2007-02-12 Thread Michał Mirosław
No other function calls __nfulnl_send() with inst->skb == NULL than nfulnl_timer(). Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.12 2007-02-12 17:58:01.0 +0100 +++ linux-2.6.20/net/netfilter/nfnetlink_log.c 2007-02

Re: [PATCH 2.6.20 13/14] nfnetlink_log: fix reference counting

2007-02-14 Thread Michał Mirosław
On Tue, Feb 13, 2007 at 01:58:34PM +0100, Patrick McHardy wrote: > Micha³ Miros³aw wrote: > > Fix reference counting (memory leak) problem in __nfulnl_send() and callers > > related to packet queueing. > > > > Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]&

Re: [PATCH 2.6.20 14/14] nfnetlink_log: micro-optimization: inst->skb != NULL in __nfulnl_send()

2007-02-14 Thread Michał Mirosław
Patch updated to apply after a new version of 13/14: No other function calls __nfulnl_send() with inst->skb == NULL than nfulnl_timer(). Signed-off-by: Michał Mirosław <[EMAIL PROTECTED]> --- linux-2.6.20/net/netfilter/nfnetlink_log.c.12 2007-02-14 12:27:09.0 +0100

Re: [PATCH 11/26] cb710: Convert to new IDA API

2018-06-21 Thread Michał Mirosław
On Thu, Jun 21, 2018 at 02:28:20PM -0700, Matthew Wilcox wrote: > Eliminates the custom spinlock and the call to ida_pre_get. > > Signed-off-by: Matthew Wilcox Acked-by: Michał Mirosław

Re: [PATCH RFC 4/6] btrfs: Check if the filesystem is has mixed type of devices

2021-02-12 Thread Michał Mirosław
On Fri, Feb 12, 2021 at 06:26:41PM +, Michal Rostecki wrote: > On Wed, Feb 10, 2021 at 05:08:05AM +0100, Michał Mirosław wrote: > > On Tue, Feb 09, 2021 at 09:30:38PM +0100, Michal Rostecki wrote: > > > From: Michal Rostecki > > > > > > Add the btrfs_ch

Re: [PATCH] mmc: cb710: Use new tasklet API

2021-02-09 Thread Michał Mirosław
On Mon, Feb 08, 2021 at 02:45:51PM +0100, Emil Renner Berthing wrote: > This converts the driver to use the new tasklet API introduced in > commit 12cc923f1ccc ("tasklet: Introduce new initialization API") > > Signed-off-by: Emil Renner Berthing Acked-by: Michał Mirosław

Re: [PATCH RFC 4/6] btrfs: Check if the filesystem is has mixed type of devices

2021-02-09 Thread Michał Mirosław
rue; > + if (!fs_devices->mixed) > + fs_devices->mixed = btrfs_check_mixed(fs_devices, rotating); Duplication. Maybe pull all this into a function? Best Regards, Michał Mirosław

Re: [PATCH RFC 6/6] btrfs: Add roundrobin raid1 read policy

2021-02-09 Thread Michał Mirosław
a single mirror will be selected for next reads (until a read on some other one completes). Have you tried testing with much more jobs / non-sequential accesses? Best Reagrds, Michał Mirosław

Re: [PATCH RFC 6/6] btrfs: Add roundrobin raid1 read policy

2021-02-10 Thread Michał Mirosław
On Wed, Feb 10, 2021 at 12:29:25PM +, Michal Rostecki wrote: > On Wed, Feb 10, 2021 at 05:24:28AM +0100, Michał Mirosław wrote: > > On Tue, Feb 09, 2021 at 09:30:40PM +0100, Michal Rostecki wrote: > > [...] > > > For the array with 3 HDDs, not adding any pena

Re: [PATCH RFC] input/elants_i2c: Detect enum overflow

2021-02-10 Thread Michał Mirosław
h to next function elants_i2c_resume() > > Reported-by: Randy Dunlap > Acked-by: Randy Dunlap > Signed-off-by: Josh Poimboeuf Reviewed-by: Michał Mirosław > --- > drivers/input/touchscreen/elants_i2c.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --

Re: [PATCH RFC 6/6] btrfs: Add roundrobin raid1 read policy

2021-02-10 Thread Michał Mirosław
On Wed, Feb 10, 2021 at 07:23:04PM +, Michal Rostecki wrote: > On Wed, Feb 10, 2021 at 01:58:15PM +0100, Michał Mirosław wrote: > > On Wed, Feb 10, 2021 at 12:29:25PM +, Michal Rostecki wrote: > > > On Wed, Feb 10, 2021 at 05:24:28AM +0100, Michał Mirosław wrote: > >

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Michał Mirosław
gt; __u32 pad; > }; > > where: > > .size = sizeof(struct ptrace_rseq_configuration), > > This way, the configuration structure can be expanded in the future. The > rseq ABI structure is by definition fixed-size, so there is no point in > having its size here. > > Florian, did I understand your request correctly, or am I missing your point ? In this case returning sizeof(conf) would serve the same purpose, wouldn't it? Best Regards Michał Mirosław [Resent because of HTML mail misfeature...]

Re: [PATCH] usb: gadget: f_acm: don't disable disabled EP

2020-05-30 Thread Michał Mirosław
rates spurious trace events if you enable them. > You mean the trace events from core.c? If it is, we could try to improve it > and indicate it is already enabled or disabled. It is indicated in return code, but the problem is that this generates noise and wastes debugging time. The problem I was seeing manifested itself as disabling disabled EPs and desync of EP state between core and UDC driver. The patch avoids the noise and makes the code obvious. (This check was there at some point in time, BTW.) Best Regards, Michał Mirosław

[PATCH] misc: atmel-ssc: lock with mutex instead of spinlock

2020-05-31 Thread Michał Mirosław
Uninterruptible context is not needed in the driver and causes lockdep warning because of mutex taken in of_alias_get_id(). Convert the lock to mutex to avoid the issue. Cc: sta...@vger.kernel.org Signed-off-by: Michał Mirosław --- drivers/misc/atmel-ssc.c | 24 1 file

Re: [PATCH] misc: atmel-ssc: lock with mutex instead of spinlock

2020-06-01 Thread Michał Mirosław
> Would you like to add the tag “Fixes” to the commit message? I guess we can add: Fixes: 099343c64e16 ("ARM: at91: atmel-ssc: add device tree support") Best Regards Michał Mirosław

Re: regulator: deadlock vs memory reclaim

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 11:15:28PM +0300, Dmitry Osipenko wrote: > 10.08.2020 23:09, Michał Mirosław пишет: > > At first I also thought so, but there's more. Below is a lockdep > > complaint with your patch applied. I did a similar patch and then two more > > (follow

Re: regulator: deadlock vs memory reclaim

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 11:56:13PM +0300, Dmitry Osipenko wrote: > 10.08.2020 23:21, Dmitry Osipenko пишет: > > 10.08.2020 23:18, Michał Mirosław пишет: > >> On Mon, Aug 10, 2020 at 11:15:28PM +0300, Dmitry Osipenko wrote: > >>> 10.08.2020 23:09, Michał Mirosław

[PATCH 7/7] regulator: remove superfluous lock in regulator_resolve_coupling()

2020-08-10 Thread Michał Mirosław
The code modifies rdev, but locks c_rdev instead. The bug remains: stored c_rdev could be freed just after unlock anyway. This doesn't blow up because regulator_list_mutex taken outside holds it together. Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 4 1 file chang

[PATCH 5/7] regulator: plug of_node leak in regulator_register()'s error path

2020-08-10 Thread Michał Mirosław
ister()") Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 0408c4e1d9a8..a9ff2ad55ee7 100644 --- a/drivers/regulator/core.c +++ b/drivers

[PATCH 4/7] regulator: push allocation in set_consumer_device_supply() out of lock

2020-08-10 Thread Michał Mirosław
Pull regulator_list_mutex into set_consumer_device_supply() and keep allocations outside of it. Fourth of the fs_reclaim deadlock case. Cc: sta...@vger.kernel.org Fixes: 45389c47526d ("regulator: core: Add early supply resolution for regulators") Signed-off-by: Michał Mirosław --

[PATCH 2/7] regulator: push allocation in regulator_ena_gpio_request() out of lock

2020-08-10 Thread Michał Mirosław
s context] Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") [this is when the regulator_list_mutex was introduced in reclaim locking path] Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 19 ++- 1 file changed, 14 insertions(+),

[PATCH 0/7] regulator: fix deadlock vs memory reclaim

2020-08-10 Thread Michał Mirosław
please review and test further. First four patches move allocations out of locked regions, next three came as a drive-by cleanups. Michał Mirosław (7): regulator: push allocation in regulator_init_coupling() outside of lock regulator: push allocation in regulator_ena_gpio_request() out of

[PATCH 6/7] regulator: cleanup regulator_ena_gpio_free()

2020-08-10 Thread Michał Mirosław
Since only regulator_ena_gpio_request() allocates rdev->ena_pin, and it guarantees that same gpiod gets same pin structure, it is enough to compare just the pointers. Also we know there can be only one matching entry on the list. Rework the code take advantage of the facts. Signed-off-by: Mic

[PATCH 3/7] regulator: push allocations in create_regulator() outside of lock

2020-08-10 Thread Michał Mirosław
ster+0x9c8/0x163c [...] other info that might help us debug this: Chain exists of: regulator_list_mutex --> &sit_i->sentry_lock --> &dcc->cmd_lock [...] Cc: sta...@vger.kernel.org Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") Sign

[PATCH 1/7] regulator: push allocation in regulator_init_coupling() outside of lock

2020-08-10 Thread Michał Mirosław
, at: __fs_reclaim_acquire+0x0/0x50 [...] Cc: sta...@vger.kernel.org Fixes: d8ca7d184b33 ("regulator: core: Introduce API for regulators coupling customization") Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

Re: [PATCH 1/7] regulator: push allocation in regulator_init_coupling() outside of lock

2020-08-11 Thread Michał Mirosław
On Tue, Aug 11, 2020 at 07:27:43PM +0300, Dmitry Osipenko wrote: > 11.08.2020 18:59, Dmitry Osipenko пишет: > > 11.08.2020 04:07, Michał Mirosław пишет: > >> Allocating memory with regulator_list_mutex held makes lockdep unhappy > >> when memory pressure makes the syste

Re: [PATCH 4/7] regulator: push allocation in set_consumer_device_supply() out of lock

2020-08-11 Thread Michał Mirosław
On Tue, Aug 11, 2020 at 01:23:47PM +0800, kernel test robot wrote: [...] > New smatch warnings: > drivers/regulator/core.c:1491 set_consumer_device_supply() warn: overwrite > may leak 'node' Ah! Good catch!

[PATCH v2 7/7] regulator: remove superfluous lock in regulator_resolve_coupling()

2020-08-11 Thread Michał Mirosław
The code modifies rdev, but locks c_rdev instead. Remove the lock as this is held together by regulator_list_mutex taken in the caller. Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Fixes: f9503385b187 ("regulator: core: Mutually resolve regulators coupling") ---

[PATCH v2 1/7] regulator: push allocation in regulator_init_coupling() outside of lock

2020-08-11 Thread Michał Mirosław
, at: __fs_reclaim_acquire+0x0/0x50 [...] Cc: sta...@vger.kernel.org Fixes: d8ca7d184b33 ("regulator: core: Introduce API for regulators coupling customization") Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko --- drivers/regulator/core.c | 5 +++-- 1 file changed, 3 ins

[PATCH v2 5/7] regulator: plug of_node leak in regulator_register()'s error path

2020-08-11 Thread Michał Mirosław
ister()") Signed-off-by: Michał Mirosław Acked-by: Vladimir Zapolskiy --- drivers/regulator/core.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 71749f48caee..448a267641df 100644 --- a/drivers/regula

[PATCH v2 4/7] regulator: push allocation in set_consumer_device_supply() out of lock

2020-08-11 Thread Michał Mirosław
Pull regulator_list_mutex into set_consumer_device_supply() and keep allocations outside of it. Fourth of the fs_reclaim deadlock case. Cc: sta...@vger.kernel.org Fixes: 45389c47526d ("regulator: core: Add early supply resolution for regulators") Signed-off-by: Michał Mirosław --- v

[PATCH v2 0/7] regulator: fix deadlock vs memory reclaim

2020-08-11 Thread Michał Mirosław
please review and test further. First four patches move allocations out of locked regions, next three came as a drive-by cleanups. --- v2: fix bug in patch #4 spotted by kernel test robot reworded commit #7 description Michał Mirosław (7): regulator: push allocation in

[PATCH v2 6/7] regulator: cleanup regulator_ena_gpio_free()

2020-08-11 Thread Michał Mirosław
Since only regulator_ena_gpio_request() allocates rdev->ena_pin, and it guarantees that same gpiod gets same pin structure, it is enough to compare just the pointers. Also we know there can be only one matching entry on the list. Rework the code take advantage of the facts. Signed-off-by: Mic

[PATCH v2 3/7] regulator: push allocations in create_regulator() outside of lock

2020-08-11 Thread Michał Mirosław
ster+0x9c8/0x163c [...] other info that might help us debug this: Chain exists of: regulator_list_mutex --> &sit_i->sentry_lock --> &dcc->cmd_lock [...] Cc: sta...@vger.kernel.org Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") Sign

[PATCH v2 2/7] regulator: push allocation in regulator_ena_gpio_request() out of lock

2020-08-11 Thread Michał Mirosław
s context] Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") [this is when the regulator_list_mutex was introduced in reclaim locking path] Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 19 ++- 1 file changed, 14 insertions(+),

Re: [PATCH v2 5/7] regulator: plug of_node leak in regulator_register()'s error path

2020-08-12 Thread Michał Mirosław
On Wed, Aug 12, 2020 at 09:29:12AM +0300, Vladimir Zapolskiy wrote: > On 8/12/20 4:31 AM, Michał Mirosław wrote: [...] > > config = kmemdup(cfg, sizeof(*cfg), GFP_KERNEL); > > if (config == NULL) { > > - kfree(rdev); > > ret = -ENOMEM;

[PATCH] regulator: fix pointer table overallocation

2020-08-09 Thread Michał Mirosław
The code allocates sizeof(regulator_dev) for a pointer. Make it less generous. Let kcalloc() calculate the size, while at it. Cc: sta...@vger.kernel.org Fixes: d8ca7d184b33 ("regulator: core: Introduce API for regulators coupling customization") Signed-off-by: Michał Mirosław --

[PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
Simplify regulator locking by removing locking around locking. rdev->ref is now accessed only when the lock is taken. The code still smells fishy, but now its obvious why. Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") Signed-off-by: Michał Mirosław

regulator: deadlock vs memory reclaim

2020-08-09 Thread Michał Mirosław
ver way to much (eg. initialization even before making the regulator visible to the system). To fix the regulator vs memory reclaim path I tried pushing all allocations out of protected sections. After doing a few patches, though, I'm not sure I'm going in the right direction. Your thoug

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > 10.08.2020 00:16, Michał Mirosław пишет: > > Simplify regulator locking by removing locking around locking. rdev->ref > > is now accessed only when the lock is taken. The code still smells fishy, > >

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: > 10.08.2020 01:30, Michał Mirosław пишет: > > On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > >> 10.08.2020 00:16, Michał Mirosław пишет: > >>> Simplify regulator locking by removin

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: > 10.08.2020 01:30, Michał Mirosław пишет: > > On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > >> 10.08.2020 00:16, Michał Mirosław пишет: > >>> Simplify regulator locking by removin

[PATCH 3/3] regulator: unexport regulator_lock/unlock()

2020-08-09 Thread Michał Mirosław
regulator_lock/unlock() was used only to guard regulator_notifier_call_chain(). As no users remain, make the functions internal. Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 6 ++ include/linux/regulator/driver.h | 3 --- 2 files changed, 2 insertions(+), 7

[PATCH 1/3] regulator: don't require mutex for regulator_notifier_call_chain()

2020-08-09 Thread Michał Mirosław
forced to be taken recursively. Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index b0662927487c..f4035167e7ba 100644 --- a/drivers/regulator/core.c +++ b/driver

[PATCH 2/3] regulator: remove locking around regulator_notifier_call_chain()

2020-08-09 Thread Michał Mirosław
regulator_notifier_call_chain() doesn't need rdev lock and rdev's existence is assumed in the code anyway. Remove the locks from drivers. Signed-off-by: Michał Mirosław --- drivers/regulator/da9055-regulator.c | 2 -- drivers/regulator/da9062-regulator.c | 2 -- drivers/regula

[PATCH 0/3] regulator: unexport regulator_lock/unlock()

2020-08-09 Thread Michał Mirosław
only client that needed recursive locking from the notifier chain was drivers/usb/host/ohci-da8xx.c, which responds to over-current notification by calling regulator_disable(). Michał Mirosław (3): regulator: don't require mutex for regulator_notifier_call_chain() regulator: remove lock

Re: regulator: deadlock vs memory reclaim

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 04:39:28PM +0100, Mark Brown wrote: > On Mon, Aug 10, 2020 at 12:25:37AM +0200, Michał Mirosław wrote: > > > regulator_lock_dependent() starts by taking regulator_list_mutex, The > > same mutex covers eg. regulator initialization, including memory al

Re: [PATCH] regulator: simplify locking

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 08:14:20AM +0300, Dmitry Osipenko wrote: > 10.08.2020 03:59, Michał Mirosław пишет: > > On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: > >> 10.08.2020 01:30, Michał Mirosław пишет: > >>> On Mon, Aug 10, 2020 at 12:40:04A

Re: [PATCH] regulator: fix pointer table overallocation

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 01:37:47PM +0100, Mark Brown wrote: > On Sun, Aug 09, 2020 at 10:44:25PM +0300, Dmitry Osipenko wrote: > > 09.08.2020 22:21, Michał Mirosław пишет: > > > The code allocates sizeof(regulator_dev) for a pointer. Make it less > > > generous. Let k

Re: [PATCH] regulator: fix pointer table overallocation

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 06:33:37PM +0100, Mark Brown wrote: > On Mon, Aug 10, 2020 at 06:25:56PM +0200, Michał Mirosław wrote: > > On Mon, Aug 10, 2020 at 01:37:47PM +0100, Mark Brown wrote: > > > Yeah, this is more a performance improvement than a fix. > > Should I r

Re: regulator: deadlock vs memory reclaim

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 06:31:36PM +0100, Mark Brown wrote: > On Mon, Aug 10, 2020 at 06:09:36PM +0200, Michał Mirosław wrote: > > On Mon, Aug 10, 2020 at 04:39:28PM +0100, Mark Brown wrote: > > > On Mon, Aug 10, 2020 at 12:25:37AM +0200, Michał Mirosław wrote: > > >

[RFC PATCH 3/3] regulator: push supply_name allocation outside of lock

2020-08-10 Thread Michał Mirosław
9c8/0x163c [...] other info that might help us debug this: Chain exists of: regulator_list_mutex --> &sit_i->sentry_lock --> &dcc->cmd_lock [...] Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") Signed-off-by: Michał Miro

[RFC PATCH 2/3] regulator: push enable_gpio allocation out from under regulator_list_mutex

2020-08-10 Thread Michał Mirosław
s context] Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") [this is when the regulator_list_mutex was introduced in reclaim locking path] Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 19 ++- 1 file changed, 14 insertions(+),

[RFC PATCH 1/3] regulator: allocate memory outside of regulator_list mutex

2020-08-10 Thread Michał Mirosław
, at: __fs_reclaim_acquire+0x0/0x50 [...] Fixes: d8ca7d184b33 ("regulator: core: Introduce API for regulators coupling customization") Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --

Re: [PATCH v1 1/2] net: phy: Add 100 base-x mode

2021-01-11 Thread Michał Mirosław
l 10GE MII > * @PHY_INTERFACE_MODE_10GKR: 10GBASE-KR - with Clause 73 AN > + * @PHY_INTERFACE_MODE_100BASEX: 100 BaseX > * @PHY_INTERFACE_MODE_MAX: Book keeping [...] This is kernel-internal interface, so maybe the new mode can be inserted before 1000baseX for easier lookup? Best Regards Michał Mirosław

[PATCH RESEND v8 1/4] input: elants: document some registers and values

2020-12-10 Thread Michał Mirosław
Add information found in downstream kernels, to make the code less magic. Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko --- drivers/input/touchscreen/elants_i2c.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a

[PATCH RESEND v8 4/4] input: elants: support 0x66 reply opcode for reporting touches

2020-12-10 Thread Michał Mirosław
uses for reporting touches. The calibration replies are handled separately from the the rest of the commands in the driver by entering into ELAN_WAIT_RECALIBRATION state and thus this change shouldn't change the old behavior. Signed-off-by: Dmitry Osipenko Tested-by: Michał Mirosław Sig

[PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624

2020-12-10 Thread Michał Mirosław
EKTF3624 as present in Asus TF300T tablet has touchscreen size encoded in different registers. Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko --- drivers/input/touchscreen/elants_i2c.c | 84 -- 1 file changed, 79 insertions(+), 5

[PATCH RESEND v8 2/4] input: elants: support old touch report format

2020-12-10 Thread Michał Mirosław
Support ELAN touchpad sensor with older firmware as found on eg. Asus Transformer Pads. Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko --- drivers/input/touchscreen/elants_i2c.c | 36 ++ 1 file changed, 25 insertions(+), 11

[PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens

2020-12-10 Thread Michał Mirosław
remove yet unused constants from patch 1 added a new drive-by cleanup (last patch) v7: rebased onto current dtor/input/for-next v8: rebased onto current dtor/input/for-linus v8-resend: rebased again, no changes though --- Dmitry Osipenko (1): input: elants: support 0x66 reply opcode for re

Re: [PATCH RESEND v8 2/4] input: elants: support old touch report format

2020-12-11 Thread Michał Mirosław
On Thu, Dec 10, 2020 at 11:29:40PM -0800, Dmitry Torokhov wrote: > Hi Michał, > On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote: > > @@ -998,17 +1011,18 @@ static irqreturn_t elants_i2c_irq(int irq, void > > *_dev) > > } > > >

Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624

2020-12-11 Thread Michał Mirosław
On Thu, Dec 10, 2020 at 11:22:09PM -0800, Dmitry Torokhov wrote: > Hi Michał, > > On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote: > > + > > + if (!phy_x || !phy_y) { > > + dev_warn(&client->dev, > > +

Re: [PATCH RESEND v8 2/4] input: elants: support old touch report format

2020-12-11 Thread Michał Mirosław
On Fri, Dec 11, 2020 at 07:39:33PM +0300, Dmitry Osipenko wrote: > 11.12.2020 19:09, Michał Mirosław пишет: > > On Thu, Dec 10, 2020 at 11:29:40PM -0800, Dmitry Torokhov wrote: > >> Hi Michał, > >> On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote: > >

Re: [PATCH v13 1/2] drm/tegra: dc: Support memory bandwidth management

2021-03-05 Thread Michał Mirosław
On Fri, Mar 05, 2021 at 12:45:51AM +0300, Dmitry Osipenko wrote: > 04.03.2021 02:08, Michał Mirosław пишет: > > On Tue, Mar 02, 2021 at 03:44:44PM +0300, Dmitry Osipenko wrote: > >> Display controller (DC) performs isochronous memory transfers, and thus, > >> has a requi

Re: [PATCH v13 1/2] drm/tegra: dc: Support memory bandwidth management

2021-03-03 Thread Michał Mirosław
t; + > + tegra_state->peak_memory_bandwidth = peak_bandwidth; > + tegra_state->avg_memory_bandwidth = avg_bandwidth; > + > + return 0; > +} [...] > +static const char * const tegra_plane_icc_names[] = { > + "wina", "winb", "winc", "", "", "", "cursor", > +}; > + > +int tegra_plane_interconnect_init(struct tegra_plane *plane) > +{ > + const char *icc_name = tegra_plane_icc_names[plane->index]; Is plane->index guaranteed to be <= 6? I would guess so, but maybe BUILD_BUG_ON(sizeof(icc_names)==TEGRA_DC_LEGACY_PLANES_NUM) or some other check could document this? [...] Best Regards Michał Mirosław

Re: [PATCH 06/11] pragma once: convert include/linux/cb710.h

2021-03-03 Thread Michał Mirosław
> This file is concatenation of two files with two include guards. > Convert it manually. > > Signed-off-by: Alexey Dobriyan Acked-by: Michał Mirosław

Re: [PATCH v1] Input: elants_i2c - fix division by zero if firmware reports zero phys size

2021-03-03 Thread Michał Mirosław
off-by: Dmitry Osipenko > --- Rewieved-by: Michał Mirosław > Please note that ASUS TF700T isn't yet supported by upstream kernel, > hence this is not a critical fix. > > drivers/input/touchscreen/elants_i2c.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(

Re: [PATCH v5 2/7] clk: tegra: Fix refcounting of gate clocks

2021-03-18 Thread Michał Mirosław
l avoid the > - * peripheral access after disabling clock > + * Some clocks are duplicated and some of them are marked as critical, > + * like fuse and fuse_burn for example, thus the enable_refcnt will > + * be non-zero here id the "unused" duplicate is disabled by CCF. s/id/if/ ? Best Regards Michał Mirosław

Re: [PATCH v16 1/2] drm/tegra: dc: Support memory bandwidth management

2021-03-18 Thread Michał Mirosław
without_filters = false, > + .has_win_b_vfilter_mem_client = false, > .has_win_c_without_vert_filter = false, > + .plane_tiled_memory_bandwidth_x2 = true, > }; > > static const struct tegra_dc_soc_info tegra124_dc_soc_info = { > @@ -2314,7 +2660,9 @@ static const struct tegra_dc_soc_info > tegra124_dc_soc_info = { > .overlay_formats = tegra124_overlay_formats, > .modifiers = tegra124_modifiers, > .has_win_a_without_filters = false, > + .has_win_b_vfilter_mem_client = false, > .has_win_c_without_vert_filter = false, > + .plane_tiled_memory_bandwidth_x2 = false, > }; > > static const struct tegra_dc_soc_info tegra210_dc_soc_info = { > @@ -2333,7 +2681,9 @@ static const struct tegra_dc_soc_info > tegra210_dc_soc_info = { > .overlay_formats = tegra114_overlay_formats, > .modifiers = tegra124_modifiers, > .has_win_a_without_filters = false, > + .has_win_b_vfilter_mem_client = false, > .has_win_c_without_vert_filter = false, > + .plane_tiled_memory_bandwidth_x2 = false, > }; > > static const struct tegra_windowgroup_soc tegra186_dc_wgrps[] = { > @@ -2382,6 +2732,7 @@ static const struct tegra_dc_soc_info > tegra186_dc_soc_info = { > .has_nvdisplay = true, > .wgrps = tegra186_dc_wgrps, > .num_wgrps = ARRAY_SIZE(tegra186_dc_wgrps), > + .plane_tiled_memory_bandwidth_x2 = false, > }; > > static const struct tegra_windowgroup_soc tegra194_dc_wgrps[] = { > @@ -2430,6 +2781,7 @@ static const struct tegra_dc_soc_info > tegra194_dc_soc_info = { > .has_nvdisplay = true, > .wgrps = tegra194_dc_wgrps, > .num_wgrps = ARRAY_SIZE(tegra194_dc_wgrps), > + .plane_tiled_memory_bandwidth_x2 = false, > }; For globals you will have .x = false by default; I'm not sure those entries add much value. Reviewed-by: Michał Mirosław

Re: [PATCH] power: bq25890: Use the correct range for IILIM register

2020-11-24 Thread Michał Mirosław
On Wed, Nov 25, 2020 at 04:48:05AM +0100, Sebastian Krzyszkowiak wrote: > I've checked bq25890, bq25892, bq25895 and bq25896 datasheets and > they all define IILIM to be between 100mA-3.25A with 50mA steps. That's what DS says, indeed. Reviewed-by: Michał Mirosław

Re: [PATCH v6 1/3] lib: zstd: Add kernel-specific API

2020-12-02 Thread Michał Mirosław
put, struct zstd_in_buffer *input) > +{ > + ZSTD_outBuffer o; > + ZSTD_inBuffer i; > + size_t ret; > + > + memcpy(&o, output, sizeof(o)); > + memcpy(&i, input, sizeof(i)); > + ret = ZSTD_compressStream(cstream, &o, &i); > + memcpy(output, &o, sizeof(o)); > + memcpy(input, &i, sizeof(i)); > + return ret; > +} Is all this copying necessary? How is it different from type-punning by direct pointer cast? Best Regards Michał Mirosław

Re: [PATCH v6 1/3] lib: zstd: Add kernel-specific API

2020-12-02 Thread Michał Mirosław
On Thu, Dec 03, 2020 at 01:42:03AM +, Nick Terrell wrote: > > > > On Dec 2, 2020, at 5:16 PM, Michał Mirosław wrote: > > > > On Wed, Dec 02, 2020 at 12:32:40PM -0800, Nick Terrell wrote: > >> From: Nick Terrell > >> > >> This patch: >

Re: [PATCH v6 1/3] lib: zstd: Add kernel-specific API

2020-12-02 Thread Michał Mirosław
On Thu, Dec 03, 2020 at 03:59:21AM +, Nick Terrell wrote: > On Dec 2, 2020, at 7:14 PM, Michał Mirosław wrote: > > On Thu, Dec 03, 2020 at 01:42:03AM +, Nick Terrell wrote: > >> On Dec 2, 2020, at 5:16 PM, Michał Mirosław > >> wrote: > >>> On Wed,

Re: [PATCH v15 2/2] drm/tegra: dc: Extend debug stats with total number of events

2021-03-14 Thread Michał Mirosław
reset. [...] Looks good. It seems independent from the other patch. Reviewed-by: Michał Mirosław

Re: [PATCH v15 1/2] drm/tegra: dc: Support memory bandwidth management

2021-03-14 Thread Michał Mirosław
mul = 1; [...] One point is unexplained yet: why is the multiplier proportional to a *difference* between src and dst widths? Also, I would expect max (worst case) is pixclock * read_size when src_w/dst_w >= read_size. BTW, you could move this below and : if (src > dst_w) peak_bandwidth *= ... > + /* average bandwidth in bytes/s */ > + avg_bandwidth = (bpp * src_w * src_h * mul + 7) / 8; > + avg_bandwidth *= drm_mode_vrefresh(&crtc_state->mode); > + > + /* mode.clock in kHz, peak bandwidth in kbit/s */ > + peak_bandwidth = crtc_state->mode.clock * bpp * mul; [...] Best Regards Michał Mirosław

Re: [PATCH RESEND v8 2/4] input: elants: support old touch report format

2021-01-22 Thread Michał Mirosław
On Fri, Jan 22, 2021 at 11:10:52PM +0300, Dmitry Osipenko wrote: > 08.01.2021 01:06, Dmitry Osipenko пишет: > > 11.12.2020 21:48, Dmitry Torokhov пишет: > >> On Fri, Dec 11, 2020 at 06:04:01PM +0100, Michał Mirosław wrote: > >>> On Fri, Dec 11, 2020 at 07:39:33P

Re: [f2fs-dev] [PATCH v7 0/3] Update to zstd-1.4.6

2020-12-16 Thread Michał Mirosław
work in the kernel. > [0] > https://github.com/terrelln/linux/commit/ac2ee65dcb7318afe426ad08f6a844faf3aebb41 I looks like you could remove a bit more dead code by noting __GNUC__ >= 4 (gcc-4.9 is currently the oldest supported [1]). [1] Documentation/process/changes.rst Best Regards Michał Mirosław

Re: About regression caused by commit aea6cb99703e ("regulator: resolve supply after creating regulator")

2020-11-22 Thread Michał Mirosław
On Sun, Nov 22, 2020 at 03:43:33PM +0100, Jan Kiszka wrote: > On 09.11.20 00:28, Qu Wenruo wrote: > > On 2020/11/9 上午1:18, Michał Mirosław wrote: > >> On Sun, Nov 08, 2020 at 03:35:33PM +0800, Qu Wenruo wrote: [...] > >>> It turns out that, commit aea6cb99703e (&q

Re: [RFT][PATCH 08/12] mmc: change cb710-mmc platform power management to use dev_pm_ops

2014-02-10 Thread Michał Mirosław
you could move cb710_mmc_suspend() (or whatever you'll call it) to one ifdef block with cb710_mmc_dev_pm_ops. Best Regards, Michał Mirosław -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo in

  1   2   3   4   >