Skip to contentSkip to conversation

Add modules for realtek USB card reader

PATCH Superseded [email protected] 5 participants 16 messages Mar 25, 2014 – Apr 8, 2014 1 message not in the archive

Subsystems (3)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover Add modules for realtek USB card reader

From: Roger Tseng <[email protected]>

This patchset adds modules to support Realtek USB vendor specific class flash card reader: one base module in MFD subsystem and two host modules in both mmc and memstick subsystems. The architecture is similar to rtsx_pci.

This work is done primarily to replace the staging driver: staging/rts5139, which doesn't utilize mmc nor memstick subsystems. Once the patchset or its revision is applied, we may need Greg's help to remove the staging one.

v2:
1. Fix potential buffer overflow in rtsx_usb_seq_write_register()
2. Remove unnecessary casting and messages
3. Revise coding style and white spaces

v3:
1. Fix MMC detection fail when under xhci
2. Minor change of pm_runtime behavior in rtsx_usb_ms to prevent some rare freeze due to erroneous Memstick card(not MS-Pro)
3. Further revise coding style as suggested in the thread of v2
4. Using managed resources: devm_*
5. Change license from "GPL v2 and later" to "GPL v2"

v4:
1. Remove invocations to deprecated/removed mmc_suspend|resume_host APIs and unnecessary platform device pm routines
2. Support CRC-ignored R1 response for CMD13 in response to commit:
a27fbf2f067b0cd6f172c8b696b9a44c58bfaa7a: mmc: add ignorance case for CMD13 CRC error
3. Remove unnecessary #ifdef CONFIG_PM_RUNTIME

v5:
1. rtsx_usb_ms.c: adding header inclusion, removing unnecessary NULL checking, and add cancel_work_sync in removal handler to wait possible pending works.
(Changes only rtsx_usb_ms. Other files remain the same to v4)

Roger Tseng (3):
mfd: Add realtek USB card reader driver
mmc: Add realtek USB sdmmc host driver
memstick: Add realtek USB memstick host driver

 drivers/memstick/host/Kconfig       |   10 +
 drivers/memstick/host/Makefile      |    1 +
 drivers/memstick/host/rtsx_usb_ms.c |  839 ++++++++++++++++++++
 drivers/mfd/Kconfig                 |   10 +
 drivers/mfd/Makefile                |    1 +
 drivers/mfd/rtsx_usb.c              |  760 ++++++++++++++++++
 drivers/mmc/host/Kconfig            |    7 +
 drivers/mmc/host/Makefile           |    1 +
 drivers/mmc/host/rtsx_usb_sdmmc.c   | 1462 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/rtsx_usb.h        |  628 +++++++++++++++
 10 files changed, 3719 insertions(+)
 create mode 100644 drivers/memstick/host/rtsx_usb_ms.c
 create mode 100644 drivers/mfd/rtsx_usb.c
 create mode 100644 drivers/mmc/host/rtsx_usb_sdmmc.c
 create mode 100644 include/linux/mfd/rtsx_usb.h
Signature · 1 line
1.8.2
#1 lore raw

PATCH v5 1/3 mfd: Add realtek USB card reader driver

From: Roger Tseng <[email protected]>

Realtek USB card reader provides a channel to transfer command or data to flash memory cards. This driver exports host instances for mmc and memstick subsystems and handles basic works.

---
 drivers/mfd/Kconfig          |  10 +
 drivers/mfd/Makefile         |   1 +
 drivers/mfd/rtsx_usb.c       | 760 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/rtsx_usb.h | 628 +++++++++++++++++++++++++++++++++++
 4 files changed, 1399 insertions(+)
 create mode 100644 drivers/mfd/rtsx_usb.c
 create mode 100644 include/linux/mfd/rtsx_usb.h
drivers/mfd/Kconfig +10 -0
index b7c74a7..fabad24 100644
@@ -507,6 +507,16 @@ config MFD_RTSX_PCI
 	  types of memory cards, such as Memory Stick, Memory Stick Pro,
 	  Secure Digital and MultiMediaCard.
 
+config MFD_RTSX_USB
+	tristate "Realtek USB card reader"
+	depends on USB
+	select MFD_CORE
+	help
+	  Select this option to get support for Realtek USB 2.0 card readers
+	  including RTS5129, RTS5139, RTS5179 and RTS5170.
+	  Realtek card reader supports access to many types of memory cards,
+	  such as Memory Stick Pro, Secure Digital and MultiMediaCard.
+
 config MFD_RC5T583
 	bool "Ricoh RC5T583 Power Management system device"
 	depends on I2C=y
