Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1550581 > unrolled thread

[PATCH v2] mfd:rtsx: do retry when dma transfer error

Started by<steven_feng@realsil.com.cn>
First post2017-01-04 10:50 +0100
Last post2017-01-06 04:20 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] mfd:rtsx: do retry when dma transfer error <steven_feng@realsil.com.cn> - 2017-01-04 10:50 +0100
    Re: [PATCH v2] mfd:rtsx: do retry when dma transfer error Lee Jones <lee.jones@linaro.org> - 2017-01-04 13:20 +0100
      Re: [PATCH v2] mfd:rtsx: do retry when dma transfer error 冯伟linux <steven_feng@realsil.com.cn> - 2017-01-05 10:10 +0100
        Re: [PATCH v2] mfd:rtsx: do retry when dma transfer error Lee Jones <lee.jones@linaro.org> - 2017-01-05 16:00 +0100
          Re: [PATCH v2] mfd:rtsx: do retry when dma transfer error 冯伟linux <steven_feng@realsil.com.cn> - 2017-01-06 04:20 +0100

#1550581 — [PATCH v2] mfd:rtsx: do retry when dma transfer error

From<steven_feng@realsil.com.cn>
Date2017-01-04 10:50 +0100
Subject[PATCH v2] mfd:rtsx: do retry when dma transfer error
Message-ID<sVQmJ-2QA-1@gated-at.bofh.it>
From: steven_feng <steven_feng@realsil.com.cn>

the request should be reissued when dma transfer error.
for rts5227, the clock freq need to step reduce when error occurred.

Signed-off-by: steven_feng <steven_feng@realsil.com.cn>
---
 drivers/mfd/rtsx_pcr.c       | 16 ++++++++++++++--
 include/linux/mfd/rtsx_pci.h |  4 ++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 98029ee..63ee0ac 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -30,6 +30,7 @@
 #include <linux/platform_device.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/rtsx_pci.h>
+#include <linux/mmc/card.h>
 #include <asm/unaligned.h>
 
 #include "rtsx_pcr.h"
@@ -452,8 +453,12 @@ int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
 	}
 
 	spin_lock_irqsave(&pcr->lock, flags);
-	if (pcr->trans_result == TRANS_RESULT_FAIL)
-		err = -EINVAL;
+	if (pcr->trans_result == TRANS_RESULT_FAIL) {
+		err = -EILSEQ;
+		if (pcr->dma_error_count < 8)
+			pcr->dma_error_count++;
+	}
+
 	else if (pcr->trans_result == TRANS_NO_DEVICE)
 		err = -ENODEV;
 	spin_unlock_irqrestore(&pcr->lock, flags);
@@ -659,6 +664,12 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
 	if (err < 0)
 		return err;
 
+	/* each time dma transfer error occurs, card clock decreased by 20MHz */
+	if (card_clock == UHS_SDR104_MAX_DTR &&
+		pcr->dma_error_count && PCI_PID(pcr) == RTS5227_DEVICE_ID)
+		card_clock = UHS_SDR104_MAX_DTR -
+			pcr->dma_error_count * 20000000;
+
 	card_clock /= 1000000;
 	pcr_dbg(pcr, "Switch card clock to %dMHz\n", card_clock);
 
@@ -894,6 +905,7 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
 			pcr->card_removed |= SD_EXIST;
 			pcr->card_inserted &= ~SD_EXIST;
 		}
