linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Some improvements/fixes for Siano driver
@ 2013-09-12 19:59 Mauro Carvalho Chehab
  2013-09-12 19:59 ` [PATCH 1/3] [media] siano: Don't show debug messages as errors Mauro Carvalho Chehab
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2013-09-12 19:59 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

I got a few reports those days about Siano regressions/issues.

The first one was reported at:
       https://bugzilla.kernel.org/show_bug.cgi?id=60645

While its fix was already upstream, the "error" messages there doesn't
help, as it induced people to believe that it was a firmware related
error.

The second one was reported via IRC, and it is related to the first
generation of Siano devices (sms1000).

It was a regression caused on kernel 3.9, that made those devices to
fail.

It turns that, on those devices, the driver should first initialize
one USB ID and load a firmware. After firmware load, the device got
replaced by another USB ID, and the device initialization can be
done, on a diferent USB Interface.

This series fixes the second issue and improves the debug message,
in order to make easier to identify what's going wrong at the
init process.

Mauro Carvalho Chehab (3):
  [media] siano: Don't show debug messages as errors
  [media] siano: Improve debug/info messages
  [media] siano: Fix initialization for Stellar models

 drivers/media/common/siano/smscoreapi.c |  4 ++--
 drivers/media/usb/siano/smsusb.c        | 40 +++++++++++++++++++++++----------
 2 files changed, 30 insertions(+), 14 deletions(-)

-- 
1.8.3.1


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

* [PATCH 1/3] [media] siano: Don't show debug messages as errors
  2013-09-12 19:59 [PATCH 0/3] Some improvements/fixes for Siano driver Mauro Carvalho Chehab
@ 2013-09-12 19:59 ` Mauro Carvalho Chehab
  2013-09-12 23:28   ` André Roth
  2013-09-12 19:59 ` [PATCH 2/3] [media] siano: Improve debug/info messages Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2013-09-12 19:59 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

At this bugzilla and similar ones:
   https://bugzilla.kernel.org/show_bug.cgi?id=60645

Those debug messages were seen as errors, but they're just debug
data, and are OK to appear on sms1100 and sms2270. Re-tag them
to appear only if debug is enabled.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/common/siano/smscoreapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c
index a142f79..acf39ad 100644
--- a/drivers/media/common/siano/smscoreapi.c
+++ b/drivers/media/common/siano/smscoreapi.c
@@ -982,7 +982,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
 	if (rc < 0)
 		goto exit_fw_download;
 
