Removal of IrDA

2017-11-05 Thread Petr Cvek

Hello,

I got a time to update from v4.10 to v4.14-rc and I've found IrDA is in 
the staging (and it is scheduled to be removed).


I'm still using the driver nsc-ircc on Thinkpad T60p and the driver 
pxaficp_ir (I have some kingsun-sir dongles and an use for irtty-sir 
too). Actually I'm pretty dependent on the second one (my phone has only 
USB host/device and IrDA).


If the removal is inevitable will there be at least some off-the-tree 
repository?


best regards,
Petr


Re: [PATCH 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-12 Thread Petr Cvek
Dne 12.9.2015 v 13:03 Robert Jarzmik napsal(a):
> Petr Cvek <petr.c...@tul.cz> writes:
> 
>>>>> And it is true I have not tested the rootfs special case, where drivers 
>>>>> are not
>>>>> yet initialized (and more specifically gpio and interrupt chip). Your 
>>>>> backtrace
>>>>> should tell me if you fall into this category of issues ... but I 
>>>>> digress, this
>>>>> has no link with pxaficp.
>>>>
>>>> Should I start new thread? (same bug can be present in the FICP too)
>>> Yes, this pxamci bothers me, it deserves a thread.
>>
>> Will start soon.
> And I think I see your problem now :
>   (a) there is a regression from the commit 8c8fe97b2b8a, for which the fix is
>   here: https://lkml.org/lkml/2015/9/6/112
>   (b) for gpio expanders, another fix is here :
>   https://lkml.org/lkml/2015/9/12/62
> 
> The regression is on dmaengine, that's where the thread belongs I think, at
> least if that fixes your issue.
> 
Great now it finally boots. Thanks.

Petr

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-12 Thread Petr Cvek
Dne 12.9.2015 v 13:45 Robert Jarzmik napsal(a):
> Convert the pxa IRDA driver to readl and writel primitives, and remove
> another set of direct registers access. This leaves only the DMA
> registers access, which will be dealt with dmaengine conversion.
> 
> Signed-off-by: Robert Jarzmik <robert.jarz...@free.fr>
> ---
> Since v1: modified __REG macro to cope with STIER, ST* registers
> ---
>  drivers/net/irda/pxaficp_ir.c | 210 
> +-
>  1 file changed, 126 insertions(+), 84 deletions(-)
> 
> diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
> index b1794998c68e..4a2b3f71e4a8 100644
> --- a/drivers/net/irda/pxaficp_ir.c
> +++ b/drivers/net/irda/pxaficp_ir.c
> @@ -29,15 +29,16 @@
>  
>  #include 
>  #include 
> +#undef __REG
> +#define __REG(x) ((x) & 0x)
>  #include 
What are future plans for the definitions in the mach/regs-uart.h ? Maybe it 
would be better to duplicate register definition in ficp source code (it seems 
that normal PXA UART driver does not use these ones). But random searches 
shows, that at least base address register:

#define STUART  STRBR
#define STRBR   __REG(0x4070)  /* Receive Buffer Register 
(read only) */

is used in machine init source codes. I can look at it in the "near" future (if 
I don't forget :-D).

In other case patchset works, as it has been tested for SIR part.

Tested-by: Petr Cvek <petr.c...@tul.cz>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-11 Thread Petr Cvek
Dne 11.9.2015 v 08:18 Robert Jarzmik napsal(a):
> Petr Cvek <petr.c...@tul.cz> writes:
> 
>>> Should have been posted to linux arm kernel mailing list, unless my mailer
>>> failed ...
>>>
>> Searching for:
>>
>>  "ARM: pxa: add resources to pxaficp_ir"
>>
>> did not found anything, same was for "ficp" in the 
>> linux-arm-kernel/netdev/linux-kernel
>> mailing list archive.
> Ah ok, I'll resend it then.
> 
>>>> BTW This patch required update of my kernel repo. It seems that my:
>>>>
>>>>magician.c patches + ficp patch + new dma engine
>>>>
>>>> does not work for me at all. Kernel throws some panic about interrupts and 
>>>> then
>>>> it ends in an infinite stack dumping loop. Fault occurs before rootfs is
>>>> mounted, so probably around MMC init (with removed SD card it fails 
>>>> normally
>>>> with no rootfs found error).
>>> Could you send me (privately) the stack you're getting please. This is 
>>> something
>>> I'd like to catch up early in the -rc releases.
>>
>> Well this will be problem as I cannot save anything to an SD card after and
>> during the failure.  Only viable interfaces would be earlycon on an infraport
>> or high speed camera on LCD :-).
> Ah just as on my mioa701. I ended up soldering a JTAG cable :)
Rather not :-D.

