diff mbox

[OOPS] cppi41_dma_channel_program: Unable to handle kernel NULL pointer dereference

Message ID CADYTM3bcTWSBf9HXKpsud6i--_04tsKZX1J3p9_6TqL1gp9YnA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bin Liu May 21, 2016, 3:13 a.m. UTC
Hi,

On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
>> Hi,
>>
>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
>>> instead.
>>
>> I just got here, and am wondering the same. But the question is why just
>> your case hit the problem. I will try to look at it more next week.
>>
>> I had an impression the linux-usb@ has a discussion before about
>> rx/tx-channel messing up, will have to look it up.
>>
>
> Thank you.
> If you need additional info, I can use kgdb with this issue.

After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
in musb_host.c part1). Please test with the following patch.

Regards,
-Bin.

-----8<---------
        u32 length, res;
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Matwey V. Kornilov May 21, 2016, 5:50 p.m. UTC | #1
2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
> Hi,
>
> On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
>> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
>>> Hi,
>>>
>>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
>>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
>>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
>>>> instead.
>>>
>>> I just got here, and am wondering the same. But the question is why just
>>> your case hit the problem. I will try to look at it more next week.
>>>
>>> I had an impression the linux-usb@ has a discussion before about
>>> rx/tx-channel messing up, will have to look it up.
>>>
>>
>> Thank you.
>> If you need additional info, I can use kgdb with this issue.
>
> After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
> bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
> in musb_host.c part1). Please test with the following patch.
>

I've just tested this patch. Indeed, it helps to avoid kernel panic.
Now, I can interact with my webcam and watch video-stream in  xawtv.
It would be great if the patch could become a part of 4.6.x stable tree.

> Regards,
> -Bin.
>
> -----8<---------
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index 2f8ad7f..9b2553c 100644
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -1551,7 +1551,7 @@ static int musb_rx_dma_iso_cppi41(struct
> dma_controller *dma,
>                                   struct urb *urb,
>                                   size_t len)
>  {
> -       struct dma_channel *channel = hw_ep->tx_channel;
> +       struct dma_channel *channel = hw_ep->rx_channel;
>         void __iomem *epio = hw_ep->regs;
>         dma_addr_t *buf;
>         u32 length, res;
>
Matwey V. Kornilov May 21, 2016, 7:04 p.m. UTC | #2
2016-05-21 20:50 GMT+03:00 Matwey V. Kornilov <matwey@sai.msu.ru>:
> 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
>> Hi,
>>
>> On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
>>> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
>>>> Hi,
>>>>
>>>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
>>>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
>>>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
>>>>> instead.
>>>>
>>>> I just got here, and am wondering the same. But the question is why just
>>>> your case hit the problem. I will try to look at it more next week.
>>>>
>>>> I had an impression the linux-usb@ has a discussion before about
>>>> rx/tx-channel messing up, will have to look it up.
>>>>
>>>
>>> Thank you.
>>> If you need additional info, I can use kgdb with this issue.
>>
>> After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
>> bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
>> in musb_host.c part1). Please test with the following patch.
>>
>
> I've just tested this patch. Indeed, it helps to avoid kernel panic.
> Now, I can interact with my webcam and watch video-stream in  xawtv.
> It would be great if the patch could become a part of 4.6.x stable tree.
>

Hm, the following string appeared one time during my testing:

[  867.017179] musb_host_rx 1925: RX14 dma busy, csr 2020

>> Regards,
>> -Bin.
>>
>> -----8<---------
>> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
>> index 2f8ad7f..9b2553c 100644
>> --- a/drivers/usb/musb/musb_host.c
>> +++ b/drivers/usb/musb/musb_host.c
>> @@ -1551,7 +1551,7 @@ static int musb_rx_dma_iso_cppi41(struct
>> dma_controller *dma,
>>                                   struct urb *urb,
>>                                   size_t len)
>>  {
>> -       struct dma_channel *channel = hw_ep->tx_channel;
>> +       struct dma_channel *channel = hw_ep->rx_channel;
>>         void __iomem *epio = hw_ep->regs;
>>         dma_addr_t *buf;
>>         u32 length, res;
>>
>
>
>
> --
> With best regards,
> Matwey V. Kornilov.
> Sternberg Astronomical Institute, Lomonosov Moscow State University, Russia
> 119991, Moscow, Universitetsky pr-k 13, +7 (495) 9392382
Bin Liu May 23, 2016, 1:35 p.m. UTC | #3
Hi,

On Sat, May 21, 2016 at 08:50:32PM +0300, Matwey V. Kornilov wrote:
> 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
> > Hi,
> >
> > On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
> >> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
> >>> Hi,
> >>>
> >>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
> >>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
> >>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
> >>>> instead.
> >>>
> >>> I just got here, and am wondering the same. But the question is why just
> >>> your case hit the problem. I will try to look at it more next week.
> >>>
> >>> I had an impression the linux-usb@ has a discussion before about
> >>> rx/tx-channel messing up, will have to look it up.
> >>>
> >>
> >> Thank you.
> >> If you need additional info, I can use kgdb with this issue.
> >
> > After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
> > bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
> > in musb_host.c part1). Please test with the following patch.
> >
> 
> I've just tested this patch. Indeed, it helps to avoid kernel panic.

