Re: [PATCH] staging: comedi: replace slash in name

2021-03-16 Thread Tong Zhang
On Tue, Mar 16, 2021 at 6:37 AM Ian Abbott  wrote:
>
> Thanks.  I think the only other Comedi driver with the same problem is
> "drivers/staging/comedi/drivers/das800.c".  It passes dev->board_name as
> the name argument of request_irq(), but that is "cio-das802/16" for one
> of the boards supported by the driver.
>

Thanks Ian, I think you are right, das800.c also shares the same issue.
I have sent a patch for das800.c as well according to your comments.
Best,
- Tong


Re: [PATCH] staging: comedi: replace slash in name

2021-03-16 Thread Ian Abbott

On 15/03/2021 20:00, Tong Zhang wrote:

Thanks Ian,
I have submitted a v2 patch based on your suggestions.
Thanks,
- Tong


Thanks.  I think the only other Comedi driver with the same problem is 
"drivers/staging/comedi/drivers/das800.c".  It passes dev->board_name as 
the name argument of request_irq(), but that is "cio-das802/16" for one 
of the boards supported by the driver.



On Mon, Mar 15, 2021 at 6:48 AM Ian Abbott  wrote:


On 15/03/2021 10:44, Ian Abbott wrote:

On 14/03/2021 03:57, Tong Zhang wrote:

request_irq() wont accept a name which contains slash so we need to
repalce it with something else -- otherwise it will trigger a warning
and the entry in /proc/irq/ will not be created