> 
>>> And it is true I have not tested the rootfs special case, where drivers are 
>>> not
>>> yet initialized (and more specifically gpio and interrupt chip). Your 
>>> backtrace
>>> should tell me if you fall into this category of issues ... but I digress, 
>>> this
>>> has no link with pxaficp.
>>
>> Should I start new thread? (same bug can be present in the FICP too)
> Yes, this pxamci bothers me, it deserves a thread.

Will start soon.

>>
>> Anyway after mmc dma revert I was still not able to start FICP. There is an 
>> error:
>>
>>  Unable to handle kernel paging request at virtual address 32e4
>>
>> from pxa_irda_startup() and it seems it is caused by register definitions. 
>> For example:
>>
>>  writel_relaxed((val), (irda)->stuart_base + (off));
>>
>> is called by
>>
>>  stuart_writel(si, 0, STIER);
>>
>> but STIER is not just an offset, but full register address:
>>  
>>  __REG(0x4074)
>>
>> So the definition should be changed, unless there is another patch I did not
>> received (in that case, send me full patchset again please) :-).
> Agreed, this is a bug in this patch. With this fix, is the pxaficp working or 
> do
> you need a bit more time to experiment ?

I have tried with a nasty hack (use only lower part of address, it should equal 
with reg offset):
#undef __REG
-#define __REG(x) (x)
+#define __REG(x) (x & 0x)

and it seems to work. The module inits and I am able to see IrDA traffic and 
ping other machine. FIR mode (mostly impacted by DMA) is still untested as 
magician unfortunately supports only SIR mode.

Petr
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-10 Thread Petr Cvek
Dne 10.9.2015 v 13:14 Robert Jarzmik napsal(a):
> Petr Cvek <petr.c...@tul.cz> writes:
> 
>> Dne 9.9.2015 v 08:25 Robert Jarzmik napsal(a):
>>> Petr Cvek <petr.c...@tul.cz> writes:
>>>
>>>> Dne 8.9.2015 v 22:24 Petr Cvek napsal(a):
>>>>>
>>>>> Did you defined resources somewhere? Actual resources are in
>>>>> "pxa_ir_resources" variable at:
>>> I have them in patch [1], which is exactly the patch you have made yourself.
>>
>> Is there a mailing list for this specific patch? It seems I did not get any
>> mail with it.
> Should have been posted to linux arm kernel mailing list, unless my mailer
> failed ...
> 
Searching for:

"ARM: pxa: add resources to pxaficp_ir"

did not found anything, same was for "ficp" in the 
linux-arm-kernel/netdev/linux-kernel
mailing list archive.

>> BTW This patch required update of my kernel repo. It seems that my:
>>
>>  magician.c patches + ficp patch + new dma engine
>>
>> does not work for me at all. Kernel throws some panic about interrupts and 
>> then
>> it ends in an infinite stack dumping loop. Fault occurs before rootfs is
>> mounted, so probably around MMC init (with removed SD card it fails normally
>> with no rootfs found error).
> Could you send me (privately) the stack you're getting please. This is 
> something
> I'd like to catch up early in the -rc releases.

Well this will be problem as I cannot save anything to an SD card after and 
during the failure.
Only viable interfaces would be earlycon on an infraport or high speed camera 
on LCD :-). 