Thanks for testing it.

> Now, I can interact with my webcam and watch video-stream in  xawtv.
> It would be great if the patch could become a part of 4.6.x stable tree.

Sure.

Would you mind to add your Reported-by in the patch?

Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bin Liu May 23, 2016, 1:36 p.m. UTC | #4
Hi,

On Sat, May 21, 2016 at 10:04:48PM +0300, Matwey V. Kornilov wrote:
> 2016-05-21 20:50 GMT+03:00 Matwey V. Kornilov <matwey@sai.msu.ru>:
> > 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
> >> Hi,
> >>
> >> On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
> >>> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
> >>>> Hi,
> >>>>
> >>>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
> >>>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
> >>>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
> >>>>> instead.
> >>>>
> >>>> I just got here, and am wondering the same. But the question is why just
> >>>> your case hit the problem. I will try to look at it more next week.
> >>>>
> >>>> I had an impression the linux-usb@ has a discussion before about
> >>>> rx/tx-channel messing up, will have to look it up.
> >>>>
> >>>
> >>> Thank you.
> >>> If you need additional info, I can use kgdb with this issue.
> >>
> >> After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
> >> bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
> >> in musb_host.c part1). Please test with the following patch.
> >>
> >
> > I've just tested this patch. Indeed, it helps to avoid kernel panic.
> > Now, I can interact with my webcam and watch video-stream in  xawtv.
> > It would be great if the patch could become a part of 4.6.x stable tree.
> >
> 
> Hm, the following string appeared one time during my testing:
> 
> [  867.017179] musb_host_rx 1925: RX14 dma busy, csr 2020

This seems to be a different issue. Does your webcam still functional
after the log shows up?

Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matwey V. Kornilov May 23, 2016, 1:38 p.m. UTC | #5
2016-05-23 16:35 GMT+03:00 Bin Liu <b-liu@ti.com>:
> Hi,
>
> On Sat, May 21, 2016 at 08:50:32PM +0300, Matwey V. Kornilov wrote:
>> 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
>> > Hi,
>> >
>> > On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
>> >> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
>> >>> Hi,
>> >>>
>> >>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
>> >>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
>> >>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
>> >>>> instead.
>> >>>
>> >>> I just got here, and am wondering the same. But the question is why just
>> >>> your case hit the problem. I will try to look at it more next week.
>> >>>
>> >>> I had an impression the linux-usb@ has a discussion before about
>> >>> rx/tx-channel messing up, will have to look it up.
>> >>>
>> >>
>> >> Thank you.
>> >> If you need additional info, I can use kgdb with this issue.
>> >
>> > After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
>> > bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
>> > in musb_host.c part1). Please test with the following patch.
>> >
>>
>> I've just tested this patch. Indeed, it helps to avoid kernel panic.
>
> Thanks for testing it.
>
>> Now, I can interact with my webcam and watch video-stream in  xawtv.
>> It would be great if the patch could become a part of 4.6.x stable tree.
>
> Sure.
>
> Would you mind to add your Reported-by in the patch?

Sure, please add

Reported-by: Matwey V. Kornilov <matwey@sai.msu.ru>

>
> Regards,
> -Bin.
>
Matwey V. Kornilov May 23, 2016, 1:41 p.m. UTC | #6
2016-05-23 16:36 GMT+03:00 Bin Liu <b-liu@ti.com>:
> Hi,
>
> On Sat, May 21, 2016 at 10:04:48PM +0300, Matwey V. Kornilov wrote:
>> 2016-05-21 20:50 GMT+03:00 Matwey V. Kornilov <matwey@sai.msu.ru>:
>> > 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
>> >> Hi,
>> >>
>> >> On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
>> >>> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
>> >>>> Hi,
>> >>>>
>> >>>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
>> >>>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
>> >>>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
>> >>>>> instead.
>> >>>>
>> >>>> I just got here, and am wondering the same. But the question is why just
>> >>>> your case hit the problem. I will try to look at it more next week.
>> >>>>
>> >>>> I had an impression the linux-usb@ has a discussion before about
>> >>>> rx/tx-channel messing up, will have to look it up.
>> >>>>
>> >>>
>> >>> Thank you.
>> >>> If you need additional info, I can use kgdb with this issue.
>> >>
>> >> After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
>> >> bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
>> >> in musb_host.c part1). Please test with the following patch.
>> >>
>> >
>> > I've just tested this patch. Indeed, it helps to avoid kernel panic.
>> > Now, I can interact with my webcam and watch video-stream in  xawtv.
>> > It would be great if the patch could become a part of 4.6.x stable tree.
>> >
>>
>> Hm, the following string appeared one time during my testing:
>>
>> [  867.017179] musb_host_rx 1925: RX14 dma busy, csr 2020
>
> This seems to be a different issue. Does your webcam still functional
> after the log shows up?