drivers/mfd/Makefile +1 -0
index 8a28dc9..33b8de6 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_MFD_CROS_EC_SPI)	+= cros_ec_spi.o
 
 rtsx_pci-objs			:= rtsx_pcr.o rts5209.o rts5229.o rtl8411.o rts5227.o rts5249.o
 obj-$(CONFIG_MFD_RTSX_PCI)	+= rtsx_pci.o
+obj-$(CONFIG_MFD_RTSX_USB)	+= rtsx_usb.o
 
 obj-$(CONFIG_HTC_EGPIO)		+= htc-egpio.o
 obj-$(CONFIG_HTC_PASIC3)	+= htc-pasic3.o
drivers/mfd/rtsx_usb.c new file +760 -0

760 lines not on this page · raw message

include/linux/mfd/rtsx_usb.h new file +628 -0

628 lines not on this page · raw message

Signature · 1 line
1.8.2
#2 lore raw

Re: [PATCH v5 1/3] mfd: Add realtek USB card reader driver

Quoted 10 lines · On Tue, 2014-03-25 at 18:44 +0800, [email protected] wrote:

From: Roger Tseng <[email protected]>

drivers/mfd/rtsx_usb.c new file +8 -0
+static int rtsx_usb_bulk_transfer_sglist(struct rtsx_ucr *ucr,
+		unsigned int pipe, struct scatterlist *sg, int num_sg,
+		unsigned int length, unsigned int *act_len, int timeout)
+{
+	int ret;
+
+	dev_dbg(&ucr->pusb_intf->dev, "%s: xfer %u bytes, %d entries\n",
+			__func__, length, num_sg);

drivers/mfd/rtsx_usb.c line 71

Quoted 10 lines
drivers/mfd/rtsx_usb.c new file +10 -0
+	ret = usb_sg_init(&ucr->current_sg, ucr->pusb_dev, pipe, 0,
+			sg, num_sg, length, GFP_NOIO);
+	if (ret)
+		return ret;
+
+	ucr->sg_timer.expires = jiffies + msecs_to_jiffies(timeout);
+	add_timer(&ucr->sg_timer);
+	usb_sg_wait(&ucr->current_sg);
+	del_timer(&ucr->sg_timer);
+

A slight race. You cannot rule out that the timer handler is still running when you call this the next time. You'd better use del_timer_sync()

Quoted 29 lines
drivers/mfd/rtsx_usb.c new file +29 -0
+static int rtsx_usb_probe(struct usb_interface *intf,
+			 const struct usb_device_id *id)
+{
+	struct usb_device *usb_dev = interface_to_usbdev(intf);
+	struct rtsx_ucr *ucr;
+	int ret;
+
+	dev_dbg(&intf->dev,
+		": Realtek USB Card Reader found at bus %03d address %03d\n",
+		 usb_dev->bus->busnum, usb_dev->devnum);
+
+	ucr = devm_kzalloc(&intf->dev, sizeof(*ucr), GFP_KERNEL);
+	if (!ucr)
+		return -ENOMEM;
+
+	ucr->pusb_dev = usb_dev;
+
+	ucr->iobuf = usb_alloc_coherent(ucr->pusb_dev, IOBUF_SIZE,
+			GFP_KERNEL, &ucr->iobuf_dma);
+	if (!ucr->iobuf)
+		return -ENOMEM;
+
+	usb_set_intfdata(intf, ucr);
+
+	ucr->vendor_id = id->idVendor;
+	ucr->product_id = id->idProduct;
+	ucr->cmd_buf = ucr->rsp_buf = ucr->iobuf;
+
+	mutex_init(&ucr->dev_mutex);

drivers/mfd/rtsx_usb.c line 648

Quoted 10 lines
drivers/mfd/rtsx_usb.c new file +10 -0
+
+	ucr->pusb_intf = intf;
+
+	/* initialize */
+	ret = rtsx_usb_init_chip(ucr);
+	if (ret)
+		goto out_init_fail;
+
+	ret = mfd_add_devices(&intf->dev, usb_dev->devnum, rtsx_usb_cells,
+			ARRAY_SIZE(rtsx_usb_cells), NULL, 0, NULL);

Race condition. What prevents the mfd layer from using this device before you've finished the next steps of the initialisation?

drivers/mfd/rtsx_usb.c line 656

Quoted 8 lines
drivers/mfd/rtsx_usb.c new file +8 -0
+	if (ret)
+		goto out_init_fail;
+
+	/* initialize USB SG transfer timer */
+	init_timer(&ucr->sg_timer);
+	setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr);
+#ifdef CONFIG_PM
+	intf->needs_remote_wakeup = 1;

Why?

Quoted 25 lines
drivers/mfd/rtsx_usb.c new file +25 -0
+	usb_enable_autosuspend(usb_dev);
+#endif
+
+	return 0;
+
+out_init_fail:
+	usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf,
+			ucr->iobuf_dma);
+	return ret;
+}
+
+static void rtsx_usb_disconnect(struct usb_interface *intf)
+{
+	struct rtsx_ucr *ucr = (struct rtsx_ucr *)usb_get_intfdata(intf);
+
+	dev_dbg(&intf->dev, "%s called\n", __func__);
+
+	mfd_remove_devices(&intf->dev);
+
+	usb_set_intfdata(ucr->pusb_intf, NULL);
+	usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf,
+			ucr->iobuf_dma);
+}
+
+#ifdef CONFIG_PM