-	sms_err("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x",
+	sms_debug("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x",
 		calc_checksum);
 	SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_VALIDITY_REQ,
 			sizeof(msg->x_msg_header) +
@@ -1562,7 +1562,7 @@ void smscore_onresponse(struct smscore_device_t *coredev,
 		{
 			struct sms_msg_data *validity = (struct sms_msg_data *) phdr;
 
-			sms_err("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x",
+			sms_debug("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x",
 				validity->msg_data[0]);
 			complete(&coredev->data_validity_done);
 			break;
-- 
1.8.3.1


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

* [PATCH 2/3] [media] siano: Improve debug/info messages
  2013-09-12 19:59 [PATCH 0/3] Some improvements/fixes for Siano driver Mauro Carvalho Chehab
  2013-09-12 19:59 ` [PATCH 1/3] [media] siano: Don't show debug messages as errors Mauro Carvalho Chehab
@ 2013-09-12 19:59 ` Mauro Carvalho Chehab
  2013-09-12 23:28   ` André Roth
  2013-09-12 20:00 ` [PATCH 3/3] [media] siano: Fix initialization for Stellar models Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2013-09-12 19:59 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

Some messages are not clear, some are debug data, but are
shown as errors, and one message is duplicated.

Cleanup that mess in order to provide a cleaner log.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/usb/siano/smsusb.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 03761c6..74236b8 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -209,8 +209,10 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size)
 	struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer;
 	int dummy;
 
-	if (dev->state != SMSUSB_ACTIVE)
+	if (dev->state != SMSUSB_ACTIVE) {
+		sms_debug("Device not active yet");
 		return -ENOENT;
+	}
 
 	sms_debug("sending %s(%d) size: %d",
 		  smscore_translate_msg(phdr->msg_type), phdr->msg_type,
@@ -445,14 +447,15 @@ static int smsusb_probe(struct usb_interface *intf,
 	char devpath[32];
 	int i, rc;
 
-	sms_info("interface number %d",
+	sms_info("board id=%lu, interface number %d",
+		 id->driver_info,
 		 intf->cur_altsetting->desc.bInterfaceNumber);
 
 	if (sms_get_board(id->driver_info)->intf_num !=
 	    intf->cur_altsetting->desc.bInterfaceNumber) {
-		sms_err("interface number is %d expecting %d",
-			sms_get_board(id->driver_info)->intf_num,
-			intf->cur_altsetting->desc.bInterfaceNumber);
+		sms_debug("interface %d won't be used. Expecting interface %d to popup",
+			intf->cur_altsetting->desc.bInterfaceNumber,
+			sms_get_board(id->driver_info)->intf_num);
 		return -ENODEV;
 	}
 
@@ -483,12 +486,11 @@ static int smsusb_probe(struct usb_interface *intf,
 	}
 	if ((udev->actconfig->desc.bNumInterfaces == 2) &&
 	    (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
-		sms_err("rom interface 0 is not used");
+		sms_debug("rom interface 0 is not used");
 		return -ENODEV;
 	}
 
 	if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
-		sms_info("stellar device was found.");
 		snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
 			 udev->bus->busnum, udev->devpath);
 		sms_info("stellar device was found.");
@@ -498,7 +500,7 @@ static int smsusb_probe(struct usb_interface *intf,
 	}
 
 	rc = smsusb_init_device(intf, id->driver_info);
-	sms_info("rc %d", rc);
+	sms_info("Device initialized with return code %d", rc);
 	sms_board_load_modules(id->driver_info);
 	return rc;
 }
-- 
1.8.3.1


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

* [PATCH 3/3] [media] siano: Fix initialization for Stellar models
  2013-09-12 19:59 [PATCH 0/3] Some improvements/fixes for Siano driver Mauro Carvalho Chehab
  2013-09-12 19:59 ` [PATCH 1/3] [media] siano: Don't show debug messages as errors Mauro Carvalho Chehab
  2013-09-12 19:59 ` [PATCH 2/3] [media] siano: Improve debug/info messages Mauro Carvalho Chehab
@ 2013-09-12 20:00 ` Mauro Carvalho Chehab
  2013-09-12 23:29   ` André Roth
  2013-09-12 23:32   ` André Roth
  2013-09-12 20:04 ` [PATCH 4/3] [media] siano: Use the default firmware for Stellar Mauro Carvalho Chehab
  2013-09-12 23:35 ` [PATCH 0/3] Some improvements/fixes for Siano driver André Roth
  4 siblings, 2 replies; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2013-09-12 20:00 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

Since kernel 3.8, the initialization for Stellar (sms1000)
devices are broken.

Those devices have a behaviour different than usual sms1100
and sms2270: they start with one USB ID (devices in cold state),
but after firmware load, they get a different USB ID.

This weren't docummented at the driver. So, the patches that added
support for sms2270 broke it.

Properly documment it, and provide a debug log that allows to
follow all phases of the device initialization:

	smsusb_probe: board id=13, interface number 0
	smsusb_probe: interface 0 won't be used. Expecting interface 1 to popup
	smsusb_probe: board id=13, interface number 1
	smsusb_probe: smsusb_probe 1
	smsusb_probe: endpoint 0 81 02 64
	smsusb_probe: endpoint 1 02 02 64
	smsusb_probe: stellar device in cold state was found at usb\4-2.
	smsusb1_load_firmware: sent 38144(38144) bytes, rc 0
	smsusb1_load_firmware: read FW dvbt_bda_stellar_usb.inp, size=38144
	smsusb_probe: stellar device now in warm state
	usbcore: registered new interface driver smsusb
	usb 4-2: USB disconnect, device number 52
	usb 4-2: new full-speed USB device number 53 using uhci_hcd
	usb 4-2: New USB device found, idVendor=187f, idProduct=0100
	usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
	usb 4-2: Product: SMS DVBT-BDA Receiver
	usb 4-2: Manufacturer: Siano Mobile Silicon
	smsusb_probe: board id=1, interface number 0
	smsusb_probe: smsusb_probe 0
	smsusb_probe: endpoint 0 81 02 64
	smsusb_probe: endpoint 1 02 02 64
	smsusb_init_device: in_ep = 81, out_ep = 02
	smscore_register_device: allocated 50 buffers
	smscore_register_device: device ffff88012a00bc00 created
	smsusb_init_device: smsusb_start_streaming(...).
	smscore_set_device_mode: set device mode to 4
	smsusb1_detectmode: 4 "SMS DVBT-BDA Receiver"
	smsusb_sendrequest: sending MSG_SMS_INIT_DEVICE_REQ(578) size: 12
	smsusb_onresponse: received MSG_SMS_INIT_DEVICE_RES(579) size: 12
	smscore_set_device_mode: Success setting device mode.
	smscore_init_ir: IR port has not been detected
	smscore_start_device: device ffff88012a00bc00 started, rc 0
	smsusb_init_device: device 0xffff88002cfa6000 created
	smsusb_probe: Device initialized with return code 0
	DVB: registering new adapter (Siano Stellar Digital Receiver)
	usb 4-2: DVB: registering adapter 0 frontend 0 (Siano Mobile Digital MDTV Receiver)...
	smscore_register_client: ffff88012174a000 693 1
	sms_board_dvb3_event: DVB3_EVENT_HOTPLUG
	smsdvb_hotplug: success
	smsdvb_module_init:

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/usb/siano/smsusb.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 74236b8..33f3575 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -491,15 +491,26 @@ static int smsusb_probe(struct usb_interface *intf,
 	}
 
 	if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
+		/* Detected a Siano Stellar uninitialized */
+
 		snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
 			 udev->bus->busnum, udev->devpath);
-		sms_info("stellar device was found.");
-		return smsusb1_load_firmware(
+		sms_info("stellar device in cold state was found at %s.", devpath);
+		rc = smsusb1_load_firmware(
 				udev, smscore_registry_getmode(devpath),
 				id->driver_info);
+
+		/* This device will reset and gain another USB ID */
+		if (!rc)
+			sms_info("stellar device now in warm state");
+		else
+			sms_err("Failed to put stellar in warm state. Error: %d", rc);
+
+		return rc;
+	} else {
+		rc = smsusb_init_device(intf, id->driver_info);
 	}
 
-	rc = smsusb_init_device(intf, id->driver_info);
 	sms_info("Device initialized with return code %d", rc);
 	sms_board_load_modules(id->driver_info);
 	return rc;
@@ -552,10 +563,13 @@ static int smsusb_resume(struct usb_interface *intf)
 }
 
 static const struct usb_device_id smsusb_id_table[] = {
+	/* This device is only present before firmware load */
 	{ USB_DEVICE(0x187f, 0x0010),
-		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
+		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR_ROM },
+	/* This device pops up after firmware load */
 	{ USB_DEVICE(0x187f, 0x0100),
 		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
+
 	{ USB_DEVICE(0x187f, 0x0200),
 		.driver_info = SMS1XXX_BOARD_SIANO_NOVA_A },
 	{ USB_DEVICE(0x187f, 0x0201),
-- 
1.8.3.1


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

* [PATCH 4/3] [media] siano: Use the default firmware for Stellar
  2013-09-12 19:59 [PATCH 0/3] Some improvements/fixes for Siano driver Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2013-09-12 20:00 ` [PATCH 3/3] [media] siano: Fix initialization for Stellar models Mauro Carvalho Chehab
@ 2013-09-12 20:04 ` Mauro Carvalho Chehab
  2013-09-12 23:33   ` André Roth
  2013-09-12 23:35 ` [PATCH 0/3] Some improvements/fixes for Siano driver André Roth
  4 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2013-09-12 20:04 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

The Stellar firmware load routine is different. Improve it to use
the default firmware, if no modprobe parameter tells otherwise.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/usb/siano/smsusb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 33f3575..05bd91a 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -245,6 +245,9 @@ static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
 	int rc, dummy;
 	char *fw_filename;
 
+	if (id < 0)
+		id = sms_get_board(board_id)->default_mode;
+
 	if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
 		sms_err("invalid firmware id specified %d", id);
 		return -EINVAL;
-- 
1.8.3.1


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

* Re: [PATCH 1/3] [media] siano: Don't show debug messages as errors
  2013-09-12 19:59 ` [PATCH 1/3] [media] siano: Don't show debug messages as errors Mauro Carvalho Chehab
@ 2013-09-12 23:28   ` André Roth
  0 siblings, 0 replies; 11+ messages in thread
From: André Roth @ 2013-09-12 23:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Thu, 12 Sep 2013 16:59:58 -0300
Mauro Carvalho Chehab <m.chehab@samsung.com> wrote:

Tested-by: André Roth <neolynx@gmail.com>

> At this bugzilla and similar ones:
>    https://bugzilla.kernel.org/show_bug.cgi?id=60645
> 
> Those debug messages were seen as errors, but they're just debug
> data, and are OK to appear on sms1100 and sms2270. Re-tag them
> to appear only if debug is enabled.
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>  drivers/media/common/siano/smscoreapi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c
> index a142f79..acf39ad 100644
> --- a/drivers/media/common/siano/smscoreapi.c
> +++ b/drivers/media/common/siano/smscoreapi.c
> @@ -982,7 +982,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
>  	if (rc < 0)
>  		goto exit_fw_download;
>  
> -	sms_err("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x",
> +	sms_debug("sending MSG_SMS_DATA_VALIDITY_REQ expecting 0x%x",
>  		calc_checksum);
>  	SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_DATA_VALIDITY_REQ,
>  			sizeof(msg->x_msg_header) +
> @@ -1562,7 +1562,7 @@ void smscore_onresponse(struct smscore_device_t *coredev,
>  		{
>  			struct sms_msg_data *validity = (struct sms_msg_data *) phdr;
>  
> -			sms_err("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x",
> +			sms_debug("MSG_SMS_DATA_VALIDITY_RES, checksum = 0x%x",
>  				validity->msg_data[0]);
>  			complete(&coredev->data_validity_done);
>  			break;

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

* Re: [PATCH 2/3] [media] siano: Improve debug/info messages
  2013-09-12 19:59 ` [PATCH 2/3] [media] siano: Improve debug/info messages Mauro Carvalho Chehab
@ 2013-09-12 23:28   ` André Roth
  0 siblings, 0 replies; 11+ messages in thread
From: André Roth @ 2013-09-12 23:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Thu, 12 Sep 2013 16:59:59 -0300
Mauro Carvalho Chehab <m.chehab@samsung.com> wrote:

Tested-by: André Roth <neolynx@gmail.com>


> Some messages are not clear, some are debug data, but are
> shown as errors, and one message is duplicated.
> 
> Cleanup that mess in order to provide a cleaner log.
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>  drivers/media/usb/siano/smsusb.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
> index 03761c6..74236b8 100644
> --- a/drivers/media/usb/siano/smsusb.c
> +++ b/drivers/media/usb/siano/smsusb.c
> @@ -209,8 +209,10 @@ static int smsusb_sendrequest(void *context, void *buffer, size_t size)
>  	struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer;
>  	int dummy;
>  
> -	if (dev->state != SMSUSB_ACTIVE)
> +	if (dev->state != SMSUSB_ACTIVE) {
> +		sms_debug("Device not active yet");
>  		return -ENOENT;
> +	}
>  
>  	sms_debug("sending %s(%d) size: %d",
>  		  smscore_translate_msg(phdr->msg_type), phdr->msg_type,
> @@ -445,14 +447,15 @@ static int smsusb_probe(struct usb_interface *intf,
>  	char devpath[32];
>  	int i, rc;
>  
> -	sms_info("interface number %d",
> +	sms_info("board id=%lu, interface number %d",
> +		 id->driver_info,
>  		 intf->cur_altsetting->desc.bInterfaceNumber);
>  
>  	if (sms_get_board(id->driver_info)->intf_num !=
>  	    intf->cur_altsetting->desc.bInterfaceNumber) {
> -		sms_err("interface number is %d expecting %d",
> -			sms_get_board(id->driver_info)->intf_num,
> -			intf->cur_altsetting->desc.bInterfaceNumber);
> +		sms_debug("interface %d won't be used. Expecting interface %d to popup",
> +			intf->cur_altsetting->desc.bInterfaceNumber,
> +			sms_get_board(id->driver_info)->intf_num);
>  		return -ENODEV;
>  	}
>  
> @@ -483,12 +486,11 @@ static int smsusb_probe(struct usb_interface *intf,
>  	}
>  	if ((udev->actconfig->desc.bNumInterfaces == 2) &&
>  	    (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
> -		sms_err("rom interface 0 is not used");
> +		sms_debug("rom interface 0 is not used");
>  		return -ENODEV;
>  	}
>  
>  	if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
> -		sms_info("stellar device was found.");
>  		snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
>  			 udev->bus->busnum, udev->devpath);
>  		sms_info("stellar device was found.");
> @@ -498,7 +500,7 @@ static int smsusb_probe(struct usb_interface *intf,
>  	}
>  
>  	rc = smsusb_init_device(intf, id->driver_info);
> -	sms_info("rc %d", rc);
> +	sms_info("Device initialized with return code %d", rc);
>  	sms_board_load_modules(id->driver_info);
>  	return rc;
>  }

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

* Re: [PATCH 3/3] [media] siano: Fix initialization for Stellar models
  2013-09-12 20:00 ` [PATCH 3/3] [media] siano: Fix initialization for Stellar models Mauro Carvalho Chehab
@ 2013-09-12 23:29   ` André Roth
  2013-09-12 23:32   ` André Roth
  1 sibling, 0 replies; 11+ messages in thread
From: André Roth @ 2013-09-12 23:29 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Thu, 12 Sep 2013 17:00:00 -0300
Mauro Carvalho Chehab <m.chehab@samsung.com> wrote:

Tested-by: André Roth <neolynx@gmail.com>


> Since kernel 3.8, the initialization for Stellar (sms1000)
> devices are broken.
> 
> Those devices have a behaviour different than usual sms1100
> and sms2270: they start with one USB ID (devices in cold state),
> but after firmware load, they get a different USB ID.
> 
> This weren't docummented at the driver. So, the patches that added
> support for sms2270 broke it.
> 
> Properly documment it, and provide a debug log that allows to
> follow all phases of the device initialization:
> 
> 	smsusb_probe: board id=13, interface number 0
> 	smsusb_probe: interface 0 won't be used. Expecting interface 1 to popup
> 	smsusb_probe: board id=13, interface number 1
> 	smsusb_probe: smsusb_probe 1
> 	smsusb_probe: endpoint 0 81 02 64
> 	smsusb_probe: endpoint 1 02 02 64
> 	smsusb_probe: stellar device in cold state was found at usb\4-2.
> 	smsusb1_load_firmware: sent 38144(38144) bytes, rc 0
> 	smsusb1_load_firmware: read FW dvbt_bda_stellar_usb.inp, size=38144
> 	smsusb_probe: stellar device now in warm state
> 	usbcore: registered new interface driver smsusb
> 	usb 4-2: USB disconnect, device number 52
> 	usb 4-2: new full-speed USB device number 53 using uhci_hcd
> 	usb 4-2: New USB device found, idVendor=187f, idProduct=0100
> 	usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> 	usb 4-2: Product: SMS DVBT-BDA Receiver
> 	usb 4-2: Manufacturer: Siano Mobile Silicon
> 	smsusb_probe: board id=1, interface number 0
> 	smsusb_probe: smsusb_probe 0
> 	smsusb_probe: endpoint 0 81 02 64
> 	smsusb_probe: endpoint 1 02 02 64
> 	smsusb_init_device: in_ep = 81, out_ep = 02
> 	smscore_register_device: allocated 50 buffers
> 	smscore_register_device: device ffff88012a00bc00 created
> 	smsusb_init_device: smsusb_start_streaming(...).
> 	smscore_set_device_mode: set device mode to 4
> 	smsusb1_detectmode: 4 "SMS DVBT-BDA Receiver"
> 	smsusb_sendrequest: sending MSG_SMS_INIT_DEVICE_REQ(578) size: 12
> 	smsusb_onresponse: received MSG_SMS_INIT_DEVICE_RES(579) size: 12
> 	smscore_set_device_mode: Success setting device mode.
> 	smscore_init_ir: IR port has not been detected
> 	smscore_start_device: device ffff88012a00bc00 started, rc 0
> 	smsusb_init_device: device 0xffff88002cfa6000 created
> 	smsusb_probe: Device initialized with return code 0
> 	DVB: registering new adapter (Siano Stellar Digital Receiver)
> 	usb 4-2: DVB: registering adapter 0 frontend 0 (Siano Mobile Digital MDTV Receiver)...
> 	smscore_register_client: ffff88012174a000 693 1
> 	sms_board_dvb3_event: DVB3_EVENT_HOTPLUG
> 	smsdvb_hotplug: success
> 	smsdvb_module_init:
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>  drivers/media/usb/siano/smsusb.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
> index 74236b8..33f3575 100644
> --- a/drivers/media/usb/siano/smsusb.c
> +++ b/drivers/media/usb/siano/smsusb.c
> @@ -491,15 +491,26 @@ static int smsusb_probe(struct usb_interface *intf,
>  	}
>  
>  	if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
> +		/* Detected a Siano Stellar uninitialized */
> +
>  		snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
>  			 udev->bus->busnum, udev->devpath);
> -		sms_info("stellar device was found.");
> -		return smsusb1_load_firmware(
> +		sms_info("stellar device in cold state was found at %s.", devpath);
> +		rc = smsusb1_load_firmware(
>  				udev, smscore_registry_getmode(devpath),
>  				id->driver_info);
> +
> +		/* This device will reset and gain another USB ID */
> +		if (!rc)
> +			sms_info("stellar device now in warm state");
> +		else
> +			sms_err("Failed to put stellar in warm state. Error: %d", rc);
> +
> +		return rc;
> +	} else {
> +		rc = smsusb_init_device(intf, id->driver_info);
>  	}
>  
> -	rc = smsusb_init_device(intf, id->driver_info);
>  	sms_info("Device initialized with return code %d", rc);
>  	sms_board_load_modules(id->driver_info);
>  	return rc;
> @@ -552,10 +563,13 @@ static int smsusb_resume(struct usb_interface *intf)
>  }
>  
>  static const struct usb_device_id smsusb_id_table[] = {
> +	/* This device is only present before firmware load */
>  	{ USB_DEVICE(0x187f, 0x0010),
> -		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
> +		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR_ROM },
> +	/* This device pops up after firmware load */
>  	{ USB_DEVICE(0x187f, 0x0100),
>  		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
> +
>  	{ USB_DEVICE(0x187f, 0x0200),
>  		.driver_info = SMS1XXX_BOARD_SIANO_NOVA_A },
>  	{ USB_DEVICE(0x187f, 0x0201),

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

* Re: [PATCH 3/3] [media] siano: Fix initialization for Stellar models
  2013-09-12 20:00 ` [PATCH 3/3] [media] siano: Fix initialization for Stellar models Mauro Carvalho Chehab
  2013-09-12 23:29   ` André Roth
@ 2013-09-12 23:32   ` André Roth
  1 sibling, 0 replies; 11+ messages in thread
From: André Roth @ 2013-09-12 23:32 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Thu, 12 Sep 2013 17:00:00 -0300
Mauro Carvalho Chehab <m.chehab@samsung.com> wrote:

Tested-by: André Roth <neolynx@gmail.com>


> Since kernel 3.8, the initialization for Stellar (sms1000)
> devices are broken.
> 
> Those devices have a behaviour different than usual sms1100
> and sms2270: they start with one USB ID (devices in cold state),
> but after firmware load, they get a different USB ID.
> 
> This weren't docummented at the driver. So, the patches that added
> support for sms2270 broke it.
> 
> Properly documment it, and provide a debug log that allows to
> follow all phases of the device initialization:
> 
> 	smsusb_probe: board id=13, interface number 0
> 	smsusb_probe: interface 0 won't be used. Expecting interface 1 to popup
> 	smsusb_probe: board id=13, interface number 1
> 	smsusb_probe: smsusb_probe 1
> 	smsusb_probe: endpoint 0 81 02 64
> 	smsusb_probe: endpoint 1 02 02 64
> 	smsusb_probe: stellar device in cold state was found at usb\4-2.
> 	smsusb1_load_firmware: sent 38144(38144) bytes, rc 0
> 	smsusb1_load_firmware: read FW dvbt_bda_stellar_usb.inp, size=38144
> 	smsusb_probe: stellar device now in warm state
> 	usbcore: registered new interface driver smsusb
> 	usb 4-2: USB disconnect, device number 52
> 	usb 4-2: new full-speed USB device number 53 using uhci_hcd
> 	usb 4-2: New USB device found, idVendor=187f, idProduct=0100
> 	usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> 	usb 4-2: Product: SMS DVBT-BDA Receiver
> 	usb 4-2: Manufacturer: Siano Mobile Silicon
> 	smsusb_probe: board id=1, interface number 0
> 	smsusb_probe: smsusb_probe 0
> 	smsusb_probe: endpoint 0 81 02 64
> 	smsusb_probe: endpoint 1 02 02 64
> 	smsusb_init_device: in_ep = 81, out_ep = 02
> 	smscore_register_device: allocated 50 buffers
> 	smscore_register_device: device ffff88012a00bc00 created
> 	smsusb_init_device: smsusb_start_streaming(...).
> 	smscore_set_device_mode: set device mode to 4
> 	smsusb1_detectmode: 4 "SMS DVBT-BDA Receiver"
> 	smsusb_sendrequest: sending MSG_SMS_INIT_DEVICE_REQ(578) size: 12
> 	smsusb_onresponse: received MSG_SMS_INIT_DEVICE_RES(579) size: 12
> 	smscore_set_device_mode: Success setting device mode.
> 	smscore_init_ir: IR port has not been detected
> 	smscore_start_device: device ffff88012a00bc00 started, rc 0
> 	smsusb_init_device: device 0xffff88002cfa6000 created
> 	smsusb_probe: Device initialized with return code 0
> 	DVB: registering new adapter (Siano Stellar Digital Receiver)
> 	usb 4-2: DVB: registering adapter 0 frontend 0 (Siano Mobile Digital MDTV Receiver)...
> 	smscore_register_client: ffff88012174a000 693 1
> 	sms_board_dvb3_event: DVB3_EVENT_HOTPLUG
> 	smsdvb_hotplug: success
> 	smsdvb_module_init:
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>  drivers/media/usb/siano/smsusb.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
> index 74236b8..33f3575 100644
> --- a/drivers/media/usb/siano/smsusb.c
> +++ b/drivers/media/usb/siano/smsusb.c
> @@ -491,15 +491,26 @@ static int smsusb_probe(struct usb_interface *intf,
>  	}
>  
>  	if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
> +		/* Detected a Siano Stellar uninitialized */
> +
>  		snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
>  			 udev->bus->busnum, udev->devpath);
> -		sms_info("stellar device was found.");
> -		return smsusb1_load_firmware(
> +		sms_info("stellar device in cold state was found at %s.", devpath);
> +		rc = smsusb1_load_firmware(
>  				udev, smscore_registry_getmode(devpath),
>  				id->driver_info);
> +
> +		/* This device will reset and gain another USB ID */
> +		if (!rc)
> +			sms_info("stellar device now in warm state");
> +		else
> +			sms_err("Failed to put stellar in warm state. Error: %d", rc);
> +
> +		return rc;
> +	} else {
> +		rc = smsusb_init_device(intf, id->driver_info);
>  	}
>  
> -	rc = smsusb_init_device(intf, id->driver_info);
>  	sms_info("Device initialized with return code %d", rc);
>  	sms_board_load_modules(id->driver_info);
>  	return rc;
> @@ -552,10 +563,13 @@ static int smsusb_resume(struct usb_interface *intf)
>  }
>  
>  static const struct usb_device_id smsusb_id_table[] = {
> +	/* This device is only present before firmware load */
>  	{ USB_DEVICE(0x187f, 0x0010),
> -		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
> +		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR_ROM },
> +	/* This device pops up after firmware load */
>  	{ USB_DEVICE(0x187f, 0x0100),
>  		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
> +
>  	{ USB_DEVICE(0x187f, 0x0200),
>  		.driver_info = SMS1XXX_BOARD_SIANO_NOVA_A },
>  	{ USB_DEVICE(0x187f, 0x0201),

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

* Re: [PATCH 4/3] [media] siano: Use the default firmware for Stellar
  2013-09-12 20:04 ` [PATCH 4/3] [media] siano: Use the default firmware for Stellar Mauro Carvalho Chehab
@ 2013-09-12 23:33   ` André Roth
  0 siblings, 0 replies; 11+ messages in thread
From: André Roth @ 2013-09-12 23:33 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Thu, 12 Sep 2013 17:04:07 -0300
Mauro Carvalho Chehab <m.chehab@samsung.com> wrote:

Tested-by: André Roth <neolynx@gmail.com>


> The Stellar firmware load routine is different. Improve it to use
> the default firmware, if no modprobe parameter tells otherwise.
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>  drivers/media/usb/siano/smsusb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
> index 33f3575..05bd91a 100644
> --- a/drivers/media/usb/siano/smsusb.c
> +++ b/drivers/media/usb/siano/smsusb.c
> @@ -245,6 +245,9 @@ static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
>  	int rc, dummy;
>  	char *fw_filename;
>  
> +	if (id < 0)
> +		id = sms_get_board(board_id)->default_mode;
> +
>  	if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
>  		sms_err("invalid firmware id specified %d", id);
>  		return -EINVAL;

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

* Re: [PATCH 0/3] Some improvements/fixes for Siano driver
  2013-09-12 19:59 [PATCH 0/3] Some improvements/fixes for Siano driver Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2013-09-12 20:04 ` [PATCH 4/3] [media] siano: Use the default firmware for Stellar Mauro Carvalho Chehab
@ 2013-09-12 23:35 ` André Roth
  4 siblings, 0 replies; 11+ messages in thread
From: André Roth @ 2013-09-12 23:35 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Thu, 12 Sep 2013 16:59:57 -0300
Mauro Carvalho Chehab <m.chehab@samsung.com> wrote:

Tested-by: André Roth <neolynx@gmail.com>


> I got a few reports those days about Siano regressions/issues.
> 
> The first one was reported at:
>        https://bugzilla.kernel.org/show_bug.cgi?id=60645
> 
> While its fix was already upstream, the "error" messages there doesn't
> help, as it induced people to believe that it was a firmware related
> error.
> 
> The second one was reported via IRC, and it is related to the first
> generation of Siano devices (sms1000).
> 
> It was a regression caused on kernel 3.9, that made those devices to
> fail.
> 
> It turns that, on those devices, the driver should first initialize
> one USB ID and load a firmware. After firmware load, the device got
> replaced by another USB ID, and the device initialization can be
> done, on a diferent USB Interface.
> 
> This series fixes the second issue and improves the debug message,
> in order to make easier to identify what's going wrong at the
> init process.
> 
> Mauro Carvalho Chehab (3):
>   [media] siano: Don't show debug messages as errors
>   [media] siano: Improve debug/info messages
>   [media] siano: Fix initialization for Stellar models
> 
>  drivers/media/common/siano/smscoreapi.c |  4 ++--
>  drivers/media/usb/siano/smsusb.c        | 40 +++++++++++++++++++++++----------
>  2 files changed, 30 insertions(+), 14 deletions(-)
> 

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

end of thread, other threads:[~2013-09-12 23:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-12 19:59 [PATCH 0/3] Some improvements/fixes for Siano driver Mauro Carvalho Chehab
2013-09-12 19:59 ` [PATCH 1/3] [media] siano: Don't show debug messages as errors Mauro Carvalho Chehab
2013-09-12 23:28   ` André Roth
2013-09-12 19:59 ` [PATCH 2/3] [media] siano: Improve debug/info messages Mauro Carvalho Chehab
2013-09-12 23:28   ` André Roth
2013-09-12 20:00 ` [PATCH 3/3] [media] siano: Fix initialization for Stellar models Mauro Carvalho Chehab
2013-09-12 23:29   ` André Roth
2013-09-12 23:32   ` André Roth
2013-09-12 20:04 ` [PATCH 4/3] [media] siano: Use the default firmware for Stellar Mauro Carvalho Chehab
2013-09-12 23:33   ` André Roth
2013-09-12 23:35 ` [PATCH 0/3] Some improvements/fixes for Siano driver André Roth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).