It seems so, but I am not sure completely, unfortunately this message
has stochastic origin.
So, I will try to reproduce it again and then report additional info.

>
> Regards,
> -Bin.
>
Tony Lindgren May 23, 2016, 3:13 p.m. UTC | #7
* Matwey V. Kornilov <matwey@sai.msu.ru> [160523 06:41]:
> 2016-05-23 16:35 GMT+03:00 Bin Liu <b-liu@ti.com>:
> > On Sat, May 21, 2016 at 08:50:32PM +0300, Matwey V. Kornilov wrote:
> >> 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
> >> > After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
> >> > bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
> >> > in musb_host.c part1). Please test with the following patch.
> >> >
> >>
> >> I've just tested this patch. Indeed, it helps to avoid kernel panic.
> >
> > Thanks for testing it.
> >
> >> Now, I can interact with my webcam and watch video-stream in  xawtv.
> >> It would be great if the patch could become a part of 4.6.x stable tree.
> >
> > Sure.
> >
> > Would you mind to add your Reported-by in the patch?
> 
> Sure, please add
> 
> Reported-by: Matwey V. Kornilov <matwey@sai.msu.ru>

Looks good to me too, sorry for the nasty typo:

Acked-by: Tony Lindgren <tony@atomide.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Matwey V. Kornilov May 28, 2016, 1:33 p.m. UTC | #8
2016-05-23 16:36 GMT+03:00 Bin Liu <b-liu@ti.com>:
> Hi,
>
> On Sat, May 21, 2016 at 10:04:48PM +0300, Matwey V. Kornilov wrote:
>> 2016-05-21 20:50 GMT+03:00 Matwey V. Kornilov <matwey@sai.msu.ru>:
>> > 2016-05-21 6:13 GMT+03:00 Bin Liu <binmlist@gmail.com>:
>> >> Hi,
>> >>
>> >> On Fri, May 20, 2016 at 4:20 PM, Matwey V. Kornilov <matwey@sai.msu.ru> wrote:
>> >>> 2016-05-21 0:12 GMT+03:00 Bin Liu <b-liu@ti.com>:
>> >>>> Hi,
>> >>>>
>> >>>> On Sat, May 21, 2016 at 12:05:06AM +0300, Matwey V. Kornilov wrote:
>> >>>>> By the way, is it ok that function musb_rx_dma_iso_cppi41 uses
>> >>>>> hw_ep->tx_channel? I would suppose that it should use rx_channel
>> >>>>> instead.
>> >>>>
>> >>>> I just got here, and am wondering the same. But the question is why just
>> >>>> your case hit the problem. I will try to look at it more next week.
>> >>>>
>> >>>> I had an impression the linux-usb@ has a discussion before about
>> >>>> rx/tx-channel messing up, will have to look it up.
>> >>>>
>> >>>
>> >>> Thank you.
>> >>> If you need additional info, I can use kgdb with this issue.
>> >>
>> >> After reviewed the code, it must be hw_ep->rx_channel instead. It is likely a
>> >> bug caused by commit 069a3fd (usb: musb: Remove ifdefs for musb_host_rx
>> >> in musb_host.c part1). Please test with the following patch.
>> >>
>> >
>> > I've just tested this patch. Indeed, it helps to avoid kernel panic.
>> > Now, I can interact with my webcam and watch video-stream in  xawtv.
>> > It would be great if the patch could become a part of 4.6.x stable tree.
>> >
>>
>> Hm, the following string appeared one time during my testing:
>>
>> [  867.017179] musb_host_rx 1925: RX14 dma busy, csr 2020
>
> This seems to be a different issue. Does your webcam still functional
> after the log shows up?
>

I've just checked. Yes, it does. I can still obtain relevant snapshots
from the webcam.

> Regards,
> -Bin.
>
diff mbox

Patch

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 2f8ad7f..9b2553c 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1551,7 +1551,7 @@  static int musb_rx_dma_iso_cppi41(struct
dma_controller *dma,
                                  struct urb *urb,
                                  size_t len)
 {
-       struct dma_channel *channel = hw_ep->tx_channel;
+       struct dma_channel *channel = hw_ep->rx_channel;
        void __iomem *epio = hw_ep->regs;
        dma_addr_t *buf;