@@ -1709,9 +1709,10 @@ static irqreturn_t do_irq(struct ipu_image_convert_run *run)
1709
1709
return IRQ_WAKE_THREAD ;
1710
1710
}
1711
1711
1712
- static irqreturn_t norotate_irq (int irq , void * data )
1712
+ static irqreturn_t eof_irq (int irq , void * data )
1713
1713
{
1714
1714
struct ipu_image_convert_chan * chan = data ;
1715
+ struct ipu_image_convert_priv * priv = chan -> priv ;
1715
1716
struct ipu_image_convert_ctx * ctx ;
1716
1717
struct ipu_image_convert_run * run ;
1717
1718
unsigned long flags ;
@@ -1728,45 +1729,26 @@ static irqreturn_t norotate_irq(int irq, void *data)
1728
1729
1729
1730
ctx = run -> ctx ;
1730
1731
1731
- if (ipu_rot_mode_is_irt (ctx -> rot_mode )) {
1732
- /* this is a rotation operation, just ignore */
1733
- spin_unlock_irqrestore (& chan -> irqlock , flags );
1734
- return IRQ_HANDLED ;
1735
- }
1736
-
1737
- ret = do_irq (run );
1738
- out :
1739
- spin_unlock_irqrestore (& chan -> irqlock , flags );
1740
- return ret ;
1741
- }
1742
-
1743
- static irqreturn_t rotate_irq (int irq , void * data )
1744
- {
1745
- struct ipu_image_convert_chan * chan = data ;
1746
- struct ipu_image_convert_priv * priv = chan -> priv ;
1747
- struct ipu_image_convert_ctx * ctx ;
1748
- struct ipu_image_convert_run * run ;
1749
- unsigned long flags ;
1750
- irqreturn_t ret ;
1751
-
1752
- spin_lock_irqsave (& chan -> irqlock , flags );
1753
-
1754
- /* get current run and its context */
1755
- run = chan -> current_run ;
1756
- if (!run ) {
1732
+ if (irq == chan -> out_eof_irq ) {
1733
+ if (ipu_rot_mode_is_irt (ctx -> rot_mode )) {
1734
+ /* this is a rotation op, just ignore */
1735
+ ret = IRQ_HANDLED ;
1736
+ goto out ;
1737
+ }
1738
+ } else if (irq == chan -> rot_out_eof_irq ) {
1739
+ if (!ipu_rot_mode_is_irt (ctx -> rot_mode )) {
1740
+ /* this was NOT a rotation op, shouldn't happen */
1741
+ dev_err (priv -> ipu -> dev ,
1742
+ "Unexpected rotation interrupt\n" );
1743
+ ret = IRQ_HANDLED ;
1744
+ goto out ;
1745
+ }
1746
+ } else {
1747
+ dev_err (priv -> ipu -> dev , "Received unknown irq %d\n" , irq );
1757
1748
ret = IRQ_NONE ;
1758
1749
goto out ;
1759
1750
}
1760
1751
1761
- ctx = run -> ctx ;
1762
-
1763
- if (!ipu_rot_mode_is_irt (ctx -> rot_mode )) {
1764
- /* this was NOT a rotation operation, shouldn't happen */
1765
- dev_err (priv -> ipu -> dev , "Unexpected rotation interrupt\n" );
1766
- spin_unlock_irqrestore (& chan -> irqlock , flags );
1767
- return IRQ_HANDLED ;
1768
- }
1769
-
1770
1752
ret = do_irq (run );
1771
1753
out :
1772
1754
spin_unlock_irqrestore (& chan -> irqlock , flags );
@@ -1859,7 +1841,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan)
1859
1841
chan -> out_chan ,
1860
1842
IPU_IRQ_EOF );
1861
1843
1862
- ret = request_threaded_irq (chan -> out_eof_irq , norotate_irq , do_bh ,
1844
+ ret = request_threaded_irq (chan -> out_eof_irq , eof_irq , do_bh ,
1863
1845
0 , "ipu-ic" , chan );
1864
1846
if (ret < 0 ) {
1865
1847
dev_err (priv -> ipu -> dev , "could not acquire irq %d\n" ,
@@ -1872,7 +1854,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan)
1872
1854
chan -> rotation_out_chan ,
1873
1855
IPU_IRQ_EOF );
1874
1856
1875
- ret = request_threaded_irq (chan -> rot_out_eof_irq , rotate_irq , do_bh ,
1857
+ ret = request_threaded_irq (chan -> rot_out_eof_irq , eof_irq , do_bh ,
1876
1858
0 , "ipu-ic" , chan );
1877
1859
if (ret < 0 ) {
1878
1860
dev_err (priv -> ipu -> dev , "could not acquire irq %d\n" ,
0 commit comments