drivers/mfd/rtsx_usb.c line 691

Quoted 10 lines
drivers/mfd/rtsx_usb.c new file +10 -0
+static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
+{
+	struct rtsx_ucr *ucr =
+		(struct rtsx_ucr *)usb_get_intfdata(intf);
+
+	dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n",
+			__func__, message.event);
+
+	mutex_lock(&ucr->dev_mutex);
+	rtsx_usb_turn_off_led(ucr);

When is this turned on again?

Quoted 54 lines
drivers/mfd/rtsx_usb.c new file +54 -0
+	mutex_unlock(&ucr->dev_mutex);
+	return 0;
+}
+
+static int rtsx_usb_resume(struct usb_interface *intf)
+{
+	return 0;
+}
+
+static int rtsx_usb_reset_resume(struct usb_interface *intf)
+{
+	struct rtsx_ucr *ucr =
+		(struct rtsx_ucr *)usb_get_intfdata(intf);
+
+	rtsx_usb_reset_chip(ucr);
+	return 0;
+}
+
+#else /* CONFIG_PM */
+
+#define rtsx_usb_suspend NULL
+#define rtsx_usb_resume NULL
+#define rtsx_usb_reset_resume NULL
+
+#endif /* CONFIG_PM */
+
+
+static int rtsx_usb_pre_reset(struct usb_interface *intf)
+{
+	struct rtsx_ucr *ucr = (struct rtsx_ucr *)usb_get_intfdata(intf);
+
+	mutex_lock(&ucr->dev_mutex);
+	return 0;
+}
+
+static int rtsx_usb_post_reset(struct usb_interface *intf)
+{
+	struct rtsx_ucr *ucr = (struct rtsx_ucr *)usb_get_intfdata(intf);
+
+	mutex_unlock(&ucr->dev_mutex);
+	return 0;
+}
+
+static struct usb_device_id rtsx_usb_usb_ids[] = {
+	{ USB_DEVICE(0x0BDA, 0x0129) },
+	{ USB_DEVICE(0x0BDA, 0x0139) },
+	{ USB_DEVICE(0x0BDA, 0x0140) },
+	{ }
+};
+
+static struct usb_driver rtsx_usb_driver = {
+	.name			= "rtsx_usb",
+	.probe			= rtsx_usb_probe,
+	.disconnect		= rtsx_usb_disconnect,

drivers/mfd/rtsx_usb.c line 755

Quoted 10 lines
drivers/mfd/rtsx_usb.c new file +10 -0
+	.suspend		= rtsx_usb_suspend,
+	.resume			= rtsx_usb_resume,
+	.reset_resume		= rtsx_usb_reset_resume,
+	.pre_reset		= rtsx_usb_pre_reset,
+	.post_reset		= rtsx_usb_post_reset,
+	.id_table		= rtsx_usb_usb_ids,
+	.supports_autosuspend	= 1,
+	.soft_unbind		= 1,
+};
+

Regards
Oliver

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw

Re: [PATCH v5 1/3] mfd: Add realtek USB card reader driver

Quoted 38 lines · Oliver Neukum
Quoted 37 lines · On Tue, 2014-03-25 at 18:44 +0800, [email protected] wrote:

