public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] staging: rts_pstor: set lun_mode in a different place
@ 2011-03-15  8:22 wei_wang
  2011-03-15  8:46 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: wei_wang @ 2011-03-15  8:22 UTC (permalink / raw)
  To: gregkh, devel, linux-kernel; +Cc: wwang

From: wwang <wei_wang@realsil.com.cn>

In sony notebook, card reader will be configured as two-lun mode
through EFUSE. In this situation, MS card can't be recognized
properly because driver does only support single-lun mode in default.
In this patch, lun_mode is set in a different place, so driver can
detect the EFUSE configuation automatically.

Signed-off-by: wwang <wei_wang@realsil.com.cn>
---
 drivers/staging/rts_pstor/rtsx_chip.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx_chip.c b/drivers/staging/rts_pstor/rtsx_chip.c
index f443d97..d2f1c71 100644
--- a/drivers/staging/rts_pstor/rtsx_chip.c
+++ b/drivers/staging/rts_pstor/rtsx_chip.c
@@ -684,6 +684,11 @@ static int rts5209_init(struct rtsx_chip *chip)
 	RTSX_DEBUGP("dw in 0x724: 0x%x\n", lval);
 	val = (u8)lval;
 	if (!(val & 0x80)) {
+		if (val & 0x08)
+			chip->lun_mode = DEFAULT_SINGLE;
+		else
+			chip->lun_mode = SD_MS_2LUN;
+
 		if (val & 0x04) {
 			SET_SDIO_EXIST(chip);
 		} else {
@@ -705,12 +710,6 @@ static int rts5209_init(struct rtsx_chip *chip)
 
 		chip->aspm_l0s_l1_en = (val >> 5) & 0x03;
 
-		if (val & 0x08) {
-			chip->lun_mode = DEFAULT_SINGLE;
-		} else {
-			chip->lun_mode = SD_MS_2LUN;
-		}
-
 		val = (u8)(lval >> 8);
 
 		clk = (val >> 5) & 0x07;
-- 
1.7.4.1


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

* Re: [PATCH 2/2] staging: rts_pstor: set lun_mode in a different place
  2011-03-15  8:22 [PATCH 2/2] staging: rts_pstor: set lun_mode in a different place wei_wang
@ 2011-03-15  8:46 ` Dan Carpenter
  2011-03-15  8:56   ` [PATCH 2/2] staging: rts_pstor: set lun_mode in a differentplace wwang
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2011-03-15  8:46 UTC (permalink / raw)
  To: wei_wang; +Cc: gregkh, devel, linux-kernel

On Tue, Mar 15, 2011 at 04:22:16PM +0800, wei_wang@realsil.com.cn wrote:
> From: wwang <wei_wang@realsil.com.cn>
> 
> In sony notebook, card reader will be configured as two-lun mode
> through EFUSE. In this situation, MS card can't be recognized
> properly because driver does only support single-lun mode in default.
> In this patch, lun_mode is set in a different place, so driver can
> detect the EFUSE configuation automatically.
> 

Hm...  The auto detect code is never run because chip->use_hw_setting is
always 0.  Are you sure the right fix isn't to set chip->use_hw_setting
to 1?

regards,
dan carpenter



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

* Re: [PATCH 2/2] staging: rts_pstor: set lun_mode in a differentplace
  2011-03-15  8:46 ` Dan Carpenter
@ 2011-03-15  8:56   ` wwang
  2011-03-15 12:48     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: wwang @ 2011-03-15  8:56 UTC (permalink / raw)
  To: Dan Carpenter, gregkh, devel, linux-kernel

于 2011年03月15日 16:46, Dan Carpenter 写道:
> Hm...  The auto detect code is never run because chip->use_hw_setting is
> always 0.  Are you sure the right fix isn't to set chip->use_hw_setting
> to 1?
>
> regards,
> dan carpenter
>
Yes, setting chip->use_hw_setting is not a wise choice.
Normally, if chip->use_hw_setting is set to 1, more configurations will
be turned on, such as auto_delink_en.
auto_delink_en can only work well when pcie hotplug is configured and
pciehp.pciehp_force is set to 1. This condition can't be met in default
kernel config by now.
So, I have to choose to set lun_mode detection code in a different place.

Best regards,
wwang

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

* Re: [PATCH 2/2] staging: rts_pstor: set lun_mode in a differentplace
  2011-03-15  8:56   ` [PATCH 2/2] staging: rts_pstor: set lun_mode in a differentplace wwang
@ 2011-03-15 12:48     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-03-15 12:48 UTC (permalink / raw)
  To: wwang; +Cc: gregkh, devel, linux-kernel

On Tue, Mar 15, 2011 at 04:56:38PM +0800, wwang wrote:
> 于 2011年03月15日 16:46, Dan Carpenter 写道:
> > Hm...  The auto detect code is never run because chip->use_hw_setting is
> > always 0.  Are you sure the right fix isn't to set chip->use_hw_setting
> > to 1?
> >
> > regards,
> > dan carpenter
> >
> Yes, setting chip->use_hw_setting is not a wise choice.
> Normally, if chip->use_hw_setting is set to 1, more configurations will
> be turned on, such as auto_delink_en.
> auto_delink_en can only work well when pcie hotplug is configured and
> pciehp.pciehp_force is set to 1. This condition can't be met in default
> kernel config by now.
> So, I have to choose to set lun_mode detection code in a different place.
> 

Ok.   Cool.  But you're going to fix the places that use ->use_hw_setting
later on yes?  For example, the rts5288 chip has the same problem earlier
in the file where the lun_mode doesn't get set correctly. 

regards,
dan carpenter



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

end of thread, other threads:[~2011-03-15 12:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15  8:22 [PATCH 2/2] staging: rts_pstor: set lun_mode in a different place wei_wang
2011-03-15  8:46 ` Dan Carpenter
2011-03-15  8:56   ` [PATCH 2/2] staging: rts_pstor: set lun_mode in a differentplace wwang
2011-03-15 12:48     ` Dan Carpenter

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