[1.565966] name 'pci-das6402/16'
[1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 
__xlate_proc_name+0x93/0xb0
[1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
[1.574200] Call Trace:
[1.574722]  proc_mkdir+0x18/0x20
[1.576629]  request_threaded_irq+0xfe/0x160
[1.576859]  auto_attach+0x60a/0xc40 [cb_pcidas64]

Signed-off-by: Tong Zhang 

[snip]

Userspace applications can use these strings to determine the board
type, so changing the strings would break those applications.

I suggest passing the comedi driver name "cb_pcidas" to request_irq()
for now.


Oops, I meant "cb_pcidas64".  But you could reach that via
dev->driver->driver_name if you want (where dev is the struct
comedi_device * parameter).


--
-=( Ian Abbott  || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-


Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Tong Zhang
Thanks Ian,
I have submitted a v2 patch based on your suggestions.
Thanks,
- Tong

On Mon, Mar 15, 2021 at 6:48 AM Ian Abbott  wrote:
>
> On 15/03/2021 10:44, Ian Abbott wrote:
> > On 14/03/2021 03:57, Tong Zhang wrote:
> >> request_irq() wont accept a name which contains slash so we need to
> >> repalce it with something else -- otherwise it will trigger a warning
> >> and the entry in /proc/irq/ will not be created
> >>
> >> [1.565966] name 'pci-das6402/16'
> >> [1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 
> >> __xlate_proc_name+0x93/0xb0
> >> [1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
> >> [1.574200] Call Trace:
> >> [1.574722]  proc_mkdir+0x18/0x20
> >> [1.576629]  request_threaded_irq+0xfe/0x160
> >> [1.576859]  auto_attach+0x60a/0xc40 [cb_pcidas64]
> >>
> >> Signed-off-by: Tong Zhang 
> [snip]
> > Userspace applications can use these strings to determine the board
> > type, so changing the strings would break those applications.
> >
> > I suggest passing the comedi driver name "cb_pcidas" to request_irq()
> > for now.
>
> Oops, I meant "cb_pcidas64".  But you could reach that via
> dev->driver->driver_name if you want (where dev is the struct
> comedi_device * parameter).
>
> --
> -=( Ian Abbott  || MEV Ltd. is a company  )=-
> -=( registered in England & Wales.  Regd. number: 02862268.  )=-
> -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
> -=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-


Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Ian Abbott
On 15/03/2021 10:44, Ian Abbott wrote:
> On 14/03/2021 03:57, Tong Zhang wrote:
>> request_irq() wont accept a name which contains slash so we need to
>> repalce it with something else -- otherwise it will trigger a warning
>> and the entry in /proc/irq/ will not be created
>>
>> [1.565966] name 'pci-das6402/16'
>> [1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 
>> __xlate_proc_name+0x93/0xb0
>> [1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
>> [1.574200] Call Trace:
>> [1.574722]  proc_mkdir+0x18/0x20
>> [1.576629]  request_threaded_irq+0xfe/0x160
>> [1.576859]  auto_attach+0x60a/0xc40 [cb_pcidas64]
>>
>> Signed-off-by: Tong Zhang 
[snip]
> Userspace applications can use these strings to determine the board
> type, so changing the strings would break those applications.
> 
> I suggest passing the comedi driver name "cb_pcidas" to request_irq()
> for now.

Oops, I meant "cb_pcidas64".  But you could reach that via
dev->driver->driver_name if you want (where dev is the struct
comedi_device * parameter).

-- 
-=( Ian Abbott  || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-


Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Ian Abbott
On 14/03/2021 03:57, Tong Zhang wrote:
> request_irq() wont accept a name which contains slash so we need to
> repalce it with something else -- otherwise it will trigger a warning
> and the entry in /proc/irq/ will not be created
> 
> [1.565966] name 'pci-das6402/16'
> [1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 
> __xlate_proc_name+0x93/0xb0
> [1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
> [1.574200] Call Trace:
> [1.574722]  proc_mkdir+0x18/0x20
> [1.576629]  request_threaded_irq+0xfe/0x160
> [1.576859]  auto_attach+0x60a/0xc40 [cb_pcidas64]
> 
> Signed-off-by: Tong Zhang 
> ---
>  drivers/staging/comedi/drivers/cb_pcidas64.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c 
> b/drivers/staging/comedi/drivers/cb_pcidas64.c
> index fa987bb0e7cd..662d6ffb8f60 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidas64.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
> @@ -677,7 +677,7 @@ static const int bytes_in_sample = 2;
>  
>  static const struct pcidas64_board pcidas64_boards[] = {
>   [BOARD_PCIDAS6402_16] = {
> - .name   = "pci-das6402/16",
> + .name   = "pci-das6402-16",
>   .ai_se_chans= 64,
>   .ai_bits= 16,
>   .ai_speed   = 5000,
> @@ -693,7 +693,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
>   .has_8255   = 1,
>   },
>   [BOARD_PCIDAS6402_12] = {
> - .name   = "pci-das6402/12", /* XXX check */
> + .name   = "pci-das6402-12", /* XXX check */
>   .ai_se_chans= 64,
>   .ai_bits= 12,
>   .ai_speed   = 5000,
> @@ -709,7 +709,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
>   .has_8255   = 1,
>   },
>   [BOARD_PCIDAS64_M1_16] = {
> - .name   = "pci-das64/m1/16",
> + .name   = "pci-das64-m1-16",
>   .ai_se_chans= 64,
>   .ai_bits= 16,
>   .ai_speed   = 1000,
> @@ -725,7 +725,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
>   .has_8255   = 1,
>   },
>   [BOARD_PCIDAS64_M2_16] = {
> - .name = "pci-das64/m2/16",
> + .name = "pci-das64-m2-16",
>   .ai_se_chans= 64,
>   .ai_bits= 16,
>   .ai_speed   = 500,
> @@ -741,7 +741,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
>   .has_8255   = 1,
>   },
>   [BOARD_PCIDAS64_M3_16] = {
> - .name   = "pci-das64/m3/16",
> + .name   = "pci-das64-m3-16",
>   .ai_se_chans= 64,
>   .ai_bits= 16,
>   .ai_speed   = 333,
> @@ -984,7 +984,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
>   .has_8255   = 0,
>   },
>   [BOARD_PCIDAS4020_12] = {
> - .name   = "pci-das4020/12",
> + .name   = "pci-das4020-12",
>   .ai_se_chans= 4,
>   .ai_bits= 12,
>   .ai_speed   = 50,
> 

Userspace applications can use these strings to determine the board
type, so changing the strings would break those applications.

I suggest passing the comedi driver name "cb_pcidas" to request_irq()
for now.

-- 
-=( Ian Abbott  || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-


[PATCH] staging: comedi: replace slash in name

2021-03-13 Thread Tong Zhang
request_irq() wont accept a name which contains slash so we need to
repalce it with something else -- otherwise it will trigger a warning
and the entry in /proc/irq/ will not be created

[1.565966] name 'pci-das6402/16'
[1.566149] WARNING: CPU: 0 PID: 184 at fs/proc/generic.c:180 
__xlate_proc_name+0x93/0xb0
[1.568923] RIP: 0010:__xlate_proc_name+0x93/0xb0
[1.574200] Call Trace:
[1.574722]  proc_mkdir+0x18/0x20
[1.576629]  request_threaded_irq+0xfe/0x160
[1.576859]  auto_attach+0x60a/0xc40 [cb_pcidas64]

Signed-off-by: Tong Zhang 
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c 
b/drivers/staging/comedi/drivers/cb_pcidas64.c
index fa987bb0e7cd..662d6ffb8f60 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -677,7 +677,7 @@ static const int bytes_in_sample = 2;
 
 static const struct pcidas64_board pcidas64_boards[] = {
[BOARD_PCIDAS6402_16] = {
-   .name   = "pci-das6402/16",
+   .name   = "pci-das6402-16",
.ai_se_chans= 64,
.ai_bits= 16,
.ai_speed   = 5000,
@@ -693,7 +693,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255   = 1,
},
[BOARD_PCIDAS6402_12] = {
-   .name   = "pci-das6402/12", /* XXX check */
+   .name   = "pci-das6402-12", /* XXX check */
.ai_se_chans= 64,
.ai_bits= 12,
.ai_speed   = 5000,
@@ -709,7 +709,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255   = 1,
},
[BOARD_PCIDAS64_M1_16] = {
-   .name   = "pci-das64/m1/16",
+   .name   = "pci-das64-m1-16",
.ai_se_chans= 64,
.ai_bits= 16,
.ai_speed   = 1000,
@@ -725,7 +725,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255   = 1,
},
[BOARD_PCIDAS64_M2_16] = {
-   .name = "pci-das64/m2/16",
+   .name = "pci-das64-m2-16",
.ai_se_chans= 64,
.ai_bits= 16,
.ai_speed   = 500,
@@ -741,7 +741,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255   = 1,
},
[BOARD_PCIDAS64_M3_16] = {
-   .name   = "pci-das64/m3/16",
+   .name   = "pci-das64-m3-16",
.ai_se_chans= 64,
.ai_bits= 16,
.ai_speed   = 333,
@@ -984,7 +984,7 @@ static const struct pcidas64_board pcidas64_boards[] = {
.has_8255   = 0,
},
[BOARD_PCIDAS4020_12] = {
-   .name   = "pci-das4020/12",
+   .name   = "pci-das4020-12",
.ai_se_chans= 4,
.ai_bits= 12,
.ai_speed   = 50,
-- 
2.25.1