From: Maxim Levitsky on
On Thu, 2010-08-05 at 18:14 -0700, Joe Perches wrote:
> On Thu, 2010-08-05 at 17:25 +0300, Maxim Levitsky wrote:
> > Signed-off-by: Maxim Levitsky <maximlevitsky(a)gmail.com>
>
> Trivial comments:
>
> > ---
> > MAINTAINERS | 6 +
> > +RICOH R5C592 MEMORYSTICK DRIVER
> > +M: Maxim Levitsky <maximlevitsky(a)gmail.com>
> > +S: Maintained
> > +F: drivers/memstick/host/r592.c
> > +F: drivers/memstick/host/r592.h
>
> Patterns in maintainers can use wildcards
Didn't know about that, thanks!
>
> F: drivers/memstick/host/r592*
>
> > --- /dev/null
> > +++ b/drivers/memstick/host/r592.c
> > @@ -0,0 +1,889 @@
> []
> > +static char *tpc_names[] = {
>
> const ?
Sure
>
> > + "MS_TPC_READ_MG_STATUS",
> > + "MS_TPC_READ_LONG_DATA",
>
> []
>
> > +#define dbg(format, ...) \
> > + if (debug) \
> > + printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
> > +
> > +#define dbg_verbose(format, ...) \
> > + if (debug > 1) \
> > + printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
> > +
> > +#define dbg_reg(format, ...) \
> > + if (debug > 2) \
> > + printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
> > +
>
> These style macros should use do { if (test) print(); } while (9)
> so they could be used without problems in if/else blocks.
>
> Maybe it'd be better to have and use 1 macro with a level passed:
>
> #define dbg(level, format, ...) \
> do { \
> if (debug > level) \
> printk(KERN_DEBUG pr_fmt(format), ##__VA_ARGS__); \
> } while (0)
Thinking again about that, why not...



>
> > +#define message(format, ...) \
> > + printk(KERN_INFO DRV_NAME ": " format "\n", ## __VA_ARGS__)
>
> Why not just use pr_info?
Will look at that.

Best regards,
Maxim Levitsky



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Alex Dubov on
> > > > >
> > > > > That's how its called in the spec.
> > > > > Sectors can be larger than 512b on
> Pro-HG sticks, and
> > > > there's additional
> > > > > TPC_READ/WRITE_QUAD_DATA which operates
> on larger
> > > > quantities.
> > > > But not on ordinary PRO, right?
> > >
> > > Pro sectors are normally 512 bytes.
> > >
> > > >
> > > > Small question, can I use Pro-HG stick in my
> reader that is
> > > > designed for
> > > > Standard/PRO only? Does your subsystem
> support it?
> > >
> > > It should work. It works for me on TI, which has
> no 8b mode either.
> > In that case, is there an upper limit on sector size?
> Also, you don't use the MS_TPC_READ_QUAD_DATA at all.
> So mspro_blk.c won't work with >512 bytes/sector disk?
> Or there is some compatibility?
>

The code can work with arbitrarily sized pages, 512b
value is not hard coded. All that is needed is to slightly alter
h_mspro_block_transfer_data function, given, of course, that adapters
support longer transfer sizes.




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Alex Dubov on
>
> Btw, I want to add a callback from driver to card driver to
> be able to
> reset card in case of error (windows driver does that in
> case of any
> error)
>
> I would use most of the mspro_block_resume for the
> implementation for
> mspro.
>
> Any objections, suggestions?
>

Just toggle a power on it. Power off/power on will do the full reset of
the controller and the media. You don't have to reinitialize it, as you
are sure that it's the same stick.





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Alex Dubov on
> >
> > >
> > > Small question, can I use Pro-HG stick in my
> reader that is
> > > designed for
> > > Standard/PRO only? Does your subsystem support
> it?
> >
> > It should work. It works for me on TI, which has no 8b
> mode either.
> In that case, is there an upper limit on sector size?
>

Good code has no artificially induced limits. Less than machine page.




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Maxim Levitsky on
On Fri, 2010-08-06 at 00:43 -0700, Alex Dubov wrote:
> > > > > >
> > > > > > That's how its called in the spec.
> > > > > > Sectors can be larger than 512b on
> > Pro-HG sticks, and
> > > > > there's additional
> > > > > > TPC_READ/WRITE_QUAD_DATA which operates
> > on larger
> > > > > quantities.
> > > > > But not on ordinary PRO, right?
> > > >
> > > > Pro sectors are normally 512 bytes.
> > > >
> > > > >
> > > > > Small question, can I use Pro-HG stick in my
> > reader that is
> > > > > designed for
> > > > > Standard/PRO only? Does your subsystem
> > support it?
> > > >
> > > > It should work. It works for me on TI, which has
> > no 8b mode either.
> > > In that case, is there an upper limit on sector size?
> > Also, you don't use the MS_TPC_READ_QUAD_DATA at all.
> > So mspro_blk.c won't work with >512 bytes/sector disk?
> > Or there is some compatibility?
> >
>
> The code can work with arbitrarily sized pages, 512b
> value is not hard coded. All that is needed is to slightly alter
> h_mspro_block_transfer_data function, given, of course, that adapters
> support longer transfer

No, I mean if I go and buy memstick PRO HG, that has > 512 bytes/sector,
will it work with current code?

Btw, there is currently no way of telling core about maximum transfer
length.
Here absolute maximum is 1024 (number of bit that _might_ hold TPC
length), and FIFO size is 512 bytes (maybe its possible to use fifo
twice)

Best regards,
Maxim Levitsky

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/