+		pcr->dma_error_count = 0;
 	}
 
 	if (int_reg & MS_INT) {
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index 7eb7cba..751c4042 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -850,6 +850,8 @@
 
 #define rtsx_pci_init_cmd(pcr)		((pcr)->ci = 0)
 
+#define RTS5227_DEVICE_ID		0x5227
+
 struct rtsx_pcr;
 
 struct pcr_handle {
@@ -957,6 +959,8 @@ struct rtsx_pcr {
 
 	int				num_slots;
 	struct rtsx_slot		*slots;
+
+	u8				dma_error_count;
 };
 
 #define CHK_PCI_PID(pcr, pid)		((pcr)->pci->device == (pid))
-- 
1.9.1

[toc] | [next] | [standalone]


#1550710

FromLee Jones <lee.jones@linaro.org>
Date2017-01-04 13:20 +0100
Message-ID<sVSHU-4z2-29@gated-at.bofh.it>
In reply to#1550581
On Wed, 04 Jan 2017, steven_feng@realsil.com.cn wrote:

> From: steven_feng <steven_feng@realsil.com.cn>
> 
> the request should be reissued when dma transfer error.
> for rts5227, the clock freq need to step reduce when error occurred.
> 
> Signed-off-by: steven_feng <steven_feng@realsil.com.cn>
> ---
>  drivers/mfd/rtsx_pcr.c       | 16 ++++++++++++++--
>  include/linux/mfd/rtsx_pci.h |  4 ++++
>  2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
> index 98029ee..63ee0ac 100644
> --- a/drivers/mfd/rtsx_pcr.c
> +++ b/drivers/mfd/rtsx_pcr.c
> @@ -30,6 +30,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/mfd/core.h>
>  #include <linux/mfd/rtsx_pci.h>
> +#include <linux/mmc/card.h>
>  #include <asm/unaligned.h>
>  
>  #include "rtsx_pcr.h"
> @@ -452,8 +453,12 @@ int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
>  	}
>  
>  	spin_lock_irqsave(&pcr->lock, flags);
> -	if (pcr->trans_result == TRANS_RESULT_FAIL)
> -		err = -EINVAL;
> +	if (pcr->trans_result == TRANS_RESULT_FAIL) {
> +		err = -EILSEQ;

Why are you using this error code?

> +		if (pcr->dma_error_count < 8)

Please define the 8.

RTSX_MAX_FREQ_REDUCTIONS or similar.

> +			pcr->dma_error_count++;
> +	}
> +
>  	else if (pcr->trans_result == TRANS_NO_DEVICE)
>  		err = -ENODEV;
>  	spin_unlock_irqrestore(&pcr->lock, flags);
> @@ -659,6 +664,12 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
>  	if (err < 0)
>  		return err;
>  
> +	/* each time dma transfer error occurs, card clock decreased by 20MHz */

"Each"

> +	if (card_clock == UHS_SDR104_MAX_DTR &&
> +		pcr->dma_error_count && PCI_PID(pcr) == RTS5227_DEVICE_ID)

Suggest placing "PCI_PID(pcr) == RTS5227_DEVICE_ID" on a new line.

> +		card_clock = UHS_SDR104_MAX_DTR -
> +			pcr->dma_error_count * 20000000;

Suggest placing parantheis around:

(UHS_SDR104_MAX_DTR - pcr->dma_error_count)

>  	card_clock /= 1000000;
>  	pcr_dbg(pcr, "Switch card clock to %dMHz\n", card_clock);
>  
> @@ -894,6 +905,7 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
>  			pcr->card_removed |= SD_EXIST;
>  			pcr->card_inserted &= ~SD_EXIST;
>  		}
> +		pcr->dma_error_count = 0;
>  	}
>  
>  	if (int_reg & MS_INT) {
> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
> index 7eb7cba..751c4042 100644
> --- a/include/linux/mfd/rtsx_pci.h
> +++ b/include/linux/mfd/rtsx_pci.h
> @@ -850,6 +850,8 @@
>  
>  #define rtsx_pci_init_cmd(pcr)		((pcr)->ci = 0)
>  
> +#define RTS5227_DEVICE_ID		0x5227
> +
>  struct rtsx_pcr;
>  
>  struct pcr_handle {
> @@ -957,6 +959,8 @@ struct rtsx_pcr {
>  
>  	int				num_slots;
>  	struct rtsx_slot		*slots;
> +
> +	u8				dma_error_count;
>  };
>  
>  #define CHK_PCI_PID(pcr, pid)		((pcr)->pci->device == (pid))

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1551781

From冯伟linux <steven_feng@realsil.com.cn>
Date2017-01-05 10:10 +0100
Message-ID<sWcdA-Is-25@gated-at.bofh.it>
In reply to#1550710

[Multipart message — attachments visible in raw view] — view raw

> +		err = -EILSEQ;
> Why are you using this error code?
>

when kernel receive the error number is EILSEQ, the SD card requeset
will be retried for some times, instead of dropping it directly.
so we use EILSEQ and frequency reduction to ensure data can be 
transmitted correctly as much as possible.



steven feng
Realsil Microelectronics CO. LTD.
Mobile:181-6899-0403  Ext:57594

在 2017年01月04日 20:12, Lee Jones 写道:
> On Wed, 04 Jan 2017, steven_feng@realsil.com.cn wrote:
>
>> From: steven_feng <steven_feng@realsil.com.cn>
>>
>> the request should be reissued when dma transfer error.
>> for rts5227, the clock freq need to step reduce when error occurred.
>>
>> Signed-off-by: steven_feng <steven_feng@realsil.com.cn>
>> ---
>>  drivers/mfd/rtsx_pcr.c       | 16 ++++++++++++++--
>>  include/linux/mfd/rtsx_pci.h |  4 ++++
>>  2 files changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
>> index 98029ee..63ee0ac 100644
>> --- a/drivers/mfd/rtsx_pcr.c
>> +++ b/drivers/mfd/rtsx_pcr.c
>> @@ -30,6 +30,7 @@
>>  #include <linux/platform_device.h>
>>  #include <linux/mfd/core.h>
>>  #include <linux/mfd/rtsx_pci.h>
>> +#include <linux/mmc/card.h>
>>  #include <asm/unaligned.h>
>>  
>>  #include "rtsx_pcr.h"
>> @@ -452,8 +453,12 @@ int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
>>  	}
>>  
>>  	spin_lock_irqsave(&pcr->lock, flags);
>> -	if (pcr->trans_result == TRANS_RESULT_FAIL)
>> -		err = -EINVAL;
>> +	if (pcr->trans_result == TRANS_RESULT_FAIL) {
>> +		err = -EILSEQ;
> Why are you using this error code?
>
>> +		if (pcr->dma_error_count < 8)
> Please define the 8.
>
> RTSX_MAX_FREQ_REDUCTIONS or similar.
>
>> +			pcr->dma_error_count++;
>> +	}
>> +
>>  	else if (pcr->trans_result == TRANS_NO_DEVICE)
>>  		err = -ENODEV;
>>  	spin_unlock_irqrestore(&pcr->lock, flags);
>> @@ -659,6 +664,12 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
>>  	if (err < 0)
>>  		return err;
>>  
>> +	/* each time dma transfer error occurs, card clock decreased by 20MHz */
> "Each"
>
>> +	if (card_clock == UHS_SDR104_MAX_DTR &&
>> +		pcr->dma_error_count && PCI_PID(pcr) == RTS5227_DEVICE_ID)
> Suggest placing "PCI_PID(pcr) == RTS5227_DEVICE_ID" on a new line.
>
>> +		card_clock = UHS_SDR104_MAX_DTR -
>> +			pcr->dma_error_count * 20000000;
> Suggest placing parantheis around:
>
> (UHS_SDR104_MAX_DTR - pcr->dma_error_count)
>
>>  	card_clock /= 1000000;
>>  	pcr_dbg(pcr, "Switch card clock to %dMHz\n", card_clock);
>>  
>> @@ -894,6 +905,7 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
>>  			pcr->card_removed |= SD_EXIST;
>>  			pcr->card_inserted &= ~SD_EXIST;
>>  		}
>> +		pcr->dma_error_count = 0;
>>  	}
>>  
>>  	if (int_reg & MS_INT) {
>> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
>> index 7eb7cba..751c4042 100644
>> --- a/include/linux/mfd/rtsx_pci.h
>> +++ b/include/linux/mfd/rtsx_pci.h
>> @@ -850,6 +850,8 @@
>>  
>>  #define rtsx_pci_init_cmd(pcr)		((pcr)->ci = 0)
>>  
>> +#define RTS5227_DEVICE_ID		0x5227
>> +
>>  struct rtsx_pcr;
>>  
>>  struct pcr_handle {
>> @@ -957,6 +959,8 @@ struct rtsx_pcr {
>>  
>>  	int				num_slots;
>>  	struct rtsx_slot		*slots;
>> +
>> +	u8				dma_error_count;
>>  };
>>  
>>  #define CHK_PCI_PID(pcr, pid)		((pcr)->pci->device == (pid))

[toc] | [prev] | [next] | [standalone]


#1552030

FromLee Jones <lee.jones@linaro.org>
Date2017-01-05 16:00 +0100
Message-ID<sWhGh-4oD-7@gated-at.bofh.it>
In reply to#1551781
On Thu, 05 Jan 2017, 冯伟linux wrote:

> > +		err = -EILSEQ;
> > Why are you using this error code?
> >
> 
> when kernel receive the error number is EILSEQ, the SD card requeset
> will be retried for some times, instead of dropping it directly.
> so we use EILSEQ and frequency reduction to ensure data can be 
> transmitted correctly as much as possible.

So this is function is SD card specific?

In which case, why isn't it in the SD card driver?

> steven feng
> Realsil Microelectronics CO. LTD.
> Mobile:181-6899-0403  Ext:57594
> 
> 在 2017年01月04日 20:12, Lee Jones 写道:
> > On Wed, 04 Jan 2017, steven_feng@realsil.com.cn wrote:
> >
> >> From: steven_feng <steven_feng@realsil.com.cn>
> >>
> >> the request should be reissued when dma transfer error.
> >> for rts5227, the clock freq need to step reduce when error occurred.
> >>
> >> Signed-off-by: steven_feng <steven_feng@realsil.com.cn>
> >> ---
> >>  drivers/mfd/rtsx_pcr.c       | 16 ++++++++++++++--
> >>  include/linux/mfd/rtsx_pci.h |  4 ++++
> >>  2 files changed, 18 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
> >> index 98029ee..63ee0ac 100644
> >> --- a/drivers/mfd/rtsx_pcr.c
> >> +++ b/drivers/mfd/rtsx_pcr.c
> >> @@ -30,6 +30,7 @@
> >>  #include <linux/platform_device.h>
> >>  #include <linux/mfd/core.h>
> >>  #include <linux/mfd/rtsx_pci.h>
> >> +#include <linux/mmc/card.h>
> >>  #include <asm/unaligned.h>
> >>  
> >>  #include "rtsx_pcr.h"
> >> @@ -452,8 +453,12 @@ int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
> >>  	}
> >>  
> >>  	spin_lock_irqsave(&pcr->lock, flags);
> >> -	if (pcr->trans_result == TRANS_RESULT_FAIL)
> >> -		err = -EINVAL;
> >> +	if (pcr->trans_result == TRANS_RESULT_FAIL) {
> >> +		err = -EILSEQ;
> > Why are you using this error code?
> >
> >> +		if (pcr->dma_error_count < 8)
> > Please define the 8.
> >
> > RTSX_MAX_FREQ_REDUCTIONS or similar.
> >
> >> +			pcr->dma_error_count++;
> >> +	}
> >> +
> >>  	else if (pcr->trans_result == TRANS_NO_DEVICE)
> >>  		err = -ENODEV;
> >>  	spin_unlock_irqrestore(&pcr->lock, flags);
> >> @@ -659,6 +664,12 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
> >>  	if (err < 0)
> >>  		return err;
> >>  
> >> +	/* each time dma transfer error occurs, card clock decreased by 20MHz */
> > "Each"
> >
> >> +	if (card_clock == UHS_SDR104_MAX_DTR &&
> >> +		pcr->dma_error_count && PCI_PID(pcr) == RTS5227_DEVICE_ID)
> > Suggest placing "PCI_PID(pcr) == RTS5227_DEVICE_ID" on a new line.
> >
> >> +		card_clock = UHS_SDR104_MAX_DTR -
> >> +			pcr->dma_error_count * 20000000;
> > Suggest placing parantheis around:
> >
> > (UHS_SDR104_MAX_DTR - pcr->dma_error_count)
> >
> >>  	card_clock /= 1000000;
> >>  	pcr_dbg(pcr, "Switch card clock to %dMHz\n", card_clock);
> >>  
> >> @@ -894,6 +905,7 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
> >>  			pcr->card_removed |= SD_EXIST;
> >>  			pcr->card_inserted &= ~SD_EXIST;
> >>  		}
> >> +		pcr->dma_error_count = 0;
> >>  	}
> >>  
> >>  	if (int_reg & MS_INT) {
> >> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
> >> index 7eb7cba..751c4042 100644
> >> --- a/include/linux/mfd/rtsx_pci.h
> >> +++ b/include/linux/mfd/rtsx_pci.h
> >> @@ -850,6 +850,8 @@
> >>  
> >>  #define rtsx_pci_init_cmd(pcr)		((pcr)->ci = 0)
> >>  
> >> +#define RTS5227_DEVICE_ID		0x5227
> >> +
> >>  struct rtsx_pcr;
> >>  
> >>  struct pcr_handle {
> >> @@ -957,6 +959,8 @@ struct rtsx_pcr {
> >>  
> >>  	int				num_slots;
> >>  	struct rtsx_slot		*slots;
> >> +
> >> +	u8				dma_error_count;
> >>  };
> >>  
> >>  #define CHK_PCI_PID(pcr, pid)		((pcr)->pci->device == (pid))
> 

> begin:vcard
> fn;quoted-printable:=E5=86=AF=E4=BC=9F
> n;quoted-printable:;=E5=86=AF=E4=BC=9F
> email;internet:steven_feng@realsil.com.cn
> tel;cell:18168990403
> version:2.1
> end:vcard
> 


-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1552493

From冯伟linux <steven_feng@realsil.com.cn>
Date2017-01-06 04:20 +0100
Message-ID<sWteq-3YS-11@gated-at.bofh.it>
In reply to#1552030

[Multipart message — attachments visible in raw view] — view raw

> So this is function is SD card specific?
>
> In which case, why isn't it in the SD card driver?
Dma tans error really because of the wrong  byte sequence rather than
the invalid argument,
so we use EILSEQ instead of EINVAL.
SD and memstick driver are all use this to transmit data, so it was put
in here,

steven feng
Realsil Microelectronics CO. LTD.
Mobile:181-6899-0403  Ext:57594

在 2017年01月05日 22:50, Lee Jones 写道:
> On Thu, 05 Jan 2017, 冯伟linux wrote:
>
>>> +		err = -EILSEQ;
>>> Why are you using this error code?
>>>
>> when kernel receive the error number is EILSEQ, the SD card requeset
>> will be retried for some times, instead of dropping it directly.
>> so we use EILSEQ and frequency reduction to ensure data can be 
>> transmitted correctly as much as possible.
> So this is function is SD card specific?
>
> In which case, why isn't it in the SD card driver?
>
>> steven feng
>> Realsil Microelectronics CO. LTD.
>> Mobile:181-6899-0403  Ext:57594
>>
>> 在 2017年01月04日 20:12, Lee Jones 写道:
>>> On Wed, 04 Jan 2017, steven_feng@realsil.com.cn wrote:
>>>
>>>> From: steven_feng <steven_feng@realsil.com.cn>
>>>>
>>>> the request should be reissued when dma transfer error.
>>>> for rts5227, the clock freq need to step reduce when error occurred.
>>>>
>>>> Signed-off-by: steven_feng <steven_feng@realsil.com.cn>
>>>> ---
>>>>  drivers/mfd/rtsx_pcr.c       | 16 ++++++++++++++--
>>>>  include/linux/mfd/rtsx_pci.h |  4 ++++
>>>>  2 files changed, 18 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
>>>> index 98029ee..63ee0ac 100644
>>>> --- a/drivers/mfd/rtsx_pcr.c
>>>> +++ b/drivers/mfd/rtsx_pcr.c
>>>> @@ -30,6 +30,7 @@
>>>>  #include <linux/platform_device.h>
>>>>  #include <linux/mfd/core.h>
>>>>  #include <linux/mfd/rtsx_pci.h>
>>>> +#include <linux/mmc/card.h>
>>>>  #include <asm/unaligned.h>
>>>>  
>>>>  #include "rtsx_pcr.h"
>>>> @@ -452,8 +453,12 @@ int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
>>>>  	}
>>>>  
>>>>  	spin_lock_irqsave(&pcr->lock, flags);
>>>> -	if (pcr->trans_result == TRANS_RESULT_FAIL)
>>>> -		err = -EINVAL;
>>>> +	if (pcr->trans_result == TRANS_RESULT_FAIL) {
>>>> +		err = -EILSEQ;
>>> Why are you using this error code?
>>>
>>>> +		if (pcr->dma_error_count < 8)
>>> Please define the 8.
>>>
>>> RTSX_MAX_FREQ_REDUCTIONS or similar.
>>>
>>>> +			pcr->dma_error_count++;
>>>> +	}
>>>> +
>>>>  	else if (pcr->trans_result == TRANS_NO_DEVICE)
>>>>  		err = -ENODEV;
>>>>  	spin_unlock_irqrestore(&pcr->lock, flags);
>>>> @@ -659,6 +664,12 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
>>>>  	if (err < 0)
>>>>  		return err;
>>>>  
>>>> +	/* each time dma transfer error occurs, card clock decreased by 20MHz */
>>> "Each"
>>>
>>>> +	if (card_clock == UHS_SDR104_MAX_DTR &&
>>>> +		pcr->dma_error_count && PCI_PID(pcr) == RTS5227_DEVICE_ID)
>>> Suggest placing "PCI_PID(pcr) == RTS5227_DEVICE_ID" on a new line.
>>>
>>>> +		card_clock = UHS_SDR104_MAX_DTR -
>>>> +			pcr->dma_error_count * 20000000;
>>> Suggest placing parantheis around:
>>>
>>> (UHS_SDR104_MAX_DTR - pcr->dma_error_count)
>>>
>>>>  	card_clock /= 1000000;
>>>>  	pcr_dbg(pcr, "Switch card clock to %dMHz\n", card_clock);
>>>>  
>>>> @@ -894,6 +905,7 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
>>>>  			pcr->card_removed |= SD_EXIST;
>>>>  			pcr->card_inserted &= ~SD_EXIST;
>>>>  		}
>>>> +		pcr->dma_error_count = 0;
>>>>  	}
>>>>  
>>>>  	if (int_reg & MS_INT) {
>>>> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
>>>> index 7eb7cba..751c4042 100644
>>>> --- a/include/linux/mfd/rtsx_pci.h
>>>> +++ b/include/linux/mfd/rtsx_pci.h
>>>> @@ -850,6 +850,8 @@
>>>>  
>>>>  #define rtsx_pci_init_cmd(pcr)		((pcr)->ci = 0)
>>>>  
>>>> +#define RTS5227_DEVICE_ID		0x5227
>>>> +
>>>>  struct rtsx_pcr;
>>>>  
>>>>  struct pcr_handle {
>>>> @@ -957,6 +959,8 @@ struct rtsx_pcr {
>>>>  
>>>>  	int				num_slots;
>>>>  	struct rtsx_slot		*slots;
>>>> +
>>>> +	u8				dma_error_count;
>>>>  };
>>>>  
>>>>  #define CHK_PCI_PID(pcr, pid)		((pcr)->pci->device == (pid))
>> begin:vcard
>> fn;quoted-printable:=E5=86=AF=E4=BC=9F
>> n;quoted-printable:;=E5=86=AF=E4=BC=9F
>> email;internet:steven_feng@realsil.com.cn
>> tel;cell:18168990403
>> version:2.1
>> end:vcard
>>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web