But I was able to revert this commit:

6464b71409511939efce1ae4fb4ec6e3483b11b2mmc: pxamci: switch 
over to dmaengine use

and after that I am able to boot.

> 
> Now with your stack, could you also give me the upstream commit id of the tip 
> of
> the tree you're using (before your patches) please ?

It is probably irelevant now, but for complete information:

Discovered on my working repo: mainline b8889c4fc6ba03e289cec6a4d692f6f080a55e53
Still present on fresh downloaded: linux-next 
22dc312d56ba077db27a9798b340e7d161f1df05

> 
> And it is true I have not tested the rootfs special case, where drivers are 
> not
> yet initialized (and more specifically gpio and interrupt chip). Your 
> backtrace
> should tell me if you fall into this category of issues ... but I digress, 
> this
> has no link with pxaficp.

Should I start new thread? (same bug can be present in the FICP too)

I will try to configure an initrd rootfs this should create more ways to save 
kernel log.


Anyway after mmc dma revert I was still not able to start FICP. There is an 
error:

Unable to handle kernel paging request at virtual address 32e4

from pxa_irda_startup() and it seems it is caused by register definitions. For 
example:

writel_relaxed((val), (irda)->stuart_base + (off));

is called by

stuart_writel(si, 0, STIER);

but STIER is not just an offset, but full register address:

__REG(0x4074)

So the definition should be changed, unless there is another patch I did not 
received (in that case, send me full patchset again please) :-).


Best regards,
Petr
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-10 Thread Petr Cvek
Dne 9.9.2015 v 08:25 Robert Jarzmik napsal(a):
> Petr Cvek <petr.c...@tul.cz> writes:
> 
>> Dne 8.9.2015 v 22:24 Petr Cvek napsal(a):
>>>
>>> Did you defined resources somewhere? Actual resources are in
>>> "pxa_ir_resources" variable at:
> I have them in patch [1], which is exactly the patch you have made yourself.

Is there a mailing list for this specific patch? It seems I did not get any 
mail with it.

> 
>> I tried to add following patch for new resources, but now it fails with:
>>
>> [  141.534545] pxa2xx-ir pxa2xx-ir: can't request region for resource [mem 
>> 0x4070-0x40700100]
>> [  141.534574] pxa2xx-ir pxa2xx-ir: resource stuart not defined
>> [  141.534656] pxa2xx-ir: probe of pxa2xx-ir failed with error -16
>>
>> That's because STUART is allocated by normal UART driver at:
>>
>>  http://lxr.free-electrons.com/source/arch/arm/mach-pxa/devices.c#L244
>>
>> So somehow there must be configuration for STUART used with FICP and STUART
>> alone (probably can be used for normal UART).
> That's because you have to remove from magician.c:
>   pxa_set_stuart_info(NULL);
> 

Thanks, I missed that.

BTW This patch required update of my kernel repo. It seems that my:

magician.c patches + ficp patch + new dma engine

does not work for me at all. Kernel throws some panic about interrupts and then 
it ends in an infinite stack dumping loop. Fault occurs before rootfs is 
mounted, so probably around MMC init (with removed SD card it fails normally 
with no rootfs found error).

Is it required to change something in the mach-pxa machine specific files?

Which hardware was used for testing new dma engine implementation? Notably MMC 
driver part, probably commit:

6464b71409511939efce1ae4fb4ec6e3483b11b2

Best regards,
Petr
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-08 Thread Petr Cvek
Dne 3.9.2015 v 08:20 Robert Jarzmik napsal(a):
> Convert the pxa IRDA driver to readl and writel primitives, and remove
> another set of direct registers access. This leaves only the DMA
> registers access, which will be dealt with dmaengine conversion.

Test on magician (nonvanilla, but there should not be any collision).