From: Roger Tseng <[email protected]>

drivers/mfd/rtsx_usb.c new file +34 -0
+static int rtsx_usb_probe(struct usb_interface *intf,
+			 const struct usb_device_id *id)
+{
+	struct usb_device *usb_dev = interface_to_usbdev(intf);
+	struct rtsx_ucr *ucr;
+	int ret;
+
+	dev_dbg(&intf->dev,
+		": Realtek USB Card Reader found at bus %03d address %03d\n",
+		 usb_dev->bus->busnum, usb_dev->devnum);
+
+	ucr = devm_kzalloc(&intf->dev, sizeof(*ucr), GFP_KERNEL);
+	if (!ucr)
+		return -ENOMEM;
+
+	ucr->pusb_dev = usb_dev;
+
+	ucr->iobuf = usb_alloc_coherent(ucr->pusb_dev, IOBUF_SIZE,
+			GFP_KERNEL, &ucr->iobuf_dma);
+	if (!ucr->iobuf)
+		return -ENOMEM;
+
+	usb_set_intfdata(intf, ucr);
+
+	ucr->vendor_id = id->idVendor;
+	ucr->product_id = id->idProduct;
+	ucr->cmd_buf = ucr->rsp_buf = ucr->iobuf;
+
+	mutex_init(&ucr->dev_mutex);
+
+	ucr->pusb_intf = intf;
+
+	/* initialize */
+	ret = rtsx_usb_init_chip(ucr);
Quoted 9 lines

drivers/mfd/rtsx_usb.c line 648

Quoted 5 lines
drivers/mfd/rtsx_usb.c new file +5 -0
+	if (ret)
+		goto out_init_fail;
+
+	ret = mfd_add_devices(&intf->dev, usb_dev->devnum, rtsx_usb_cells,
+			ARRAY_SIZE(rtsx_usb_cells), NULL, 0, NULL);

Race condition. What prevents the mfd layer from using this device before you've finished the next steps of the initialisation?

OK, I'll put the timer init before mfd_add_devices.

Quoted 10 lines

drivers/mfd/rtsx_usb.c line 656

Quoted 8 lines
drivers/mfd/rtsx_usb.c new file +8 -0
+	if (ret)
+		goto out_init_fail;
+
+	/* initialize USB SG transfer timer */
+	init_timer(&ucr->sg_timer);
+	setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr);
+#ifdef CONFIG_PM
+	intf->needs_remote_wakeup = 1;

Why?

Our reader supports remote wake-up from card slot event(insertion, removal). It should be enabled to let the driver be able to detect the newly inserted card.

Quoted 11 lines
Quoted 11 lines
drivers/mfd/rtsx_usb.c new file +11 -0
+	usb_enable_autosuspend(usb_dev);
+#endif
+
+	return 0;
+
+out_init_fail:
+	usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf,
+			ucr->iobuf_dma);
+	return ret;
+}
+

...

Quoted 4 lines
Quoted 4 lines
drivers/mfd/rtsx_usb.c new file +4 -0
+static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
+{
+	struct rtsx_ucr *ucr =
+		(struct rtsx_ucr *)usb_get_intfdata(intf);
Quoted 9 lines

drivers/mfd/rtsx_usb.c line 691

Quoted 6 lines
drivers/mfd/rtsx_usb.c new file +6 -0
+
+	dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n",
+			__func__, message.event);
+
+	mutex_lock(&ucr->dev_mutex);
+	rtsx_usb_turn_off_led(ucr);

When is this turned on again?

The LED is not in a permanent cut-off state after here. It is called to guarantee the LED is off during suspend to save more power. It could be lit up in the card host drivers(e.g. rtsx_usb_sdmmc.c) anytime whenever necessary.

This has been asked may times. I'm considering putting some comment in next revision.

Best regards,
Roger Tseng

#5 lore raw

Re: [PATCH v5 1/3] mfd: Add realtek USB card reader driver

[...]

Quoted 14 lines
Quoted 4 lines
Quoted 4 lines
drivers/mfd/rtsx_usb.c new file +4 -0
+static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
+{
+	struct rtsx_ucr *ucr =
+		(struct rtsx_ucr *)usb_get_intfdata(intf);
Quoted 9 lines

drivers/mfd/rtsx_usb.c line 691

Quoted 6 lines
drivers/mfd/rtsx_usb.c new file +6 -0
+
+	dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n",
+			__func__, message.event);
+
+	mutex_lock(&ucr->dev_mutex);
+	rtsx_usb_turn_off_led(ucr);

When is this turned on again?

Quoted 7 lines

The LED is not in a permanent cut-off state after here. It is called to guarantee the LED is off during suspend to save more power. It could be lit up in the card host drivers(e.g. rtsx_usb_sdmmc.c) anytime whenever necessary.

This has been asked may times. I'm considering putting some comment in next revision.

Yes, please do.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#6 lore raw

Re: [PATCH v5 1/3] mfd: Add realtek USB card reader driver

In reply to Roger
Quoted 14 lines · Roger
Quoted 13 lines · Oliver Neukum

drivers/mfd/rtsx_usb.c line 656

Quoted 10 lines · On Tue, 2014-03-25 at 18:44 +0800, [email protected] wrote:

From: Roger Tseng <[email protected]>

drivers/mfd/rtsx_usb.c new file +8 -0
+	if (ret)
+		goto out_init_fail;
+
+	/* initialize USB SG transfer timer */
+	init_timer(&ucr->sg_timer);
+	setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr);
+#ifdef CONFIG_PM
+	intf->needs_remote_wakeup = 1;

Why?

Quoted 3 lines

Our reader supports remote wake-up from card slot event(insertion, removal). It should be enabled to let the driver be able to detect the newly inserted card.

Interesting. This capability has been lacking for a long time. That is cool hardware. Are you sure the upper layers implement the event infrastructure so that devices are not polled?

Quoted 7 lines

The LED is not in a permanent cut-off state after here. It is called to guarantee the LED is off during suspend to save more power. It could be lit up in the card host drivers(e.g. rtsx_usb_sdmmc.c) anytime whenever necessary.

This has been asked may times. I'm considering putting some comment in next revision.

Good idea.

Regards
Oliver

author
#7 lore raw

Re: [PATCH v5 1/3] mfd: Add realtek USB card reader driver

Quoted 15 lines · Oliver Neukum
Quoted 14 lines · Roger
Quoted 13 lines · Oliver Neukum

drivers/mfd/rtsx_usb.c line 656

Quoted 10 lines · On Tue, 2014-03-25 at 18:44 +0800, [email protected] wrote:

From: Roger Tseng <[email protected]>

drivers/mfd/rtsx_usb.c new file +8 -0
+	if (ret)
+		goto out_init_fail;
+
+	/* initialize USB SG transfer timer */
+	init_timer(&ucr->sg_timer);
+	setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr);
+#ifdef CONFIG_PM
+	intf->needs_remote_wakeup = 1;

Why?

Quoted 8 lines
Quoted 3 lines

Our reader supports remote wake-up from card slot event(insertion, removal). It should be enabled to let the driver be able to detect the newly inserted card.

Interesting. This capability has been lacking for a long time. That is cool hardware. Are you sure the upper layers implement the event infrastructure so that devices are not polled?

Polling is still necessary because USB essentially doesn't support interrupt.

However, if remote wake-up is not enabled or supported, the device will have to be resumed every time when polling and then suspended right away if there isn't a new card. This should consume more power than the designed behavior: suspending device while card removed, taking failed polls as no-card, and card being successfully polled after insertion-triggered remote wake-up.

Quoted 5 lines
Quoted 5 lines

The LED is not in a permanent cut-off state after here. It is called to guarantee the LED is off during suspend to save more power. It could be lit up in the card host drivers(e.g. rtsx_usb_sdmmc.c) anytime whenever necessary.

Quoted 7 lines
Quoted 2 lines

This has been asked may times. I'm considering putting some comment in next revision.

Good idea.

Regards
Oliver

Best regards,
Roger Tseng

#8 lore raw

PATCH v5 2/3 mmc: Add realtek USB sdmmc host driver

In reply to [email protected]

From: Roger Tseng <[email protected]>

Realtek USB SD/MMC host driver provides mmc host support based on the Realtek USB card reader MFD driver.

---
 drivers/mmc/host/Kconfig          |    7 +
 drivers/mmc/host/Makefile         |    1 +
 drivers/mmc/host/rtsx_usb_sdmmc.c | 1462 +++++++++++++++++++++++++++++++++++++
 3 files changed, 1470 insertions(+)
 create mode 100644 drivers/mmc/host/rtsx_usb_sdmmc.c
drivers/mmc/host/Kconfig +7 -0
index 7fc5099..16f9a23 100644
@@ -665,3 +665,10 @@ config MMC_REALTEK_PCI
 	help
 	  Say Y here to include driver code to support SD/MMC card interface
 	  of Realtek PCI-E card reader
+
+config MMC_REALTEK_USB
+	tristate "Realtek USB SD/MMC Card Interface Driver"
+	depends on MFD_RTSX_USB
+	help
+	  Say Y here to include driver code to support SD/MMC card interface
+	  of Realtek RTS5129/39 series card reader
drivers/mmc/host/Makefile +1 -0
index c41d0c3..9d8d765 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_MMC_USHC)		+= ushc.o
 obj-$(CONFIG_MMC_WMT)		+= wmt-sdmmc.o
 
 obj-$(CONFIG_MMC_REALTEK_PCI)	+= rtsx_pci_sdmmc.o
+obj-$(CONFIG_MMC_REALTEK_USB)	+= rtsx_usb_sdmmc.o
 
 obj-$(CONFIG_MMC_SDHCI_PLTFM)		+= sdhci-pltfm.o
 obj-$(CONFIG_MMC_SDHCI_CNS3XXX)		+= sdhci-cns3xxx.o
drivers/mmc/host/rtsx_usb_sdmmc.c new file +1462 -0

1,462 lines not on this page · raw message

Signature · 1 line
1.8.2
#9 lore raw

PATCH v5 3/3 memstick: Add realtek USB memstick host driver

In reply to [email protected]

From: Roger Tseng <[email protected]>

Realtek USB memstick host driver provides memstick host support based on the Realtek USB card reader MFD driver.

---
 drivers/memstick/host/Kconfig       |  10 +
 drivers/memstick/host/Makefile      |   1 +
 drivers/memstick/host/rtsx_usb_ms.c | 839 ++++++++++++++++++++++++++++++++++++
 3 files changed, 850 insertions(+)
 create mode 100644 drivers/memstick/host/rtsx_usb_ms.c
drivers/memstick/host/Kconfig +10 -0
index 1b37cf8..7310e32 100644
@@ -52,3 +52,13 @@ config MEMSTICK_REALTEK_PCI
 
 	  To compile this driver as a module, choose M here: the module will
 	  be called rtsx_pci_ms.
+
+config MEMSTICK_REALTEK_USB
+	tristate "Realtek USB Memstick Card Interface Driver"
+	depends on MFD_RTSX_USB
+	help
+	  Say Y here to include driver code to support Memstick card interface
+	  of Realtek RTS5129/39 series USB card reader
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called rts5139_ms.
drivers/memstick/host/Makefile +1 -0
index af3459d..491c955 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_MEMSTICK_TIFM_MS)		+= tifm_ms.o
 obj-$(CONFIG_MEMSTICK_JMICRON_38X)	+= jmb38x_ms.o
 obj-$(CONFIG_MEMSTICK_R592)		+= r592.o
 obj-$(CONFIG_MEMSTICK_REALTEK_PCI)	+= rtsx_pci_ms.o
+obj-$(CONFIG_MEMSTICK_REALTEK_USB)	+= rtsx_usb_ms.o
drivers/memstick/host/rtsx_usb_ms.c new file +839 -0

839 lines not on this page · raw message

Signature · 1 line
1.8.2
author
#10 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 5 lines · On 03/25/2014 06:44 PM, [email protected] wrote:

From: Roger Tseng <[email protected]>

Realtek USB memstick host driver provides memstick host support based on the Realtek USB card reader MFD driver.

Quoted 7 lines
---
  drivers/memstick/host/Kconfig       |  10 +
  drivers/memstick/host/Makefile      |   1 +
  drivers/memstick/host/rtsx_usb_ms.c | 839 ++++++++++++++++++++++++++++++++++++
  3 files changed, 850 insertions(+)

create mode 100644 drivers/memstick/host/rtsx_usb_ms.c

Hi Andrew,

Since I'll have to send next revision(v6, to modify patch 1/3) and you've commented v4, would you also comment or Ack the 3/3 of this one? This should save one revision for me to make any necessary change.

#11 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 13 lines · On Tue, 1 Apr 2014 11:20:32 +0800 Roger <[email protected]> wrote:
Quoted 5 lines · On 03/25/2014 06:44 PM, [email protected] wrote:

From: Roger Tseng <[email protected]>

Realtek USB memstick host driver provides memstick host support based on the Realtek USB card reader MFD driver.

Quoted 7 lines
---
  drivers/memstick/host/Kconfig       |  10 +
  drivers/memstick/host/Makefile      |   1 +
  drivers/memstick/host/rtsx_usb_ms.c | 839 ++++++++++++++++++++++++++++++++++++
  3 files changed, 850 insertions(+)

create mode 100644 drivers/memstick/host/rtsx_usb_ms.c

Quoted 5 lines

Hi Andrew,

Since I'll have to send next revision(v6, to modify patch 1/3) and you've commented v4, would you also comment or Ack the 3/3 of this one? This should save one revision for me to make any necessary change.

It looks OK to my inexpert eye. It would be better if Maxim and/or Alex could review the code. If that doesn't happen then I guess the best we can do is to go ahead and merge it. Have you worked out via which tree the patches will be merged?

#12 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 17 lines · Andrew Morton
Quoted 15 lines · On Tue, 1 Apr 2014 11:20:32 +0800 Roger <[email protected]> wrote:
Quoted 5 lines · On 03/25/2014 06:44 PM, [email protected] wrote:

From: Roger Tseng <[email protected]>

Realtek USB memstick host driver provides memstick host support based on the Realtek USB card reader MFD driver.

Quoted 7 lines
---
  drivers/memstick/host/Kconfig       |  10 +
  drivers/memstick/host/Makefile      |   1 +
  drivers/memstick/host/rtsx_usb_ms.c | 839 ++++++++++++++++++++++++++++++++++++
  3 files changed, 850 insertions(+)

create mode 100644 drivers/memstick/host/rtsx_usb_ms.c

Hi Andrew,

Quoted 8 lines
Quoted 3 lines

Since I'll have to send next revision(v6, to modify patch 1/3) and you've commented v4, would you also comment or Ack the 3/3 of this one? This should save one revision for me to make any necessary change.

It looks OK to my inexpert eye. It would be better if Maxim and/or Alex could review the code. If that doesn't happen then I guess the best we can do is to go ahead and merge it. Have you worked out via which tree the patches will be merged?

I'll be happy to take the set if one of the subsystem experts would be kind enough to cast an eye over it.

Maxim, Alex?

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
author
#13 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 28 lines · Lee Jones
Quoted 17 lines · Andrew Morton
Quoted 15 lines · On Tue, 1 Apr 2014 11:20:32 +0800 Roger <[email protected]> wrote:
Quoted 5 lines · On 03/25/2014 06:44 PM, [email protected] wrote:

From: Roger Tseng <[email protected]>

Realtek USB memstick host driver provides memstick host support based on the Realtek USB card reader MFD driver.

Quoted 7 lines
---
   drivers/memstick/host/Kconfig       |  10 +
   drivers/memstick/host/Makefile      |   1 +
   drivers/memstick/host/rtsx_usb_ms.c | 839 ++++++++++++++++++++++++++++++++++++
   3 files changed, 850 insertions(+)

create mode 100644 drivers/memstick/host/rtsx_usb_ms.c

Hi Andrew,

Quoted 8 lines
Quoted 3 lines

Since I'll have to send next revision(v6, to modify patch 1/3) and you've commented v4, would you also comment or Ack the 3/3 of this one? This should save one revision for me to make any necessary change.

It looks OK to my inexpert eye. It would be better if Maxim and/or Alex could review the code. If that doesn't happen then I guess the best we can do is to go ahead and merge it. Have you worked out via which tree the patches will be merged?

Quoted 5 lines

I'll be happy to take the set if one of the subsystem experts would be kind enough to cast an eye over it.

Maxim, Alex?

Lee,

When I prepare my next submission, I found a previous version of this patch set(and only the 1/3 'mfd' part) seems to be merged in the following commit:

commit e5744abb2fa3629aa5a94e21ca1eae32ff2fe00b
Merge: c29aa15 2d28ca7
Author: Linus Torvalds <[email protected]>
Date: Mon Apr 7 10:24:18 2014 -0700

    Merge tag 'mfd-for-linus-3.15' of 

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Is there any chance to revert it? Or what can I do to help current situation?

note: the merged commit:
commit 730876be256603b4ee7225a125467d97a7ce9060

Author: Roger Tseng <[email protected]>
Date:   Wed Feb 12 18:00:36 2014 +0800

mfd: Add realtek USB card reader driver

Best regards,
Roger Tseng

#14 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 39 lines
Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
Quoted 5 lines

From: Roger Tseng <[email protected]>

Realtek USB memstick host driver provides memstick host support based on the Realtek USB card reader MFD driver.

Quoted 7 lines
---
  drivers/memstick/host/Kconfig       |  10 +
  drivers/memstick/host/Makefile      |   1 +
  drivers/memstick/host/rtsx_usb_ms.c | 839 ++++++++++++++++++++++++++++++++++++
  3 files changed, 850 insertions(+)

create mode 100644 drivers/memstick/host/rtsx_usb_ms.c

Hi Andrew,

Quoted 8 lines
Quoted 3 lines

Since I'll have to send next revision(v6, to modify patch 1/3) and you've commented v4, would you also comment or Ack the 3/3 of this one? This should save one revision for me to make any necessary change.

It looks OK to my inexpert eye. It would be better if Maxim and/or Alex could review the code. If that doesn't happen then I guess the best we can do is to go ahead and merge it. Have you worked out via which tree the patches will be merged?

Quoted 5 lines

I'll be happy to take the set if one of the subsystem experts would be kind enough to cast an eye over it.

Maxim, Alex?

Lee,

When I prepare my next submission, I found a previous version of this patch set(and only the 1/3 'mfd' part) seems to be merged in the following commit:

commit e5744abb2fa3629aa5a94e21ca1eae32ff2fe00b
Merge: c29aa15 2d28ca7
Author: Linus Torvalds <[email protected]>
Date: Mon Apr 7 10:24:18 2014 -0700

Quoted 5 lines
    Merge tag 'mfd-for-linus-3.15' of

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Is there any chance to revert it? Or what can I do to help current situation?

What will happen if we don't revert it? Does it depend on something else?

Quoted 10 lines

note: the merged commit:
commit 730876be256603b4ee7225a125467d97a7ce9060

Author: Roger Tseng <[email protected]>
Date:   Wed Feb 12 18:00:36 2014 +0800

mfd: Add realtek USB card reader driver

Best regards,
Roger Tseng

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
author
#15 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 12 lines · Lee Jones
Quoted 12 lines
Quoted 1 line

Lee,

When I prepare my next submission, I found a previous version of this patch set(and only the 1/3 'mfd' part) seems to be merged in the following commit:

commit e5744abb2fa3629aa5a94e21ca1eae32ff2fe00b
Merge: c29aa15 2d28ca7
Author: Linus Torvalds <[email protected]>
Date: Mon Apr 7 10:24:18 2014 -0700

Quoted 9 lines
Quoted 5 lines
     Merge tag 'mfd-for-linus-3.15' of

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Is there any chance to revert it? Or what can I do to help current situation?

What will happen if we don't revert it? Does it depend on something else?

No, it has no dependency error but only provides an unused mfd device and exports nothing functional to user.

I think it would be good to submit the diff between the merged 1/3 patch and the v6, along with full 2/3 and 3/3.

Quoted 11 lines
Quoted 10 lines

note: the merged commit:
commit 730876be256603b4ee7225a125467d97a7ce9060

Author: Roger Tseng <[email protected]>
Date:   Wed Feb 12 18:00:36 2014 +0800

mfd: Add realtek USB card reader driver

Best regards,
Roger Tseng

#16 lore raw

Re: [PATCH v5 3/3] memstick: Add realtek USB memstick host driver

Quoted 19 lines · Roger
Quoted 18 lines · Lee Jones
Quoted 17 lines
Quoted 1 line

Lee,

When I prepare my next submission, I found a previous version of this patch set(and only the 1/3 'mfd' part) seems to be merged in the following commit:

commit e5744abb2fa3629aa5a94e21ca1eae32ff2fe00b
Merge: c29aa15 2d28ca7
Author: Linus Torvalds <[email protected]>
Date: Mon Apr 7 10:24:18 2014 -0700

    Merge tag 'mfd-for-linus-3.15' of

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Is there any chance to revert it? Or what can I do to help current situation?

Quoted 8 lines
Quoted 3 lines

What will happen if we don't revert it? Does it depend on something else?

No, it has no dependency error but only provides an unused mfd device and exports nothing functional to user.

I think it would be good to submit the diff between the merged 1/3 patch and the v6, along with full 2/3 and 3/3.

Yes. That sounds best.

regards,
dan carpenter