Re: [PATCH] rtlwifi: cleanup 8723be ant_sel definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2018-04-19 at 12:52 +0300, Kalle Valo wrote:
> <pkshih@xxxxxxxxxxx> writes:
> 
> > From: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> >
> > The module parameter ant_sel is used to control antenna number and path.
> > There is an existing enum ANT_{X2,X1} defined the antenna number, so
> > add a new enum ANT_{MAIN,AUX} to make it readable. After this work,
> > incorrect given values depend on ant_sel were exposed, so refill values
> > according following definition:
> >   ant_sel   ant_num   ant_path  print_label
> >      1      ANT_X1    ANT_AUX        #2
> >      2      ANT_X2    ANT_MAIN       #1
> > Then, the workaround in halbtcoutsrc.c was removed.
> >
> > The experimental results with single antenna connected to specific path
> > are in following:
> >   ant_sel  ANT_MAIN(#1)  ANT_AUX(#2)
> >      0        -8            -62
> >      1        -62           -10
> >      2        -6            -60
> >
> > Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> > Cc: Stable <stable@xxxxxxxxxxxxxxx> # 4.7+
> > Reviewed-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
> > ---
> > Hi Kalle,
> >
> > This patch would send to 4.17.
> 
> For -rc releases I require a quite clear bug report but I do not
> understand what you are fixing here, even after reading the commit log
> twice. Could you try to improve it? Especially focus on describing the
> bug in simple terms and how this patch changes the functionality from
> user's point of view.
> 
The patch mainly fix the wrong value of ant_num and single_ant_path when
ant_sel is set.

        if (mod_params->ant_sel) {                                              
                rtlpriv->btcoexist.btc_info.ant_num =                           
-                       (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);           
+                       (mod_params->ant_sel == 1 ? ANT_X1 : ANT_X2);           
                                                                                
                rtlpriv->btcoexist.btc_info.single_ant_path =                   
-                       (mod_params->ant_sel == 1 ? 0 : 1);                     
+                       (mod_params->ant_sel == 1 ? ANT_AUX : ANT_MAIN);        
        }    
So, need workaround to fix the problem.

For end user, most people don't need ant_sel, but HP user needs to set to 1.
In case ant_sel=1, the result is almost the same, but ant_sel=2 that is rare
used is broken. So, this bug may be not seen by user.

Another thing is we want to apply this patch to stable release to give correct
values and remove the workaround, so I think it can apply to -rc too.

Anyway, I'll add more description to commit log, and you can decide to
apply this patch to 4.17 or queue to 4.18.

Thanks
PK




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]