>  
> - err = request_mem_region(__PREG(STUART), 0x24, "IrDA") ? 0 : -EBUSY;
> - if (err)
> - goto err_mem_1;
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + ficp = devm_ioremap_resource(>dev, res);
> + if (IS_ERR(ficp)) {
> + dev_err(>dev, "resource ficp not defined\n");

Fails around here with:

[ 4245.368764] pxa2xx-ir pxa2xx-ir: invalid resource
[ 4245.369191] pxa2xx-ir pxa2xx-ir: resource ficp not defined
[ 4245.369364] pxa2xx-ir: probe of pxa2xx-ir failed with error -22

Did you defined resources somewhere? Actual resources are in "pxa_ir_resources" 
variable at:

http://lxr.free-electrons.com/source/arch/arm/mach-pxa/devices.c#L386

or this pdata should be moved into specific machine files?

Cheers,
Petr
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] net: irda: pxaficp_ir: convert to readl and writel

2015-09-08 Thread Petr Cvek
Dne 8.9.2015 v 22:24 Petr Cvek napsal(a):
> 
> Did you defined resources somewhere? Actual resources are in 
> "pxa_ir_resources" variable at:
> 
>   http://lxr.free-electrons.com/source/arch/arm/mach-pxa/devices.c#L386
> 
> or this pdata should be moved into specific machine files?
> 

I tried to add following patch for new resources, but now it fails with:

[  141.534545] pxa2xx-ir pxa2xx-ir: can't request region for resource [mem 
0x4070-0x40700100]
[  141.534574] pxa2xx-ir pxa2xx-ir: resource stuart not defined
[  141.534656] pxa2xx-ir: probe of pxa2xx-ir failed with error -16

That's because STUART is allocated by normal UART driver at:

http://lxr.free-electrons.com/source/arch/arm/mach-pxa/devices.c#L244

So somehow there must be configuration for STUART used with FICP and STUART 
alone (probably can be used for normal UART).


diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 3543466..316ffa3 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -394,6 +394,26 @@ static struct resource pxa_ir_resources[] = {
.end= IRQ_ICP,
.flags  = IORESOURCE_IRQ,
},
+   [2] = {
+   .start  = 0x4080,
+   .end= 0x4080 + 0x100,
+   .flags  = IORESOURCE_MEM,
+   },
+   [3] = {
+   .start  = 0x4070,
+   .end= 0x4070 + 0x100,
+   .flags  = IORESOURCE_MEM,
+   },
+   [4] = {
+   .start  = 17,
+   .end= 17,
+   .flags  = IORESOURCE_DMA,
+   },
+   [5] = {
+   .start  = 18,
+   .end= 18,
+   .flags  = IORESOURCE_DMA,
+   },
 };
 
 struct platform_device pxa_device_ficp = {
-- 
1.7.12.1


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] net: irda: pxaficp_ir: dmaengine conversion

2015-09-06 Thread Petr Cvek
Dne 3.9.2015 v 08:20 Robert Jarzmik napsal(a):
> Hi,
> 
> This serie aims at converting pxaficp_ir to dmaengine. This is almost the last
> driver to be converted, and once this is gone, legacy DMA support in pxa
> architecture can be gone.
> 
> Nothing fancy here, standard readl/writel conversion, then dmaengine support.
> 
> The main trouble is that I cannot test it, I only compiled and inserted the
> module, which works on lubbock, but I have no way to make a communcation try.
> 
> Petr, Dmitry, once the review is advanced enough, ie. in a couple of weeks, do
> you have a way to test it on corgi/magician if I give you a git tree to pull
> from ?
> 
> Cheers
> 
> --
> Robert
> 
> Robert Jarzmik (3):
>   net: irda: pxaficp_ir: use sched_clock() for time management
>   net: irda: pxaficp_ir: convert to readl and writel
>   net: irda: pxaficp_ir: dmaengine conversion
> 
>  drivers/net/irda/pxaficp_ir.c | 366 
> +++---
>  1 file changed, 233 insertions(+), 133 deletions(-)
> 

Hi,
I will test it this week.

OT: (hw verified) Magician sadly does not support FIR (only SIR transceiver 
module) :-( .

Petr
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html