* [PATCH 1/6] phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS change
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
@ 2016-06-23 6:02 ` Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 2/6] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe() Kishon Vijay Abraham I
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2016-06-23 6:02 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
This patch fixes an issue that the driver is possible to cause
unexpected repeat interrupts if a board condition is wrong
(e.g. even if the ID pin is as function, a board supplies the VBUS.)
The reason why unexpected repeat interrupts happen is:
1) The driver changed the mode to function if it detected the ID pin
is high and the VBUS is high.
2) After the driver changed function mode, it disabled the "VBUS control"
feature. Then, the VBUS signal will be low.
3) Since the VBUS change interruption happened, the driver checked
the ID pin and VBUS.
4) Since VBUS was low, the driver changed the mode to host and enabled
the "VBUS control" feature. Then the VBUS signal will be high.
5) Since the VBUS change interruption happened, the driver did 1) above.
So, this patch modified the condition in rcar_gen3_device_recognition()
to check the ID pin only.
Fixes: 1114e2d (phy: rcar-gen3-usb2: change the mode to OTG on the combined channel)
Cc: <stable@vger.kernel.org> # v4.5+
Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-rcar-gen3-usb2.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index 76bb88f..4be3f5d 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -144,12 +144,6 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch)
extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
}
-static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch)
-{
- return !!(readl(ch->base + USB2_ADPCTRL) &
- USB2_ADPCTRL_OTGSESSVLD);
-}
-
static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
{
return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG);
@@ -157,13 +151,7 @@ static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch)
{
- bool is_host = true;
-
- /* B-device? */
- if (rcar_gen3_check_id(ch) && rcar_gen3_check_vbus(ch))
- is_host = false;
-
- if (is_host)
+ if (!rcar_gen3_check_id(ch))
rcar_gen3_init_for_host(ch);
else
rcar_gen3_init_for_peri(ch);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/6] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe()
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 1/6] phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS change Kishon Vijay Abraham I
@ 2016-06-23 6:02 ` Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 3/6] phy: phy-sun4i-usb: Fix optional gpios failing probe Kishon Vijay Abraham I
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2016-06-23 6:02 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
In case of error, the function devm_kzalloc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-rockchip-dp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/phy-rockchip-dp.c b/drivers/phy/phy-rockchip-dp.c
index 793ecb6..8b267a7 100644
--- a/drivers/phy/phy-rockchip-dp.c
+++ b/drivers/phy/phy-rockchip-dp.c
@@ -90,7 +90,7 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev)
return -ENODEV;
dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
- if (IS_ERR(dp))
+ if (!dp)
return -ENOMEM;
dp->dev = dev;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/6] phy: phy-sun4i-usb: Fix optional gpios failing probe
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 1/6] phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS change Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 2/6] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe() Kishon Vijay Abraham I
@ 2016-06-23 6:02 ` Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 4/6] phy-sun4i-usb: fix missing __iomem * Kishon Vijay Abraham I
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2016-06-23 6:02 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Quentin Schulz <quentin.schulz@free-electrons.com>
The interrupt 0 is not a valid interrupt number. In the event where the
retrieval of the vbus-det gpio would return null, the gpiod_to_irq
callback would return 0, while the current code makes the assumption
that it is a valid interrupt, and would go on calling request_irq.
Obviously, this would fail, preventing the driver from probing properly,
while the vbus and id gpios are optional.
Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-sun4i-usb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index bae54f7..45f01d6 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -645,11 +645,11 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
data->id_det_irq = gpiod_to_irq(data->id_det_gpio);
data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio);
- if ((data->id_det_gpio && data->id_det_irq < 0) ||
- (data->vbus_det_gpio && data->vbus_det_irq < 0))
+ if ((data->id_det_gpio && data->id_det_irq <= 0) ||
+ (data->vbus_det_gpio && data->vbus_det_irq <= 0))
data->phy0_poll = true;
- if (data->id_det_irq >= 0) {
+ if (data->id_det_irq > 0) {
ret = devm_request_irq(dev, data->id_det_irq,
sun4i_usb_phy0_id_vbus_det_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -660,7 +660,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
}
}
- if (data->vbus_det_irq >= 0) {
+ if (data->vbus_det_irq > 0) {
ret = devm_request_irq(dev, data->vbus_det_irq,
sun4i_usb_phy0_id_vbus_det_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/6] phy-sun4i-usb: fix missing __iomem *
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
` (2 preceding siblings ...)
2016-06-23 6:02 ` [PATCH 3/6] phy: phy-sun4i-usb: Fix optional gpios failing probe Kishon Vijay Abraham I
@ 2016-06-23 6:02 ` Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 5/6] phy: bcm-ns-usb2: checking the wrong variable Kishon Vijay Abraham I
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2016-06-23 6:02 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Ben Dooks <ben.dooks@codethink.co.uk>
Fix the missing __iomem attribute in sun4i_usb_phy_write()
function. This fixes the following sparse warnings:
drivers/phy/phy-sun4i-usb.c:178:39: warning: incorrect type in initializer (different address spaces)
drivers/phy/phy-sun4i-usb.c:178:39: expected void *phyctl
drivers/phy/phy-sun4i-usb.c:178:39: got void [noderef] <asn:2>*
drivers/phy/phy-sun4i-usb.c:185:17: warning: incorrect type in argument 2 (different address spaces)
drivers/phy/phy-sun4i-usb.c:185:17: expected void volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:185:17: got void *phyctl
drivers/phy/phy-sun4i-usb.c:189:24: warning: incorrect type in argument 1 (different address spaces)
drivers/phy/phy-sun4i-usb.c:189:24: expected void const volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:189:24: got void *phyctl
drivers/phy/phy-sun4i-usb.c:196:17: warning: incorrect type in argument 2 (different address spaces)
drivers/phy/phy-sun4i-usb.c:196:17: expected void volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:196:17: got void *phyctl
drivers/phy/phy-sun4i-usb.c:199:24: warning: incorrect type in argument 1 (different address spaces)
drivers/phy/phy-sun4i-usb.c:199:24: expected void const volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:199:24: got void *phyctl
drivers/phy/phy-sun4i-usb.c:205:17: warning: incorrect type in argument 2 (different address spaces)
drivers/phy/phy-sun4i-usb.c:205:17: expected void volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:205:17: got void *phyctl
drivers/phy/phy-sun4i-usb.c:208:24: warning: incorrect type in argument 1 (different address spaces)
drivers/phy/phy-sun4i-usb.c:208:24: expected void const volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:208:24: got void *phyctl
drivers/phy/phy-sun4i-usb.c:210:17: warning: incorrect type in argument 2 (different address spaces)
drivers/phy/phy-sun4i-usb.c:210:17: expected void volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:210:17: got void *phyctl
drivers/phy/phy-sun4i-usb.c:212:24: warning: incorrect type in argument 1 (different address spaces)
drivers/phy/phy-sun4i-usb.c:212:24: expected void const volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:212:24: got void *phyctl
drivers/phy/phy-sun4i-usb.c:214:17: warning: incorrect type in argument 2 (different address spaces)
drivers/phy/phy-sun4i-usb.c:214:17: expected void volatile [noderef] <asn:2>*addr
drivers/phy/phy-sun4i-usb.c:214:17: got void *phyctl
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-sun4i-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index 45f01d6..7390294 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -175,7 +175,7 @@ static void sun4i_usb_phy_write(struct sun4i_usb_phy *phy, u32 addr, u32 data,
{
struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy);
u32 temp, usbc_bit = BIT(phy->index * 2);
- void *phyctl = phy_data->base + phy_data->cfg->phyctl_offset;
+ void __iomem *phyctl = phy_data->base + phy_data->cfg->phyctl_offset;
int i;
mutex_lock(&phy_data->mutex);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/6] phy: bcm-ns-usb2: checking the wrong variable
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
` (3 preceding siblings ...)
2016-06-23 6:02 ` [PATCH 4/6] phy-sun4i-usb: fix missing __iomem * Kishon Vijay Abraham I
@ 2016-06-23 6:02 ` Kishon Vijay Abraham I
2016-06-23 6:02 ` [PATCH 6/6] phy-sun4i-usb: Fix irq free conditions to match request conditions Kishon Vijay Abraham I
2016-06-25 0:02 ` [GIT PULL] phy: for 4.7 -rc cycle Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2016-06-23 6:02 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Dan Carpenter <dan.carpenter@oracle.com>
We intended to test "usb2->phy" here instead of "dev".
Fixes: d3feb4067335 ('phy: bcm-ns-usb2: new driver for USB 2.0 PHY on Northstar')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-bcm-ns-usb2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/phy-bcm-ns-usb2.c b/drivers/phy/phy-bcm-ns-usb2.c
index 95ab6b2..58dff80 100644
--- a/drivers/phy/phy-bcm-ns-usb2.c
+++ b/drivers/phy/phy-bcm-ns-usb2.c
@@ -109,8 +109,8 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
}
usb2->phy = devm_phy_create(dev, NULL, &ops);
- if (IS_ERR(dev))
- return PTR_ERR(dev);
+ if (IS_ERR(usb2->phy))
+ return PTR_ERR(usb2->phy);
phy_set_drvdata(usb2->phy, usb2);
platform_set_drvdata(pdev, usb2);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/6] phy-sun4i-usb: Fix irq free conditions to match request conditions
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
` (4 preceding siblings ...)
2016-06-23 6:02 ` [PATCH 5/6] phy: bcm-ns-usb2: checking the wrong variable Kishon Vijay Abraham I
@ 2016-06-23 6:02 ` Kishon Vijay Abraham I
2016-06-25 0:02 ` [GIT PULL] phy: for 4.7 -rc cycle Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2016-06-23 6:02 UTC (permalink / raw)
To: gregkh; +Cc: kishon, linux-kernel
From: Hans de Goede <hdegoede@redhat.com>
commit 5cf700ac9d50 ("phy: phy-sun4i-usb: Fix optional gpios failing
probe")
changed the condition under which irqs are requested, but omitted matching
changes to sun4i_usb_phy_remove(). This commit fixes this.
Fixes: 5cf700ac9d50 ("phy: phy-sun4i-usb: Fix optional gpios failing probe")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/phy/phy-sun4i-usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index 7390294..de3101f 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -514,9 +514,9 @@ static int sun4i_usb_phy_remove(struct platform_device *pdev)
if (data->vbus_power_nb_registered)
power_supply_unreg_notifier(&data->vbus_power_nb);
- if (data->id_det_irq >= 0)
+ if (data->id_det_irq > 0)
devm_free_irq(dev, data->id_det_irq, data);
- if (data->vbus_det_irq >= 0)
+ if (data->vbus_det_irq > 0)
devm_free_irq(dev, data->vbus_det_irq, data);
cancel_delayed_work_sync(&data->detect);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [GIT PULL] phy: for 4.7 -rc cycle
2016-06-23 6:02 [GIT PULL] phy: for 4.7 -rc cycle Kishon Vijay Abraham I
` (5 preceding siblings ...)
2016-06-23 6:02 ` [PATCH 6/6] phy-sun4i-usb: Fix irq free conditions to match request conditions Kishon Vijay Abraham I
@ 2016-06-25 0:02 ` Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2016-06-25 0:02 UTC (permalink / raw)
To: Kishon Vijay Abraham I; +Cc: linux-kernel
On Thu, Jun 23, 2016 at 11:32:18AM +0530, Kishon Vijay Abraham I wrote:
> Hi Greg,
>
> Please find the 2nd pull request for the -rc cycle. This contains minor
> fixes in various phy drivers. I've listed the changes in the tag message.
> Consider merging it in this -rc cyle.
>
> Please let me know if I have to change something.
>
> Thanks
> Kishon
>
> The following changes since commit 31b2a32f708bb33b3f35b03ce3d2cb31f7d1e684:
>
> phy: ti-pipe3: Program the DPLL even if it was already locked (2016-06-03 12:06:41 +0530)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git tags/phy-for-4.7-rc5
Pulled and pushed out, thanks.
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread