* linux-next: manual merge of the v4l-dvb tree with the i2c tree
@ 2013-04-03 1:12 Stephen Rothwell
2013-05-01 3:27 ` Stephen Rothwell
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2013-04-03 1:12 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: linux-next, linux-kernel, Lars-Peter Clausen, Wolfram Sang,
Frank Schaefer
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
Hi Mauro,
Today's linux-next merge of the v4l-dvb tree got a conflict in
drivers/media/pci/bt8xx/bttv-input.c between commit bf51a8c5e0b6 ("i2c:
Ignore return value of i2c_del_adapter()") from the i2c tree and commit
457ba4ce4f43 ("[media] bttv: move fini_bttv_i2c() from bttv-input.c to
bttv-i2c.c") from the v4l-dvb tree.
The latter moved the code that the former modified, so I added the
following fix patch and can carry the fix as necessary (no action is
required).
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 3 Apr 2013 12:10:05 +1100
Subject: [PATCH] i2c: fixup for code movement from bttv_input.c
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/media/pci/bt8xx/bttv-i2c.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c
index b7c52dc..d43911d 100644
--- a/drivers/media/pci/bt8xx/bttv-i2c.c
+++ b/drivers/media/pci/bt8xx/bttv-i2c.c
@@ -397,8 +397,8 @@ int init_bttv_i2c(struct bttv *btv)
int fini_bttv_i2c(struct bttv *btv)
{
- if (0 != btv->i2c_rc)
- return 0;
+ if (btv->i2c_rc == 0)
+ i2c_del_adapter(&btv->c.i2c_adap);
- return i2c_del_adapter(&btv->c.i2c_adap);
+ return 0;
}
--
1.8.1
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2013-04-03 1:12 Stephen Rothwell
@ 2013-05-01 3:27 ` Stephen Rothwell
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Rothwell @ 2013-05-01 3:27 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-next, linux-kernel, Lars-Peter Clausen,
Mauro Carvalho Chehab, Frank Schaefer
[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]
Hi all,
On Wed, 3 Apr 2013 12:12:57 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the v4l-dvb tree got a conflict in
> drivers/media/pci/bt8xx/bttv-input.c between commit bf51a8c5e0b6 ("i2c:
> Ignore return value of i2c_del_adapter()") from the i2c tree and commit
> 457ba4ce4f43 ("[media] bttv: move fini_bttv_i2c() from bttv-input.c to
> bttv-i2c.c") from the v4l-dvb tree.
>
> The latter moved the code that the former modified, so I added the
> following fix patch and can carry the fix as necessary (no action is
> required).
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 3 Apr 2013 12:10:05 +1100
> Subject: [PATCH] i2c: fixup for code movement from bttv_input.c
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> drivers/media/pci/bt8xx/bttv-i2c.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c
> index b7c52dc..d43911d 100644
> --- a/drivers/media/pci/bt8xx/bttv-i2c.c
> +++ b/drivers/media/pci/bt8xx/bttv-i2c.c
> @@ -397,8 +397,8 @@ int init_bttv_i2c(struct bttv *btv)
>
> int fini_bttv_i2c(struct bttv *btv)
> {
> - if (0 != btv->i2c_rc)
> - return 0;
> + if (btv->i2c_rc == 0)
> + i2c_del_adapter(&btv->c.i2c_adap);
>
> - return i2c_del_adapter(&btv->c.i2c_adap);
> + return 0;
> }
> --
> 1.8.1
This fix up patch is now required when I merge the i2c tree (as Linus'
has merged the v4l-dvb stuff).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* linux-next: manual merge of the v4l-dvb tree with the i2c tree
@ 2025-04-28 0:49 Stephen Rothwell
2025-04-28 1:22 ` Stephen Rothwell
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2025-04-28 0:49 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Wolfram Sang
Cc: Hans Verkuil, Jai Luthra, Linux Kernel Mailing List,
Linux Next Mailing List, Romain Gantois, Sakari Ailus,
Tomi Valkeinen, Wolfram Sang
[-- Attachment #1: Type: text/plain, Size: 4261 bytes --]
Hi all,
Today's linux-next merge of the v4l-dvb tree got a conflict in:
drivers/media/i2c/ds90ub960.c
between commits:
3ec29d51b546 ("media: i2c: ds90ub960: Protect alias_use_mask with a mutex")
818bd489f137 ("i2c: use client addresses directly in ATR interface")
from the i2c tree and commits:
24868501a744 ("media: i2c: ds90ub9xx: Add err parameter to read/write funcs")
2ca499384e98 ("media: i2c: ds90ub960: Add RX port iteration support")
from the v4l-dvb tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/media/i2c/ds90ub960.c
index 5a4d5de110bd,1877eb735cc7..000000000000
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@@ -1056,11 -1271,10 +1274,12 @@@ static int ub960_atr_attach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret = 0;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
- if (!rxport->aliased_clients[reg_idx])
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
+ if (!rxport->aliased_addrs[reg_idx])
break;
}
@@@ -1069,15 -1283,18 +1288,18 @@@
return -EADDRNOTAVAIL;
}
- rxport->aliased_clients[reg_idx] = client;
+ rxport->aliased_addrs[reg_idx] = addr;
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ID(reg_idx),
- addr << 1);
- client->addr << 1, &ret);
++ addr << 1, &ret);
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
- alias << 1);
+ alias << 1, &ret);
+
+ if (ret)
+ return ret;
dev_dbg(dev, "rx%u: client 0x%02x assigned alias 0x%02x at slot %u\n",
- rxport->nport, client->addr, alias, reg_idx);
+ rxport->nport, addr, alias, reg_idx);
return 0;
}
@@@ -1089,11 -1306,10 +1311,12 @@@ static void ub960_atr_detach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
- if (rxport->aliased_clients[reg_idx] == client)
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
+ if (rxport->aliased_addrs[reg_idx] == addr)
break;
}
@@@ -1103,12 -1319,18 +1326,18 @@@
return;
}
- rxport->aliased_clients[reg_idx] = NULL;
+ rxport->aliased_addrs[reg_idx] = 0;
- ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx), 0);
+ ret = ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
+ 0, NULL);
+ if (ret) {
+ dev_err(dev, "rx%u: unable to fully unmap client 0x%02x: %d\n",
+ rxport->nport, client->addr, ret);
+ return;
+ }
dev_dbg(dev, "rx%u: client 0x%02x released at slot %u\n", rxport->nport,
- client->addr, reg_idx);
+ addr, reg_idx);
}
static const struct i2c_atr_ops ub960_atr_ops = {
@@@ -3231,21 -4370,12 +4376,14 @@@ static void ub960_txport_free_ports(str
static void ub960_rxport_free_ports(struct ub960_data *priv)
{
- unsigned int nport;
-
- for (nport = 0; nport < priv->hw_data->num_rxports; nport++) {
- struct ub960_rxport *rxport = priv->rxports[nport];
-
- if (!rxport)
- continue;
-
- fwnode_handle_put(rxport->source.ep_fwnode);
- fwnode_handle_put(rxport->ser.fwnode);
+ for_each_active_rxport(priv, it) {
+ fwnode_handle_put(it.rxport->source.ep_fwnode);
+ fwnode_handle_put(it.rxport->ser.fwnode);
+ mutex_destroy(&rxport->aliased_addrs_lock);
+
- kfree(rxport);
- priv->rxports[nport] = NULL;
+ kfree(it.rxport);
+ priv->rxports[it.nport] = NULL;
}
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-04-28 0:49 linux-next: manual merge of the v4l-dvb tree with the i2c tree Stephen Rothwell
@ 2025-04-28 1:22 ` Stephen Rothwell
2025-04-28 1:30 ` Stephen Rothwell
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2025-04-28 1:22 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Wolfram Sang
Cc: Hans Verkuil, Jai Luthra, Linux Kernel Mailing List,
Linux Next Mailing List, Romain Gantois, Sakari Ailus,
Tomi Valkeinen, Wolfram Sang
[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]
Hi all,
On Mon, 28 Apr 2025 10:49:05 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the v4l-dvb tree got a conflict in:
>
> drivers/media/i2c/ds90ub960.c
>
> between commits:
>
> 3ec29d51b546 ("media: i2c: ds90ub960: Protect alias_use_mask with a mutex")
> 818bd489f137 ("i2c: use client addresses directly in ATR interface")
>
> from the i2c tree and commits:
>
> 24868501a744 ("media: i2c: ds90ub9xx: Add err parameter to read/write funcs")
> 2ca499384e98 ("media: i2c: ds90ub960: Add RX port iteration support")
>
> from the v4l-dvb tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
The actual resolution is below ...
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-04-28 1:22 ` Stephen Rothwell
@ 2025-04-28 1:30 ` Stephen Rothwell
2025-04-29 11:46 ` Tomi Valkeinen
2025-05-29 2:49 ` Stephen Rothwell
0 siblings, 2 replies; 12+ messages in thread
From: Stephen Rothwell @ 2025-04-28 1:30 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Wolfram Sang
Cc: Hans Verkuil, Jai Luthra, Linux Kernel Mailing List,
Linux Next Mailing List, Romain Gantois, Sakari Ailus,
Tomi Valkeinen, Wolfram Sang
[-- Attachment #1: Type: text/plain, Size: 4699 bytes --]
Hi all,
On Mon, 28 Apr 2025 11:22:00 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Mon, 28 Apr 2025 10:49:05 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the v4l-dvb tree got a conflict in:
> >
> > drivers/media/i2c/ds90ub960.c
> >
> > between commits:
> >
> > 3ec29d51b546 ("media: i2c: ds90ub960: Protect alias_use_mask with a mutex")
> > 818bd489f137 ("i2c: use client addresses directly in ATR interface")
> >
> > from the i2c tree and commits:
> >
> > 24868501a744 ("media: i2c: ds90ub9xx: Add err parameter to read/write funcs")
> > 2ca499384e98 ("media: i2c: ds90ub960: Add RX port iteration support")
> >
> > from the v4l-dvb tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging. You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
>
> The actual resolution is below ...
I hit the wrong key :-( Resolution below.
--
Cheers,
Stephen Rothwell
diff --cc drivers/media/i2c/ds90ub960.c
index 5a4d5de110bd,1877eb735cc7..000000000000
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@@ -1056,11 -1271,10 +1274,12 @@@ static int ub960_atr_attach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret = 0;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
- if (!rxport->aliased_clients[reg_idx])
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
+ if (!rxport->aliased_addrs[reg_idx])
break;
}
@@@ -1069,15 -1283,18 +1288,18 @@@
return -EADDRNOTAVAIL;
}
- rxport->aliased_clients[reg_idx] = client;
+ rxport->aliased_addrs[reg_idx] = addr;
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ID(reg_idx),
- addr << 1);
- client->addr << 1, &ret);
++ addr << 1, &ret);
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
- alias << 1);
+ alias << 1, &ret);
+
+ if (ret)
+ return ret;
dev_dbg(dev, "rx%u: client 0x%02x assigned alias 0x%02x at slot %u\n",
- rxport->nport, client->addr, alias, reg_idx);
+ rxport->nport, addr, alias, reg_idx);
return 0;
}
@@@ -1089,11 -1306,10 +1311,12 @@@ static void ub960_atr_detach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
- if (rxport->aliased_clients[reg_idx] == client)
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
+ if (rxport->aliased_addrs[reg_idx] == addr)
break;
}
@@@ -1103,12 -1319,18 +1326,18 @@@
return;
}
- rxport->aliased_clients[reg_idx] = NULL;
+ rxport->aliased_addrs[reg_idx] = 0;
- ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx), 0);
+ ret = ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
+ 0, NULL);
+ if (ret) {
+ dev_err(dev, "rx%u: unable to fully unmap client 0x%02x: %d\n",
- rxport->nport, client->addr, ret);
++ rxport->nport, addr, ret);
+ return;
+ }
dev_dbg(dev, "rx%u: client 0x%02x released at slot %u\n", rxport->nport,
- client->addr, reg_idx);
+ addr, reg_idx);
}
static const struct i2c_atr_ops ub960_atr_ops = {
@@@ -3231,21 -4370,12 +4376,14 @@@ static void ub960_txport_free_ports(str
static void ub960_rxport_free_ports(struct ub960_data *priv)
{
- unsigned int nport;
+ for_each_active_rxport(priv, it) {
+ fwnode_handle_put(it.rxport->source.ep_fwnode);
+ fwnode_handle_put(it.rxport->ser.fwnode);
- for (nport = 0; nport < priv->hw_data->num_rxports; nport++) {
- struct ub960_rxport *rxport = priv->rxports[nport];
++ mutex_destroy(&it.rxport->aliased_addrs_lock);
+
- if (!rxport)
- continue;
-
- fwnode_handle_put(rxport->source.ep_fwnode);
- fwnode_handle_put(rxport->ser.fwnode);
-
- mutex_destroy(&rxport->aliased_addrs_lock);
-
- kfree(rxport);
- priv->rxports[nport] = NULL;
+ kfree(it.rxport);
+ priv->rxports[it.nport] = NULL;
}
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-04-28 1:30 ` Stephen Rothwell
@ 2025-04-29 11:46 ` Tomi Valkeinen
2025-05-29 2:49 ` Stephen Rothwell
1 sibling, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2025-04-29 11:46 UTC (permalink / raw)
To: Stephen Rothwell, Mauro Carvalho Chehab, Wolfram Sang
Cc: Hans Verkuil, Jai Luthra, Linux Kernel Mailing List,
Linux Next Mailing List, Romain Gantois, Sakari Ailus,
Wolfram Sang
Hi,
On 28/04/2025 04:30, Stephen Rothwell wrote:
> Hi all,
>
> On Mon, 28 Apr 2025 11:22:00 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>
>> On Mon, 28 Apr 2025 10:49:05 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>>
>>> Today's linux-next merge of the v4l-dvb tree got a conflict in:
>>>
>>> drivers/media/i2c/ds90ub960.c
>>>
>>> between commits:
>>>
>>> 3ec29d51b546 ("media: i2c: ds90ub960: Protect alias_use_mask with a mutex")
>>> 818bd489f137 ("i2c: use client addresses directly in ATR interface")
>>>
>>> from the i2c tree and commits:
>>>
>>> 24868501a744 ("media: i2c: ds90ub9xx: Add err parameter to read/write funcs")
>>> 2ca499384e98 ("media: i2c: ds90ub960: Add RX port iteration support")
>>>
>>> from the v4l-dvb tree.
>>>
>>> I fixed it up (see below) and can carry the fix as necessary. This
>>> is now fixed as far as linux-next is concerned, but any non trivial
>>> conflicts should be mentioned to your upstream maintainer when your tree
>>> is submitted for merging. You may also want to consider cooperating
>>> with the maintainer of the conflicting tree to minimise any particularly
>>> complex conflicts.
>>
>> The actual resolution is below ...
>
> I hit the wrong key :-( Resolution below.
I came up with the same resolution, so looks correct to me.
Tomi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-04-28 1:30 ` Stephen Rothwell
2025-04-29 11:46 ` Tomi Valkeinen
@ 2025-05-29 2:49 ` Stephen Rothwell
2025-05-30 8:13 ` Romain Gantois
1 sibling, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2025-05-29 2:49 UTC (permalink / raw)
To: Wolfram Sang
Cc: Mauro Carvalho Chehab, Hans Verkuil, Jai Luthra,
Linux Kernel Mailing List, Linux Next Mailing List,
Romain Gantois, Sakari Ailus, Tomi Valkeinen, Wolfram Sang
[-- Attachment #1: Type: text/plain, Size: 5170 bytes --]
Hi all,
On Mon, 28 Apr 2025 11:30:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Mon, 28 Apr 2025 11:22:00 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > On Mon, 28 Apr 2025 10:49:05 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > Today's linux-next merge of the v4l-dvb tree got a conflict in:
> > >
> > > drivers/media/i2c/ds90ub960.c
> > >
> > > between commits:
> > >
> > > 3ec29d51b546 ("media: i2c: ds90ub960: Protect alias_use_mask with a mutex")
> > > 818bd489f137 ("i2c: use client addresses directly in ATR interface")
> > >
> > > from the i2c tree and commits:
> > >
> > > 24868501a744 ("media: i2c: ds90ub9xx: Add err parameter to read/write funcs")
> > > 2ca499384e98 ("media: i2c: ds90ub960: Add RX port iteration support")
> > >
> > > from the v4l-dvb tree.
> > >
> > > I fixed it up (see below) and can carry the fix as necessary. This
> > > is now fixed as far as linux-next is concerned, but any non trivial
> > > conflicts should be mentioned to your upstream maintainer when your tree
> > > is submitted for merging. You may also want to consider cooperating
> > > with the maintainer of the conflicting tree to minimise any particularly
> > > complex conflicts.
> >
> > The actual resolution is below ...
>
> I hit the wrong key :-( Resolution below.
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc drivers/media/i2c/ds90ub960.c
> index 5a4d5de110bd,1877eb735cc7..000000000000
> --- a/drivers/media/i2c/ds90ub960.c
> +++ b/drivers/media/i2c/ds90ub960.c
> @@@ -1056,11 -1271,10 +1274,12 @@@ static int ub960_atr_attach_addr(struc
> struct ub960_rxport *rxport = priv->rxports[chan_id];
> struct device *dev = &priv->client->dev;
> unsigned int reg_idx;
> + int ret = 0;
>
> - for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
> - if (!rxport->aliased_clients[reg_idx])
> + guard(mutex)(&rxport->aliased_addrs_lock);
> +
> + for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
> + if (!rxport->aliased_addrs[reg_idx])
> break;
> }
>
> @@@ -1069,15 -1283,18 +1288,18 @@@
> return -EADDRNOTAVAIL;
> }
>
> - rxport->aliased_clients[reg_idx] = client;
> + rxport->aliased_addrs[reg_idx] = addr;
>
> ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ID(reg_idx),
> - addr << 1);
> - client->addr << 1, &ret);
> ++ addr << 1, &ret);
> ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
> - alias << 1);
> + alias << 1, &ret);
> +
> + if (ret)
> + return ret;
>
> dev_dbg(dev, "rx%u: client 0x%02x assigned alias 0x%02x at slot %u\n",
> - rxport->nport, client->addr, alias, reg_idx);
> + rxport->nport, addr, alias, reg_idx);
>
> return 0;
> }
> @@@ -1089,11 -1306,10 +1311,12 @@@ static void ub960_atr_detach_addr(struc
> struct ub960_rxport *rxport = priv->rxports[chan_id];
> struct device *dev = &priv->client->dev;
> unsigned int reg_idx;
> + int ret;
>
> - for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
> - if (rxport->aliased_clients[reg_idx] == client)
> + guard(mutex)(&rxport->aliased_addrs_lock);
> +
> + for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
> + if (rxport->aliased_addrs[reg_idx] == addr)
> break;
> }
>
> @@@ -1103,12 -1319,18 +1326,18 @@@
> return;
> }
>
> - rxport->aliased_clients[reg_idx] = NULL;
> + rxport->aliased_addrs[reg_idx] = 0;
>
> - ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx), 0);
> + ret = ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
> + 0, NULL);
> + if (ret) {
> + dev_err(dev, "rx%u: unable to fully unmap client 0x%02x: %d\n",
> - rxport->nport, client->addr, ret);
> ++ rxport->nport, addr, ret);
> + return;
> + }
>
> dev_dbg(dev, "rx%u: client 0x%02x released at slot %u\n", rxport->nport,
> - client->addr, reg_idx);
> + addr, reg_idx);
> }
>
> static const struct i2c_atr_ops ub960_atr_ops = {
> @@@ -3231,21 -4370,12 +4376,14 @@@ static void ub960_txport_free_ports(str
>
> static void ub960_rxport_free_ports(struct ub960_data *priv)
> {
> - unsigned int nport;
> + for_each_active_rxport(priv, it) {
> + fwnode_handle_put(it.rxport->source.ep_fwnode);
> + fwnode_handle_put(it.rxport->ser.fwnode);
>
> - for (nport = 0; nport < priv->hw_data->num_rxports; nport++) {
> - struct ub960_rxport *rxport = priv->rxports[nport];
> ++ mutex_destroy(&it.rxport->aliased_addrs_lock);
> +
> - if (!rxport)
> - continue;
> -
> - fwnode_handle_put(rxport->source.ep_fwnode);
> - fwnode_handle_put(rxport->ser.fwnode);
> -
> - mutex_destroy(&rxport->aliased_addrs_lock);
> -
> - kfree(rxport);
> - priv->rxports[nport] = NULL;
> + kfree(it.rxport);
> + priv->rxports[it.nport] = NULL;
> }
> }
This is now a conflict between the i2c tree and Linus' tree.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-05-29 2:49 ` Stephen Rothwell
@ 2025-05-30 8:13 ` Romain Gantois
2025-05-30 11:24 ` Wolfram Sang
2025-05-31 12:05 ` Wolfram Sang
0 siblings, 2 replies; 12+ messages in thread
From: Romain Gantois @ 2025-05-30 8:13 UTC (permalink / raw)
To: Wolfram Sang, Stephen Rothwell
Cc: Mauro Carvalho Chehab, Hans Verkuil, Jai Luthra,
Linux Kernel Mailing List, Linux Next Mailing List, Sakari Ailus,
Tomi Valkeinen, Wolfram Sang
[-- Attachment #1: Type: text/plain, Size: 5596 bytes --]
Hi Stephen,
On Thursday, 29 May 2025 04:49:29 CEST Stephen Rothwell wrote:
> Hi all,
>
> On Mon, 28 Apr 2025 11:30:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au>
wrote:
> > On Mon, 28 Apr 2025 11:22:00 +1000 Stephen Rothwell <sfr@canb.auug.org.au>
wrote:
> > > On Mon, 28 Apr 2025 10:49:05 +1000 Stephen Rothwell
<sfr@canb.auug.org.au> wrote:
> > > > Today's linux-next merge of the v4l-dvb tree got a conflict in:
> > > > drivers/media/i2c/ds90ub960.c
> > > >
> > > > between commits:
> > > > 3ec29d51b546 ("media: i2c: ds90ub960: Protect alias_use_mask with a
> > > > mutex")
> > > > 818bd489f137 ("i2c: use client addresses directly in ATR interface")
> > > >
> > > > from the i2c tree and commits:
> > > > 24868501a744 ("media: i2c: ds90ub9xx: Add err parameter to
> > > > read/write funcs") 2ca499384e98 ("media: i2c: ds90ub960: Add RX
> > > > port iteration support")> > >
> > > > from the v4l-dvb tree.
> > > >
> > > > I fixed it up (see below) and can carry the fix as necessary. This
> > > > is now fixed as far as linux-next is concerned, but any non trivial
> > > > conflicts should be mentioned to your upstream maintainer when your
> > > > tree
> > > > is submitted for merging. You may also want to consider cooperating
> > > > with the maintainer of the conflicting tree to minimise any
> > > > particularly
> > > > complex conflicts.
> > >
> > > The actual resolution is below ...
> >
> > I hit the wrong key :-( Resolution below.
>
> This is now a conflict between the i2c tree and Linus' tree.
Below is the resolution I came up with.
Thanks,
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
diff --cc drivers/media/i2c/ds90ub960.c
index ed9ace1a54766,94b20ba6cb86f..54c2546551451
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@@ -1271,10 -1056,11 +1274,12 @@@ static int ub960_atr_attach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret = 0;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients);
reg_idx++) {
- if (!rxport->aliased_clients[reg_idx])
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs);
reg_idx++) {
+ if (!rxport->aliased_addrs[reg_idx])
break;
}
@@@ -1283,18 -1069,15 +1288,18 @@@
return -EADDRNOTAVAIL;
}
- rxport->aliased_clients[reg_idx] = client;
+ rxport->aliased_addrs[reg_idx] = addr;
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ID(reg_idx),
- client->addr << 1, &ret);
- addr << 1);
++ addr << 1, &ret);
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
- alias << 1);
+ alias << 1, &ret);
+
+ if (ret)
+ return ret;
dev_dbg(dev, "rx%u: client 0x%02x assigned alias 0x%02x at slot %u\n",
- rxport->nport, client->addr, alias, reg_idx);
+ rxport->nport, addr, alias, reg_idx);
return 0;
}
@@@ -1306,10 -1089,11 +1311,12 @@@ static void ub960_atr_detach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients);
reg_idx++) {
- if (rxport->aliased_clients[reg_idx] == client)
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs);
reg_idx++) {
+ if (rxport->aliased_addrs[reg_idx] == addr)
break;
}
@@@ -1319,18 -1103,12 +1326,18 @@@
return;
}
- rxport->aliased_clients[reg_idx] = NULL;
+ rxport->aliased_addrs[reg_idx] = 0;
- ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx), 0);
+ ret = ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
+ 0, NULL);
+ if (ret) {
+ dev_err(dev, "rx%u: unable to fully unmap client 0x%02x:
%d\n",
+ rxport->nport, client->addr, ret);
+ return;
+ }
dev_dbg(dev, "rx%u: client 0x%02x released at slot %u\n", rxport-
>nport,
- client->addr, reg_idx);
+ addr, reg_idx);
}
static const struct i2c_atr_ops ub960_atr_ops = {
@@@ -4370,12 -3231,21 +4376,14 @@@ static void ub960_txport_free_ports(str
static void ub960_rxport_free_ports(struct ub960_data *priv)
{
- unsigned int nport;
-
- for (nport = 0; nport < priv->hw_data->num_rxports; nport++) {
- struct ub960_rxport *rxport = priv->rxports[nport];
-
- if (!rxport)
- continue;
-
- fwnode_handle_put(rxport->source.ep_fwnode);
- fwnode_handle_put(rxport->ser.fwnode);
+ for_each_active_rxport(priv, it) {
+ fwnode_handle_put(it.rxport->source.ep_fwnode);
+ fwnode_handle_put(it.rxport->ser.fwnode);
+ mutex_destroy(&rxport->aliased_addrs_lock);
+
- kfree(rxport);
- priv->rxports[nport] = NULL;
+ kfree(it.rxport);
+ priv->rxports[it.nport] = NULL;
}
}
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-05-30 8:13 ` Romain Gantois
@ 2025-05-30 11:24 ` Wolfram Sang
2025-06-02 16:17 ` Romain Gantois
2025-05-31 12:05 ` Wolfram Sang
1 sibling, 1 reply; 12+ messages in thread
From: Wolfram Sang @ 2025-05-30 11:24 UTC (permalink / raw)
To: Romain Gantois
Cc: Stephen Rothwell, Mauro Carvalho Chehab, Hans Verkuil, Jai Luthra,
Linux Kernel Mailing List, Linux Next Mailing List, Sakari Ailus,
Tomi Valkeinen
[-- Attachment #1: Type: text/plain, Size: 237 bytes --]
> Below is the resolution I came up with.
Thank you for this...
> - for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients);
> reg_idx++) {
... but it was mangled, sadly. Can you resend it properly, please?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-05-30 8:13 ` Romain Gantois
2025-05-30 11:24 ` Wolfram Sang
@ 2025-05-31 12:05 ` Wolfram Sang
2025-06-02 15:57 ` Romain Gantois
1 sibling, 1 reply; 12+ messages in thread
From: Wolfram Sang @ 2025-05-31 12:05 UTC (permalink / raw)
To: Romain Gantois
Cc: Stephen Rothwell, Mauro Carvalho Chehab, Hans Verkuil, Jai Luthra,
Linux Kernel Mailing List, Linux Next Mailing List, Sakari Ailus,
Tomi Valkeinen
[-- Attachment #1: Type: text/plain, Size: 242 bytes --]
> Below is the resolution I came up with.
Linus solved it differently [1]. I think he is right, but those
interested please double check.
[1] https://lore.kernel.org/all/CAHk-=wiKW=BPcDvBAsVDemdWBR0uh09A_WMOCoceqj3w3doGJg@mail.gmail.com/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-05-31 12:05 ` Wolfram Sang
@ 2025-06-02 15:57 ` Romain Gantois
0 siblings, 0 replies; 12+ messages in thread
From: Romain Gantois @ 2025-06-02 15:57 UTC (permalink / raw)
To: Wolfram Sang, Romain Gantois, Stephen Rothwell,
Mauro Carvalho Chehab, Hans Verkuil, Jai Luthra,
Linux Kernel Mailing List, Linux Next Mailing List, Sakari Ailus,
Tomi Valkeinen
[-- Attachment #1: Type: text/plain, Size: 550 bytes --]
Hi Wolfram,
On Saturday, 31 May 2025 14:05:03 CEST Wolfram Sang wrote:
> > Below is the resolution I came up with.
>
> Linus solved it differently [1]. I think he is right, but those
> interested please double check.
>
> [1]
> https://lore.kernel.org/all/CAHk-=wiKW=BPcDvBAsVDemdWBR0uh09A_WMOCoceqj3w3d
> oGJg@mail.gmail.com/
Indeed Linus' resolution is correct, the mutex destroy line should be:
mutex_destroy(&it.rxport->aliased_addrs_lock);
Thanks,
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: linux-next: manual merge of the v4l-dvb tree with the i2c tree
2025-05-30 11:24 ` Wolfram Sang
@ 2025-06-02 16:17 ` Romain Gantois
0 siblings, 0 replies; 12+ messages in thread
From: Romain Gantois @ 2025-06-02 16:17 UTC (permalink / raw)
To: Wolfram Sang, Romain Gantois, Stephen Rothwell,
Mauro Carvalho Chehab, Hans Verkuil, Jai Luthra,
Linux Kernel Mailing List, Linux Next Mailing List, Sakari Ailus,
Tomi Valkeinen
Hi Wolfram,
On Friday, 30 May 2025 13:24:46 CEST Wolfram Sang wrote:
> > Below is the resolution I came up with.
>
> Thank you for this...
>
> > - for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients);
> > reg_idx++) {
>
> ... but it was mangled, sadly. Can you resend it properly, please?
Sorry about that, here's a hopefully properly formatted version. Besides the
issue that Linus found with the mutex_destroy(), I'd also missed a
"s/client->addr/addr" in the previous version.
By the way, this is just the output of "git show" after resolving the merge,
I'm not used to sending these "resolutions diffs" so please let me know
if you need it in some other form.
Thanks,
---
diff --cc drivers/media/i2c/ds90ub960.c
index ed9ace1a54766,94b20ba6cb86f..082fc62b0f5b9
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@@ -1271,10 -1056,11 +1274,12 @@@ static int ub960_atr_attach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret = 0;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
- if (!rxport->aliased_clients[reg_idx])
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
+ if (!rxport->aliased_addrs[reg_idx])
break;
}
@@@ -1283,18 -1069,15 +1288,18 @@@
return -EADDRNOTAVAIL;
}
- rxport->aliased_clients[reg_idx] = client;
+ rxport->aliased_addrs[reg_idx] = addr;
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ID(reg_idx),
- client->addr << 1, &ret);
- addr << 1);
++ addr << 1, &ret);
ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
- alias << 1);
+ alias << 1, &ret);
+
+ if (ret)
+ return ret;
dev_dbg(dev, "rx%u: client 0x%02x assigned alias 0x%02x at slot %u\n",
- rxport->nport, client->addr, alias, reg_idx);
+ rxport->nport, addr, alias, reg_idx);
return 0;
}
@@@ -1306,10 -1089,11 +1311,12 @@@ static void ub960_atr_detach_addr(struc
struct ub960_rxport *rxport = priv->rxports[chan_id];
struct device *dev = &priv->client->dev;
unsigned int reg_idx;
+ int ret;
- for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_clients); reg_idx++) {
- if (rxport->aliased_clients[reg_idx] == client)
+ guard(mutex)(&rxport->aliased_addrs_lock);
+
+ for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
+ if (rxport->aliased_addrs[reg_idx] == addr)
break;
}
@@@ -1319,18 -1103,12 +1326,18 @@@
return;
}
- rxport->aliased_clients[reg_idx] = NULL;
+ rxport->aliased_addrs[reg_idx] = 0;
- ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx), 0);
+ ret = ub960_rxport_write(priv, chan_id, UB960_RR_SLAVE_ALIAS(reg_idx),
+ 0, NULL);
+ if (ret) {
+ dev_err(dev, "rx%u: unable to fully unmap client 0x%02x: %d\n",
- rxport->nport, client->addr, ret);
++ rxport->nport, addr, ret);
+ return;
+ }
dev_dbg(dev, "rx%u: client 0x%02x released at slot %u\n", rxport->nport,
- client->addr, reg_idx);
+ addr, reg_idx);
}
static const struct i2c_atr_ops ub960_atr_ops = {
@@@ -4370,12 -3231,21 +4376,14 @@@ static void ub960_txport_free_ports(str
static void ub960_rxport_free_ports(struct ub960_data *priv)
{
- unsigned int nport;
-
- for (nport = 0; nport < priv->hw_data->num_rxports; nport++) {
- struct ub960_rxport *rxport = priv->rxports[nport];
-
- if (!rxport)
- continue;
-
- fwnode_handle_put(rxport->source.ep_fwnode);
- fwnode_handle_put(rxport->ser.fwnode);
+ for_each_active_rxport(priv, it) {
+ fwnode_handle_put(it.rxport->source.ep_fwnode);
+ fwnode_handle_put(it.rxport->ser.fwnode);
- mutex_destroy(&rxport->aliased_addrs_lock);
++ mutex_destroy(&it.rxport->aliased_addrs_lock);
+
- kfree(rxport);
- priv->rxports[nport] = NULL;
+ kfree(it.rxport);
+ priv->rxports[it.nport] = NULL;
}
}
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-06-02 16:17 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-28 0:49 linux-next: manual merge of the v4l-dvb tree with the i2c tree Stephen Rothwell
2025-04-28 1:22 ` Stephen Rothwell
2025-04-28 1:30 ` Stephen Rothwell
2025-04-29 11:46 ` Tomi Valkeinen
2025-05-29 2:49 ` Stephen Rothwell
2025-05-30 8:13 ` Romain Gantois
2025-05-30 11:24 ` Wolfram Sang
2025-06-02 16:17 ` Romain Gantois
2025-05-31 12:05 ` Wolfram Sang
2025-06-02 15:57 ` Romain Gantois
-- strict thread matches above, loose matches on Subject: below --
2013-04-03 1:12 Stephen Rothwell
2013-05-01 3:27 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox