public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.7 023/108] net: usb: ax88179_178a: avoid two consecutive device resets
       [not found] <20240116194225.250921-1-sashal@kernel.org>
@ 2024-01-16 19:38 ` Sasha Levin
  2024-01-16 19:39 ` [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices Sasha Levin
  1 sibling, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2024-01-16 19:38 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jose Ignacio Tornos Martinez, Herb Wei, Jakub Kicinski,
	Sasha Levin, davem, edumazet, pabeni, gregkh, stern, linux-usb,
	netdev

From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>

[ Upstream commit d2689b6a86b9d23574bd4b654bf770b6034e2c7e ]

The device is always reset two consecutive times (ax88179_reset is called
twice), one from usbnet_probe during the device binding and the other from
usbnet_open.

Remove the non-necessary reset during the device binding and let the reset
operation from open to keep the normal behavior (tested with generic ASIX
Electronics Corp. AX88179 Gigabit Ethernet device).

Reported-by: Herb Wei <weihao.bj@ieisystem.com>
Tested-by: Herb Wei <weihao.bj@ieisystem.com>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Link: https://lore.kernel.org/r/20231120121239.54504-1-jtornosm@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/ax88179_178a.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 5a1bf42ce156..d837c1887416 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1315,8 +1315,6 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
 
 	netif_set_tso_max_size(dev->net, 16384);
 
-	ax88179_reset(dev);
-
 	return 0;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
       [not found] <20240116194225.250921-1-sashal@kernel.org>
  2024-01-16 19:38 ` [PATCH AUTOSEL 6.7 023/108] net: usb: ax88179_178a: avoid two consecutive device resets Sasha Levin
@ 2024-01-16 19:39 ` Sasha Levin
  2024-01-17  8:04   ` Johan Hovold
  1 sibling, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2024-01-16 19:39 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dmitry Baryshkov, Heikki Krogerus, Neil Armstrong,
	Bjorn Andersson, Sasha Levin, gregkh, hdegoede, fabrice.gasnier,
	quic_jackp, saranya.gopal, quic_linyyuan, andriy.shevchenko,
	minhuadotchen, johan+linaro, robh, linux-usb

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit 1d103d6af241dbfc7e11eb9a46dff65db257a37f ]

On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no
easy way to recover from it. Since we have no easy way to determine
whether the partner really has PD support, shortcut UCSI_GET_PDOS on
such platforms. This allows us to enable UCSI support on such devices.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231025115620.905538-2-dmitry.baryshkov@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/typec/ucsi/ucsi.c       |  3 +++
 drivers/usb/typec/ucsi/ucsi.h       |  3 +++
 drivers/usb/typec/ucsi/ucsi_glink.c | 13 +++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 61b64558f96c..5392ec698959 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -578,6 +578,9 @@ static int ucsi_read_pdos(struct ucsi_connector *con,
 	u64 command;
 	int ret;
 
+	if (ucsi->quirks & UCSI_NO_PARTNER_PDOS)
+		return 0;
+
 	command = UCSI_COMMAND(UCSI_GET_PDOS) | UCSI_CONNECTOR_NUMBER(con->num);
 	command |= UCSI_GET_PDOS_PARTNER_PDO(is_partner);
 	command |= UCSI_GET_PDOS_PDO_OFFSET(offset);
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 474315a72c77..6478016d5cb8 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -317,6 +317,9 @@ struct ucsi {
 #define EVENT_PENDING	0
 #define COMMAND_PENDING	1
 #define ACK_PENDING	2
+
+	unsigned long quirks;
+#define UCSI_NO_PARTNER_PDOS	BIT(0)	/* Don't read partner's PDOs */
 };
 
 #define UCSI_MAX_SVID		5
diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
index 4853141cd10c..53a7ede8556d 100644
--- a/drivers/usb/typec/ucsi/ucsi_glink.c
+++ b/drivers/usb/typec/ucsi/ucsi_glink.c
@@ -6,6 +6,7 @@
 #include <linux/auxiliary_bus.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
+#include <linux/of_device.h>
 #include <linux/property.h>
 #include <linux/soc/qcom/pdr.h>
 #include <linux/usb/typec_mux.h>
@@ -296,11 +297,19 @@ static void pmic_glink_ucsi_destroy(void *data)
 	mutex_unlock(&ucsi->lock);
 }
 
+static const struct of_device_id pmic_glink_ucsi_of_quirks[] = {
+	{ .compatible = "qcom,sc8180x-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, },
+	{ .compatible = "qcom,sc8280xp-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, },
+	{ .compatible = "qcom,sm8350-pmic-glink", .data = (void *)UCSI_NO_PARTNER_PDOS, },
+	{}
+};
+
 static int pmic_glink_ucsi_probe(struct auxiliary_device *adev,
 				 const struct auxiliary_device_id *id)
 {
 	struct pmic_glink_ucsi *ucsi;
 	struct device *dev = &adev->dev;
+	const struct of_device_id *match;
 	struct fwnode_handle *fwnode;
 	int ret;
 
@@ -327,6 +336,10 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev,
 	if (ret)
 		return ret;
 
+	match = of_match_device(pmic_glink_ucsi_of_quirks, dev->parent);
+	if (match)
+		ucsi->ucsi->quirks = (unsigned long)match->data;
+
 	ucsi_set_drvdata(ucsi->ucsi, ucsi);
 
 	device_for_each_child_node(dev, fwnode) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
  2024-01-16 19:39 ` [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices Sasha Levin
@ 2024-01-17  8:04   ` Johan Hovold
  2024-01-17 12:17     ` Dmitry Baryshkov
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hovold @ 2024-01-17  8:04 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Dmitry Baryshkov, Heikki Krogerus,
	Neil Armstrong, Bjorn Andersson, gregkh, hdegoede,
	fabrice.gasnier, quic_jackp, saranya.gopal, quic_linyyuan,
	andriy.shevchenko, minhuadotchen, johan+linaro, robh, linux-usb

On Tue, Jan 16, 2024 at 02:39:10PM -0500, Sasha Levin wrote:
> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
> [ Upstream commit 1d103d6af241dbfc7e11eb9a46dff65db257a37f ]
> 
> On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
> UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no
> easy way to recover from it. Since we have no easy way to determine
> whether the partner really has PD support, shortcut UCSI_GET_PDOS on
> such platforms. This allows us to enable UCSI support on such devices.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> Link: https://lore.kernel.org/r/20231025115620.905538-2-dmitry.baryshkov@linaro.org
> Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>

Correct me if I'm wrong Dmitry, but while the commit message makes this
sound like a fix, it is not needed unless you backport follow-on patches
that enable UCSI on these platforms.

So this one can be dropped from all stable queues (unless you're
backporting patches that enable new features and that depend on this
one).

Johan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
  2024-01-17  8:04   ` Johan Hovold
@ 2024-01-17 12:17     ` Dmitry Baryshkov
  2024-01-17 12:51       ` Johan Hovold
  2024-01-17 16:04       ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2024-01-17 12:17 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Sasha Levin, linux-kernel, stable, Heikki Krogerus,
	Neil Armstrong, Bjorn Andersson, gregkh, hdegoede,
	fabrice.gasnier, quic_jackp, saranya.gopal, quic_linyyuan,
	andriy.shevchenko, minhuadotchen, johan+linaro, robh, linux-usb

On Wed, 17 Jan 2024 at 10:03, Johan Hovold <johan@kernel.org> wrote:
>
> On Tue, Jan 16, 2024 at 02:39:10PM -0500, Sasha Levin wrote:
> > From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >
> > [ Upstream commit 1d103d6af241dbfc7e11eb9a46dff65db257a37f ]
> >
> > On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
> > UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no
> > easy way to recover from it. Since we have no easy way to determine
> > whether the partner really has PD support, shortcut UCSI_GET_PDOS on
> > such platforms. This allows us to enable UCSI support on such devices.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > Link: https://lore.kernel.org/r/20231025115620.905538-2-dmitry.baryshkov@linaro.org
> > Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
>
> Correct me if I'm wrong Dmitry, but while the commit message makes this
> sound like a fix, it is not needed unless you backport follow-on patches
> that enable UCSI on these platforms.
>
> So this one can be dropped from all stable queues (unless you're
> backporting patches that enable new features and that depend on this
> one).

Exactly. It didn't have the Fixes: tag. So I'm completely unsure why
it ended up in the autosel queue at all.

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
  2024-01-17 12:17     ` Dmitry Baryshkov
@ 2024-01-17 12:51       ` Johan Hovold
  2024-01-17 16:04       ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Johan Hovold @ 2024-01-17 12:51 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Sasha Levin, linux-kernel, stable, Heikki Krogerus,
	Neil Armstrong, Bjorn Andersson, gregkh, hdegoede,
	fabrice.gasnier, quic_jackp, saranya.gopal, quic_linyyuan,
	andriy.shevchenko, minhuadotchen, johan+linaro, robh, linux-usb

On Wed, Jan 17, 2024 at 02:17:40PM +0200, Dmitry Baryshkov wrote:
> On Wed, 17 Jan 2024 at 10:03, Johan Hovold <johan@kernel.org> wrote:
> >
> > On Tue, Jan 16, 2024 at 02:39:10PM -0500, Sasha Levin wrote:
> > > From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > >
> > > [ Upstream commit 1d103d6af241dbfc7e11eb9a46dff65db257a37f ]
> > >
> > > On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
> > > UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no
> > > easy way to recover from it. Since we have no easy way to determine
> > > whether the partner really has PD support, shortcut UCSI_GET_PDOS on
> > > such platforms. This allows us to enable UCSI support on such devices.

> > Correct me if I'm wrong Dmitry, but while the commit message makes this
> > sound like a fix, it is not needed unless you backport follow-on patches
> > that enable UCSI on these platforms.
> >
> > So this one can be dropped from all stable queues (unless you're
> > backporting patches that enable new features and that depend on this
> > one).
> 
> Exactly. It didn't have the Fixes: tag. So I'm completely unsure why
> it ended up in the autosel queue at all.

AUTOSEL is Sasha's machine-learning based tool for picking potential
fixes also among commits that lack a Fixes tag.

Johan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
  2024-01-17 12:17     ` Dmitry Baryshkov
  2024-01-17 12:51       ` Johan Hovold
@ 2024-01-17 16:04       ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2024-01-17 16:04 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Johan Hovold, Sasha Levin, linux-kernel, stable, Heikki Krogerus,
	Neil Armstrong, Bjorn Andersson, hdegoede, fabrice.gasnier,
	quic_jackp, saranya.gopal, quic_linyyuan, andriy.shevchenko,
	minhuadotchen, johan+linaro, robh, linux-usb

On Wed, Jan 17, 2024 at 02:17:40PM +0200, Dmitry Baryshkov wrote:
> On Wed, 17 Jan 2024 at 10:03, Johan Hovold <johan@kernel.org> wrote:
> >
> > On Tue, Jan 16, 2024 at 02:39:10PM -0500, Sasha Levin wrote:
> > > From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > >
> > > [ Upstream commit 1d103d6af241dbfc7e11eb9a46dff65db257a37f ]
> > >
> > > On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
> > > UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no
> > > easy way to recover from it. Since we have no easy way to determine
> > > whether the partner really has PD support, shortcut UCSI_GET_PDOS on
> > > such platforms. This allows us to enable UCSI support on such devices.
> > >
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > > Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> > > Link: https://lore.kernel.org/r/20231025115620.905538-2-dmitry.baryshkov@linaro.org
> > > Signed-off-by: Bjorn Andersson <andersson@kernel.org>
> > > Signed-off-by: Sasha Levin <sashal@kernel.org>
> >
> > Correct me if I'm wrong Dmitry, but while the commit message makes this
> > sound like a fix, it is not needed unless you backport follow-on patches
> > that enable UCSI on these platforms.
> >
> > So this one can be dropped from all stable queues (unless you're
> > backporting patches that enable new features and that depend on this
> > one).
> 
> Exactly. It didn't have the Fixes: tag. So I'm completely unsure why
> it ended up in the autosel queue at all.

Based on the text in the subject and in the changelog, it sure looks
like a bugfix to me!  Perhaps don't write changelogs that say "fix
SOMETHING on SOMETHING" next time if they really are not a fix :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-17 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240116194225.250921-1-sashal@kernel.org>
2024-01-16 19:38 ` [PATCH AUTOSEL 6.7 023/108] net: usb: ax88179_178a: avoid two consecutive device resets Sasha Levin
2024-01-16 19:39 ` [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices Sasha Levin
2024-01-17  8:04   ` Johan Hovold
2024-01-17 12:17     ` Dmitry Baryshkov
2024-01-17 12:51       ` Johan Hovold
2024-01-17 16:04       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox