Skip to contentSkip to conversation

Driver for Ricoh cardreader + few fixes

PATCH In review Maxim Levitsky 1 participant 5 messages Aug 5, 2010

Subsystems (2)
lore
Share & tools
lore

Maxim Levitsky

author maintainer
#0 lore raw

v3 cover Driver for Ricoh cardreader + few fixes

Hi,

This is third revision of my patches that conatains one more fix, and few fixes for the driver.

Changes since V2:
* Removed accidently added hunk from r852.c
* Few cosmetic cleanups in the driver

--- original description from v2 ---

Patches 1-2 have no reason to be held back from beeing merged in 2.6.35 In fact patch #2 should be added to -stable as well.

The actual driver (patch #3) is new driver, so it can't introduce regressions, thus I think it can go to 2.6.36 as well.

I already have report form one user that driver works.

Best regards,
Maxim Levitsky

author maintainer
#1 lore raw

PATCH 1/3 memstick: init sysfs attributes

Otherwise locdep complains.

---
 drivers/memstick/core/mspro_block.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/memstick/core/mspro_block.c +1 -0
index 8327e24..369313f 100644
@@ -1040,6 +1040,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
 			snprintf(s_attr->name, sizeof(s_attr->name),
 				 "attr_x%02x", attr->entries[cnt].id);
 
+		sysfs_attr_init(&s_attr->dev_attr.attr);
 		s_attr->dev_attr.attr.name = s_attr->name;
 		s_attr->dev_attr.attr.mode = S_IRUGO;
 		s_attr->dev_attr.show = mspro_block_attr_show(s_attr->id);
Signature · 1 line
1.7.0.4
author maintainer
#2 lore raw

PATCH 2/3 MEMSTICK: fix hangs on unexpected device removal in mspro_blk

In reply to Maxim Levitsky

mspro_block_remove is called from detect thread that first calls the mspro_block_stop, which stops the request queue. If we call del_gendisk with queue stopped we get a deadlock.

---
 drivers/memstick/core/mspro_block.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/memstick/core/mspro_block.c +3 -2
index 369313f..300ec15 100644
@@ -1331,13 +1331,14 @@ static void mspro_block_remove(struct memstick_dev *card)
 	struct mspro_block_data *msb = memstick_get_drvdata(card);
 	unsigned long flags;
 
-	del_gendisk(msb->disk);
-	dev_dbg(&card->dev, "mspro block remove\n");
 	spin_lock_irqsave(&msb->q_lock, flags);
 	msb->eject = 1;
 	blk_start_queue(msb->queue);
 	spin_unlock_irqrestore(&msb->q_lock, flags);
 
+	del_gendisk(msb->disk);
+	dev_dbg(&card->dev, "mspro block remove\n");
+
 	blk_cleanup_queue(msb->queue);
 	msb->queue = NULL;
 
Signature · 1 line
1.7.0.4
author maintainer
#3 lore raw

PATCH 3/3 MEMSTICK: Add driver for Ricoh R5C592 Card reader.

In reply to Maxim Levitsky
---
 MAINTAINERS                    |    6 +
 drivers/memstick/host/Kconfig  |   13 +
 drivers/memstick/host/Makefile |    1 +
 drivers/memstick/host/r592.c   |  857 ++++++++++++++++++++++++++++++++++++++++
 drivers/memstick/host/r592.h   |  173 ++++++++
 5 files changed, 1050 insertions(+), 0 deletions(-)
 create mode 100644 drivers/memstick/host/r592.c
 create mode 100644 drivers/memstick/host/r592.h
MAINTAINERS +6 -0
index 88fcb7c..7ebdd32 100644
@@ -4822,6 +4822,12 @@ S:	Maintained
 F:	drivers/mtd/nand/r822.c
 F:	drivers/mtd/nand/r822.h
 
+RICOH R5C592 MEMORYSTICK DRIVER
+M:	Maxim Levitsky <[email protected]>
+S:	Maintained
+F:	drivers/memstick/host/r592.c
+F:	drivers/memstick/host/r592.h
+
 RISCOM8 DRIVER
 S:	Orphan
 F:	Documentation/serial/riscom8.txt
drivers/memstick/host/Kconfig +13 -0
index 4ce5c8d..7022a2a 100644
@@ -30,3 +30,16 @@ config MEMSTICK_JMICRON_38X
 
           To compile this driver as a module, choose M here: the
 	  module will be called jmb38x_ms.
+
+config MEMSTICK_R592
+	tristate "Ricoh R5C592 MemoryStick interface support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL && PCI
+
+	help
+	  Say Y here if you want to be able to access MemoryStick cards with
+	  the Ricoh R5C592 MemoryStick card reader (which is part of 5 in one
+		multifunction reader)
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called r592.
+
drivers/memstick/host/Makefile +1 -0
index 12530e4..ad63c16 100644
@@ -8,3 +8,4 @@ endif
 
 obj-$(CONFIG_MEMSTICK_TIFM_MS)		+= tifm_ms.o
 obj-$(CONFIG_MEMSTICK_JMICRON_38X)	+= jmb38x_ms.o
+obj-$(CONFIG_MEMSTICK_R592)		+= r592.o
drivers/memstick/host/r592.c new file +857 -0

857 lines not on this page · raw message

drivers/memstick/host/r592.h new file +173 -0

173 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author maintainer
#4 lore raw
In reply to Maxim Levitsky
Quoted 12 lines · Maxim Levitsky

Hi,

This is third revision of my patches that conatains one more fix, and few fixes for the driver.

Changes since V2:
* Removed accidently added hunk from r852.c
* Few cosmetic cleanups in the driver

--- original description from v2 ---

Quoted 7 lines

Patches 1-2 have no reason to be held back from beeing merged in 2.6.35 In fact patch #2 should be added to -stable as well.

The actual driver (patch #3) is new driver, so it can't introduce regressions, thus I think it can go to 2.6.36 as well.

I already have report form one user that driver works.

Two users now...

Quoted 5 lines

Best regards,
Maxim Levitsky

Andrew, this is the latest version of my patches. Sorry again for the mess in V1 of patches I sent to you.

Best regards,
Maxim Levitsky